SA-MP Forums Archive
Question for define - 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)
+--- Thread: Question for define (/showthread.php?tid=307830)



Question for define - FreshRio - 01.01.2012

Hi,

Just a small question with defining.

Lets say I define this:

#define Build "20"


Then under OnGameModeInit:

new mapname[ 100 ];
format( mapname, sizeof( mapname ), "mapname Build: "#Build"" );
SendRconCommand( mapname );



So whats the correct one?

"#Build"
or
"Build"

Thanks


AW: Question for define - Nero_3D - 01.01.2012

None of them, its just Build

Your example code would work because you put #Build there

But thats enough
pawn Код:
SendRconCommand("mapname Build: " Build);
If you put something in quotes the compiler think its a string and wont change it
"Build" and "#Build" wouldnt change at all

The # just converts the work behind it into a string