-
Notifications
You must be signed in to change notification settings - Fork 32
FAQ
This is a collection of common pitfalls encountered while using sampctl. Hopefully this document remains small as weird UX issues should be fixed in the tool itself. However, some things can't be fixed with code and are just a side effect of learning a new tool. Hopefully this document will help you get up and running with sampctl with no more questions!
So sampctl downloads and installs its own Pawn compiler (Zeex version) into ~/.samp/pawn/<version>
it does not have its own includes because the compiler and the SA:MP includes are separate things that do not depend on each other. Compilers are released on a completely separate cycle to SA:MP versions (and, in-turn, SA:MP includes).
To resolve this, I created a Pawn package for the SA:MP includes which is treated like any other package. It's named samp-stdlib (SA:MP standard library) and can be found here.
In order to to make your build work, you must add it as a dependency to your pawn.json
file:
{
"entry": "gamemodes/my_gamemode.pwn",
"output": "gamemodes/my_gamemode.amx",
"dependencies": [
"Southclaws/samp-stdlib"
]
}
It also has version tags so for example, 0.3.8 comes out and you might still use 0.3.7, you must specify the SA:MP server version as the version tag:
{
"entry": "gamemodes/my_gamemode.pwn",
"output": "gamemodes/my_gamemode.amx",
"dependencies": [
"Southclaws/samp-stdlib:0.3.7-R2-2-1"
]
}
Some libraries (especially plugins) often store their .inc files in a subdirectory. For example, check the Zeex/samp-plugin-crashdetect repository, the .inc file is actually in the ./includes/
subdirectory.
This is easily solved, simply add the path relative to the repository root to the dependency string:
{
"entry": "gamemodes/my_gamemode.pwn",
"output": "gamemodes/my_gamemode.amx",
"dependencies": [
"Zeex/samp-plugin-crashdetect/include"
]
}
This also works fine with versioned dependencies:
{
"entry": "gamemodes/my_gamemode.pwn",
"output": "gamemodes/my_gamemode.amx",
"dependencies": [
"Zeex/samp-plugin-crashdetect/include:^4.18.1"
]
}