I need a script that makes a storage value counter of damage dealt and received
I have experience working with lua so, I wont have problem editing the script.
Thanks
- - - Updated - - -
I do it, if anyone wants it:
I have experience working with lua so, I wont have problem editing the script.
Thanks
- - - Updated - - -
I do it, if anyone wants it:
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) then
if isInArray({COMBAT_ENERGYDAMAGE, COMBAT_FIREDAMAGE, COMBAT_PHYSICALDAMAGE, COMBAT_EARTHDAMAGE, COMBAT_POISONDAMAGE, COMBAT_UNDEFINEDDAMAGE, COMBAT_LIFEDRAIN, COMBAT_MANADRAIN, COMBAT_DROWNDAMAGE, COMBAT_ICEDAMAGE, COMBAT_HOLYDAMAGE, COMBAT_DEATHDAMAGE}, combat) then
if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then
total = getPlayerStorageValue(cid,44451)
setPlayerStorageValue(cid,44451,total+value)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Total de daño recibido: " .. total+value .. "")
totala = getPlayerStorageValue(attacker,44452)
setPlayerStorageValue(attacker,44452,totala+value)
doPlayerSendTextMessage(attacker, MESSAGE_EVENT_DEFAULT, "Total de daño hecho: " .. totala+value .. "")
end
end
end
return true
end
Last edited: