Hello.
I have started playing around LUA and MTA recently and I have already got to one problem. I wanted to make that if you kill ped with headshot (bodypart 9) it would take its head of. It has never wanted to work, so I added this little debug line to OnPedWasted callback.
function wastedped(ammo, attacker, weapon, bodypart)
outputChatBox(""..tostring(ammo).." and "..tostring(attacker).." and "..tostring(weapon).." and "..tostring(bodypart).."")
end
addEventHandler("onPedWasted",getRootElement(),wastedped)
It always gets me ammo (0), attacker (userdata: 00000***), weapon (false), bodypart (false). I wonder who it is possible that weapon and bodypart can be false, since it should return integer and not boolean (at least what wiki says)
Regards