Group Authorization
Revision as of 16:21, 18 October 2009 by Chase Quinnell (talk | contribs) (Created page with '<lsl> //============================================================ //© 2009 Chase Quinnell and TerraCo Designs // http://www.terracodesigns.com //Please keep this open so...')
<lsl> //============================================================ //© 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. }
}
</lsl>