Difference between revisions of "AGENT FLYING"
Jump to navigation
Jump to search
Omei Qunhua (talk | contribs) (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
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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>