If you just want to run the server, you're looking for the latest release, you may also want to read the Runtime prerrequisites and Actually running the server sections
- Build prerrequisites
- Runtime prerrequisites
- How to build
- Just before running the server
- Actually running the server
- Collaboration and Pull Requests
Install the following in order to compile the gamemode:
- Git v2.39.x, because sampctl requires it
- sampctl version 1.11.3 installed, manual installation recommended
- Following sampctl's config wiki, configure
git_usernameandgithub_tokenwithinconfig.jsonor you may hit github's rate limits.- [
C:\Users\<User>\AppData\Roaming\sampctl] on Windows - Possibly [
~/.sampctl] on linux
- [
- Following sampctl's config wiki, configure
If you're planning to run the server on a Linux machine, keep in mind that samp-server is still a 32bit process as of now.
You may need to install the i386 architecture and install the 32bit version of the C++ Standard Library runtime, the installation procedure may vary depending on your distro:
If your package manager is APT (Debian, Ubuntu, etc), you can achieve this by running:
dpkg --add-architecture i386 && apt-get update && apt-get install libstdc++6:i386If your package manager is pacman (Arch Linux), you can achieve this by running:
pacman -Syu lib32-gcc-libsIf you're unsure, research how to do this on your machine!
If you're planning to run the server on a Windows machine, you may or may not need to install the MVSC runtimes.
Clone the project or download the project in a zip archive:
git clone https://github.com/ZantetsukenGT/AttDef attdef
#linux
cd ./attdef
#windows
cd .\attdefFetch the needed libraries/dependencies, the following command will fetch plugins as well:
sampctl ensureCompile the gamemode to generate the attdef.amx file needed to run the server:
#Will build with debug symbols -d3 flag (debug symbols included, development and for crashdetect to output useful info)
sampctl build
#or
sampctl build dev#Will build with optimizations and no debug symbols, mainly for release builds
sampctl build releaseSince we are using open.mp, you need to delete the server.cfg file and run the following command to generate a config.json file:
#linux
./samp03svr --default-config
#windows
.\samp-server.exe --default-configIn the plugins/ folder:
- Delete the
streamerplugin, its unused. - Delete the
SKYplugin, having it present will prevent the gamemode from working at all. - Move
pawnraketandsscanfto thecomponents/folder.
In the scriptfiles/ folder:
- Make a copy of the
AttDefDatabase.db.examplefile and rename it toAttDefDatabase.dbor the server won't start properly.
In the config.json file:
- In the
"pawn"."legacy_plugins"array, add"samp_bcrypt"if you're in windows or"samp_bcrypt"if you're in linux. - In the
"pawn"."main_scripts"array, remove"test 1"and add"attdef". - In the
"rcon"."password"property, change it from the defaultchangeme.
It is recommended to use the config.json customizations from the latest release
Use your preferred way to start the server:
#On Windows
.\samp-server.exe
#On Linux
./samp-serverThis works fine until you need to log off, on Windows, the process will stay alive as long as the machine is turned on and in Linux the process will be terminated.
So, on Linux, using pm2 is recommended, it will help you in restarting the server upon crashes and start it automatically when you reboot your machine.
Just casually follow these steps:
- Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash-
Log off and log in again to complete the nvm installation
-
Install the latest version of NodeJS
nvm install node # "node" is an alias for the latest version
nvm use node- Install pm2
npm install pm2 -g- Tell pm2 to run on boot
#Run as root or use sudo
pm2 startup- Start your server with pm2
# very important to be inside the correct folder
cd path/to/server
pm2 start "./samp-server" --name myAttdef
pm2 saveYou're done!
Other useful pm2 commands:
pm2 list
pm2 log myAttdef
pm2 stop myAttdef
pm2 restart myAttdef
pm2 delete myAttdef
pm2 describe myAttdefThis project is open for collaboration, create a fork, start from How to build and make a pull request!