- Joined
- Jun 19, 2009
- Messages
- 1,852
- Reaction score
- 5
Hello!
How do I add three charges to this instead of making it forever?
How do I add three charges to this instead of making it forever?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getCreatureSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doCreatureSetSkullType(cid,0)
doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180)
doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
end
return true
end