Disable/enable code?
#1

Hey ive seen something like this before:
You have a piece of code that will only be used when something is configurated at the top of the script like #define NoWeather or whatever... How can i do something like this?
Reply
#2

using a variables.

pawn Код:
new Disable[MAX_PLAYERS];
Reply
#3

You're right, use defines.

pawn Код:
#define SOMETHING
Then:

pawn Код:
#if defined SOMETHING
// Put your code here, it'll only be executed/compiled if SOMETHING is defined, otherwise it will be skipped
#else
// Code if its NOT defined
#endif
Reply
#4

https://sampwiki.blast.hk/wiki/Keywords:Directives
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)