Перейти к основному содержимому

SetPlayerAttachedObject

Description

Attach an object to a specific bone on a player.

NameDescription
playeridThe ID of the player to attach the object to.
indexThe index (slot 0-9) to assign the object to.
modelidThe model to attach.
boneThe bone to attach the object to.
Float:offsetX(optional) X axis offset for the object position.
Float:offsetY(optional) Y axis offset for the object position.
Float:offsetZ(optional) Z axis offset for the object position.
Float:rotationX(optional) X axis rotation of the object.
Float:rotationY(optional) Y axis rotation of the object.
Float:rotationZ(optional) Z axis rotation of the object.
Float:scaleX(optional) X axis scale of the object.
Float:scaleY(optional) Y axis scale of the object.
Float:scaleZ(optional) Z axis scale of the object.
materialColour1(optional) The first object color to set, as an integer or hex in ARGB color format.
materialColour2(optional) The second object color to set, as an integer or hex in ARGB color format

Returns

1 on success, 0 on failure.

Examples

public OnPlayerSpawn(playerid)
{
SetPlayerAttachedObject(playerid, 3, 1609, 2); // Attach a turtle to the playerid's head, in slot 3

// Example of using colors on an object being attached to the player:
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1.0, 1.0, 1.0, 0xFF00FF00);
// Attach a white hat to the head of the player and paint it green
return 1;
}

Notes

подсказка

This function is separate from the CreateObject / CreatePlayerObject pools.

warning

Up to 10 objects can be attached to a single player (index 0-9)