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

Lua Anty Idle script dont work

DarchameQ

New Member
Joined
Oct 12, 2008
Messages
9
Reaction score
2
Hello

I have problem with script "anty idle" this script dont work.
I added it as you need to and nothing creaturescript

PHP:
function onDirection(cid, old, current)
	local storage = 123456
	local triesStorage = 123457
	local set = 0
 
	if (exhaustion.check(cid, storage)) then
		local tries = getCreatureStorage(cid, triesStorage)
 
		if (tries >= 5) then
			doPlayerSendCancel(cid, 'Obracasz sie szybciej niz 5x na sekunde, odczekaj 0.5 sekundy.')
            return false
		else
			set = tries + 1
		end
	end
 
	doCreatureSetStorage(cid, triesStorage, set)
	exhaustion.make(cid, storage, 0.5)
	return true
end
 
Try this,

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

- - - Updated - - -

and if you mean the !afk talkaction, take a look here.
http://otland.net/f81/0-4-0-3-6-afk-system-100739/
 
Back
Top Bottom