- Fórum
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- [RESOLVENDO] Exit Trainer
TH
creatureevent
[RESOLVENDO] Exit Trainer
Por ThiagoBji, 21 de abr. de 2015 em Globalevents e Spells
exit trainerexit trainer
como resolver
solução
arrumando
sem ban
otservlist
script
otserv
lista
list
otservelist
ot
ots
1
2.2k
info
Grupo: Conde
Registrado: 29/10/12
Posts: 789
Reputação: +146
Explicação: Ensinarei a como resolver o problema do exit trainer, que é quando você dá exit no trainer e o char contiuna online mesmo com a pessoa não estando lá, com isso automaticamente o ip do player é mudado para 0.0.0.0 e é assim que você toma um banimento de 30 dias do Otservlist, que é algo que ninguém deseja, não é mesmo?!
otserv => data -> creaturescripts -> creaturescripts.xml:
otserv => data -> creaturescripts -> scripts -> idle.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 endotserv => data -> creaturescripts -> scripts -> login.lua:
Otserv/config.lua:
Deixe assim:
Ou assim:
E para configurar o tempo de kikar o player após certo tempo sem mexer, é nessa parte aqui do config.lua:
Créditos: Thiagobji