usa esse:
testei já :]
-- [( XTibia.com )] --
function onSay(cid, words, param)
local item = 2178 -- id do item que sera removido
local quanty = 1 -- quantidade de item que sera removido
local skull = getPlayerSkullType(cid) -- não mexa
local check = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK}
if isInArray(check, skull) then
if doPlayerRemoveItem(cid,item,quanty) then
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doCreatureSetSkullType(cid, 0)
doCreatureSay(cid, "Your frags and skulls is cleaned!", 19)
doSendMagicEffect(getPlayerPosition(cid), 26)
else
doPlayerSendCancel(cid, "You need " .. quanty .. " " .. getItemNameById(item) .. " for clear skull")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendTextMessage(cid, 23, "Sorry, you don't have Frags or Skull to be Removed.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end