[Tutorial] A more close look at Ternary Operators
#9

Quote:
Originally Posted by Vince
View Post
Worth mentioning that this can also be used inline, e.g.:
pawn Code:
ShowPlayerDialog(showplayerid, DIALOG_NO_RETURN, rows ? DIALOG_STYLE_LIST : DIALOG_STYLE_MSGBOX, temp, dialogstring, "Okay", "");
Or even:
pawn Code:
return SendClientMessage(playerid, COLOR_RED, (PlayerStats[playerid][pDrugSeeds])
    ? ("You aren't growing any drug plants. Use /plant to grow one.")
    : ("You aren't growing any drug plants. Get some seeds first!")
);
thnx man i will add it as soon as i can
Reply


Messages In This Thread
A more close look at Ternary Operators - by BroZeus - 02.07.2014, 10:11
Re: A more close look at Ternary Operators - by Rittik - 02.07.2014, 10:48
Re: A more close look at Ternary Operators - by BroZeus - 02.07.2014, 10:52
Re: A more close look at Ternary Operators - by Rittik - 02.07.2014, 11:02
Re: A more close look at Ternary Operators - by BroZeus - 02.07.2014, 11:05
Re: A more close look at Ternary Operators - by Rittik - 02.07.2014, 11:08
Re: A more close look at Ternary Operators - by BroZeus - 02.07.2014, 11:12
Re: A more close look at Ternary Operators - by Vince - 02.07.2014, 11:30
Re: A more close look at Ternary Operators - by BroZeus - 02.07.2014, 13:22
Re: A more close look at Ternary Operators - by Pottus - 02.07.2014, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)