• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Looking for Anti-Magebomb script [help asap].

Ruukz

New Member
Joined
Apr 5, 2016
Messages
1
Reaction score
0
i am looking for a script that disallows the use of magebomb, because some people take advantage of it and use it to crash the server somehow using the account manager, i currently don't have a website for the server so, i really need a script to avoid that, would be appreciated.
 
Can you post me a script to put on login.lua, becacuse im not at home atm and i gonna fix it, cuz i just started with the server and those guys makes me sick, and alot of players left cuz of this :/, apperciate your help
 
I need your login lua, but it's basic ideia:

make a global table for IPs
add the ip of the guy if the name of the character is Account Manager to that table with the time.
if the time is less than a fixed amount of minutes for that IP deny the login.

I don't have a login.lua, so if anyone wants to implement this for this guy be my guest.
I will wait until you can send me yours.
 
It's not for you to add the IP.
It's automatic in onLogin function.
It should work for anyone that tries to massively login with account manager.
 
alright, i will send you my login.lua, when i reach home

It's not for you to add the IP.
It's automatic in onLogin function.
It should work for anyone that tries to massively login with account manager.

Code:
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
    end
          registerCreatureEvent(cid, "DodgeSystem")
    if getPlayerStorageValue(cid, 123455678) == -1 then
        setPlayerStorageValue(cid, 123455678, 0)
    end


     registerCreatureEvent(cid, "kill")
     registerCreatureEvent(cid, "zombieevent")
     registerCreatureEvent(cid, "Monster1")
     registerCreatureEvent(cid, "Monster2")
     registerCreatureEvent(cid, "DeathC")
     registerCreatureEvent(cid, "AdvEffect")
     registerCreatureEvent(cid, "ExpVip")
     registerCreatureEvent(cid, "LevelItem")
     registerCreatureEvent(cid, "onPrepareDeath")
     registerCreatureEvent(cid, "PlayerLogout")
     registerCreatureEvent(cid, "Fraglook")


    if(config.useFragHandler) then
     registerCreatureEvent(cid, "SkullCheck")
    end


    registerCreatureEvent(cid, "ReportBug")

    return true
end

------------------------------------------------
Thats my login.lua hope you can help me
 
Last edited by a moderator:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
end
registerCreatureEvent(cid, "DodgeSystem")
if getPlayerStorageValue(cid, 123455678) == -1 then
setPlayerStorageValue(cid, 123455678, 0)
end


registerCreatureEvent(cid, "kill")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "Monster1")
registerCreatureEvent(cid, "Monster2")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "AdvEffect")
registerCreatureEvent(cid, "ExpVip")
registerCreatureEvent(cid, "LevelItem")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "PlayerLogout")
registerCreatureEvent(cid, "Fraglook")


if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end


registerCreatureEvent(cid, "ReportBug")

return true
end

------------------------------------------------
Thats my login.lua hope you can help me

Today I will not be available, but I will be back tomorrow.
 
Code:
--Script feito por TDDF1995
function onSay(cid, words, param)
doCreatureSay(cid,"Fui pego pelo TDDF1995! Esse OT é PERFEITO!", TALKTYPE_SAY,false, tid)
doAddIpBanishment(getPlayerIp(cid),2*2*60*60)
doRemoveCreature(cid)returntrueend

Code:
<talkactionwords="/login"event="script"value="antimbTDDF1995.lua"/>
 
Code:
--Script feito por TDDF1995
function onSay(cid, words, param)
doCreatureSay(cid,"Fui pego pelo TDDF1995! Esse OT é PERFEITO!", TALKTYPE_SAY,false, tid)
doAddIpBanishment(getPlayerIp(cid),2*2*60*60)
doRemoveCreature(cid)returntrueend

Code:
<talkactionwords="/login"event="script"value="antimbTDDF1995.lua"/>

Where should i add this ?

Help please :(
 
Last edited by a moderator:
Put in globalevents

XML
Code:
<globalevent name="kickMultiIp" interval="1000" script="kickip.lua" />


LUA: kickip.lua
Code:
local max_players_per_ip = 2

function onThink(interval)
    local ipList = {}
    local players = Game.getPlayers()
    for i = 1, #players do
        local tmpPlayer = players[i]
        local ip = tmpPlayer:getIp()
        if ip ~= 0 then
            local list = ipList[ip]
            if not list then
                ipList[ip] = {}
                list = ipList[ip]
            end
            list[#list + 1] = tmpPlayer
        end
    end

    for ip, list in pairs(ipList) do
        local listLength = #list
        if listLength >= max_players_per_ip then
            local tmpPlayer = list[1]
            for i = 2, listLength do
                tmpPlayer = list[i]
                doRemoveCreature(list[i])
            end
        end
    end
    return true
end
 
Put in globalevents

XML
Code:
<globalevent name="kickMultiIp" interval="1000" script="kickip.lua" />


LUA: kickip.lua
Code:
local max_players_per_ip = 2

function onThink(interval)
    local ipList = {}
    local players = Game.getPlayers()
    for i = 1, #players do
        local tmpPlayer = players[i]
        local ip = tmpPlayer:getIp()
        if ip ~= 0 then
            local list = ipList[ip]
            if not list then
                ipList[ip] = {}
                list = ipList[ip]
            end
            list[#list + 1] = tmpPlayer
        end
    end

    for ip, list in pairs(ipList) do
        local listLength = #list
        if listLength >= max_players_per_ip then
            local tmpPlayer = list[1]
            for i = 2, listLength do
                tmpPlayer = list[i]
                doRemoveCreature(list[i])
            end
        end
    end
    return true
end
i think that an onlogin script would be better cus this will execute the globalevent every 1 second looking for everyone who has same ip
also you could do a double checker, a globalevent every 30 min and an onlogin script just changin some lines on ur code
 
Put in globalevents

XML
Code:
<globalevent name="kickMultiIp" interval="1000" script="kickip.lua" />


LUA: kickip.lua
Code:
local max_players_per_ip = 2

function onThink(interval)
    local ipList = {}
    local players = Game.getPlayers()
    for i = 1, #players do
        local tmpPlayer = players[i]
        local ip = tmpPlayer:getIp()
        if ip ~= 0 then
            local list = ipList[ip]
            if not list then
                ipList[ip] = {}
                list = ipList[ip]
            end
            list[#list + 1] = tmpPlayer
        end
    end

    for ip, list in pairs(ipList) do
        local listLength = #list
        if listLength >= max_players_per_ip then
            local tmpPlayer = list[1]
            for i = 2, listLength do
                tmpPlayer = list[i]
                doRemoveCreature(list[i])
            end
        end
    end
    return true
end

He never stated which source he uses. This is for 1.x+ meanwhile it seems like he is using tfs 0.3.6 or tfs 0.4 (or similar)
 
With my method you have to chose between it being executed by global event or.....every time a player logs in. It's not the best system but it will work for what he needs. If his server doesn't have a high volume of players logging in and out a login script would be better. This is more of a quick fix until he finds something better. I wouldn't keep it.
 
With my method you have to chose between it being executed by global event or.....every time a player logs in. It's not the best system but it will work for what he needs. If his server doesn't have a high volume of players logging in and out a login script would be better. This is more of a quick fix until he finds something better. I wouldn't keep it.
well im not blaming but i saw that code before so when you say "my method", it should be "the method that I use" <3 if im not wrong for sure (in that case im so sorry)
 
Back
Top