function onDeath(cid, corpse, deathList)
local reward = {
item = 2152,
count = 1
}
for i = 1, #deathList do
if isPlayer(cid) and isPlayer(deathList[i]) then
--[[if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then ]]--
if getPlayerItemCount(deathList[i], reward.item) > 0 then
local item = getPlayerItemById(deathList[i], true, reward.item)
if item.type >= ITEMCOUNT_MAX then
doPlayerAddItem(deathList[i], reward.item, reward.count)
setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
else
doTransformItem(item.uid, reward.item, item.type + 1)
doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
end
else
doPlayerAddItem(deathList[i], reward.item, reward.count)
setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
end
--[[else
doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
doPlayerAddExperience(cid, - 500000)
end ]]--
end
end
return true
end