Access (NewAge)
Revision as of 13:18, 22 July 2010 by Asia Snowfall (talk | contribs) (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...')
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>