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

Players Using Traniers all day

renots10

New Member
Joined
Feb 28, 2010
Messages
34
Reaction score
1
I coulden't bump up my old thread, sorry.

But players can afk all day in trainers, and never log off..
I have the idle script, registered in login.lua, there's not a no logout tile under them..
Can anyone help?
 
He means the event onThink, is placed in creatureevents and all distrubutions have it by default, I really don't think that that's the problem, do you have correctly configured lua config?
 
Last edited:
He means the event onThink, is placed in creatureevents and all distrubutions have it by default, I really don't think that that's the proble, do you have correctly configured lua config?

Yes Sir. This is My Config.

-- Limits
idleWarningTime = 14 * 60 * 1000
idleKickTime = 15 * 60 * 1000
expireReportsAfterReads = 1
playerQueryDeepness = 2
maxItemsPerPZTile = 0
maxItemsPerHouseTile = 0

- - - Updated - - -

Here is the idle scrip.. I really need someone to help me with this.. It sucks have 34 players, but only 2 are ACTUALLY playing..

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
 
Sometimes it wont kick the player if it still ATK. Try change in config.lua

Lua:
stopAttackingAtExit = true
 
Back
Top