Postado Abril 23, 2017 8 anos Antes de trocar as sources do OT (agora eu uso, rev 3777 do fir3element), eu usava o seguinte code para ver quem era p.a e trocar de vocação: Mas agora não está mais funcionando... Este eu uso no login do creaturescripts/scripts/login.lua if isPremium(cid) then if getPlayerVocation(cid) == 1 then doPlayerSetVocation(cid, 5) elseif getPlayerVocation(cid) == 2 then doPlayerSetVocation(cid, 6) elseif getPlayerVocation(cid) == 3 then doPlayerSetVocation(cid, 7) elseif getPlayerVocation(cid) == 4 then doPlayerSetVocation(cid, 8) end else if getPlayerVocation(cid) == 5 then doPlayerSetVocation(cid, 1) elseif getPlayerVocation(cid) == 6 then doPlayerSetVocation(cid, 2) elseif getPlayerVocation(cid) == 7 then doPlayerSetVocation(cid, 3) elseif getPlayerVocation(cid) == 8 then doPlayerSetVocation(cid, 4) end end Também tem um erro do idle, ele não kick player. creature/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 end Poderiam me ajudar? Editado Abril 23, 2017 8 anos por Helliab (veja o histórico de edições)
Postado Abril 25, 2017 8 anos if isPremium(cid) then if getPlayerVocation(cid) == 1 then doPlayerSetVocation(cid, 5) elseif getPlayerVocation(cid) == 2 then doPlayerSetVocation(cid, 6) elseif getPlayerVocation(cid) == 3 then doPlayerSetVocation(cid, 7) elseif getPlayerVocation(cid) == 4 then doPlayerSetVocation(cid, 8) end end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.