General Scripting Question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: General Scripting Question (
/showthread.php?tid=84944)
General Scripting Question -
ledzep - 04.07.2009
I have no idea what this particular code is called, but I found it very useful when making commands that had optional strings.
https://sampwiki.blast.hk/wiki/Fast_Comm...tional_strings
Код:
...
format(reason, sizeof (reason), "You have been banned%s%s.", reason[0] ? (" for: ") : (""), reason);
...
Could someone tell me what this is called and where I can learn more about how to use it?
Thanks,
ledzep
Re: General Scripting Question -
UsaBoy91 - 04.07.2009
Quote:
|
Originally Posted by ledzep
I have no idea what this particular code is called, but I found it very useful when making commands that had optional strings.
https://sampwiki.blast.hk/wiki/Fast_Comm...tional_strings
Код:
...
format(reason, sizeof (reason), "You have been banned%s%s.", reason[0] ? (" for: ") : (""), reason);
...
Could someone tell me what this is called and where I can learn more about how to use it?
Thanks,
ledzep
|
Post the whole code
Re: General Scripting Question -
ledzep - 04.07.2009
There's a link to the whole code above the code I posted.
I always give sauce.
Re: General Scripting Question -
yom - 04.07.2009
It's called a conditional expression, and you can learn about it by reading the pawn manual.
a ? b : c is like "if a is true then do b, else do c"
Re: General Scripting Question -
UsaBoy91 - 04.07.2009
you mean at this ?
Re: General Scripting Question -
ledzep - 04.07.2009
Yes that is what I meant.
Quote:
|
Originally Posted by 0rb
It's called a conditional expression, and you can learn about it by reading the pawn manual.
a ? b : c is like "if a is true then do b, else do c"
|
Thanks a lot. Just needed to know what it was called so I could actually search for it lol.
Re: General Scripting Question -
yom - 04.07.2009
Here you ca understand it better
http://en.wikipedia.org/wiki/%3F:
Re: General Scripting Question -
ledzep - 04.07.2009
Awesome.
That's definitely easier to understand than the Pawn_Language_Guide.pdf.
Thanks again.