GOD Half
Member
- Joined
- May 9, 2010
- Messages
- 179
- Reaction score
- 15
Hello,
I have a script that worked in earlier version of my server, only the current it is not working TFS 0.4_DEV
Error:
data\globalevents\scripts\removevip.lua
Can anyone help me?
I have a script that worked in earlier version of my server, only the current it is not working TFS 0.4_DEV
Error:
Code:
[20:44:16.546] [Error - GlobalEvent Interface]
[20:44:16.546] data/globalevents/scripts/removevip.lua:onThink
[20:44:16.546] Description:
[20:44:16.546] data/globalevents/scripts/removevip.lua:10: attempt to call field 'executeQuery' (a nil value)
[20:44:16.546] stack traceback:
[20:44:16.546] data/globalevents/scripts/removevip.lua:10: in function <data/globalevents/scripts/removevip.lua:1>
[20:44:16.546] [Error - GlobalEvents::think] Couldn't execute event: RemoveVipDays
data\globalevents\scripts\removevip.lua
Code:
function onThink(interval, lastExecution, thinkInterval)
Query = db.getResult("SELECT `id`, `vip_e_time` FROM `accounts` WHERE `accounts`.`vip` = 1")
if(Query:getID() == -1) then
return true
end
for i = 1, Query:getRows() do
local AccID = Query:getDataInt("id")
local VipeTime = Query:getDataInt("vip_e_time")
if VipeTime >= os.time() then
db.executeQuery("UPDATE `accounts` SET `vip_days` = ".. math.ceil((VipeTime - os.time()) / 86400) .." WHERE `accounts`.`id` = ".. AccID ..";")
else
db.executeQuery("UPDATE `accounts` SET `vip_e_time` = 0 WHERE `accounts`.`id` = ".. AccID ..";")
db.executeQuery("UPDATE `accounts` SET `time` = 0 WHERE `accounts`.`id` = ".. AccID ..";")
db.executeQuery("UPDATE `accounts` SET `vip_time` = 0 WHERE `accounts`.`id` = ".. AccID ..";")
db.executeQuery("UPDATE `accounts` SET `vip_days` = 0 WHERE `accounts`.`id` = ".. AccID ..";")
db.executeQuery("UPDATE `accounts` SET `vip` = 0 WHERE `accounts`.`id` = ".. AccID ..";")
db.executeQuery("UPDATE `players` SET `reset_temple` = 1 WHERE `players`.`account_id` = ".. AccID ..";")
end
Query:next()
end
Query:free()
return true
end
Can anyone help me?