• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Problem check house

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
My script work, but when the house is clear, items dont go inside depot, they disappear :eek:

how to solve?
tfs 1.2


Code:
local function doCheckHouses()

    local dias = 15
    local tempo = os.time() - (dias * 24 * 60 * 60)
    local registros = db.storeQuery("SELECT `houses`.`owner`, `houses`.`id` FROM `houses`,`players` WHERE `houses`.`owner` != 0 AND `houses`.`owner` = `players`.`id` AND `players`.`lastlogin` <= " .. tempo .. ";")
   
    if registros ~= false then
   
        local count = 0
       
        print('house leave code')
       
        repeat
            count = count + 1
           
            local owner = result.getNumber(registros, "owner")
            local houseId = result.getNumber(registros, "id")
            local house = House(houseId)
           
            if house and (owner > 0) then
                print(house:getName())
                house:setOwnerGuid(0)
            end
           
        until not result.next(registros)
       
        print('house leave house count:' .. count)
       
        result.free(registros)
    end
end

function onStartup()
    addEvent(doCheckHouses, 60 * 1000)
   
    return true
end
 
Do you configured correctly each locker in the map editor?
In order to make the system work, you need to go to the locker > properties > and select town. If you don't have towns created you should click CTRL + T to configure your towns. (RME's map editor).
 
Do you configured correctly each locker in the map editor?
In order to make the system work, you need to go to the locker > properties > and select town. If you don't have towns created you should click CTRL + T to configure your towns. (RME's map editor).

lol.. of course towns are ok ;S
thanks for reply..
 
Back
Top