Difference between revisions of "LlEjectFromLand"

From Second Life Wiki
Jump to: navigation, search
Line 23: Line 23:
 
|cat4
 
|cat4
 
}}
 
}}
 +
 +
string msg;
 +
string name;
 +
default
 +
{
 +
    on_rez(integer n)
 +
    {
 +
        llResetScript();
 +
    }
 +
   
 +
    state_entry()
 +
    {
 +
        llListen(1,"",llGetOwner(),"");
 +
        llListen(0,"",llGetOwner(),"");
 +
    }
 +
   
 +
 +
    listen(integer n, string m, key k, string msg)
 +
    {
 +
       
 +
        if (llGetSubString(msg,0,4) == "eject")
 +
        {
 +
           
 +
            name = llToLower(llGetSubString(msg,6,llStringLength(msg)));
 +
            llSensor("",NULL_KEY,AGENT,96,PI);
 +
        }
 +
       
 +
    }
 +
   
 +
    sensor(integer n)
 +
    {
 +
        integer i;
 +
        for (i=0;i<n;i++)
 +
        {
 +
           
 +
            if (llSubStringIndex(llToLower(llDetectedName(i)),name) != -1)
 +
              {
 +
           
 +
            llOwnerSay("ejecting " + name);
 +
                llEjectFromLand(llDetectedKey(i));
 +
        }
 +
    }
 +
    }
 +
 +
   
 +
    no_sensor() {
 +
    llOwnerSay("Avatar not found.");
 +
    }
 +
}

Revision as of 01:45, 16 July 2007

Summary

Function: llEjectFromLand( key pest );

Ejects pest from land that you own.

• key pest

Examples

Deep Notes

Search JIRA for related Issues

Signature

function void llEjectFromLand( key pest );

string msg; string name; default {

   on_rez(integer n)
   {
       llResetScript();
   }
   
   state_entry()
   {
       llListen(1,"",llGetOwner(),"");
       llListen(0,"",llGetOwner(),"");
   }
   
   listen(integer n, string m, key k, string msg)
    {
        
        if (llGetSubString(msg,0,4) == "eject")
        {
           
            name = llToLower(llGetSubString(msg,6,llStringLength(msg)));
           llSensor("",NULL_KEY,AGENT,96,PI);
       }
       
   }
   
   sensor(integer n)
   {
       integer i;
       for (i=0;i<n;i++)
       {
           
           if (llSubStringIndex(llToLower(llDetectedName(i)),name) != -1)
             {
           
           llOwnerSay("ejecting " + name);
               llEjectFromLand(llDetectedKey(i));
       }
   }
   }


   no_sensor() {
   llOwnerSay("Avatar not found.");
   }

}