Download latest version here AMXbans v5.0 by YoMama/LuX & lantz69/Geesu
0. index

  1. CURRENT VERSIONS
  2. REQUIREMENTS
  3. FEATURES
  4. INSTALLING AMXBANS
  5. USING THE MOTD-TEMPLATE
  6. ADDING ADMINS
  7. THIRD PARTY PLUGINS
  8. CONSOLE COMMANDS
  9. HOW DOES IT WORK?
  10. CONTACT INFO
  11. CREDITS
  12. DOWNLOAD
  13. CHANGELOG

1. current versions

Below are the most recent versions of the plugins and front-end for AMXBans:
  • amxmodx plugins: 5.0.
  • web front-end (PHP): 5.0.

2. requirements

In order to be able to use AMXbans, you will need the following:
  • Latest (release) version of Metamod installed and working.
  • Latest (release) version of AMXMODX (1.76a) installed and working (with mySQL support).
  • Access to MySQL Database.
  • website/space with PHP (magic_quotes_gpc must be ON)
  • Smarty templating system (http://smarty.php.net).

3. features
  1. Plugin included only for AMXMODX
  2. Banmenu
  3. Fully automated ingame bansystem
  4. Supports Steam
  5. Ban by SteamID or IP
  6. Kickban players on your servers directly from the web front-end
  7. Search bandatabase (in-game and via front-end)
  8. Supports multiple HL mods (currently Counter-Strike, Counter-Strike: Condition Zero, Day of Defeat, Team Fortress Classic and Natural Selection, and much more are tested)
  9. Supports an unlimited (OK maybe not unlimited, but a lot! :) amount of servers (tested on 10+ servers simultaniously)
  10. Look and feel fully customizeable by using a templating system
  11. Configuration panel for easy front-end configuration
  12. Optionally use included amx admin plugin or your own
  13. Baninfo displayed in motd-window (html). When a player gets banned, a motd-style window will pop-up with ban-details.
  14. Editable MOTD display time. Since the motd-window closes when the player is kicked, a delay is introduced. This delay can also be set via web-frontend (defaults to 10 secs)
  15. Login using cookies
  16. Ban / unban / ban edit / ban removal via website
  17. Banlist-export
  18. Search-options (search by wonid, date, server or admin)
  19. Import from text-based banlist (i.e. banned.cfg). Original code for this was donated by Jon L. aka intel352 (thx dude!)
  20. Customizeable webadmin levels (setup your own levels and assign them to admins)
  21. Ability to create gameadmin-only accounts, amxbansweb-only accounts or both (so you can create logins that will only work on the gameserver, but not on the website for example)
  22. Ability to assign custom access and flags (according to amxmod specifications)
  23. amx plugin auto-update notification
  24. Admin management (web-based)
  25. Permissions matrix - quickly assign admins to servers.
  26. Ban-history
  27. Various logging features
  28. DB pruning via seperate perl-script (included)
  29. works on win32 and linux systems
  30. Possibility to use master-slave setups (Contact YoMama for more information)
  31. Easy to integrate with other plugins (HLGuard, ATAC, admin menu plugin, etc.)
  32. easy to install
  33. and more...
If you want to check out some of the features before installing, Check out a working example at: http://www.amxbans.net/example/

4. installing amxbans

  • Backup
    1. Backup all tables!
    2. Make a backup of the web front-end

  • installing the web interface
    1. Copy the contents of the 'web'-folder to a location accessible to your webserver (e.g. /usr/local/www/www.yoursite.com/htdocs/amxbans).
    2. Make sure that the user running your webserver has write-access to the smarty/templates_c directory and to include/config.inc.php!
    3. Make sure you have a database available that will be holding the AMXBans tables.
    4. Open setup.php in your favorite browser (e.g. http://www.yoursite.com/amxbans/admin/setup.php) and follow the directions. Note that existing tables will *NOT* get overwritten. If your upgrading from a previous version, Make sure you enter the same login details as your current one when asked.

  • Installing the plugins
    • AMXMODX
      1. extract admin_sql.sma and amxbans.sma to /addons/amxmodx/scripting

        *note*
        The supplied admin_sql.sma is a slightly modified version of the original (admin.sma 1.60).
        It uses an altered query to only fetch admins assigned to one or more particular servers.
        This way you can have all admins in one table, and still be able to assign admins per server.
        Don't use admin_sql.sma if you're not going to manage your admins with the web front-end

      2. Compile the plugins.
      3. Add an entry for admin_sql.amxx at the top of plugins.ini, but only if your going to use the web front-end to manage admins.
        Add an entry for amxbans.amxx to /addons/amxmodx/configs/plugins.ini (right below admin.amxx).
      4. Place amxbans.txt in /addons/amxmodx/data/lang folder
      5. restart your server(s) (or changelevel) and verify that the plugin(s) are loaded (You will see a line '[amxbans.amxx] AMXBans amxx_4.3 is online').
        If you don't have access to the console; this message is also printed in amxmodx logs.
      6. You can use the included web-interface to add your admins and reasons

  • installing the DB pruning script (optional)
    1. open the file move_bans.pl located in the zip-file.
    2. enter your database details
    3. run the script regularly via a cronjob for example. To setup a cronjob for this, you might use: '*/15 * * * * /home/amxbans/mv_bans.pl'.
      This will prune your DB every 15 minutes.


5. using the motd-template

From v2.0 onwards, a 'MOTD'-style info-pane is displayed to the target before (s)he gets kicked from the server. Both the time this MOTD is displayed and the URL to the template can be edited in the server setting-window. For your convenience we have included a MOTD-template called 'motd_details.php. You need to pass the banID like so:

'http://www.yourdomain.com/amxbans/motd_details.php?bid=%s'.

The '%s' will be parsed by the AMXbans plugin. Obviously you can edit the corresponding template file to suit your needs.


6. adding admins

There are two types of admins that can be managed using AMXBans:
  1. Webadmins. Admins created in this section have access to (some parts of) the AMXBans website. How much access they have, depends on the level they are assigned to.
  2. AMXadmins. Admins created in this section are given (certain) admin-rights on (some of) the participating servers. How much access and to which servers can be determined by repectively the 'access'-field in the 'AMXadmin management'-section, and the 'server admins'-option at the top of the page.
The Webadmins-part is pretty self explainatory, so we'll get right on to AMXadmin management.

First off: if you like to disable AMXadmin management alltogether (for example because you want to use 'users.ini' located in '<moddir>/addons/amx/'), you need to set '$CFG->admin_management' to 'no' in '<amxbanswebroot>/inc/config.inc.php'. If you choose to set this value to 'no', you do not need to load the plugin 'admin_mysql.amx'.

If you do choose to use the included admin-management feature, here's what the different fields represent:
  • Nickname/SteamID/IP
    Here you enter (surprisingly) either the admin's nickname, SteamID or IP address. Depending on what you enter here, you need to define the corresponding 'flags', but will get to that later.

  • password
    Here you enter the password belonging to whatever you entered in the 'Nickname/SteamID/IP'-field. You do not need to enter a password, but again you would have to define the corresponding 'flags.

  • access
    Here you define how much 'power' your admin has on the server(s). Below is a legend:

    a - immunity (can't be kicked/banned/slayed/slaped and affected by other commmands)
    b - reservation (can join on reserved slots)
    c - amx_kick command
    d - amx_ban and amx_unban commands
    e - amx_slay and amx_slap commands
    f - amx_map command
    g - amx_cvar command (not all cvars will be available)
    h - amx_cfg command
    i - amx_chat and other chat commands
    j - amx_vote and other vote commands
    k - access to sv_password cvar (by amx_cvar command)
    l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
    m - custom level A (for additional plugins)
    n - custom level B
    o - custom level C
    p - custom level D
    q - custom level E
    r - custom level F
    s - custom level G
    t - custom level H
    u - menu access
    z - user

    So if you want an admin to only be ably to change maps, vote maps, kick players and use admin chat commands on your server(s), you would enter 'cfi'. If you want to give an admin full admin-rights on your server, you would enter 'abcdefghijklmnopqrstu' (allthough I strongly advise against 'l', a lowercased 'L' that is, since it basically gives your admin RCON-access to your server).

  • flags
    Here you define the various 'flags' for an admin:

    a - disconnect player on invalid password
    b - clan tag
    c - this is steamid
    d - this is ip
    e - password is not checked (only name/ip/steamid needed)

    The best way to explain the usage is by looking at some of the examples at the end of this paragraph.

  • SteamID
    Here you define the steamID of the admin. This is purely used for displaying a name on the AMXbans website.

  • nickname
    Here you define the nickname the admin is commonly known as. This is purely used for displaying a name on the AMXbans website.

    If an admin is for example well known as 'YoMama' in your community, but enters the server incognito as for example 'Shaka Zulu' and bans a player, In the ban-details screen the admin would be displayed as: banned by:    Shaka Zulu (YoMama).

Now for some examples:

If you want the admin YoMama, with SteamID STEAM_0:1:4548 to be able to admin under any name, have full access to your server, and use a password to identify him/herself as admin you would enter:

Nickname/SteamID/IP password access flags steamid nickname


If you want the same admin have the same rights as above, but don't need him to enter a password (since SteamIDs are unique), you would enter:

Nickname/SteamID/IP password access flags steamid nickname


If you want admin YoMama from a specific IP-address to have kick-, ban- and slay-rights without having to provide a password, enter:

Nickname/SteamID/IP password access flags steamid nickname


Finally an example of the settings I use. I authenticate my admins using their SteamID (so they can admin the servers using whatever name they choose), and I do want them to provide a password. The admins on my servers all have full access (except RCON- and CVAR-access) Besides that, I want to prevent other people from taking on the admin's nickname and pretending to be admin. Last but not least I want to prevent people from connecting with the default name 'Player':

Nickname/SteamID/IP password access flags steamid nickname


Note that in the last example you want to use the same password and acces for the first 2 entries, since they belong to the same admin.


8. third party plugins

The examples below are based on AMXMODX 1.60.
  • ATAC (Advanced Team Attack Control)

    1. Install this plugin according to the installation instructions. You'll find the plugin and information on how to install it in this thread (this example discusses the amxmodx version of the plugin): http://www.amxmodx.org/forums/viewtopic.php?t=11930
    2. Open the file atac.cfg and look after the line:

      atac_amxban 0
      Change that to
      atac_amxban 1

      ATAC will now ban with amxbans.

  • HLG 1.8 (Half-Life Guard)

    1. Install this anti-cheat solution according to the installation instructions. You'll find it at http://www.thezproject.org/projects.php?pid=1
    2. Open the file 'hlg_net.cfg' (located in the zip-file in 'addons/hlguard/config).

    3. In section:

      // Alias Detection Actions


    4. Find the following line:

      hlg_action "b:found:10" "banid 0.0 %w;kick #%u [HLGUARD] Banned: Permanently. Reason: %y;wait;writeid"


    5. And replace it with:

      hlg_action "b:found" "amx_ban 0.0 %w [HLGUARD] %y"


    6. Find the following line:

      hlg_action "t:found:10" "banid 1440.0 %w;kick #%u [HLGUARD] Banned: 24 hours. Reason: %y;wait;writeid"


    7. And replace it with:

      hlg_action "t:found" "amx_ban 1440.0 %w [HLGUARD] %y"


    8. In section:

      // Steambans check actions


    9. Find the following line:

      hlg_action "h:found:10" "banid 1440.0 %w;kick #%u [HLGUARD] Banned: 24 hours. Reason: You are SteamBans blacklisted! Visit www.steambans.com for more information;wait;writeid"


    10. And replace it with:

      hlg_action "h:found" "amx_ban 1440 %w [HLGUARD] SteamBans blacklisted!"

    11. In section:

      // Nameban Actions


    12. Find the following line:

      hlg_action "q:found:10" "banid 120.0 %w;kick #%u [HLGUARD] Banned: 2 hours. Reason: %y;wait;writeid"


    13. And replace it with:

      hlg_action "q:found" "amx_ban 120 %w [HLGUARD] %y"

    14. Aimbot Warning System Detection Actions (Abandoned, not updated, no support)
    15. When you're done, save the file.
    16. Type hlg_reset in console or (Re)start your server, and you should be all set.


9. console commands

amx_ban <time_in_minutes> <nickname|steamid> <reason>

Kicks and bans specified nickname/steamid
  • When using nickname to ban, the user needs to be on the server.
  • When steamid is used, the player does not need to be on the server.
  • *cannot* contain spaces
  • may be a unique substring of the actual nickname
amx_banip <time_in_minutes> <nickname|steamid> <reason>

Kicks and bans specified nickname/steamid by IP. All future connections from this IP will be refused. Use with caution and only when target has fixed IP.
  • When using nickname to ban, the user needs to be on the server.
  • When steamid is used, the player does not need to be on the server.
  • *cannot* contain spaces
  • may be a unique substring of the actual nickname
amx_find <steamid>

Checks wether an active ban exists for given steamid
  • *cannot* contain spaces

amx_findex
<steamid>

Checks expired bans for given steamid
  • *cannot* contain spaces
amxbans_menu

Opens up the AMXBans Menu

amx_reloadreasons

Reloads the reasons for that server from the database


10. how does it work?

Instead of using the standard banid/writeid functionality this banmod is based on kicking offenders. When a player connects, the steamID (and/or IP-address) is matched against a table. If a match is found, the corresponding information of that steamID will be displayed to the player (banlength, reason, admin, etc), and the player will be kicked. Unbanning a player consists of merely moving his record from the ban table to the ban history table. If the player then connects, no match will be found, and the player can connect as usual. I'm not the one who invented this set-up (check the credits :)

People will be able to view all ban-details via the included php-scripts, including timeleft in case of a temp ban. Everyone can use the various search-options to display bandetails and banhistory details Admins are able to add, edit, unban and completely remove bans using the webinterface. Admin-management is also performed here.

Each plugin that is loaded will register itself to provide an overview on which servers are currently connected to the ban-database. In the near future, a master/slave setup will be available.


11. contact info

For discussions on AMXbans, please visit: http://www.amxbans.net/forums/ (Amxbans Forum)


12. credits

Credits go to:
  • nassie of course!
  • Downtown for fixing a *huge* bug in the amxbans plugin, and helping me out with new functionality)
  • mahnsawce for helping me out bigtime with the Banmenu plugin
  • BAILOPAN, SniperBeamer, devicenull, Gonzo, QwertyAccess and definately XTC too... basically all devs and testers for helping me out a great deal
  • GIR for helping me out with the amxx-port
  • OLO as usual
  • JustinHoMi for the original MySQL banplugin
  • Mannekino for helping out a lot with the smarty templating system.
  • Mannekino again for letting me steal some of his layout (check out his site: http://www.clanhost.nl if you're looking to rent a good Dutch clanserver)
  • 5chaap2k, Nya, Bunnykiller, take13|Invader Zim, NetBlaster, Ingerfara and all the others for testing
  • Nieka for the perl pruning script
  • Jon L. aka intel352 for the original ban-import code
  • Morpheus for making HLGuard work with AMXBans
  • ToT | V!PER for pointing out some security issues
  • Gerimaster for making some plugins amxbans compatible
  • Conrad (http://conradworld.free.fr) for letting me use his rcon class)
  • Sikkie for continously bugging me for no apparent reason. (ok, ok... he did give me *some* pointers ;)
  • All the admins @ XS4ALL.nl gameservers for giving feedback
If you like AMXBans, we would appreciate some sort of hint on your website that you are using this system.


13. download

Get the latest version of AMXBans here


14. changelog (back to top)

  • 28/10/2006 - v5.0 (AMXMODX) / v5.0 (PHP)
    • AMXX plugins: all
    • php file(s): all (plus corresponding .tpl files)

  • 28/10/2005 - v4.3 (AMXMODX) / v4.3 (PHP)
    • AMXX plugins: all
    • php file(s): all (plus corresponding .tpl files)

    • 13/10/2005 - v4.2 (AMXMODX) / v4.2 (PHP)
      • AMXX plugins: all
      • php file(s): all (plus corresponding .tpl files)

      • 25/11/2004 - v4.0 (AMX) / v4.0 (AMXX) / v4.0 (PHP). Major release. Added lots of new features, fixed lots of bugs (probably intoduced a couple too).

        • AMX plugin(s): all
        • AMXX plugins: all
        • php file(s): all (plus corresponding .tpl files)

      • 25/07/2004 - v3.0 (AMX) / v3.0 (AMXX) / v3.1 (PHP). Patched a couple of major security holes (sorry!). Included second rcon class for those who were having problems with the first one (configurable via control panel). Added button in add_live_ban section (for browsers incapable of some javascript). Added support for the Specialist mod.

        • AMX plugin(s): amxbans.sma, amxbans.amx
        • AMXX plugins: amxbans.sma, amxbans.amx
        • php file(s): all (plus corresponding .tpl files)

      • 18/07/2004 - v3.0 (AMX) / v3.0 (AMXX) / v3.0 (PHP). Major release. Added lots of new features, fixed lots of bugs.

        • AMX plugin(s): amxbans.sma, amxbans.amx
        • AMXX plugins: amxbans.sma, amxbans.amx
        • php file(s): all

      • 20/04/2004 - v2.1 (AMX) / v2.0 (AMXX) / v2.2 (PHP). Added support for AMXX (http://www.amxmodx.org). Added AMX/AMXX-specific versionchecks. Fixed some minor bugs. Affected files:

        • AMX plugin(s): amxbans.sma, amxbans.amx
        • AMXX plugins: admin_mysql.sma, admin_mysql.amx, amxbans.sma, amxbans.amx
        • php file(s): mylib.inc.php, server_mgmt, ban_list.php

      • 29/02/2004 - v2.0 (AMX) / v2.1 (PHP). In 'admins & levels'-screen renamed 'username' field to 'NickName/SteamID/IP'. Fixed incorrect link in 'Prune DB'-screen. Corrected a typo in motd_details.php. Fixed bug where admins & levels wasn't displayed appropriately according to the access restrictions. Added ability to display reason on main page (configurable via config.inc.php). Added section to readme explaining the use of 'AMXadmins management'. Affected files:

        • php file(s): config.inc.php, mylib.inc.php, header.php, ban_list.php, prune_db.php, admin_mgmt.php, motd_details.php

      • 14/02/2004 - v2.0 (AMX) / v2.0 (PHP). Major release (refer to the amxbans-thread on amxmod forums). Affected files:

        • AMX plugin(s): all
        • php file(s): all

      • 29/10/2003 - v1.1 (AMX) / v1.3 (PHP). Added a manual 'prune database'-option (level 1 status required). This is for people who are unable to run the included perl-script; They can now use this functionality to transfer expired bans to the banhistory table. I also fixed a minor cosmetic issue in the Permissions Marix. Besides this I added the ability to remove servers from within the ban_stats page. Affected files:

        • php file(s): config.inc.php, mylib.inc.php, move_bans.php (new), permissions_matrix.php, ban_stats.php

      • 14/10/2003 - v1.1 (AMX) / v1.2 (PHP). Added account-flags support in admin-management screen (defaults to "a" for nickname account-flags, and "ac" for steamid account-flags). For more info on account-flags, please check users.ini in your '/addons/amx'-directory. Affected files:

        • php file(s): config.inc.php, mylib.inc.php, admin_management.php, form_check.js

      • 30/09/2003 - v1.1 (AMX) / v1.1 (PHP). Added SteamID+IP ban support ('amx_banplayer'-command). Included new global variable 'view_ip' (defaults to "no"). Affected files:

        • AMX plugin(s): amxbans.sma, amxbans.amx
        • php file(s): config.inc.php, ban_details.php, ban_edit.php, ban_search

      • 24/09/2003 - v1.0 (AMX) / v1.0 (PHP). Amxbans v1.0 is released