Trying to learn Ternary Operator, but failed!
#6

Quote:
Originally Posted by Calg00ne
You are only making two comparisons...

pawn Code:
SetPlayerColor(playerid, (classid == 0) ? 0xFFFFFFFF : 0xAAAAAAAA);
I'd say you're better off using a switch, instead of the ternary operator to declutter your code for this operation though.
Thanks! For the information.

Quote:
Originally Posted by RSS Cops_sandu
SetPlayerColor(playerid, (classid == 0) ? 0xFFFFFFFF : (classid == 1) ? 0xAAAAAAAA);
....... Spammer!
That code looks the same as mine....................
Reply


Messages In This Thread
Trying to learn Ternary Operator, but failed! - by Basicz - 14.06.2011, 07:25
Re: Trying to learn Ternary Operator, but failed! - by Skaizo - 14.06.2011, 07:28
Re: Trying to learn Ternary Operator, but failed! - by Basicz - 14.06.2011, 07:31
Re: Trying to learn Ternary Operator, but failed! - by Calgon - 14.06.2011, 07:34
Re: Trying to learn Ternary Operator, but failed! - by Skaizo - 14.06.2011, 07:37
Re: Trying to learn Ternary Operator, but failed! - by Basicz - 14.06.2011, 07:40

Forum Jump:


Users browsing this thread: 5 Guest(s)