What is this and what does it do? - 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: What is this and what does it do? (
/showthread.php?tid=496524)
What is this and what does it do? -
Don_Cage - 22.02.2014
so.. i broke my arm some days ago so i had to take a break from scripting. But insted of just put it away i decided to read and learn something new about pawn.
So i started to read topics here and wiki etc.. and i saw something like this
pawn Код:
if(something == 0) ? something2 : something3
What does it do? Is it like if and else?
Re: What is this and what does it do? -
newbienoob - 22.02.2014
It's ternary operator.
Check this link to learn more about it;
https://sampforum.blast.hk/showthread.php?tid=216730
Re: What is this and what does it do? -
Konstantinos - 22.02.2014
https://sampwiki.blast.hk/wiki/Control_Structures#.3F:
Few more examples from Wiki.
Re: What is this and what does it do? -
Don_Cage - 22.02.2014
thanks!