• 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!

Sql 7.6 engine and scripting knowledge .

Qlimaxowy

New Member
Joined
Jul 3, 2013
Messages
14
Reaction score
1
Hello, I would like to know how to add lua scripts, I was looking for a theoretical "command" script that removes all objects from houses and their own owners!

I found something like:

globalevents/scripts/cleanhouses.lua

Lua:
local config = {
    days = 14,
    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

globalevents/globalevents.xml

Code:
<globalevent name="cleanhouses" type="start" event="script" value="cleanhouses.lua"/>

as I mentioned in the subject that this is a 7.6 sql engine and I can not find a globalevent file folder anywhere, maybe it's a different version of the script of a larger engine protocol.

could I add it to "movements"
 
Yes, I know I can do it, but you know it is problematic, so I am looking for a quick way to get around it. I expect some hints. Maybe when compiling dev + cpp is the possibility of?;) Some script to compile
 
oh you mean all houses? just set rent to 9999999999999999999999999999999999999 and make 1 day payment restard server twice
 
yes I want all houses, I have 7.6 engine versions. where I can find a source to add to the server.

or command add ??
 
every time server restarts 1 day pass. as i said change monthly rent and keep restarting server
 
Back
Top