Difference between revisions of "Access (NewAge)"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) (removed some redundant elses in userfunctions where returning values) |
Omei Qunhua (talk | contribs) (→Access Script: Simplify) |
||
Line 1: | Line 1: | ||
== Access Script == | == Access Script == | ||
How to use? | How to use? | ||
Change the Access | Change the Access variable to one of the three; | ||
'Public' | 'Public' | ||
'Group' | 'Group' | ||
'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> | ||
// NewAge Access Script | // NewAge Access Script | ||
// By Asia Snowfall | // By Asia Snowfall | ||
// Version | // Version 2 | ||
// | // | ||
// Access Mode: | // Access Mode: | ||
Line 31: | Line 22: | ||
string accessMode = "public"; | string accessMode = "public"; | ||
integer asAccessCheck(key id) | integer asAccessCheck(key id) | ||
Line 45: | Line 27: | ||
string accessModeToLower = llToLower(accessMode); | string accessModeToLower = llToLower(accessMode); | ||
if (accessModeToLower == "public") | if (accessModeToLower == "public" || id == llGetOwner() ) | ||
return TRUE; | return TRUE; | ||
if (accessModeToLower == "group") | |||
return llSameGroup(id); | |||
return FALSE; | |||
} | } | ||
Line 70: | Line 40: | ||
touch_start(integer num_detected) | touch_start(integer num_detected) | ||
{ | { | ||
if (asAccessCheck( llDetectedKey(0) )) | |||
llWhisper(0, "Access Granted"); | |||
llWhisper( | |||
else | else | ||
llWhisper( | llWhisper(0, "Access Denied"); | ||
} | } | ||
} | } | ||
</lsl> | </lsl> |
Revision as of 11:09, 27 March 2014
Access Script
How to use?
Change the Access variable 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> // NewAge Access Script // By Asia Snowfall // Version 2 // // Access Mode: // public = anybody // group = agents with the same active group // owner = owner only
string accessMode = "public";
integer asAccessCheck(key id) {
string accessModeToLower = llToLower(accessMode);
if (accessModeToLower == "public" || id == llGetOwner() ) return TRUE;
if (accessModeToLower == "group") return llSameGroup(id);
return FALSE;
}
default {
touch_start(integer num_detected) { if (asAccessCheck( llDetectedKey(0) )) llWhisper(0, "Access Granted"); else llWhisper(0, "Access Denied"); }
} </lsl>