Commands don't work
#1

In the [GM] that I'm working on the commands stopped working. At the end of the script I had to put #endif otherwise the GameMode wouldn't compile. The way I have my commands set up is that they can be enabled/disabled by using the true/false system.
pawn Код:
#define ThisCommand true
if ThisCommand == true
if(strcmp,"/command",bla,bla)
{
    for those who didn't know what I'm talking about
}
#endif
From what I remember I put #endif accordingly and it asked me to use #endif again. Now none of my commands work. Commands inside Filterscripts however work normally. If someone can help, I would gladly appreciate it.
Reply
#2

but the endif before the "OnGameModeInit"
Reply
#3

Try using this instead:
pawn Код:
#if defined ThisCommand true
or
pawn Код:
#if ThisCommand == true
I'm not very familiar with the preprocessor, but one of those might work.
Reply
#4

I think that will work, i'm not sure
pawn Код:
#define ThisCommand true

#if ThisCommand == true
if(strcmp,"/command",bla,bla)
{
    //stuff
}
#endif
Reply
#5

pawn Код:
#if defined MyDefine
// Your' Stuff
#endif
if you want `enable` your stuff you need write: \

pawn Код:
#define MyDefine
Reply
#6

Why The **** are you people using #define or #dontdefine or #mamadefine?
Just write down command! and add "!" BETWEEN the first ( and strcmp and in the end of OnPlayerCommandText write return 0; fools.....
Reply
#7

Quote:
Originally Posted by Captain Price
Посмотреть сообщение
Why The **** are you people using #define or #dontdefine or #mamadefine?
Just write down command! and add "!" BETWEEN the first ( and strcmp and in the end of OnPlayerCommandText write return 0; fools.....
You just idiot if you don't understand why people's using #define then just stop posting.

AnyWay put return 0; in your brains ^^

Have a nice day Captain "Fool"
Reply
#8

I used Vince's method...
pawn Код:
#if defined ThisCommand true
and I put
pawn Код:
#endif
after the last #endif in my script
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)