hello everyone,
the anti idle will kick the player if he doesn't make any action in 15min. right ?
i need a change in this script, to do the same thing. but ONLY if the player doesn't move (walk)
exemple:
if the player are talking, fishing or etc he will be kicked !
he only can stop this if he's walk
any help will be apreciated
and sorry for bad english
thankss !!
the anti idle will kick the player if he doesn't make any action in 15min. right ?
i need a change in this script, to do the same thing. but ONLY if the player doesn't move (walk)
exemple:
if the player are talking, fishing or etc he will be kicked !
he only can stop this if he's walk
any help will be apreciated
and sorry for bad english
thankss !!
Lua:
local config = {
idleWarning = getConfigValue('idleWarningTime'),
idleKick = getConfigValue('idleKickTime')
}
function onThink(cid, interval)
if not isCreature(cid) then return true end
if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE)) then
return true
end
if getCreatureOutfit(cid).lookType == 814 then return true end --alterado v1.9
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