hi
can anyone help me
i have script save [ kills, deaths, Ratio]
my problim
kills is work and good
deaths no work if kill with weapons
if kill me with admin panel or [F1 Freeroam] he let me +1 deaths
sorry for my english
code
addEventHandler ( "onPlayerWasted", root,
function( totalAmmo, killer, killerWeapon, bodypart, stealth )
if killer then
local account = getPlayerAccount ( killer )
if killer ~= source then
setAccountData( account,"kills",tonumber( getAccountData( account,"kills" ) or 0 ) +1 )
setElementData( killer, "kills", tonumber( getAccountData( account,"kills" ) ) )
setElementData( killer, "Ratio", tonumber(getElementData( killer, "kills" )/getElementData( source, "Deaths") ) )
end
else
local accountSource = getPlayerAccount ( source )
setAccountData( accountSource,"Deaths",tonumber( getAccountData(accountSource,"Deaths") or 0 ) +1 )
setElementData( source, "Deaths", tonumber( getAccountData( accountSource,"Deaths" ) ) )
setElementData( source, "Ratio", tonumber(getElementData( killer, "kills" )/getElementData( source, "Deaths") ) )
end
end
)