integer llGetPermissions();
Returns which
permissions have been granted. The return value will be a
bitmask of the following
values:
To compare the resulting number to these constants, remember that it is necessary to use
bitwise operators! That means doing
if (llGetPermissions() & PERMISSION_ATTACH),
not if (llGetPermissions() == PERMISSION_ATTACH). The latter may work some of the time, but not in all cases.
Example:
Q: How does this know what agent to get the permissions from?
A: The last person who requested permissions. Use llGetPermissionsKey to find out the key of the agent.
Q: Is there a way to find out what permissions are already granted for a different agent, or do I need to keep a list of my own?
A: If you wanted a script to get permissions from more than one person, you would have to keep a list of your own.
Q: It's returning a value that I check against the constants listed in the table above, and nothing happens. What's up with that?
A: Are you sure you're using bitwise operators in your IF statement? (For instance, & instead of ==?) The value returned by llGetPermissions is a bitfield, and will not equal any of the above constants if more than one have been granted and are returned.
Compare with
llRequestPermissions and
llGetPermissionsKey.
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Agent/Avatar