Commands help
#4

#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 :
Код:
#define A B
This happens before the gamemode/filterscript is compiled and only affects lines below the directive.

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);
}
Note : When interpolating strings you need to put a number sign/hash (#) before the identifier.
Reply


Messages In This Thread
Commands help - by Lixyde - 07.04.2018, 18:07
Re: Commands help - by ForCop - 07.04.2018, 18:44
Re: Commands help - by scripter112 - 08.04.2018, 10:02
Re: Commands help - by Codeah - 08.04.2018, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)