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

Player doesn't log out when quitting the game in fight

nanduzenho

Member
Joined
Mar 21, 2021
Messages
187
Solutions
1
Reaction score
15
GitHub
nanduzenho
Good afternoon, on my server, when I quit the game, the player keeps attacking and doesn't log out. How do I fix this? I use TFS 1.3
 
Good afternoon, on my server, when I quit the game, the player keeps attacking and doesn't log out. How do I fix this? I use TFS 1.3
You can use this globalevent to force player exit if the server doesn't find player's ip
Lua:
    function onThink(interval, lastExecution)
        for _, player in pairs(Game.getPlayers()) do
            if not player then
                return false
            end
        local ip = Game.convertIpToString(player:getIp())
        local nameP = player:getName()
            if player:getIp() == 0 and player:getSkull() == SKULL_NONE and Tile(player:getPosition()):hasFlag(TILESTATE_NOLOGOUT) then
                print(nameP, ip) -- write name and Ip player was kicked
                player:remove()
            end
        end
            return true
    end

XML:
    <globalevent name="Exit Logout" interval="60000" script="exit.lua"/>
 
You can use this globalevent to force player exit if the server doesn't find player's ip
Lua:
    function onThink(interval, lastExecution)
        for _, player in pairs(Game.getPlayers()) do
            if not player then
                return false
            end
        local ip = Game.convertIpToString(player:getIp())
        local nameP = player:getName()
            if player:getIp() == 0 and player:getSkull() == SKULL_NONE and Tile(player:getPosition()):hasFlag(TILESTATE_NOLOGOUT) then
                print(nameP, ip) -- write name and Ip player was kicked
                player:remove()
            end
        end
            return true
    end

XML:
    <globalevent name="Exit Logout" interval="60000" script="exit.lua"/>
OMG! Thank u bro!!!!
 
Back
Top