RealSoft
Banned User
I would love if someone could help me out a bit before I go all crazy about this one..
This error is from Avesta 0.6.3
This is the script make the error:
Rep++ to the one help me out!
This error is from Avesta 0.6.3
This is the script make the error:
PHP:
local COST = 20
local ADD_ITEM = "yes"
function onSay(cid, words, param, channel)
if getPlayerLevel(cid) > 1 then
local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
local points = query:getDataInt("premium_points")
if points >= COST then
local update = db.executeQuery("UPDATE `accounts` SET `premium_points`= "..(points - COST).." WHERE `id`= " .. getPlayerAccountId(cid) .. "; ")
if (update == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your red skull has been taken off!\nRemaining premium points: " .. (points - COST))
doCreatureSetSkullType(cid, SKULL_NONE)
if (ADD_ITEM == "yes") then
doPlayerAddItem(cid,2181,1)
end
else
doPlayerSendCancel(cid, "Database error")
end
else
doPlayerSendCancel(cid, "You need " ..COST.. " premium points to remove red skull")
end
else
doPlayerSendCancel(cid, "You need to be level 2 or above to use this command!")
end
query:free()
return TRUE
end
Rep++ to the one help me out!