What is this and what does it do?
#1

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?
Reply
#2

It's ternary operator.
Check this link to learn more about it; https://sampforum.blast.hk/showthread.php?tid=216730
Reply
#3

https://sampwiki.blast.hk/wiki/Control_Structures#.3F:

Few more examples from Wiki.
Reply
#4

thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)