Hugofasima
Website: thenosegang.servegame.com
- Joined
- Jun 24, 2015
- Messages
- 206
- Reaction score
- 23
Anyone can fix this script to me?
Thanks OT Land!
@EDIT: TFS 1.0 / Gesior 2012
Error:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/others/cleanHouse.lua: onStartup
data/globalevents/scripts/others/cleanHouse.lua:12: attempt to index a nil value
stack traceback:
[C]: in function '__index'
data/globalevents/scripts/others/cleanHouse.lua:12: in function <data/globalevents/scripts/others/cleanHouse.lua:3>
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/others/cleanHouse.lua: onStartup
data/globalevents/scripts/others/cleanHouse.lua:12: attempt to index a nil value
stack traceback:
[C]: in function '__index'
data/globalevents/scripts/others/cleanHouse.lua:12: in function <data/globalevents/scripts/others/cleanHouse.lua:3>
local days = 20 -- days to lose the house
function onStartup()
local resultId = db.storeQuery("SELECT `owner`,`id` FROM `houses`;")
if resultId then
repeat
local aux = db.storeQuery("SELECT `lastlogin` FROM `players` WHERE `id` = ".. result.getDataString(resultId, "owner") .. ";")
if aux then
if result.getDataInt(aux, "lastlogin") < os.time() - (days * 86400) then
House(result.getDataInt(resultId, "id")):setOwnerGuid(-1)
end
end
until not result.next(resultId)
end
saveServer()
return true
end
function onStartup()
local resultId = db.storeQuery("SELECT `owner`,`id` FROM `houses`;")
if resultId then
repeat
local aux = db.storeQuery("SELECT `lastlogin` FROM `players` WHERE `id` = ".. result.getDataString(resultId, "owner") .. ";")
if aux then
if result.getDataInt(aux, "lastlogin") < os.time() - (days * 86400) then
House(result.getDataInt(resultId, "id")):setOwnerGuid(-1)
end
end
until not result.next(resultId)
end
saveServer()
return true
end
Thanks OT Land!
@EDIT: TFS 1.0 / Gesior 2012
Last edited: