Question defining - 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 defining (
/showthread.php?tid=307831)
Question defining -
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
Re: Question defining -
FireCat - 01.01.2012
You don't have to create a new string, or put quotes in int defines.
pawn Код:
#define Build 20
SendRconCommand("mapname Build: "Build"");
Re: Question defining -
FreshRio - 02.01.2012
When I define Build as
#define Build 20
I get these 4 errors:
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: error 001: expected token: "-string end-", but found "-identifier-"
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: warning 215: expression has no effect
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: error 001: expected token: ";", but found "-string-"
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: warning 215: expression has no effect
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: error 001: expected token: ";", but found ")"
C:\GTA SAMP - Servers\g\gamemodes\G.pwn(94

: fatal error 107: too many error messages on one line
When I put quotes, its fine.
Re: Question defining -
[ABK]Antonio - 02.01.2012
pawn Код:
new str[17];
format(str,sizeof(str), "mapname Build: %d", Build);
SendRconCommand(str);
Re: Question defining -
FreshRio - 02.01.2012
Yeah, I guess what way would be the easiest.
So I would remove the brackets on the define, right?