Group Authorization

De DigiWiki.

This script is used to check whether the object is set to the appropriate group (by group key).

The Script

//============================================================
//© 2009 Chase Quinnell and TerraCo Designs
//      http://www.terracodesigns.com
//Please keep this open source and leave my name reference here
 
//AUTHORIZED GROUP KEYS
//This is the group key for the authorized group.
string authgroupkey = "INSERT YOUR GROUP KEY HERE";
 
//============================================================
 
Unauthorized()
{
    llOwnerSay("Authorization failed.");
    llDetachFromAvatar();
    llDie(); 
}
 
default
{
    state_entry()
    {
 
        llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
        key id = llGetOwner();  
        list group = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
            //gets the group key of the object
 
 
        if ((llList2String(group,0) != authgroupkey))
            //checks object group key
            //if it does not match, then it is unauthorized
        {
          Unauthorized();
          //queue unauthorized subroutine
        }
        else 
        {
            llOwnerSay("Authorization passed");
        }
    }
    on_rez(integer tcauth_chk)
    {
        llResetScript();
        //resets script on_rez so that it knows who owns it.
    }
}
Outils personnels
  • Cette page a été consultée 699 fois.
donate
Google Ads