/attachments-mtasa

Bone attach with a preview panel to configure the positions and rotations.

Primary LanguageLuaMIT LicenseMIT

Attachments (Bone) - MTA: SA

Bone attach with a preview panel to configure the positions and rotations.

Environment

Command: type /ap to open - everyone can open this, once it's just for previewing to the client.
Cursor: hold mouse2 to toggle cursor.

Exported Functions

attach

void attach(
    object element, remote player, int boneId,
    float offsetX, float offsetY, float offsetZ,
    float rotationX, float rotationY, float rotationZ
)

Parameters

element: the object that you want to attach
player: the remote player that will receive that attached element
boneId: the bone ID that you are attaching to
offsetX, offsetY, offsetZ: x, y and z values determining where the object will be. Left, right, backwards, forwards, up, down
rotationX, rotationY, rotationZ: rx, ry and rz of the attached element

detach

void detach(object element)

Parameters

element: the object that will be detached from the remote player

updateAttachment

void updateAttachment(
    object element, int boneId,
    float offsetX, float offsetY, float offsetZ,
    float rotationX, float rotationY, float rotationZ
)

Parameters

element: the object that you want to update
boneId: the bone ID that you are attaching to
offsetX, offsetY, offsetZ: x, y and z values determining where the object will be. Left, right, backwards, forwards, up, down
rotationX, rotationY, rotationZ: rx, ry and rz of the attached element

isAttached

bool isAttached(object element)

Parameters

element: the object that you want to check

getAttachmentDetails

table getAttachmentDetails(object element)

Parameters

element: the object that you want to get the details