Hello! I am using DayZ mod and I need to fix some problems with dead player's body creation.
As standard, the following code is provided:
local x,y,z = getElementPosition(source)
local rotX,rotY,rotZ = getElementRotation(source)
local skin = getElementModel(source)
local ped = createPed(skin,x,y,z,rotZ)
As you can see, if I kill someone who is in the air at the moment, the body will be created in the air too. But I need to attach the"ped" to the ground "z" coordinate. As I understand correctly, the only one way to do it is to use "getGroundPosition". As wiki says, it is a client-only function.
This is the function which makes player dead if he has zero blood:
should I get ground position here? And how to do it correctly?