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

TFS 1.3 force player to kick after 15 minutes

paola92

Member
Joined
Jan 14, 2009
Messages
105
Solutions
1
Reaction score
6
Hi,
can someone help with write script to kick player after 15 minutes when player didn't move?

I want to avoid ban on otserlist for trainers.
 
hi @paola92 try with this
XML:
 <globalevent name="Kick Check 5min" interval="300000" script="others/kick.lua"/>

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 then
print(nameP, ip) -- write name and Ip player was kicked
    player:remove()
    end
end
    return true
end

this is going to help you with the exit players logout, for the idle time just change kickIdlePlayerAfterMinutes = 15
here you can find the original thread GlobalEvent - [TFS1.3] Kick player after x log or disconnected check 5 min (https://otland.net/threads/tfs1-3-kick-player-after-x-log-or-disconnected-check-5-min.267975/)
 
Last edited:
Hi,
I found second way. I had to remove "resetIdleTime();" from player.cpp and game.cpp from on action section.

Thank you for this. I will test but I think it will not work for players with opened client.
 
Back
Top