OsNpcRemove

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
 
</source>
 
</source>
 
|
 
|
ossl_example = See [[osNpcCreate]] example.
+
ossl_example =It might be helpful to erase all of the NPCs in your sim.
 +
<source lang="lsl">
 +
// sim-wide NPC killer
 +
// kill all of NPCs in this SIM
 +
// Attempts to kill agents too, but it will silently fail
 +
 
 +
default
 +
{
 +
    touch_start(integer number)
 +
    {
 +
        list avatars = llList2ListStrided(osGetAvatarList(), 0, -1, 3);
 +
        integer i;
 +
        for (i=0; i<llGetListLength(avatars); i++)
 +
        {
 +
            string target = llList2String(avatars, i);
 +
            osNpcRemove(target);
 +
        }
 +
    }
 +
}
 +
</source>
 +
See [[osNpcCreate]] for another example.
 
|  
 
|  
 
additional_info = *Removes the avatar who has specified by '''npc'''.
 
additional_info = *Removes the avatar who has specified by '''npc'''.

Revision as of 05:26, 30 June 2011

osNpcRemove(key npc);
No descriptions provided
Threat Level High
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
It might be helpful to erase all of the NPCs in your sim.
// sim-wide NPC killer
// kill all of NPCs in this SIM
// Attempts to kill agents too, but it will silently fail
 
default
{
    touch_start(integer number)
    {
        list avatars = llList2ListStrided(osGetAvatarList(), 0, -1, 3);
        integer i;
        for (i=0; i<llGetListLength(avatars); i++)
        {
            string target = llList2String(avatars, i);
            osNpcRemove(target);
        }
    }
}

See osNpcCreate for another example.

Notes
*Removes the avatar who has specified by npc.
  • If the npc is the uuid of any agent(or users, not NPC), this function will silently fail, not erasing existing avatar.
Personal tools
General
About This Wiki