AMX Mod Setup Guide
Half-Life server administration by OLO

# Compiling plugins

Compiling plugins is very easy. It's a requirement to do so if you plan on running any custom plugins at all. Pre-compiled plugins are available, but as AMX gets upgraded you are almost always required to recompile your plugins. Alternatively, you must download a new version of all your custom plugins compiled for the newer version of AMX.

This also can be a tiring if Olo starts putting out alot of beta's and you're trying to keep up. It's almost certain the plugin authors will rely on people to just recompile their plugins rather than releasing a compiled version for every final and beta release of AMX.

## Compiling under Windows:

- Find a plugin you want to add to your server. They can be found here with their source.
- The source code is in the section called AMX Code:. Highlight everything in the white field and copy it to your clipboard.
- Open WordPad and paste what you just copied. Now save it to your C:\hlserver\yourmodThis could be:
  valve, cstrike, dod, tfc, etc.\addons\amx\examples\source folder. When naming, if the plugin is called AFK Manager, then save it as something like afk_manager.sma. It must have the extension .sma and be saved as plain text, not Rich Text.
- In the parent folder ('examples'), you will see a file called compile.bat (MS-DOS Batch file). Run it. As the plugin compiles you will see a DOS window pop up and with luck, you will see this:
  Small compiler 2.6 Copyright (c) 1997-2004, ITB CompuPhase
  Press any key to continue . . .

If you see that, then success! You will find the compiled plugin in the addons\amx\examples\compiled folder now with a .amx extention. Now install the plugin by moving it to your addons\amx\plugins folder and making the appropriate edit to your plugins.ini file. If you received errors or warnings when compiling, check out the tips section below.

## Compiling under Linux:

- Find a plugin you want to add to your server. They can be found here with their source.
- The source code is in the section called AMX Code:. Highlight everything in the white field and copy the text.
- Open your prefered text editor and paste what you copied. Now save it to your hlds_l/yourmodThis could be:
  valve, cstrike, dod, tfc, etc./addons/amx/examples/source folder. When naming, if the plugin is called AFK Manager, then save it as something like afk_manager.sma. It must have the extension .sma and be saved as plain text, not Rich Text.
- You will see an executable file called sc. To compile your plugin, do this:
  ./sc source/afk_manager.sma
  Then you should see this:
  Small compiler 2.6 Copyright (c) 1997-2004, ITB CompuPhase

If you see that, then success! You will find the compiled plugin in the addons\amx\examples\ folder now with a .amx extension. Now install the plugin by moving it to your addons\amx\plugins folder and making the appropriate edit to your plugins.ini file. If you received errors or warnings when compiling, check out the tips section below.

Note: you can also use the provided Shell script ./compile to get all your plugins compiled at once. They will be placed in the compiled folder.

## Tips for compiling plugins:

- Pay attention to comments in source. Most of the time, how the plugin works and the valid commands for it are in the top of the source code.
- It may be necessary to create new .cfg or .ini files or folders for your plugin to work, so read up on how the plugin works in the source and in the thread it's posted in.
- Warnings are not errors. If you see plugin_name.sma(51) : warning 217: loose indentation, you can safely ignore this.
- Notepad works as long as you are aware of what it is capable of. Some versions insist on making the extension of a saved file .txt. You can save a file with .sma in the extension, but Notepad may actually save it plugin_name.sma.txt. And since the Windows default is not to show you file extensions, it may not be obvious to you what is happening.
- I like to make a folder in the examples folder called source, and in that a folder called default. I move all my default plugin source files to the examples\source\default folder and all my custom plugins to examples\source. This has been applied to the AMX Mod packages as of v0.9.9.
- Some plugins require additional modules to run. Again, pay attention to the source and the thread the plugin is posted in. Some popular modules are Vexd Utilities Module and XtraFun. VexdUM has been included within the AMX default packages since v0.9.9.

Half-Life is a registered trademark of VALVe Software and Sierra
AMX Mod was created by OLO and is not affiliated with VALVe.