variables between two other strings? - 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: variables between two other strings? (
/showthread.php?tid=439452)
variables between two other strings? -
Frede - 25.05.2013
Well this question might sound stupid, but i just really need it now: in PHP you can set up a string like this $string = "hello".$name."<br />"; and in C++ you JavaScript you can do it too like this: string = "hello "+name+"<br />"; and in C++ you can put a variable into a string like this: "hello "<<name<<"<br />";. is this possible in PAWN?
or shall it be like this format(..., sizeof(...), "Hello %s <br />", name);
i was just wondering if it was possibe because i need something like that right now
Re: variables between two other strings? -
Vince - 25.05.2013
No, you should use format. However, it works with literal strings. For example:
pawn Код:
#define COL_GREEN "{00FF00}"
"some text and some " #COL_GREEN "green text"
Re: variables between two other strings? -
Frede - 25.05.2013
hmmm... sad... i really needed it like that :/. However, thanks