MA
creatureevent

AntiMageBomb para TFS 0.3.6 | 0.4

Por Marco Oliveira, 31 de jul. de 2015 em Globalevents e Spells

3
1.2k
31 de julho de 2015 às 19:46

Já existe um sistema parecido no fórum, mas esse possui um código menor e também é funcional em 0.3.6 e 0.4

Em data\creaturescripts\scripts crie um arquivo chamado Antimagebomb.lua

local config = {
        max = 3,
        text = "Multi-Client or Magebomb is not allowed.",
        group_id = 1  -- it will only kick player whit that id (1=Players, 2=tutor, 3=seniortutors, 4=Gm's, 5=Cm's and 6=God's
}

local accepted_ip_list = ""

local function antiMC(p)
	if (getCreatureName(p.pid) == "Account Manager") then return true end
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
                doRemoveCreature(p.pid)
        end
        return TRUE
end

function onLogin(cid)
	if not(isPlayer(cid)) then return true end
	if (getCreatureName(cid) == "Account Manager") then return true end
	if(getConfigValue("antimulticlient")) then
        if getPlayerGroupId(cid) <= config.group_id then
                if isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE then
                        addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
                        doPlayerSendTextMessage(cid, 19, config.text)
                	end
		end
        end
        return TRUE
end

Em creaturescripts.xml

	<event type="login" name="Antimagebomb" event="script" value="Antimagebomb.lua"/>

Na linha é o máximo de players que podem logar por ip:

        max = 3,

Editado Janeiro 23 por Marco Oliveira

SkyLighS
31 de julho de 2015 às 20:39

O código é de sua autoria? caso contrario coloque os créditos ao dono.

31 de julho de 2015 às 22:20

Iae galo cego husahusauash'.

 

Peguei o código numa source que encontrei na otland, não possui créditos :D