• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Items are not going to depot after leaving house.

bury

Active Member
Joined
Jul 27, 2008
Messages
421
Solutions
7
Reaction score
25
Hello OTland!

I wanted to set the cleanhouses.lua script so that if a player has been offline for X days loses his houses and other players could buy it. The problem is that if I set another owner to a house or /owner 0, the player loses everything of his house because items are not going to depot.

I'm not sure what script makes this, or even what table in db... Because I think items just will change of database table (from house tiles db to something like depot table).

Thanks!
 
Hi! Here is a script that works perfectly and moves the items to players depots:
GlobalEvent - Automagically clean unused houses, multi-world support!

I'm using this script right now and I think it doesn't move the items to depot. But what about if a player !leavehouse or I make /owner 0 or /owner anotherplayer?

The problem was with a player that wanted to change his house and made !leavehouse thinking that his items would go to depot. He losed everything :S

I read is something in the compiling?
 
Hello.

Set correctly where? If a player citizen of Thais says !leavehouse in his Thais home, he loses every items on it :S
Make sure you have all your towns match their depot ids in that town. Sometimes remere has weird saves and doesnt save depot ids or town ids I've had this happen.
 
@xKrazyx
@jestem pro

I've checked all depots, and they match with their towns. If I double click on a depot in thais, its set as "thais" in the properties. I can't find the "depot id" in this script:


LUA:
 local config = {
    days = 1,
    log = true,
    file = getDataDir() .. "/logs/cleanhouses.txt"
}  
local ns_query =[[ SELECT houses.owner,houses.id,players.name FROM houses
                LEFT JOIN players ON players.id=houses.owner
                WHERE players.lastlogin < (UNIX_TIMESTAMP() - ]] ..config.days.. [[*24*60*60)
                AND
                players.world_id =]] .. getConfigValue("worldId")

function onStartup(_time)

    local house = db.getResult(ns_query)
    local logs = " :: Houses cleaned:\n\n"
    if house:getID() ~= -1 then
        repeat
            logs = logs .. getHouseInfo(house:getDataInt('id')).name ..", owned by " .. house:getDataString('name') .. "\n"
            setHouseOwner(house:getDataInt('id'), 0)
        until not house:next()
        house:free()
    else
        logs = logs .. "There were no houses to clean."
    end
    if config.log then
        doWriteLogFile(config.file, logs)
    end
    addEvent(doSaveServer, 1000)
end

Anyway, I will try it again. I've set it in one day and will test in my test server. But, how about a player makes !leavehouse, or I set /owner 0?? or /owner anotherplayer? Items will be lost.

Thanks.

bump!
 
Last edited by a moderator:
Hello bury, this script is not responsible for sending items back to the depot as you see. As long as your db queries are fine then your distro itself should send the items back to players depot once the house they lived in changes owner. Specify please the version of your distribution.
 
Hello bury, this script is not responsible for sending items back to the depot as you see. As long as your db queries are fine then your distro itself should send the items back to players depot once the house they lived in changes owner. Specify please the version of your distribution.

Do you know how can I get the distribution without restarting the server (since I think it's written when you start it). Thanks!

Do you know how can I get the distribution without restarting the server (since I think it's written when you start it). Thanks!

Bump? :D Thanks!

Hello bury, this script is not responsible for sending items back to the depot as you see. As long as your db queries are fine then your distro itself should send the items back to players depot once the house they lived in changes owner. Specify please the version of your distribution.

Found it!

0.4.3777.19 - codenamed: (completed)

bump
 
Last edited by a moderator:
Hello. I opened this thread in 2017 and it's still not solved.

Finally we could conclude that it's a database problem but how could I solve it?

I'm using TFS 0.4
 
Back
Top