Difference between revisions of "Blacklist and Remote Kill"

From Second Life Wiki
Jump to navigation Jump to search
Line 13: Line 13:
Allows you to delete something owned by someone else by saying something like "kill:ownername" on a private admin channel to delete, clean scripts, or detach their object.
Allows you to delete something owned by someone else by saying something like "kill:ownername" on a private admin channel to delete, clean scripts, or detach their object.


===The Script===
==The Script==


<lsl>
<lsl>

Revision as of 14:25, 18 October 2009

Blacklist and Remote Kill

This script explains how to set up a blacklist and incorporate a remote kill script for something.

Blacklist

The Blacklist is a list of avatar names you can input which will be denied access to your object. The script will check the blacklist on rez and if the owner is on it, the object will delete, clean scripts, or detach.

Remote Kill

Allows you to delete something owned by someone else by saying something like "kill:ownername" on a private admin channel to delete, clean scripts, or detach their object.

The Script

<lsl> //© 2009 Chase Quinnell and TerraCo Designs // http://www.terracodesigns.com //Please keep this open source and leave my name reference here



list blacklist=["name 1","name2","name3"]; //This is our blacklist. key creator = "YOUR AVATAR UUID KEY HERE"; //this identifies the object creator. Hardcode your key in this spot


integer AChan=901; //This is the admin channel to listen for creator commands


default {

   state_entry()
   {
       //llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);  //this is used if you need to DETACH from avatar
       
       
       //CHECK BLACKLIST
       if (llListFindList(blacklist,[llKey2Name(llGetOwner())])!=-1) 
       {
           //if new owner is in blacklist, tell them to go away
       llOwnerSay("Warning: You are not allowed to use this item, you have been blacklisted by the creator.  Item has been self-destructed.  Have a nice day, " + (llKey2Name(llGetOwner())));
       llSleep(2);
       //llDie();  //deletes object
       //llDetachFromAvatar; //detaches from avatar, requires the request permissions function.
       }
   }
   on_rez(integer start)
   {
       llResetScript(); //resets script, makes sure it knows who owns it
       llListen(AChan,"","","");
   }
   listen(integer CH, string name, key id, string msg)
   {
       key ownername = (llKey2Name(llGetOwner()));
       
   if (msg==llToLower("kill:"+(string)ownername) && CH==AChan && id==creator)
       {
       //if the message equals kill:currentownernamehere
       //and the channel is the admin channel
       //and the person is the creator
       
       //then tell the person their thing has been nerfed... 
       llOwnerSay("Self destruct initiated...");
       llInstantMessage(creator, "/me owned by " +(llKey2Name(llGetOwner())) +" has self-destructed");
       llSleep(1);
       llRemoveInventory("otherscripthere..");
       llSleep(1); 
       llRemoveInventory(llGetScriptName());
       }
   }

} </lsl>