Postado Maio 6, 2020 5 anos 2 horas atrás, Storm disse: @One Punch Man @dbofurie 38 minutos atrás, dbofurie disse: Acho que agora foi, mas tipo, o lvl 500 nao pode atacar o 200, porem o lvl 200 pode atacar o 500, teria como bloquear isso? e outra coisa tbm, ao inves de colocar um padrao de 300 leveis, tem como colocar tipo: 100 ao 300 300 ao 600 600 ao 1000 e de 1000 em diante é liberado ?? Desculpe pelo incomodo.. A questão do level menor atacar o level maior eu consegui resolver deixando dessa forma: local limit = 500 -- Até quantos leveis a mais um jogador pode atacar um jogador level menor que ele local areas = { [1] = { fromPos = {x=2146, y=2114, z=3}, toPos = {{x=2267, y=2230, z=8}} }, [2] = { fromPos = {x=1465, y=1534, z=7}, toPos = {{x=1521, y=1567, z=7}} }, [3] = { fromPos = {x=978, y=893, z=7}, toPos = {{x=993, y=902, z=7}} }, } function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerLevel(target) + limit <= getPlayerLevel(cid) or getPlayerLevel(target) + limit >= getPlayerLevel(cid) then for _, var in pairs(areas) do if not isInArea(getCreaturePosition(target), var.fromPos, var.toPos) then doPlayerSendTextMessage(cid, 27, "Voce nao pode atacar jogadores de ".. limit .." leveis a menos ou a mais que você.") return false end end end end return true end blockquote widget Editado Maio 6, 2020 5 anos por One Punch Man (veja o histórico de edições)
Postado Maio 6, 2020 5 anos Autor 1 hora atrás, One Punch Man disse: A questão do level menor atacar o level maior eu consegui resolver deixando dessa forma: local limit = 500 -- Até quantos leveis a mais um jogador pode atacar um jogador level menor que ele local areas = { [1] = { fromPos = {x=2146, y=2114, z=3}, toPos = {{x=2267, y=2230, z=8}} }, [2] = { fromPos = {x=1465, y=1534, z=7}, toPos = {{x=1521, y=1567, z=7}} }, [3] = { fromPos = {x=978, y=893, z=7}, toPos = {{x=993, y=902, z=7}} }, } function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerLevel(target) + limit <= getPlayerLevel(cid) or getPlayerLevel(target) + limit >= getPlayerLevel(cid) then for _, var in pairs(areas) do if not isInArea(getCreaturePosition(target), var.fromPos, var.toPos) then doPlayerSendTextMessage(cid, 27, "Voce nao pode atacar jogadores de ".. limit .." leveis a menos ou a mais que você.") return false end end end end return true end blockquote widget Essas posições que você alterou, é onde fica o seu castle ??
Postado Maio 6, 2020 5 anos 1 hora atrás, dbofurie disse: Essas posições que você alterou, é onde fica o seu castle ?? Sim e minhas arenas
Postado Maio 6, 2020 5 anos Autor 1 minuto atrás, Storm disse: @dbofurie Vou fazer o código mais tarde e posto aqui. valeeu
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.