So i've tried this but this did not work. I guess i did some fatal error
function PedWasted()
setElementHealth ( killer, 0 )
outputChatBox( "Just in the middle", player, 255, 0, 0 )
end
addEventHandler("onClientPedWasted", getRootElement(), PedWasted)
Edit: It didn't work even. It's for only players. I thought peds are non player npcs in MTA. I've tried this with the citizens resource.
function PedDamage()
outputChatBox("Just in the middle", player, 255, 0, 0)
end
addEventHandler("onClientPedDamage", getRootElement(), PedDamage)