SA-MP Forums Archive
Commands don't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Commands don't work (/showthread.php?tid=258614)



Commands don't work - PCheriyan007 - 31.05.2011

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.


Re: Commands don't work - Sascha - 31.05.2011

but the endif before the "OnGameModeInit"


Re: Commands don't work - Vince - 31.05.2011

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.


Re: Commands don't work - Laronic - 31.05.2011

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

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



Re: Commands don't work - Raimis_R - 31.05.2011

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

pawn Код:
#define MyDefine



Re: Commands don't work - Captain Price - 31.05.2011

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.....


Re: Commands don't work - Raimis_R - 31.05.2011

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"


Re: Commands don't work - PCheriyan007 - 01.06.2011

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