Script:
function onSay(cid, words, param, channel)
if getCreatureSkullType(cid) == SKULL_RED then
if getAccountPoints(cid) >= 5 then
db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) - 5 .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
doCreatureSetSkullType(cid, 0)
else
return doPlayerSendTextMessage(cid, 27, "Sorry, you don't have a 5 premium points.") and true
end
elseif getCreatureSkullType(cid) == SKULL_BLACK then
if getAccountPoints(cid) >= 10 then
db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) - 10 .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
doCreatureSetSkullType(cid, 0)
else
return doPlayerSendTextMessage(cid, 27, "Sorry, you don't have a 10 premium points.") and true
end
else
return doPlayerSendTextMessage(cid, 27, "Sorry, you don't have a Red Skull or Black Skull.") and true
end
end
tag:
<talkaction words="/removeskull" script="nome do script.lua"/>
Só precisa falar "/removeskull" e pronto.