06.07.2014, 07:47
So essentially, I have a command that displays the same dialog with options green depending on if the task has been finished, based on the values in the array.
new contract1[MAX_PLAYERS][3];
// 0 = option1
// 1 = option2
// 2 = option3
If 0 == 1, I want the first option in the dialog to be coloured green
if 1 == 1, I want the second option in the dialog to be coloured green
if 2 == 1, I want the third option to be colored green
Any number of these options can be green at the same but idk how to do it.
This is the command.
I know I could do long multiple if-else statements to accomplish it, but I want to find out what the quickest, most sufficient way is.
new contract1[MAX_PLAYERS][3];
// 0 = option1
// 1 = option2
// 2 = option3
If 0 == 1, I want the first option in the dialog to be coloured green
if 1 == 1, I want the second option in the dialog to be coloured green
if 2 == 1, I want the third option to be colored green
Any number of these options can be green at the same but idk how to do it.
This is the command.
Код:
if (strcmp("/contracts", cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 5.0, -138.5305,1075.0895,19.7422)) { if(job[playerid] != 1) { SendClientMessage(playerid, -1, "You are not a trucker."); } else { ShowPlayerDialog(playerid, DIALOG_CONTRACT1, DIALOG_STYLE_LIST, "Contracts", "Jim Aarons\nStark Industries\nXen Records", "Select", "Close"); } } else { SendClientMessage(playerid, -1, "You're not at the delivery station!"); } return 1;