Difference between revisions of "LlGetRegionAgentCount"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{LSL_Generic/pre-release|function}}{{LSL_Function
{{LSL_Function
|func_id=334|func_sleep=0.0|func_energy=10.0
|func_id=334|func_sleep=0.0|func_energy=10.0
|func=llGetRegionAgentCount
|func=llGetRegionAgentCount
Line 5: Line 5:
|return_text=that is the number of avatars in the region.
|return_text=that is the number of avatars in the region.
|caveats
|caveats
|examples=<lsl>//Tell the owner how many avatars are in the region on touch
|examples=
<source lang="lsl2">
default
default
{
{
     touch_start(integer count)
     touch_start(integer num_detected)
     {
     {
         llOwnerSay((string)llGetRegionAgentCount());
         integer numberOfAvatarsInSim = llGetRegionAgentCount();
        llSay(0, "There are currently "
            + (string) numberOfAvatarsInSim + " avatars in this sim.");
     }
     }
}</lsl>
}
</source>
|spec
|spec
|caveats=
* The value returned by this function is technically the average number of agents who were in the region for the past second, rounded to the nearest integer.  This means that there is a slight (<1 second) delay  in agent count when an agent enters or exits a region.
|constants
|constants
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetAgentList]]}}
{{LSL DefineRow||[[llGetRegionFPS]]}}
{{LSL DefineRow||[[llGetRegionFPS]]}}
{{LSL DefineRow||[[llGetRegionTimeDilation]]}}
{{LSL DefineRow||[[llGetRegionTimeDilation]]}}
Line 23: Line 30:
|also_articles
|also_articles
|notes
|notes
|history=Introduced in {{SVN|568|rev=88085|branch=Release|anchor=file33|date=Wednesday, 21 May 2008}}
|history=
*Introduced in {{SVN|568|rev=88085|branch=Release|anchor=file33|date=Wednesday, 21 May 2008}}
*Date of Release [[ Release_Notes/Second_Life_Release/1.21 | 16-10-2008 ]]
|cat1=Region
|cat1=Region
|cat2
|cat2

Latest revision as of 01:44, 22 January 2015

Summary

Function: integer llGetRegionAgentCount( );
0.0 Forced Delay
10.0 Energy

Returns an integer that is the number of avatars in the region.

Caveats

  • The value returned by this function is technically the average number of agents who were in the region for the past second, rounded to the nearest integer. This means that there is a slight (<1 second) delay in agent count when an agent enters or exits a region.

Examples

default
{
    touch_start(integer num_detected)
    {
        integer numberOfAvatarsInSim = llGetRegionAgentCount();
        llSay(0, "There are currently "
            + (string) numberOfAvatarsInSim + " avatars in this sim.");
    }
}

See Also

Deep Notes

History

Signature

function integer llGetRegionAgentCount();