Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

RequestPermissions and switching states

Ty Gould
Registered User
Join date: 1 Sep 2005
Posts: 14
05-15-2006 08:51
If I request permissions and the avatar grants them within the default state, and then I switch to a different state, are those granted permissions still in effect?
Nick Shatner
Isn't a game
Join date: 11 Jul 2005
Posts: 39
05-15-2006 09:34
Yes :)
Permissions are granted to a script as a whole, not a state.

Following script demonstrates this:
CODE
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}

run_time_permissions(integer perms)
{
if(perms & PERMISSION_TRIGGER_ANIMATION)
state other;
}
}
state other
{
state_entry()
{
if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
{
llSay(0, "Has permission still");
} else {
llSay(0, "Not got permissions");
}
}
}
Ty Gould
Registered User
Join date: 1 Sep 2005
Posts: 14
05-15-2006 18:26
Thanks very much!