local storage = 20233
local reward = {
item = 11197,
count = 1
}
function onKill(cid, target, flags, damage)
if isPlayer(target) then
--[[if getPlayerIp(cid) ~= getPlayerIp(target) then]]
local frags = math.max(0, getPlayerStorageValue(cid, storage))
doCreatureSetStorage(cid, storage, frags+1)
if(frags >= 30) then
doCreatureSetGuildEmblem(cid, EMBLEM_WHITE)
elseif(frags >= 80) then
doCreatureSetGuildEmblem(cid, EMBLEM_BLUE)
elseif(frags >= 130) then
doCreatureSetGuildEmblem(cid, EMBLEM_GREEN)
end
if getPlayerItemCount(cid, reward.item) > 0 then
local item = getPlayerItemById(cid, true, reward.item)
if item.type >= 100 then
doPlayerAddItem(cid, reward.item, reward.count)
else
doTransformItem(item.uid, reward.item, item.type + 1)
end
else
doPlayerAddItem(cid, reward.item, reward.count)
end
doSendAnimatedText(getPlayerPosition(cid), "Frag!", TEXTCOLOR_RED)
--[[else
doPlayerSendTextMessage(cid, 18, "You didn't get frag/reward because of killing a player with same ip.")
end]]
end
return true
end