local config = {
-- [kills] = {'text', money}
[2] = {'Double', 200},
[3] = {'Triple', 1000},
[4] = {'Ultra', 2000}
}
addEventStorage = 6546 -- set free storage
killCount = 57587 -- set free storage
timeBettwenKills = 20 -- seconds
function onKill(cid, target, lastHit)
if isPlayer(cid) then
if getCreatureStorage(cid, killCount) >= 1 then
doCreatureSetStorage(cid, killCount, getCreatureStorage(cid, killCount) + 1)
stopEvent(getCreatureStorage(cid, addEventStorage))
doSendAnimatedText(getThingPos(cid), config[getCreatureStorage(cid, killCount)][1], TEXTCOLOR_RED)
addEvent(doSendAnimatedText, 300, getThingPos(cid), 'kill', TEXTCOLOR_RED)
doPlayerAddMoney(cid, config[getCreatureStorage(cid, killCount)][2])
else
doCreatureSetStorage(cid, killCount, 1)
end
event = addEvent(setStorage , timeBettwenKills * 1000, cid, killCount, getPlayerGUID(cid))
doCreatureSetStorage(cid, addEventStorage, event)
end
return true
end
function setStorage(cid, storage, GUID)
if isPlayer(cid) then
doCreatureSetStorage(cid, storage, -1)
else
db.executeQuery('UPDATE `player_storage` SET `value` = -1 WHERE `player_id` = ' .. GUID .. ' AND `key` = ' .. storage)
end
end