Requested by frankfarmer in our request thread. Some features not added yet. Not fully tested. Credits to Shawak for fix (if it works lol)
Lua:
function onKill(cid, target, lastHit)
local config = {
mc_protection = true,
killsstorage = 43534,
deathsstorage = 43535
}
if not isPlayer(target) then
return true
end
if config.mc_protection and (getPlayerIp(cid) == getPlayerIp(target)) then
return true
end
local tdeaths = getCreatureStorage(target, config.deathstorage) ~= -1 and getCreatureStorage(target, config.deathstorage) or 0
local tkills = getCreatureStorage(target, config.killstorage) ~= -1 and getCreatureStorage(target, config.killstorage) or 0
local ckills = getCreatureStorage(cid, config.killstorage) ~= -1 and getCreatureStorage(cid, config.killstorage) or 0
local cdeaths = getCreatureStorage(cid, config.deathstorage) ~= -1 and getCreatureStorage(cid, config.deathstorage) or 0
doCreatureSetStorage(cid, config.killsstorage, ckills+1)
doCreatureSetStorage(target, config.deathsstorage, tdeaths+1)
doPlayerSetSpecialDescription(cid, ". Frags [" ..ckills.."] Deaths ["..cdeaths.."] this week.")
doPlayerSetSpecialDescription(target, ". Frags [" ..tkills.."] Deaths ["..tdeaths.."] this week.")
return true
end
Last edited: