Jump to content

anti-flood


Nerses

Recommended Posts

--ServerSide ,

local ads = 
{ 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5', 
} 
addEventHandler("onPlayerChat", root,  
 function(msg) 
     for _,v in ipairs(ads) do 
     if string.find(msg,v) then 
     banPlayer( source ) 
       end 
     end 
  end 
) 
Link to comment
--ServerSide ,

local ads = 
{ 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5', 
} 
addEventHandler("onPlayerChat", root,  
 function(msg) 
     for _,v in ipairs(ads) do 
     if string.find(msg,v) then 
     banPlayer( source ) 
       end 
     end 
  end 
) 

does not work

Link to comment
local ads = { 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5', 
} 
  
addEventHandler( "onPlayerChat", root, 
    function( msg, type ) 
        for _,v in ipairs( ads ) do 
            if string.find( msg, v ) then 
                cancelEvent( ) 
                if type == 0 then 
                    banPlayer ( source, false, false, true ) 
                else 
                    return  
                end  
            end 
        end 
    end 
) 

Give it admin rights .

Link to comment
local ads = 
{ 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5' -- Don't forget to keep the last one without comma. 
} 
addEventHandler("onPlayerChat", root, 
function(msg) 
     for index, v in ipairs(ads) do 
          if string.find(msg,v) then 
               cancelEvent() 
               banPlayer ( source, false, false, true ) 
          end 
     end 
end 
) 

Link to comment
Don't be lazy. You have to edit those "AD" values to specific words and phrases you want to block; there's no such thing as "automatic advertising detector".

well I need that if someone has gone to the server and started his IP to advertise on this ban would that have to be envisioned?

Link to comment
local ads = { 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5', 
} 
  
addEventHandler( "onPlayerChat", root, 
    function( msg, type ) 
        for _,v in ipairs( ads ) do 
            if string.find( msg, v ) then 
                cancelEvent( ) 
                if type == 0 then 
                    banPlayer ( source, false, false, true ) 
                else 
                    return  
                end  
            end 
        end 
    end 
) 

Give it admin rights .

gave

Link to comment
local ads = 
{ 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5' -- Don't forget to keep the last one without comma. 
} 

It wouldn't make a difference.

Explain why this is please? I run my tables all with a , at the end and it just works fine?

Link to comment
local ads = 
{ 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5' -- Don't forget to keep the last one without comma. 
} 

It wouldn't make a difference.

Explain why this is please? I run my tables all with a , at the end and it just works fine?

Have no difference, but logically the last value don't need comma.

Link to comment

the script is right onix

local ads = { 
    'AD1', 
    'AD2', 
    'AD3', 
    'AD4', 
    'AD5', 
} 
  
addEventHandler( "onPlayerChat", root, 
    function( msg, type ) 
        for _,v in ipairs( ads ) do 
            if string.find( msg, v ) then 
                cancelEvent( ) 
                if type == 0 then 
                    banPlayer ( source, false, false, true ) 
                else 
                    return 
                end  
            end 
        end 
    end 
) 

WORKING

Link to comment
help

iam sure you didn't give it admin rights

put the resourceName in the admin Acl

becuase banPlayer need rights ,

and yeah i fogot to remove the ads, with cancelEvent ()

#

my acl

<acl> 
    <group name="Everyone">
        <acl name="Default"></acl>
        <object name="user.*"></object>
        <object name="resource.*"></object>
    </group>
    <group name="Moderator">
        <acl name="Moderator"></acl>
        <object name="resource.mapcycler"></object>
        <object name="resource.mapmanager"></object>
        <object name="resource.resourcemanager"></object>
        <object name="resource.votemanager"></object>
        <object name="user.bp1"></object>
        <object name="user.12345"></object>
        <object name="user.paramaunt041"></object>
        <object name="user.foka"></object>
    </group>
    <group name="SuperModerator">
        <acl name="Moderator"></acl>
        <acl name="SuperModerator"></acl>
        <object name="user.bp3"></object>
        <object name="user.210314_080c"></object>
        <object name="user.GOLOUCHENKO"></object>
        <object name="user.sarkis393"></object>
    </group>
    <group name="Admin">
        <acl name="Moderator"></acl>
        <acl name="SuperModerator"></acl>
        <acl name="Admin"></acl>
        <acl name="RPC"></acl>
        <acl name="TCT"></acl>
        <object name="resource.admin"></object>
        <object name="resource.webadmin"></object>
        <object name="user.[bP]"></object>
        <object name="resource.bpantiweapon"></object>
        <object name="resource.acpanel"></object>
        <object name="resource.hpk"></object>
        <object name="resource.flood"></object>
    </group>
    <group name="Console">
        <acl name="Moderator"></acl>
        <acl name="SuperModerator"></acl>
        <acl name="Admin"></acl>
        <acl name="RPC"></acl>
        <object name="user.Console"></object>
        <object name="resource.bplogin"></object>
        <object name="resource.bpantiweapon"></object>
        <object name="resource.acpanel"></object>
        <object name="user.[bP]"></object>
        <object name="resource.flood"></object>
    </group>
    <group name="RPC">
        <acl name="RPC"></acl>
    </group>
    <group name="MapEditor">
        <acl name="Default"></acl>
        <acl name="MapEditor"></acl>
        <object name="resource.editor_main"></object>
        <object name="resource.edf"></object>
    </group>
    <group name="raceACLGroup">
        <acl name="Default"></acl>
        <acl name="raceACL"></acl>
        <object name="resource.race"></object>
    </group>
    <group name="DevGroup">
        <acl name="DevACL"></acl>
    </group>
    <group name="autoGroup_acpanel">
        <acl name="autoACL_acpanel"></acl>
        <object name="resource.acpanel"></object>
    </group>
    <group name="autoGroup_bpacpanel">
        <object name="resource.bpacpanel"></object>
    </group>
    <group name="autoGroup_ban">
        <acl name="autoACL_ban"></acl>
        <object name="resource.ban"></object>
    </group>
    <group name="autoGroup_globalbans">
        <acl name="autoACL_globalbans"></acl>
        <object name="resource.globalbans"></object>
    </group>
    <acl name="Default">
        <right name="general.ModifyOtherObjects" access="false"></right>
        <right name="general.http" access="false"></right>
        <right name="command.start" access="false"></right>
        <right name="command.stop" access="false"></right>
        <right name="command.stopall" access="false"></right>
        <right name="command.gamemode" access="false"></right>
        <right name="command.changemode" access="false"></right>
        <right name="command.changemap" access="false"></right>
        <right name="command.stopmode" access="false"></right>
        <right name="command.stopmap" access="false"></right>
        <right name="command.skipmap" access="false"></right>
        <right name="command.restart" access="false"></right>
        <right name="command.refresh" access="false"></right>
        <right name="command.refreshall" access="false"></right>
        <right name="command.addaccount" access="false"></right>
        <right name="command.delaccount" access="false"></right>
        <right name="command.debugscript" access="false"></right>
        <right name="command.chgpass" access="false"></right>
        <right name="command.loadmodule" access="false"></right>
        <right name="command.upgrade" access="false"></right>
        <right name="command.mute" access="false"></right>
        <right name="command.crun" access="false"></right>
        <right name="command.srun" access="false"></right>
        <right name="command.run" access="false"></right>
        <right name="command.unmute" access="false"></right>
        <right name="command.kick" access="false"></right>
        <right name="command.ban" access="false"></right>
        <right name="command.banip" access="false"></right>
        <right name="command.unbanip" access="false"></right>
        <right name="command.reloadbans" access="false"></right>
        <right name="command.shutdown" access="false"></right>
        <right name="command.install" access="false"></right>
        <right name="command.aexec" access="false"></right>
        <right name="command.whois" access="false"></right>
        <right name="command.whowas" access="false"></right>
        <right name="function.executeCommandHandler" access="false"></right>
        <right name="function.setPlayerMuted" access="false"></right>
        <right name="function.addAccount" access="true"></right>
        <right name="function.addBan" access="false"></right>
        <right name="function.removeBan" access="false"></right>
        <right name="function.removeAccount" access="false"></right>
        <right name="function.setAccountPassword" access="false"></right>
        <right name="function.kickPlayer" access="false"></right>
        <right name="function.banIP" access="false"></right>
        <right name="function.banPlayer" access="false"></right>
        <right name="function.banSerial" access="false"></right>
        <right name="function.getBansXML" access="false"></right>
        <right name="function.unbanIP" access="false"></right>
        <right name="function.unbanSerial" access="false"></right>
        <right name="function.reloadBans" access="false"></right>
        <right name="function.setServerPassword" access="false"></right>
        <right name="function.getServerPassword" access="false"></right>
        <right name="function.callRemote" access="false"></right>
        <right name="function.fetchRemote" access="false"></right>
        <right name="function.startResource" access="false"></right>
        <right name="function.stopResource" access="false"></right>
        <right name="function.restartResource" access="false"></right>
        <right name="function.createResource" access="false"></right>
        <right name="function.copyResource" access="false"></right>
        <right name="function.addResourceMap" access="false"></right>
        <right name="function.addResourceConfig" access="false"></right>
        <right name="function.removeResourceFile" access="false"></right>
        <right name="function.setResourceDefaultSetting" access="false"></right>
        <right name="function.removeResourceDefaultSetting" access="false"></right>
        <right name="function.redirectPlayer" access="false"></right>
        <right name="function.aclReload" access="false"></right>
        <right name="function.aclSave" access="false"></right>
        <right name="function.aclCreate" access="false"></right>
        <right name="function.aclDestroy" access="false"></right>
        <right name="function.aclSetRight" access="false"></right>
        <right name="function.aclRemoveRight" access="false"></right>
        <right name="function.aclCreateGroup" access="false"></right>
        <right name="function.aclDestroyGroup" access="false"></right>
        <right name="function.aclGroupAddACL" access="false"></right>
        <right name="function.aclGroupRemoveACL" access="false"></right>
        <right name="function.aclGroupAddObject" access="false"></right>
        <right name="function.aclGroupRemoveObject" access="false"></right>
        <right name="function.refreshResources" access="false"></right>
        <right name="function.setServerConfigSetting" access="false"></right>
        <right name="function.updateResourceACLRequest" access="false"></right>
        <right name="command.aclrequest" access="true"></right>
        <right name="general.adminpanel" access="false"></right>
        <right name="general.tab_players" access="false"></right>
        <right name="general.tab_resources" access="false"></right>
        <right name="general.tab_maps" access="false"></right>
        <right name="general.tab_server" access="false"></right>
        <right name="general.tab_bans" access="false"></right>
        <right name="general.tab_adminchat" access="false"></right>
        <right name="command.freeze" access="false"></right>
        <right name="command.setnick" access="false"></right>
        <right name="command.shout" access="false"></right>
        <right name="command.spectate" access="false"></right>
        <right name="command.slap" access="false"></right>
        <right name="command.setgroup" access="false"></right>
        <right name="command.sethealth" access="false"></right>
        <right name="command.setarmour" access="false"></right>
        <right name="command.setmoney" access="false"></right>
        <right name="command.setskin" access="false"></right>
        <right name="command.setteam" access="false"></right>
        <right name="command.giveweapon" access="false"></right>
        <right name="command.setstat" access="false"></right>
        <right name="command.jetpack" access="false"></right>
        <right name="command.warp" access="false"></right>
        <right name="command.setdimension" access="false"></right>
        <right name="command.setinterior" access="false"></right>
        <right name="command.givevehicle" access="false"></right>
        <right name="command.repair" access="false"></right>
        <right name="command.blow" access="false"></right>
        <right name="command.destroy" access="false"></right>
        <right name="command.customize" access="false"></right>
        <right name="command.setcolor" access="false"></right>
        <right name="command.setpaintjob" access="false"></right>
        <right name="command.listmessages" access="false"></right>
        <right name="command.readmessage" access="false"></right>
        <right name="command.listresources" access="false"></right>
        <right name="command.execute" access="false"></right>
        <right name="command.delete" access="false"></right>
        <right name="command.setpassword" access="false"></right>
        <right name="command.setwelcome" access="false"></right>
        <right name="command.setgame" access="false"></right>
        <right name="command.setmap" access="false"></right>
        <right name="command.setweather" access="false"></right>
        <right name="command.blendweather" access="false"></right>
        <right name="command.setblurlevel" access="false"></right>
        <right name="command.setwaveheight" access="false"></right>
        <right name="command.setskygradient" access="false"></right>
        <right name="command.setgamespeed" access="false"></right>
        <right name="command.setgravity" access="false"></right>
        <right name="command.settime" access="false"></right>
        <right name="function.shutdown" access="false"></right>
        <right name="command.setfpslimit" access="false"></right>
        <right name="command.fetchRemote" access="false"></right>
        <right name="command.unban" access="false"></right>
        <right name="command.banserial" access="false"></right>
        <right name="command.unbanserial" access="false"></right>
        <right name="command.listbans" access="false"></right>
    </acl>
    <acl name="Moderator">
        <right name="general.ModifyOtherObjects" access="false"></right>
        <right name="command.gamemode" access="false"></right>
        <right name="command.changemode" access="false"></right>
        <right name="command.changemap" access="false"></right>
        <right name="command.stopmode" access="false"></right>
        <right name="command.stopmap" access="false"></right>
        <right name="command.skipmap" access="false"></right>
        <right name="command.mute" access="true"></right>
        <right name="command.unmute" access="true"></right>
        <right name="command.whois" access="false"></right>
        <right name="command.whowas" access="false"></right>
        <right name="function.setPlayerMuted" access="true"></right>
        <right name="function.kickPlayer" access="true"></right>
        <right name="function.banIP" access="false"></right>
        <right name="function.banPlayer" access="false"></right>
        <right name="function.banSerial" access="false"></right>
        <right name="function.getBansXML" access="false"></right>
        <right name="function.unbanIP" access="false"></right>
        <right name="function.unbanSerial" access="false"></right>
        <right name="function.startResource" access="false"></right>
        <right name="function.stopResource" access="false"></right>
        <right name="function.restartResource" access="false"></right>
        <right name="function.redirectPlayer" access="false"></right>
        <right name="general.adminpanel" access="true"></right>
        <right name="general.tab_players" access="true"></right>
        <right name="general.tab_resources" access="false"></right>
        <right name="general.tab_maps" access="false"></right>
        <right name="general.tab_server" access="true"></right>
        <right name="general.tab_bans" access="false"></right>
        <right name="general.tab_adminchat" access="true"></right>
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...