17.03.2017, 08:51
Read about Variables and Index them. One variable holds the question and the another holds the answer.
PHP код:
#undef MAX_PLAYERS
#define MAX_PLAYERS (10) // server total slots....
#define QUESTION_LENGTH (100) // question string length
#define ANSWER_LENGTH (100) // answer string length
new Question[MAX_PLAYERS][QUESTION_LENGTH],
Answer[MAX_PLAYERS][ANSWER_LENGTH]; // variables to hold the question and the answer respectively.
CMD:n(playerid) return cmd_newbie(playerid);
CMD:newbie(playerid) {
ShowPlayerDialog(playerid, DIALOG_NEWBIE, DIALOG_STYLE_LIST, "{FF0000}Newbie Chat", "{FF0000}1. {FFFFFF}Question\n{FF0000}2. {FFFFFF}Answer", "Choose", "Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch(dialogid) {
case DIALOG_NEWBIE: {
if(!response) return 0;
if(!listitem) ShowPlayerDialog(playerid, Dialogquestion, DIALOG_STYLE_INPUT, "Change {FF0000}Question", "Enter your Question here :", "Enter", "Back");
else ShowPlayerDialog(playerid, Dialoganswer, DIALOG_STYLE_INPUT, "Change {FF0000}Answer", "Enter your Answer here :", "Enter", "Back");
}
}
return 1;
}