Nevalopo
Demigod
Hello! Im here to request a player-kills-counter.
Every player that you kill should be registrered and saved in a storage id.. If anyone can make it. Ill be happy. Here is something i found from roxxor ot. Made for creatures but can maybe be changed?
Every player that you kill should be registrered and saved in a storage id.. If anyone can make it. Ill be happy. Here is something i found from roxxor ot. Made for creatures but can maybe be changed?
Code:
local monsters = {
--name = storage
["rat"] = 35001,
["troll"] = 35002,
["rotworm"] = 35003,
["dragon"] = 35004,
["dragon lord"] = 35005,
["demon"] = 35006,
}
function onKill(cid, target)
if(isMonster(target) == TRUE) then
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
end
end
return TRUE
end