#if is known as a directive, its a preprocessor in PAWN and you can use them to check specific conditions.
You can choose what to compile and what to not, ex:
Код:
#define LIMIT 10
if (LIMIT < 10)
{
printf("Limit too low");
}
which would compile as :
Код:
if (10 < 10)
{
printf("Limit too low");
}
The compiler knows that its not true and never will be so it would give you a constant expression warning, so the only reason you would want to keep this code if someone changes the limit and recompiles, so that's when #if comes in play, Unlike normal if which give a warning if the expression is constant, #if expressions MUST be constant. So:
Код:
#define LIMIT 10
#if LIMIT < 10
#error Limit too low
#endif
If the limit is too small, it would give you a compiler error instead of you having to manually test it as it would check the code.
Source: Wiki for examples.