llIsFriend

From Second Life Wiki
Jump to navigation Jump to search

Summary

Function: integer llIsFriend( key agent_id );

Returns a boolean (an integer) that is TRUE if agent_id and the owner of the prim the script is in are friends, otherwise FALSE.

• key agent_id

Specification

  • If the prim is owned by a group this function behaves identically to llSameGroup
  • This function will return FALSE under the following edge cases:
    • If neither the owner, nor the target agent are in the region.
    • If the agent_id does not specify an agent.

Caveats

  • You are not your own friend.
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    state_entry()
    {
        llSensorRepeat("", NULL_KEY, AGENT, 95, PI, 10);
    }

    sensor(integer count)
    {
        integer index;
        for (index = 0; index < count; ++index)
        {
            string is_is_not = " is NOT ";
            if (llIsFriend(llDetectedKey(index)))
            {
                is_is_not = " is ";
            }
            llSay(0, llDetectedName(index) + is_is_not + "a friend.");
        }
    }
}

See Also

Functions

•  llDetectedGroup
•  llSameGroup

Deep Notes

Search JIRA for related Issues

Signature

function integer llIsFriend( key agent_id );