- Documentation
- Client functions
- getElementBonePosition
Function
getElementBonePosition
Returns a ped bone's position in the world.
Syntax
float getElementBonePosition(element theElement, int bone)Arguments
theElementelement- A player or ped.
boneint- Bone number (e.g. 8 head, 24 right hand).
Returns
x, y, z or false.
Example
addEventHandler("onClientRender", root, function()
for _, p in ipairs(getElementsByType("player")) do
local x, y, z = getElementBonePosition(p, 8)
if x then
local sx, sy = getScreenFromWorldPosition(x, y, z + 0.3)
if sx then dxDrawText(getPlayerName(p), sx, sy) end
end
end
end)