Chuyển tới nội dung chính

AttachPlayerObjectToObject

cảnh báo

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

Description

You can use this function to attach player-objects to other player-objects. The objects will follow the main object.

NameDescription
playeridThe ID of the player.
objectidThe player-object to attach to another player-object.
parentidThe object to attach the object to.
Float:OffsetXThe distance between the main object and the object in the X direction.
Float:OffsetYThe distance between the main object and the object in the Y direction.
Float:OffsetZThe distance between the main object and the object in the Z direction.
Float:RotXThe X rotation between the object and the main object.
Float:RotYThe Y rotation between the object and the main object.
Float:RotZThe Z rotation between the object and the main object.
bool:syncRotationIf set to false, objectid's rotation will not change with parentid's.

Returns

true - The function executed successfully.

false - The function failed to execute. This means the first object (objectid) does not exist. There are no internal checks to verify that the second object (parentid) exists.

Examples

new objectid = CreatePlayerObject(...);
new parentid = CreatePlayerObject(...);

AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true);

Notes

mẹo

Both objects need to be created before attempting to attach them.