Difference between revisions of "LlGetAgentList"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Function |inject-2={{Issues/Svc-5488}}{{Issues/MISC-243}}{{LSL_Function/avatar|avatar|sim=*}} |func=llGetAgentList |sort=GetAgentList |func_id=0 |func_sleep=0.0 |func_energ…")
 
Line 8: Line 8:
|func_desc=Requests a list of agents currently in the region, limited by the flags parameter.
|func_desc=Requests a list of agents currently in the region, limited by the flags parameter.
* AGENT_LIST_PARCEL - returns only agents on the same parcel where the script is running.
* AGENT_LIST_PARCEL - returns only agents on the same parcel where the script is running.
* AGENT_LIST_PARCEL_OWNER - returns only agents on any parcel in the region where the parcel owner is the same as the object's owner.
* AGENT_LIST_PARCEL_OWNER - returns only agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object.
* AGENT_LIST_REGION - returns any/all agents in the region.
* AGENT_LIST_REGION - returns any/all agents in the region.
|func_footnote=
|func_footnote=

Revision as of 13:29, 20 March 2012

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: list llGetAgentList( integer max_agents, integer flags );

Requests a list of agents currently in the region, limited by the flags parameter.

  • AGENT_LIST_PARCEL - returns only agents on the same parcel where the script is running.
  • AGENT_LIST_PARCEL_OWNER - returns only agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object.
  • AGENT_LIST_REGION - returns any/all agents in the region.
    Returns a list [key id0, key id1, ..., key idn] or [string error_msg] - returns avatar keys for all agents in the region limited to the area specified by flags
• integer max_agents Maximum number of agents to return in the list.
• integer flags selection flags

Examples

<lsl>//Displays up to 50 avatar key: name pairs detected in the entire region list gaAgents; integer giMaxAgentsToReturn = 50;

default {

   touch_start(integer total_number)
   {
       integer  i;
       integer  liCount;
       gaAgents = llGetAgentList(giMaxAgentsToReturn,AGENT_LIST_REGION);
       liCount = llGetListLength(gaAgents);
       if (liCount > 0)
           if (llGetListEntryType(gaAgents,0) == TYPE_STRING)
               llOwnerSay("Error: "+llList2String(gaAgents,0));
           else
               for (i=0; i < liCount; ++i)
                   llOwnerSay(llList2String(gaAgents,i)+": "+llKey2Name(llList2String(gaAgents,i)));
  }
}</lsl>

Deep Notes

Search JIRA for related Issues

Signature

//function list llGetAgentList( integer max_agents, integer flags );