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

idleKickTime

raq

Member
Joined
Sep 29, 2011
Messages
39
Reaction score
8
Nie wyrzuca ludzi z trainów po 15 minutach, już nie mam pojęcia jak to naprawić.
To nie jest wina no-logout zone na mapie, czy ktoś ma jakiś pomysł?

config.lua

Code:
idleWarningTime = 10 * 60 * 1000
idleKickTime = 15 * 60 * 1000


creaturescripts/scripts/idle.lua

Code:
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
 
Może po prostu jesteś zalogowany na postać z accessem wyższym niż 1? Takie postacie posiadają już odpowiednie flagi, które pozwalają im być niewylogowanym w każdym momencie. Lub jeszcze jest możliwość taka, że dana postać ma ustawione NoMove (nie znam określenia w j. polskim). Nie używasz czasem takiej komendy gdzieś
Lua:
doSetCreatureNoMove(cid, true/false)
 
Back
Top