:facepalm:
client
addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(),function(weapon, ammo, ammoInClip,endX,endY,endZ,hitElement)
triggerServerEvent("daj_cos",localPlayer,endZ,hitElement)
end)
server
addEvent("daj_cos",true)
addEventHandler("daj_cos",root,function(endZ,hitElement)
local x,y,z = getElementPosition(hitElement)
if getDistanceBetweenPoints3D(_,_,z,_,_,endZ)<1.0 then
killPed(hitElement)
end
end)
db : Bad argument getDistanceBetweenPoints3D [ Expected vector3 at argument 1, got nil]