Jump to content

Where is sitted script


JJValero Writer
 Share

You are about to reply to a thread that has been inactive for 3888 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

This script just show where are sitted all avatars in region.

 

list g_lAgents = [];

default
{
    state_entry()
    {
        llSetText("", <1.0, 1.0, 1.0>, 1.0);
        llSetTimerEvent(1.0);
    }
    
    on_rez(integer start_param)
    {
        llResetScript();
    }

    timer()
    {
        g_lAgents = llGetAgentList(AGENT_LIST_REGION, []);
        integer iMax = llGetListLength(g_lAgents);
        integer iCount;
        string sOut = "";
        for (iCount = 0; iCount < iMax; iCount++){
            
            key kAgent = llList2Key(g_lAgents, iCount);
            integer iAgentInfo = llGetAgentInfo(kAgent);
            list lDetails = llGetObjectDetails(kAgent, [OBJECT_ROOT, OBJECT_NAME]);
            key kObject = llList2Key(lDetails, 0);
            string sAvatar = llList2String(lDetails, 1);
            
            if (iAgentInfo & AGENT_ON_OBJECT) {
             
                if (kAgent != kObject) {
                    list lObjDetails = llGetObjectDetails(
                        kObject, 
                        [OBJECT_NAME, OBJECT_PHYSICS, OBJECT_RUNNING_SCRIPT_COUNT]);
                    string sObjName =  llList2String(lObjDetails, 0);
                    integer bPhys = llList2Integer(lObjDetails, 1);
                    integer iNScrips = llList2Integer(lObjDetails, 2);
                    sOut += sAvatar + " on '" + sObjName + "'";
                    if ((bPhys == TRUE) && (iNScrips > 0)) {
                        sOut += " (Vehicle)";
                    } else if ((bPhys == TRUE) && (iNScrips == 0)) {
                        sOut += " (Physical)";
                    } else if ((bPhys == FALSE) && (iNScrips > 0)) {
                        sOut += " (NPV)";
                    } else if ((bPhys == FALSE) && (iNScrips == 0)) {
                        sOut += " (Object)";
                    }
                    sOut += "\n";
                }
                   
            } else if (iAgentInfo & AGENT_SITTING) {
                sOut += sAvatar + " on Ground.\n";
            } else {
                //sOut += sAvatar + " is not sitted.\n";
            }
        } 
        llSetText(sOut, <1.0, 1.0, 1.0>, 1.0);
        
        
    }
}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3888 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...