HappyFeet
New Member
can someone help me to make this to tfs 1.0?
I have add it to global.lua (tfs 1.0 functions) tried alot but no result
it keep saying error line xxx -> local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
after I fixed that it wil give another error for the next line ->if Info:getID() ~= LUA_ERROR then
Code:
function getPlayerVipDays(cid)
local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
function doAddVipDays(cid, days)
db.query("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function doRemoveVipDays(cid, days)
db.query("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
I have add it to global.lua (tfs 1.0 functions) tried alot but no result
it keep saying error line xxx -> local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
after I fixed that it wil give another error for the next line ->if Info:getID() ~= LUA_ERROR then