• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Battle + Exit = Don't get kicked

arturhaddad

Member
Joined
Aug 14, 2010
Messages
217
Reaction score
8
I'm having this problem:
many people log in, put their characters in trainers, attack and exit.
Come back days later and the character still there ATTACKING and getting attacked.
It doesn't happens only on trainers, but even in hunt places when player get his connection down and there is battle signal, the character doesn't get kicked (even after 15 minutes).

My idle configuration:

idleWarningTime = 14 * 60 * 1000
idleKickTime = 15 * 60 * 1000

Now i can't know how many players are REALLY online on the server because many of them may be away <_<
 
don't change it, it is actually illegal if somebody report you're server that people don't get kicked after 15 minutes or something you said in you're post, then you might get banned from otservlist i don't recommend it.
 
In creaturescripts.xml:

<event type="think" name="Idle" event="script" value="idle.lua"/>

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
 
don't change it, it is actually illegal if somebody report you're server that people don't get kicked after 15 minutes or something you said in you're post, then you might get banned from otservlist i don't recommend it.

Well actually i'm trying to solve this problem for that reason oO...
 
Back
Top