- Documentation
- Client functions
- getPedBoneIndexForMta
Function
getPedBoneIndexForMta
Translates a bone number used by existing scripts (e.g. 8 = head, 25 = right hand) into a bone index in the Definitive Edition skeleton. Useful when porting existing scripts that use bone numbers. Returns false when the bone has no counterpart in the new skeleton.
Syntax
int getPedBoneIndexForMta(int boneId)Arguments
boneIdint- Bone number (as in
getBoneIDs).
Returns
Game bone index, or false.
Example
outputChatBox("Głowa 8 = kość gry " .. tostring(getPedBoneIndexForMta(8)))
See also
getPedBoneIndexByNameConverts a game skeleton bone name to its index, which you can then pass togetPedBonePositionand similar functions. Some names repeat in the skeleton (there are e.g. two "Spine" bones); the second argument picks which occurrence to return.getPedBonePositionReturns the world position of a chosen skeleton bone of a ped, such as the head or a hand. On the client the position is exact and follows the animation (the bone is read from the game). The server does not know the ped's pose, so it returns an approximation: a fixed bone offset of a standing ped, rotated to match its heading. Bone numbers are the ones fromgetBoneIDs(e.g. 8 head, 25 right hand, 35 left hand); on the client a game bone index also works.