Difference between revisions of "Access (NewAge)"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with '== Access Script == '''Note: This script is for people who have knowledge of coding''' How to use? Change the Access varible to one of the three; 'Public' 'Group' 'Owner' Ret...')
 
Line 10: Line 10:
'Owner'
'Owner'


Returns TRUE if user UUID is allowed to continue using
Returns TRUE if user UUID is allowed to continue using.
Returns FALSE if user UUID is not permitted to use
Returns FALSE if user UUID is not permitted to use.


<lsl>
<lsl>

Revision as of 13:19, 22 July 2010

Access Script

Note: This script is for people who have knowledge of coding

How to use?

Change the Access varible to one of the three; 'Public' 'Group' 'Owner'

Returns TRUE if user UUID is allowed to continue using. Returns FALSE if user UUID is not permitted to use.

<lsl> if(asAccessCheck(key id) == TRUE) { ... </lsl>


<lsl> ///////////////////////////////// // NewAge Access Script // By Asia Snowfall // Version 1.0 /////////////////////////////////

string Access = "public";

// Access Types; // Public = Everyone can use // Group = Group Only // Owner = Owner Only

key asObjectOwner() {

   list details = llGetObjectDetails(llGetKey(), [OBJECT_OWNER]);
   return (key)llList2CSV(details);

}

integer asAccessCheck(key id) {

   if(llSubStringIndex(llToLower(Access), "public") != -1)
   {
       return TRUE;
   }
   else if((llSubStringIndex(llToLower(Access), "group") != -1)||(asObjectOwner() == id))
   {
       if(llSameGroup(id) == TRUE)
       {
           return TRUE;
       }
       else
       {
           return FALSE;
       }
   }
   else if(llSubStringIndex(llToLower(Access), "owner") != -1)
   {
       if(asObjectOwner() == id)
       {
           return TRUE;
       }
       else
       {
           return FALSE;
       }
   }
   else
   {
       return FALSE;
   }

}

default {

   touch_start(integer x)
   {
       if(asAccessCheck(llDetectedKey(0)) == TRUE)
       {
           llWhisper(0, "Access Granted");
       }
       else
       {
           llWhisper(0, "Access Denied");
       }
   }

} </lsl>