Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

@dbofurie 

Tente esse aqui uso em um servidor meu.

local config = {
diffType = 1, -- 1 = NORMAL/ 2 = PERCENT
maxDiff = 300
}
function onCombat(cid, target)
if isPlayer(cid) ~= TRUE or isPlayer(target) ~= TRUE then
return TRUE
end

if config. diffType == 1 then -- if NORMAL
if math.abs(getPlayerLevel(cid) - getPlayerLevel(target)) > config.maxDiff then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
end
elseif config.diffType == 2 then --if PERCENT
local levels = {getPlayerLevel(cid), getPlayerLevel(target)}
table.sort(levels)
if (((levels[2] - levels[1]) * 100) / levels[1]) > config.maxDiff then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
end
else
print("DEBUG: Wrong config.diffType")
end
return TRUE
end

 

  • Respostas 17
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @dbofurie  local limit = 300 -- Até quantos leveis a mais um jogador pode atacar um jogador level menor que ele local areas = { [1] = { fromPos = {x = 100, y = 200, z = 7}, toPos = {{x = 200, y

  • @One Punch Man @dbofurie Atualizei o código, porém testem antes de colocar no servidor principal de vocês.      

Postado
  • Autor
27 minutos atrás, Lokyskiller disse:

@dbofurie 

Tente esse aqui uso em um servidor meu.


local config = {
diffType = 1, -- 1 = NORMAL/ 2 = PERCENT
maxDiff = 300
}
function onCombat(cid, target)
if isPlayer(cid) ~= TRUE or isPlayer(target) ~= TRUE then
return TRUE
end

if config. diffType == 1 then -- if NORMAL
if math.abs(getPlayerLevel(cid) - getPlayerLevel(target)) > config.maxDiff then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
end
elseif config.diffType == 2 then --if PERCENT
local levels = {getPlayerLevel(cid), getPlayerLevel(target)}
table.sort(levels)
if (((levels[2] - levels[1]) * 100) / levels[1]) > config.maxDiff then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
end
else
print("DEBUG: Wrong config.diffType")
end
return TRUE
end

 

 

Voce sabe se no Castle Of War ele nao altera nada?? ou dentro da arena ?

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo