SA-MP Forums Archive
Show 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: Show define. (/showthread.php?tid=496715)



Show define. - audriuxxx - 23.02.2014

Hi,

Can i format and show define value?
Код:
#define EXAMPLE 55


new msg[128];
format(msg,127,"BLABLA: %d", EXAMPLE ");
SendClientMessage(playerid,-1,msg);



Re: Show define. - AlonzoTorres - 23.02.2014

Yes,

pawn Код:
#define EXAMPLE 55

new msg[128];
format(msg, sizeof(msg), "BLABLA: %d", EXAMPLE);
SendClientMessage(playerid,-1,msg);



Re: Show define. - Konstantinos - 23.02.2014

Yes, you can.

pawn Код:
format(msg,sizeof(msg),"BLABLA: %d", EXAMPLE);
EDIT: Too late.


Re: Show define. - Vince - 23.02.2014

Yes, but it wouldn't be very wise to do so. A macro isn't a variable, it merely replaces text. You could simply do:
pawn Код:
SendClientMessage(playerid, -1, "BLABLA: " #EXAMPLE);