Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

@Phineasz Possível fazer uma checagem através da área onde fica o evento ou você pode usar esse script do dwarfer

 

Globalevents

<globalevent name="RemoveAllMc" interval="30000" event="script" value="removeMC.lua"/>

local t = {kick = true, temple = true, -- kick = false - não kicka o player, temple = false não teleporta o player para o templo
areas = {
[1] = {{x = 1, y = 1, z = 7}, {x = 1, y = 1, z = 5}},
[2] = {{x = 1, y = 1, z = 7}, {x = 1, y = 1, z = 7}},
[3] = {{x = 1, y = 1, z = 6}, {x = 1, y = 1, z = 8}}
}}

function onThink(interval, lastExecution)
local total = 0 
for _, v in pairs(t.areas) do
    total = total + removeAllMcInArea(v[1], v[2], t.kick, t.temple)
end
print("Multi Clients removed: " .. total)
return true
end

function removeAllMcInArea(fromPosition, toPosition, kick, toTemple) -- by dwarfer
    local players, check, freq, remove, removeall = {}, {}, {}, {}, {}
    for _, pid in ipairs(getPlayersOnline()) do
        local f = {x = fromPosition.x, y = fromPosition.y, z = fromPosition.z}
        local t = {x = toPosition.x, y = toPosition.y, z = toPosition.z}
        local min = (fromPosition.z > toPosition.z and toPosition.z or fromPosition.z)
        for index = 0, math.abs(toPosition.z - fromPosition.z) do
            f.z = min + index
            t.z = min + index
            if isInRange(getPlayerPosition(pid), f, t) then
                table.insert(players, pid)
            end
        end    
    end
    if #players > 0 then
        for _, player in pairs(players) do
            table.insert(check, getPlayerIp(player))
        end
    end
    for _, v in pairs(check) do
        freq[v] = (freq[v] or 0) + 1
    end
    for ip, ip_freq in pairs(freq) do 
        if ip_freq > 1 then
           local text = ""
            local mc = getPlayersByIp(ip)
           for i = 1, #mc do
                if isInArray(players, mc[i]) and getPlayerAccess(mc[i]) < 3 then
                    text = text .. "" .. mc[i] .. ","
                end
            end
            remove[ip] = text
        end
    end
    for ip, players in pairs(remove) do
        ret = string.explode(players, ",")
        for i = 1, (#ret-2) do
            removeall[#removeall + 1] = ret[i]
        end
    end
    for _, tid in pairs(removeall) do
        if kick then
            if toTemple == false then
                doRemoveCreature(tid)
            else
                doTeleportThing(tid, getTownTemplePosition(getPlayerTown(tid)))
                doRemoveCreature(tid)
            end
        else
            doTeleportThing(tid, getTownTemplePosition(getPlayerTown(tid)))
        end
    end
    return #removeall
end

 

Editado por Celulose (veja o histórico de edições)

  • 2 weeks later...
  • Respostas 6
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Nesse script ai você não consegue botar a limitação, tem que colocar no portal em si. Colocar uma actionid no teleport que é criado, se não tiver esse ip lá, ele teleporta, se não, ele faz o bone

Posted Images

Postado
  • Autor

@lordzetros @KotZletY @Vodkart @Sttorm @xWhiteWolf Alguma chance desse método de script existir? Por Favor, me dê um sinal ;( 

Deem :( *

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo