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.


info
Grupo: Campones
Registrado: 29/11/08
Posts: 36
Reputação: +1
Usei o sistema de points deste topico : http://www.xtibia.co...points-in-game/
Gostaria de dois script um para retirar blackskull e outro para retirar redskull do personagem e que cobre points.
* Remover REDSkull (remover o redskull do personagem, valor 5 poits)
- Comando: !comprar removerredskull
* Remover BLACKSkull (remover o blackskull do personagem, valor 10 points)
- Comando: !comprar removerblackskull