problem in /newbie chat
#4

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(playeridDIALOG_NEWBIEDIALOG_STYLE_LIST"{FF0000}Newbie Chat""{FF0000}1. {FFFFFF}Question\n{FF0000}2. {FFFFFF}Answer""Choose""Close");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
    switch(
dialogid) {
        case 
DIALOG_NEWBIE: {
            if(!
response) return 0;
            if(!
listitemShowPlayerDialog(playeridDialogquestionDIALOG_STYLE_INPUT"Change {FF0000}Question""Enter your Question here :""Enter""Back");
            else 
ShowPlayerDialog(playeridDialoganswerDIALOG_STYLE_INPUT"Change {FF0000}Answer""Enter your Answer here :""Enter""Back");
        }
    }
    return 
1;

Reply


Messages In This Thread
problem in /newbie chat - by Imbalo - 17.03.2017, 08:28
Re: problem in /newbie chat - by Logic_ - 17.03.2017, 08:38
Re: problem in /newbie chat - by Imbalo - 17.03.2017, 08:45
Re: problem in /newbie chat - by Logic_ - 17.03.2017, 08:51
Re: problem in /newbie chat - by SyS - 17.03.2017, 08:57
Re: problem in /newbie chat - by Imbalo - 17.03.2017, 09:25
Re: problem in /newbie chat - by Imbalo - 17.03.2017, 10:06
Re: problem in /newbie chat - by Toroi - 17.03.2017, 10:13
Re: problem in /newbie chat - by Imbalo - 17.03.2017, 10:34
Re: problem in /newbie chat - by SyS - 17.03.2017, 10:36

Forum Jump:


Users browsing this thread: 2 Guest(s)