Installation FOR DEVELOPMENT OR CONTRIBUTIONS. Otherwise you're looking for the latest release.
Clone the project or download the project in a zip archive:
git clone https://github.com/ZantetsukenGT/AttDef attdef
#linux
cd ./attdef
#windows
cd .\attdef
Modify the pawn.json file whether you need an open.mp
, 0.3.7 R2
, 0.3DL
or an UGMP
server. open.mp
is recommended and is the default.
Fetch the needed libraries/dependencies, make sure you have sampctl version 1.11.0 installed, manual installation recommended (the following cmd will fetch plugins as well):
sampctl ensure
You need to delete server.cfg
and run the following command to generate a config.json
file:
#linux
./samp03svr --default-config
#windows
.\samp-server.exe --default-config
Then in the plugins/
folder:
- Delete the
streamer
plugin, its unused. - Move
pawnraket
andsscanf
to thecomponents/
folder.
Then in the scriptfiles/
folder:
- Make a copy of the
AttDefDatabase.db.example
file and rename it toAttDefDatabase.db
or the server won't start properly.
Then in the config.json
file:
- In the
"pawn"."legacy_plugins"
array, add"samp_bcrypt"
if you're in windows or"samp_bcrypt.so"
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
.
Will 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 main
#Will build with optimizations and no debug symbols, mainly for release builds
sampctl build release
Then use your preferred way to start the server and keep it alive on user logout, 'screen' for linux is recommended.
You can also start it the old way:
#linux start, will persist over logouts
screen -S mySampScreen ./samp03svr
#dettach from the server output with CTRL + A, and then press D
#later that day...
#linux cmd to return to the mySampScreen screen
screen -R mySampScreen
#you can kill it with CTRL + C
#windows
.\samp-server.exe
This project is open for collaboration, following a few guidelines:
- Your proposed changes must compile without any warnings, const correctness warnings caused by dependencies ensured by sampctl are fine, warnings caused by YSI includes are fine, warnings caused by legacy dependencies (basically your code) are not.
- Before making your pull request, delete the dependencies folder and run
sampctl ensure
andsampctl build
and check for further warnings and functionality remains as intended. - Your code preferably has to be formatted through vscode's
xaver.clang-format
extension, it will use the formatting rules present in the.clang-format
file, and applying the actual formatting withAlt + Shift + F
, for the formatting to work you need to set the file language specify in the extension's settings the path of theclang-format.exe
file bundled in the clang C++ compiler; obtained from https://winlibs.com/ (Win64, UCRT runtime), all of this will help to keep a consistent code style throughout the project. - Due to the pawn compiler's limitations, after formatting, some adjustments need to be made manually or you will find cryptic and useless compiler errors.
- String literals need to be modified into 1-liners.
- Pawn Tags cannot have a space between the
Tag
and the:
, example: (Tag: good, Tag : bad). - The formatter adds a NewLine character after the keyword
public
, remove it so that the keyword and the function name is in the same line. - Macros which make use of
%0
or any number really, will be separated as% 0
and need to be joined again.