08.04.2018, 11:07
#define is a pre-processor directive. You can read more about it here and here.
To put it in simple words. It replaces A with B in your code :
This happens before the gamemode/filterscript is compiled and only affects lines below the directive.
Here is an example :
Note : When interpolating strings you need to put a number sign/hash (#) before the identifier.
To put it in simple words. It replaces A with B in your code :
Код:
#define A B
Here is an example :
Код:
#define SERVER_VERSION "0.00.1" #define SOME_IDENTIFIER print("Oh, hey there!"); #define foo(%0) print(%0) public OnGameModeInit() { SOME_IDENTIFIER foo("Oh, hey there!"); SetGameModeText("MyGameMode v" #SERVER_VERSION); }