Ugrás a fő tartalomhoz

AttachObjectToObject

Description

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

NameDescription
objectidThe object to attach to another 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:rotationXThe X rotation between the object and the main object.
Float:rotationYThe Y rotation between the object and the main object.
Float:rotationZThe Z rotation between the object and the main object.
bool:syncRotationIf set to false, objectid's rotation will not change with attachtoid'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 (attachtoid) exists.

Examples

new gObjectId = CreateObject(...);
new gAttachToId = CreateObject(...);

AttachObjectToObject(gObjectId, gAttachToId, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true);

Notes

tanács

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

tanács

There is no player-object version of this function in SA-MP.

But there is AttachPlayerObjectToObject in open.mp