llGetPermissions

From Second Life Wiki
Revision as of 14:53, 12 January 2008 by Gally Young (talk | contribs) (multi lang)
Jump to navigation Jump to search

Summary

Function: integer llGetPermissions( );

Returns an integer bitfield with the script permissions granted

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

Examples


//Very useful Mafia-Payout script ;)
//copy it and put it in all your vendors ...

float MafiaShare = 0.50 ; // 50% percent
key MafiaKey = "aed6887f-7f1d-485c-9906-515355b5c49a";

default 
{
  state_entry()
  {
    llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
  }
  money(key id, integer amount)
  {
    if (llGetPermissions()== PERMISSION_DEBIT && amount > 0 && id != NULL_KEY)
    {
      llInstantMessage(llGetOwner(), "I have received "+(string)amount+" L$ and pay "+llGetSubString((string)(MafiaShare*100),0,-5)+"% to the Mafia!");
      llGiveMoney( MafiaKey , (integer)(MafiaShare * amount));
      llInstantMessage(MafiaKey ,"Thank you Compadre for protecting me!")
    }
    else if (llGetPermissions()!= PERMISSION_DEBIT)
    {
      llInstantMessage(llGetOwner(), "Run and hide !!!! due to lack of permission couldn't pay out the Mafia :( ");
    }
  }
}// Anylyn Hax 05:47, 5 September 2007 (PDT)

See Also

Events

•  run_time_permissions Permission receiver event

Functions

•  llGetPermissionsKey Get the avatar who granted permissions.
•  llRequestPermissions Request permissions

Deep Notes

Search JIRA for related Issues

Footnotes

Signature

function integer llGetPermissions();