plugins.ini - Adding more plugins
The plugins.ini file in your addons/amx/config
folder is the list of what plugins are run in your server. See below
how to edit this file and add or remove plugins from your server. This
is what the default plugins.ini looks like:
; AMX Mod plugins
; To disable any plugin, add a semi-colon ";" to the beginning of its line.
; You can disable the Just-In-Time (JIT) compiler with the "nojit" keyword:
; pluginname.amx nojit
; (read the docs for more details)
; To load admins from a MySQL db, open the amx/examples/source/default/admin.sma file
; and follow the instructions.
language.amx ; language management
admin.amx ; admin base (required for any admin-related)
adminchat.amx ; console chat commands
admincmd.amx ; basic admin console commands
adminhelp.amx ; help command for admin console commands
adminslots.amx ; slot reservation
adminvote.amx ; vote commands
menufront.amx ; front-end for admin and custom menus
cmdmenu.amx ; command menu (speech, settings)
mapsmenu.amx ; maps menu (vote, changelevel)
plmenu.amx ; players menu (kick, ban, client cmds.)
telemenu.amx ; teleport menu (Fun Module required!)
antiflood.amx ; prevent clients from chat-flooding the server
scrollmsg.amx ; displays a scrolling message
imessage.amx ; displays information messages
nextmap.amx ; displays next map in mapcycle
mapchooser.amx ; allows to vote for next map
timeleft.amx ; displays time left on map
mapconfig.amx ; executes custom map configuration files
pausecfg.amx ; allows to pause and unpause some plugins
plugmod_manager.amx ; manages amx's modules.ini and plugins.ini
;welcomemsg.amx ; console motd @ client connection
; Counter-Strike
; Note: you don't need to declare csstats.amx here (CSStats will load it).
statscfg.amx ; allows to manage stats plugins via menu and commands
ff_manager.amx ; friendly-fire manager
restmenu.amx ; restrict weapons menu for Counter-Strike
statsx.amx ; stats on death or round end (CSStats module required!)
miscstats.amx ; bunch of events announcement for Counter-Strike
stats_logging.amx ; weapons stats logging (CSStats module required!)
; Add custom plugins below.
Now there are two ways you can add plugins to your server:
Download pre-compiled plugins:
Then copy the .amx file to your addons/amx/plugins folder and add the line for that plugin to your plugins.ini file. Here are a few reasons this is not the best way:
- The compiled plugin needs to be compiled to your version of AMX or it may not work.
- When you upgrade AMX you should recompile all your plugins anyway.
- You should know how to compile plugins, it's very easy and many edits can be made by non programmers such as myself.
- You'll never know if someone decides to be hax0rish and gives you a plugin with malicious code in it.
Download the source and compile it:
(Click here to learn how to compile!)
Then copy the .amx file to your addons/amx/plugins folder and add the line for that plugin to your plugins.ini file. Here are a few reasons this is the best way:
- You can edit the level of access to your choosing.
- Many other people have seen the code and may have offered improvements and can see if the plugin is malicious.
- It lets you learn a little bit more about the overall scheme of how AMX works. And that may come in handy.
Actually doing it:
There
are literally hundreds of plugins that can be downloaded and installed
into AMX to make it do many things. Here are a single place to go and
get more plugins:
So
go to one of those two links and find a plugin that you must have. It's
a good idea just to do one plugin at first, this way if you have
trouble it will be easier to find the point at which the problem
occurred. Let's say you have a plugin called amx_gag.amx. This is what it would look like if it was in the plugins.ini file.
; Add custom plugins below
amx_gag.amx ; admin gag (admins can gag players)
I
started a new section for any plugins that I added and left the default
plugin section alone. Now to test and see if the plugin you added is
installed and running, start up your server. In the server's console
type amx plugins. You should get something like this:
Currently loaded plugins:
name
version author
file
status jit
[ 1] Language Manager 2010.1 AMX Mod
Team language.amx running yes
[ 2] Admin
Base 2010.1 AMX
Mod Team admin.amx
running yes
[ 3] Admin Chat
2010.1 AMX Mod Team adminchat.amx running yes
[ 4] Admin Commands 2010.1 AMX
Mod Team admincmd.amx running
yes
(etc, etc. Not all plugins shown)
[
24] Admin gag
0.6 default
amx_gag.amx running yes
Troubleshooting:
If you see something like bad load under status or unknown under name while doing amx plugins, or [AMX] Plugin file open error (plugin "some_plugin.amx") while your server was starting up then possibly:
- the plugin wasn't copied to the addons/amx/plugins folder
- the name of the plugin doesn't match what you typed in the plugins.ini file.
AMX can also display [AMX] Function not found (name "some_function") (plugin "some_plugin.amx") at startup, then the problem is that the plugin requires a certain AMX Mod module to be loaded.
About the JIT:
The Just-In-Time compiler has been introduced in AMX 0.9.9.
It allows 10+ times faster plugin execution.
For the curious ones that would wonder how it works:
your .sma plugins are compiled to .amx
files with the sc compiler. The .amx files are
Abstract Machine eXecutables: they
contain bytecode (instructions that has to be interpreted). Before AMX Mod 0.9.9,
the only way to run plugins was to interpret their bytecode constantly, and this was consuming much resources.
Now thanks to the JIT, the .amx plugins are compiled at load time to instructions
that can be sent directly to the processor, no longer needing the (slow) interpreter. Plugins run faster, and
your server will no longer suffer high stress when you declare many.
By default, AMX Mod tries to load plugins with the JIT. You can control this thanks to the amx_usejit localinfo (add +localinfo amx_usejit value to the command launching your server).
There are three possible values for this localinfo:
Anyway, if the JIT compiler fails for some reason on a plugin, that one will be executed the old way.