Difference between revisions of "AGENT FLYING"

From Second Life Wiki
Jump to navigation Jump to search
(Add an example)
Line 7: Line 7:
|text=
|text=
|pb=
|pb=
|examples
|examples=Count how many people are currently flying within this parcel
<lsl>
// On touch, say how many avatars are currently flying within this parcel
default
{
    touch_start(integer total_number)
    {
        list AgentList = llGetAgentList(AGENT_LIST_PARCEL, [] );
        integer CountAll = (AgentList != [] );
        integer CountFlying;
        key AgentKey;
        while (CountAll)
        {
            AgentKey = llList2Key(AgentList, --CountAll);
            if (llGetAgentInfo(AgentKey) & AGENT_FLYING)      ++CountFlying;
        }
        llSay(0, (string) CountFlying + " avatars are currently flying within this parcel" );
    }
}
</lsl>
|constants=
|constants=
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->

Revision as of 14:32, 22 December 2013

Description

Constant: integer AGENT_FLYING = 0x0001;

The integer constant AGENT_FLYING has the value 0x0001

Caveats


Related Articles

Functions

•  llGetAgentInfo

Examples

Count how many people are currently flying within this parcel <lsl> // On touch, say how many avatars are currently flying within this parcel default {

   touch_start(integer total_number)
   {
       list AgentList = llGetAgentList(AGENT_LIST_PARCEL, [] );
       integer CountAll = (AgentList != [] );
       integer CountFlying;
       key AgentKey;
       while (CountAll)
       {
           AgentKey = llList2Key(AgentList, --CountAll);
           if (llGetAgentInfo(AgentKey) & AGENT_FLYING)       ++CountFlying;
       }
       llSay(0, (string) CountFlying + " avatars are currently flying within this parcel" );
   }

} </lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer AGENT_FLYING = 0x0001;