[HOWTO] Compile locally with custom includes

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1189
Gender:
United States of America

[HOWTO] Compile locally with custom includes

Post by Archive-Poster »

The first thing you need to do is set everything up.

If you don't have an amxx installation on your pc,
you should start by downloading the latest amxx build here
If you're not planning on setting up amxx on a listen / dedicated server, you can download the base package instead of the installer.
Unzip it and navigate to the scripting folder.
Once there is should look like this.

Now you have to have the code to compile,
We're gonna use a little example that required the colorchat.inc to compile.

Code: Select all

#include <amxmodx>
#include <colorchat>

public plugin_init()
{
    register_plugin("custom include compiling", "0.1", "Drekes");
    
    set_task(100.0, "TaskShowMsg", .flags = "b");
}

public TaskShowMsg()
    ColorChat(0, BLUE, "Message"); 
Before we start compiling we need to add the colorchat include to the scripting/include folder,
just copy - paste it in there.
Now, drag and drop the *.sma (in my case compiletut.sma) onto compile.exe.
For linux compile.exe is compile.so.

A console window appears with the info about the compilation. (errors, warnings, ...)

If you placed the required include right, it should look like this:

The *.amxx file can now be found in the scripting/compiled folder.

If you didn't place the include right, it looks like this:

If this occurs, check if you pasted the include in the right folder, and if it has the same name
in the script.
Attachments
tut1.jpg
tut1.jpg (74.16 KiB) Viewed 18 times
tut2.jpg
tut2.jpg (54.63 KiB) Viewed 18 times
tut3.jpg
tut3.jpg (64.88 KiB) Viewed 18 times
compiletut.sma.zip
(1.11 KiB) Downloaded 2 times
colorchat.inc.zip
(1.13 KiB) Downloaded 5 times

Who is online

Users browsing this forum: No registered users and 0 guests