Difference between revisions of "Run time permissions"

From Second Life Wiki
Jump to navigation Jump to search
 
m (Replaced old <LSL> block with <source lang="lsl2">)
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{LSL_Event|event_id=22|event_delay|event=run_time_permissions|p1_type=integer|p1_name=perm|p1_desc|event_desc=Triggered when an agent grants run time permissions to task|constants|spec|caveats|examples|helpers|also_header|also_events|also_functions|also_articles|also_footer|notes|mode|deprecated}}[[Category:LSL_Events]][[Category:LSL_Stub]]
{{LSL_Event
|event_id=22|event_delay
|event=run_time_permissions
|p1_type=integer|p1_name=perm|p1_desc=mask of PERMISSIONS_* flags granting permissions
|event_desc=Triggered when an agent grants run time permissions to this script.
|constants={{LSL Constants/Permissions}}
|spec
|caveats
|examples=
=====Plays an animation=====
<source lang="lsl2">default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TRIGGER_ANIMATION & perm)
        {
            llStartAnimation("nyanya");
        }
    }
}</source>
|helpers
|also_header
|also_events
|also_functions
|also_articles
|also_footer
|notes = The argument '''perm''' is the bit combination of all permissions granted when this event is triggered. To determine if an exact permission is granted you will need to perform a bitwise AND comparison between '''perm''' and the permission constant you are looking for. The example above demonstrates this. Perm will be 0 if the user has refused to grant any permissions.
|mode
|deprecated
|cat1=Permissions/Script
|cat2
|cat3
|cat4
}}

Latest revision as of 00:10, 22 January 2015

Description

Event: run_time_permissions( integer perm ){ ; }

Triggered when an agent grants run time permissions to this script.

• integer perm mask of PERMISSIONS_* flags granting permissions
Constants Action Category Granter Automatically granted when…
PERMISSION_DEBIT 0x2 take money from agent's account Money Owner
PERMISSION_TAKE_CONTROLS 0x4 take agent's controls Control Anyone sat on, attached
PERMISSION_TRIGGER_ANIMATION 0x10 start or stop Animations on agent Animation Anyone sat on, attached
PERMISSION_ATTACH 0x20 attach/detach from agent Attachment Owner or Anyone attached
PERMISSION_CHANGE_LINKS 0x80 change links Link Owner
PERMISSION_TRACK_CAMERA 0x400 track the agent's camera position and rotation Camera Anyone sat on, attached
PERMISSION_CONTROL_CAMERA 0x800 control the agent's camera
(must be sat on or attached; automatically revoked on stand or detach)
Camera Anyone sat on, attached
PERMISSION_TELEPORT 0x1000 teleport the agent Teleport Anyone[1]
PERMISSION_SILENT_ESTATE_MANAGEMENT 0x4000 manage estate access without notifying the owner of changes Estate Owner
PERMISSION_OVERRIDE_ANIMATIONS 0x8000 configure the overriding of default animations on agent Animation Anyone attached
PERMISSION_RETURN_OBJECTS 0x10000 Used by llReturnObjectsByOwner and llReturnObjectsByID to return objects from parcels Cleanup Owner, Group Owner

Caveats


Examples

Plays an animation
default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TRIGGER_ANIMATION & perm)
        {
            llStartAnimation("nyanya");
        }
    }
}

Notes

The argument perm is the bit combination of all permissions granted when this event is triggered. To determine if an exact permission is granted you will need to perform a bitwise AND comparison between perm and the permission constant you are looking for. The example above demonstrates this. Perm will be 0 if the user has refused to grant any permissions.

Deep Notes

Footnotes

Signature

event void run_time_permissions( integer perm );