Trying to learn Ternary Operator, but failed!
#4

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.
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: 2 Guest(s)