Postado Maio 7, 2020 5 anos @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
Postado Maio 7, 2020 5 anos 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 ?
Postado Maio 8, 2020 5 anos Autor Em 06/05/2020 em 19:20, Storm disse: @dbofurie Vou fazer o código mais tarde e posto aqui. Conseguiu @Storm ??
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.