Talk:LlParcelSay

From Second Life Wiki
Revision as of 09:21, 15 February 2015 by Sayrah Parx (talk | contribs) (examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

llParcelMessage

Here are some examples if you just want to send a message to all avatars on related parcels without a script delay:

llParcelMessage(string message)
{
    list avatars = llGetAgentList(AGENT_LIST_PARCEL_OWNER, []);
    integer count;

    for (count = 0; count < llGetListLength(avatars); count++)
    {
        llRegionSayTo(llList2String(avatars, count), 0, message);
    }
}

llParcelHeightMessage(integer min_height, integer max_height, string message)
{
    list avatars = llGetAgentList(AGENT_LIST_PARCEL_OWNER, []);
    vector avatar_pos;
    integer count;

    for (count = 0; count < llGetListLength(avatars); count++)
    {
        avatar_pos = llList2Vector(llGetObjectDetails(llList2String(avatars, count), [OBJECT_POS]), 0);

        if ((avatar_pos.z >= min_height) && (avatar_pos.z <= max_height))
        {
            llRegionSayTo(llList2String(avatars, count), 0, message);
        }
    }
}

default
{
    state_entry()
    {
        llParcelMessage("This message gets sent to all avatars on related parcels.");
        llParcelHeightMessage(400, 500, "This message only gets sent to avatars on related parcels who are at or above 400 meters, and also at or below 500 meters.");
    }
}

Sayrah Parx (talk) 08:21, 15 February 2015 (PST)