• 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.X+ player does not take kick while giving exit.

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
457
Solutions
3
Reaction score
194
Location
Brazil
GitHub
pedrogiampietro
esou having a problem on my server, the players in the trainers do not log out, I already checked config.lua, creaturescript, movements, there is no script that implies.
and I would not want to take ban from otservlist, if anyone can help.

The strange thing is that in hunt or anywhere else it kicks normal after 15min.
I found this script but it is for 0.4, I could not run it on my server, if anyone pduer help, I use otx 1.3

LUA:
local config = {
    idleWarning = getConfigValue('idleWarningTime'),
    idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
    if(getTileInfo(getCreaturePosition(cid)).noLogout or getCreatureNoMove(cid) or
        getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE)) then
        return true
    end

    local idleTime = getPlayerIdleTime(cid) + interval
    doPlayerSetIdleTime(cid, idleTime)
    if(config.idleKick > 0 and idleTime > config.idleKick) then
        doRemoveCreature(cid)
    elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
        local message = "There was no variation in your behaviour for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
        if(config.idleKick > 0) then
            message = message .. ". You will be disconnected in "
            local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
            if(diff > 1) then
                message = message .. diff .. " minutes"
            else
                message = message .. "one minute"
            end

            message = message .. " if there is no change in your actions until then."
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
    end

    return true
end
 
Check in map editor if there is "non-logout"-zones at trainers. Maybe you can check if the player have an IP, if not they probably exited

Thanks for your answer, I checked the anti logout, but the player is exited by hitting the training. I searched for stamina scripts etc ...

the first thing was to check in RME, with and without no-logout, and it was correct .. so I do not know what can be
jbWg9wB.png


z87aVyu.png


Health: 530 / 530, Mana: 155 / 155.
Position: 559, 940, 10
IP: 0.0.0.0.
 
Last edited:
on creaturescripts.xml
- <event type="think" name="Idle" event="script" value="idle.lua"/>
idle.lua
local config = {

idleWarning = getConfigValue('idleWarningTime'),

idleKick = getConfigValue('idleKickTime')

}


function onThink(cid, interval)

if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or

getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then

return true

end


local idleTime = getPlayerIdleTime(cid) + interval

doPlayerSetIdleTime(cid, idleTime)

if(config.idleKick > 0 and idleTime > config.idleKick) then

doRemoveCreature(cid)

elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then

local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"

if(config.idleKick > 0) then

message = message .. ", you will be disconnected in "

local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)

if(diff > 1) then

message = message .. diff .. " minutes"

else

message = message .. "one minute"

end


message = message .. " if you are still idle"

end


doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")

end


return true

end
 
on creaturescripts.xml
- <event type="think" name="Idle" event="script" value="idle.lua"/>
idle.lua
local config = {

idleWarning = getConfigValue('idleWarningTime'),

idleKick = getConfigValue('idleKickTime')

}


function onThink(cid, interval)

if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or

getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then

return true

end


local idleTime = getPlayerIdleTime(cid) + interval

doPlayerSetIdleTime(cid, idleTime)

if(config.idleKick > 0 and idleTime > config.idleKick) then

doRemoveCreature(cid)

elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then

local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"

if(config.idleKick > 0) then

message = message .. ", you will be disconnected in "

local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)

if(diff > 1) then

message = message .. diff .. " minutes"

else

message = message .. "one minute"

end


message = message .. " if you are still idle"

end


doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")

end


return true

end
this script does not work in tfs 1.2, no more tag is used with event type, and several functions of the code do not have in tfs, I could not adapt to work.
 
I have a similar issue on TFS 1.2, even if I don't have the logout block from being in a fight, I can logout normally with ctrl + Q, but if I click exit, it takes a while for the player to logout.
 
Back
Top