Difference between revisions of "LlIsFriend"

From Second Life Wiki
Jump to navigation Jump to search
m (Caveat about a bug in the function as confirmed by Maestro Linden in March)
m (Bugfix in 2024-11-12.11802108395)
 
Line 19: Line 19:
|caveats=
|caveats=
* You are not your own friend.
* You are not your own friend.
* Currently a faulty result is given if the owner of the object the script resides in has moved to an adjacant region shortly before the query (see [https://feedback.secondlife.com/scripting-bugs/p/llisfriend-fails-if-owner-is-not-present-on-region llIsFriend fails if owner is not present on region] on Canny). First noticed on server version 2024-01-19.7590161929, last checked (and still not fixed) in server version 2024-09-13.10853867644.
* <s>Currently a faulty result is given if the owner of the object the script resides in has moved to an adjacant region shortly before the query (see [https://feedback.secondlife.com/scripting-bugs/p/llisfriend-fails-if-owner-is-not-present-on-region llIsFriend fails if owner is not present on region] on Canny). First noticed on server version 2024-01-19.7590161929, last checked (and still not fixed) in server version 2024-09-13.10853867644.</s> Fixed in server version 2024-11-12.11802108395.


|constants
|constants

Latest revision as of 10:03, 15 November 2024

Summary

Function: integer llIsFriend( key agent_id );
0.0 Forced Delay
10.0 Energy

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.
  • Currently a faulty result is given if the owner of the object the script resides in has moved to an adjacant region shortly before the query (see llIsFriend fails if owner is not present on region on Canny). First noticed on server version 2024-01-19.7590161929, last checked (and still not fixed) in server version 2024-09-13.10853867644. Fixed in server version 2024-11-12.11802108395.

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

Signature

function integer llIsFriend( key agent_id );