Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Club Elite Protection Script

BigJohn Jade
Registered User
Join date: 5 Aug 2003
Posts: 93
06-14-2004 11:09
Do what you like to with this script make it better or whatever want to do with it.
CODE

// Club Elite Protection Script

// Keep this script free for all to use, do not sale it.

// This script is a Modify version of Darth Jones and Anaraxis Romulus PSPS Kicker script by BigJohn Jade

// This script was made so I could give my dacners and dj's boot power from club to kick ppl out that starts shit using owner of land llEjectFromLand and llUnSit commands to get them out of the club. It has a sensor range up to 80 meters away. Should also have a notecard called Help in whatever object the script may be in.

// Master Levels only Commands:
// ===================
// start protection - Must turn on script before it works.
// reset protection - Will reset script and clear everyone out of ban list and access list and turn script off.
// script status - Will show script info.
// aaccess username - Will give access to anyone in list to add to the ban list.
// raccess username - Will take away access from person in the list.
// accesslist - Will list everyone on access list.

// Dancers Levels commands:
// ===================
// Add username - Will add someone to ban list to kick out from club.
// remove username - Will delete from ban list from club.
// list - will list who all in ban list for club.
// ===================

integer LID;
list EliteBanList;
list Access_List;

// You can change sensor range here.
integer sensor_range = 80;

// how fast repeat for sensor is
float how_fast = 1.0;

// Name of help card when someone clicks on object they must have access to get the help card.
string note_name = "Help";

// Lets give someone we pick to have same master level access so they can add ppl and remove ppl. Note: Owener and who you pick to have master access must add there self to access list before working ban list.
key MasterLevelKey = "Ana Lily";

// Config all strings here to match whatever you need to.
string StateEntryText ="Club Elite Protection System: To activate Must have Master Level Access, say 'start protection'";

string DeleteFromAccessText=" from Club Elite Protection Access list";

string DeleteFromBanListText=" from Club Elite Ban list.";

string resetBanListText="Club Elite Protection Script System online!";

string EjectText1=" away from Club Elite Land!";

string EjectText2=" You have been boot from Club Elite Land!";

string TouchStartText=" Sorry you do not have Access to Club Elite Protection System";

string ScriptResetText="Resetting Club Elite Protection Script";

string AlreadyInAccessListText=" already in Club Elite Access list";

string AddToAccessListText=" to Club Elite Access list";

string AlreadyInBanListText=" already in Club Elite ban list";

string MemeberCantBeAddToBanList=" has Club Elite Access and can't be added to ban list";

string AddToBanListText= " to Club Elite ban list";

string NotFoundInAccessListText=" was not found in Club Elite Access list";

string WasNotFoundInBanListText=" was not found in Club Elite Ban list";

string PrintAccessListText="Club Elite Protection Access List:";

string PrintBanListText="Club Elite Ban List:";


GetScriptStatus()
{
llWhisper(0,"Script Free Memory " + (string)llGetFreeMemory());
llWhisper(0,"Script Name " + (string)llGetScriptName());
llWhisper(0,"Region Name " + (string)llGetRegionName());
llWhisper(0,"Region FPS " + (string)llGetRegionFPS());
}

string getParameter(list strings)
{
integer len = llGetListLength(strings);
integer i;
string ret;
string space= "";
for (i=1;i<len;i++)
{
ret += space + llList2String(strings,i);
space=" ";
}
return ret;
}

integer printAccessList()
{
integer i;
llWhisper(0,(string)PrintAccessListText);
for (i=0;i<llGetListLength(Access_List);i++)
{
llWhisper(0,llList2String(Access_List,i));
}
return 0;
}

integer printEliteBanList()
{
integer i;
llWhisper(0,(string)PrintBanListText);
for (i=0;i<llGetListLength(EliteBanList);i++)
{
llWhisper(0,llList2String(EliteBanList,i));
}
return 0;
}

integer DelFromAccessList(string name)
{
integer i;
for (i=0;i<llGetListLength(Access_List);i++)
{
string s = llList2String(Access_List,i);
if (s==name)
{
Access_List = llDeleteSubList(Access_List, i, i);
llWhisper(0,"Removed " + name + (string)DeleteFromAccessText);
}
}
return 0;
}

integer DelFromBanList(string name)
{
integer i;
for (i=0;i<llGetListLength(EliteBanList);i++)
{
string s = llList2String(EliteBanList,i);
if (s==name)
{
EliteBanList = llDeleteSubList(EliteBanList, i, i);
llWhisper(0,"Removed " + name + (string)DeleteFromBanListText);
}
}
return 0;
}

integer isEliteAccessUser(string name)
{
integer i;
for (i=0;i<llGetListLength(Access_List);i++)
{
string s = llList2String(Access_List,i);
if (s==name) return 1;
}
return 0;
}

integer isEliteBan(string name)
{
integer i;
for (i=0;i<llGetListLength(EliteBanList);i++)
{
string s = llList2String(EliteBanList,i);
if (s==name) return 1;
}
return 0;
}
SensorSetup()
{
llSensorRepeat("","" , AGENT, sensor_range, 2*PI, how_fast);
}

integer resetBanList()
{
string listen_name = llDetectedName(0);
llWhisper(0,(string)resetBanListText);
llSensorRemove();
SensorSetup();
llListenRemove(LID);
LID = llListen(0,"","","");
return 0;
}
default
{
state_entry()
{
SensorSetup();
llWhisper(0,(string)StateEntryText);
llListenRemove(LID);
LID = llListen(0,"","","");
}
sensor(integer total_number)
{
integer i;
for (i=0;i<total_number;i++)
{
key person = llDetectedKey(i);
string name = llDetectedName(i);
if (isEliteBan(name)>0)
{
llWhisper(0,"I Eject " + name + (string)EjectText1);
llUnSit(person);
llEjectFromLand(person);
llInstantMessage(person, name + (string)EjectText2);
}

}
}

touch_start(integer total_number)
{
integer i;
for (i=0;i<total_number;i++)
{
key person = llDetectedKey(i);
string name = llDetectedName(i);
if (isEliteAccessUser(name)>0)
{
llGiveInventory(person, note_name);
}
else llInstantMessage(person, name + (string)TouchStartText);

}
}
listen(integer channel, string name, key id, string message)
{
if (message == "script status" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
GetScriptStatus();
}

else if (message == "start protection" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
resetBanList();
return;
}
else if (message == "reset protection" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
llWhisper(0,ScriptResetText);
llResetScript();
}
list strings = llParseString2List(message,[" "],[]);
string command = llList2String(strings,0);
if (command=="accesslist" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
printAccessList();
}
else if(message=="list" && (isEliteAccessUser(name)>0))
{
printEliteBanList();
return;
}
string par = getParameter(strings);
if (par=="")
{
return;
}
else if (command=="aaccess" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
if (isEliteAccessUser(par)>0)
{
llWhisper(0,"Sorry " + par + (string)AlreadyInAccessListText);
return;
}
else Access_List = llListInsertList(Access_List,[par],llGetListLength(Access_List));
llWhisper(0,"Added " + par + (string)AddToAccessListText);
return;
}
else if(command=="add" && (isEliteAccessUser(name)>0))
{
if (isEliteBan(par)>0)
{
llWhisper(0,"Sorry " + par + (string)AlreadyInBanListText);
return;
}
if (isEliteAccessUser(par)>0)
{
llWhisper(0,"Sorry " + par + (string)MemeberCantBeAddToBanList);
return;
}
else EliteBanList = llListInsertList(EliteBanList,[par],llGetListLength(EliteBanList));
llWhisper(0,"Added " + par + (string)AddToBanListText);
return;
}
else if (command=="raccess" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
if (isEliteAccessUser(par)>0)
{
DelFromAccessList(par);
return;
}
else llWhisper(0,"Sorry " + par + (string)NotFoundInAccessListText);
}
else if(command=="remove" && (isEliteAccessUser(name)>0))
{
if (isEliteBan(par)>0)
{
DelFromBanList(par);
return;
}
else llWhisper(0,"Sorry " + par + (string)WasNotFoundInBanListText);
}
}
}

edit-just added the code mark-ups
Fargon Millhouse
Soul Wanderer
Join date: 26 May 2004
Posts: 8
Original Thread
06-22-2004 10:09
/15/b8/15487/1.html


Thank you BigJohn. Most useful!!
Navy Bean
Registered User
Join date: 29 May 2005
Posts: 13
Rented land
01-14-2006 15:20
So this would work with rented land if the landlord rezzed it and added the tennants to the access list, right? But does it have a one-time ejection option, or just a ban list?
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
New discussion thread
01-15-2006 13:01
/54/ef/82665/1.html
_____________________
i've got nothing. ;)