help with control structure inside format? - 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: help with control structure inside format? (
/showthread.php?tid=620010)
help with control structure inside format? -
quvin4 - 24.10.2016
I've seen it used before, but don't know what to call it, so can't find anything when searching. Basically I want an if-else control structure inside a format, like:
Код:
format(string,sizeof(string),"%d",condition(true/false));
Re: help with control structure inside format? -
AndySedeyn - 24.10.2016
It's called the ternary operator or conditional operator:
PHP код:
condition ? true : false
Re: help with control structure inside format? -
quvin4 - 24.10.2016
Ah, alright. Thanks alot for the quick reply!