llTransferOwnership

From Second Life Wiki
Revision as of 10:40, 13 November 2024 by Rider Linden (talk | contribs) (Created page with "{{LSL_Function |inject-2={{Issues/SVC-7631}}{{Issues/BUG-5656}} |func_sleep=0.0|func_energy=10.0 |func=llTransferOwnership |p1_type=key|p1_name=agent_id|p1_desc=Agent ID for t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: llTransferOwnership( key agent_id, integer flags );
0.0 Forced Delay
10.0 Energy

Transfer ownership of the object containing this script to agent_id.

• key agent_id Agent ID for the avatar to receive ownership of the object
• integer flags Flags controlling transfer behavior.

Specification

Transfers ownership of an object rezzed in world to agent_id. The object must be transferable by its current owner and must not be an attachment.

Optionally this function may force the object to derez itself into the destination agent's inventory, or make a copy of itself directly into inventory.

Transfer Flags

Constant Description
TRANSFER_FLAG_RESERVED 0x0001 Reserved, do not use.
TRANSFER_FLAG_TAKE 0x0002 When transfer is accepted, immediately take the object into inventory.
TRANSFER_FLAG_COPY 0x0004 Give a copy of the object and place it into the destination agent's inventory.

Transfer Errors

Constant Description
TRANSFER_OK 0 No error detected, inventory transferred
TRANSFER_BAD_OPTS -1 A bad option was passed in the options list.
TRANSFER_NO_TARGET -2 Could not find the receiving agent in the current region.
TRANSFER_THROTTLE -3 Transfer rate exceeded the inventory transfer throttle.
TRANSFER_NO_ITEMS -4 The list of items was empty or contained only non-transferable items.
TRANSFER_BAD_ROOT -5 The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing.
TRANSFER_NO_PERMS -6 The object does not have transfer permissions.
TRANSFER_NO_ATTACHMENT -7 Can not transfer ownership of an attached object.

Caveats

  • agent_id must be an agent in the region.
  • There is no way to detect if the receiver ignored, rejected or blocked the transaction (aside from a changed event never occurring.)
  • The function fails with a return code of TRANSFER_NO_PERMS if:
    • The object is no-transfer.
    • The object is no-copy and flags includes the TRANSFER_FLAG_COPY flag.
    • The object contains no-copy inventory and flags includes the TRANSFER_FLAG_COPY flag.
  • Calling this function from an attachment will fail and return TRANSFER_NO_ATTACHMENT

Examples

See Also

Deep Notes

Signature

function void llTransferOwnership( key agent_id, integer flags );