Checking a define in gamemode? - 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: Plugin Development (
https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: Checking a define in gamemode? (
/showthread.php?tid=301958)
Checking a define in gamemode? -
Awesome™ - 06.12.2011
Hey guys.
I want to check for a define in a plugin.
How to do this:
Something like:
Gamemode:
Plugin:
Код:
if("defined BLAH") { /* do something here */ }
Gz
Re: Checking a define in gamemode? -
admantis - 06.12.2011
Wrong section, but..
pawn Код:
#define BLAH
#if defined BLAH
{
// do something
}
#endif
also you can make it like this
pawn Код:
#define BLAH true
#if BLAH == true
{
// do something
}
#else
{
// do other thing
}
#endif
Re: Checking a define in gamemode? -
Ash. - 06.12.2011
Quote:
Originally Posted by admantis
Wrong section, but..
pawn Код:
#define BLAH
#if defined BLAH { // do something } #endif
also you can make it like this
pawn Код:
#define BLAH true
#if BLAH == true { // do something } #else { // do other thing } #endif
|
Not in a plugin...
In a plugins include (if it were to have one), yes.
Your code won't work, either.
Re: Checking a define in gamemode? -
admantis - 06.12.2011
A plugin for that intentions is not needed at all.
AW: Checking a define in gamemode? -
Awesome™ - 06.12.2011
I mean to check in plugin for a define in the plugin include.
Re: Checking a define in gamemode? -
steki. - 06.12.2011
no need of { } btw
Re: Checking a define in gamemode? -
admantis - 06.12.2011
Sorry I thought you were talking about searching certain define in the script