Help please.. Need help.. + rep Wit Quiz..
#5

Remove your dialog from OnPlayerConnect, each time they will logged in the quiz will apear it must be under your /register command or under your register dialog like that:

pawn Код:
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_BLUE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_BLUE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney] = 0);
                INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore] = 0);
                INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin] = 0);
                INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills] = 0);
                INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths] = 0);
                INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin] = 0);
                INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge] = 0);
                INI_WriteInt(File,"Born",PlayerInfo[playerid][pBorn] = 0);
                INI_WriteInt(File,"Month",PlayerInfo[playerid][pMonth] = 0);
                INI_WriteInt(File,"Day",PlayerInfo[playerid][pDay] = 0);
                INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank] = 0);
                INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted] = 0);
                INI_WriteInt(File,"MuteTime",PlayerInfo[playerid][pMuteTime] = 0);
                INI_Close(File);
                ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"What does RP stands for?"," Real Pussy \n Role Play \n Real Money","Select","Leave Game");
                QuizAnswers[playerid] = 0; // We set the player quiz answers to 0 when he connects.

            }
        }
and then:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_QUIZ: // If first dialog shows up
        {
            if(!response) return Kick(playerid); // If he click "Leave Game" he will be kicked.
            if(response) // If he click first button
            {
                switch(listitem) // We switch the available answers
                {
                    case 0:// If he choose first answer, wich is: Real Pussy
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
                        // Second question will show up
                    }
                    case 1: // If he choose 2nd answers, which is: Role Play (correct one)
                    {
                        SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
                        ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
                        // Second question will show up
                    }
                    case 2:
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
                        // Second question will show up
                    }
                }
            }
        }
        case DIALOG_QUIZ1: // If second dialog shows up
        {
            if(!response) return Kick(playerid); // If he press second button he get kicked
            if(response) // If he press first button
            {
                switch(listitem) // We switch the available answers
                {
                    case 0: // If he choose first answer wich is: Yes
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 1: // If he choose first answer wich is: No, it's a NON-RP word (correct one)
                    {
                        SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
                        ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 2:
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
                        // Next dialog will show up
                    }
                }
            }
        }
        case DIALOG_QUIZ2: // If 3rd dialog shows up
        {
            if(!response) return Kick(playerid); // If he click second button he get kicked
            if(response) // If he click first button
            {
                switch(listitem) // We switch the available answers
                {
                    case 0: // If he choose first answer wich is: /me laugs (correct one)
                    {
                        SendClientMessage(playerid, -1,"That's the correct answer");
                        ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 1:
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 2:
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                }
                if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers
                {
                    SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
                    Kick(playerid); // He will be kicked
                }
            }
        }
        case DIALOG_QUIZ3: // If 4rd dialog shows up
        {
            if(!response) return Kick(playerid); // If he click second button he get kicked
            if(response) // If he click first button
            {
                switch(listitem) // We switch the available answers
                {
                    case 0: // If he choose first answer wich is: Information Centre
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 1: // If he choose first answer wich is: In Character (correct one)
                    {
                        SendClientMessage(playerid, -1,"That's the correct answer!");
                        ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                    case 2: // If he choose first answer wich is: I'm Cool
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                        ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
                        // Next dialog will show up
                    }
                }
                if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
                {
                    SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
                    Kick(playerid); // He will be kicked
                }
            }
        }
        case DIALOG_QUIZ4: // If 5 dialog shows up
        {
            if(!response) return Kick(playerid); // If he click second button he get kicked
            if(response) // If he click first button
            {
                switch(listitem) // We switch the available answers
                {
                    case 0: // If he choose first answers wich is: Out of Chat
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                    }
                    case 1: // If he choose second answers wich is: Out of Character (correct one)
                    {
                        SendClientMessage(playerid, -1,"That's the correct answer");
                    }
                    case 2: // If he choose 3rd answer wich is: Ow ow cool
                    {
                        SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
                        QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
                    }
                }
                if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
                {
                    SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
                    Kick(playerid); // He will be kicked
                }
                else // If he didn't have at least 3 wrong answers
                {
                    SendClientMessage(playerid, -1,"Congratulations, you have passed the RP quiz!");
                    SpawnPlayer(playerid);
                    // After the quiz is finish,the player will be spawned, you can change here.
                }
            }
        }
    }
    return 1;
}
Edit it as you like and if you want them to spawn use SetSpawnInfo and SpawnPlayer at the last question.
Reply


Messages In This Thread
Help please.. Need help.. + rep Wit Quiz.. - by Scrillex - 10.03.2012, 13:15
Re: Help please.. Need help.. + rep Wit Quiz.. - by Scrillex - 10.03.2012, 13:28
Respuesta: Help please.. Need help.. + rep Wit Quiz.. - by vernz - 10.03.2012, 13:31
Re: Help please.. Need help.. + rep Wit Quiz.. - by Scrillex - 10.03.2012, 13:37
Respuesta: Help please.. Need help.. + rep Wit Quiz.. - by vernz - 10.03.2012, 13:41
Re: Help please.. Need help.. + rep Wit Quiz.. - by Scrillex - 10.03.2012, 13:59
Respuesta: Help please.. Need help.. + rep Wit Quiz.. - by vernz - 10.03.2012, 14:12
Re: Help please.. Need help.. + rep Wit Quiz.. - by Scrillex - 10.03.2012, 14:16
Respuesta: Help please.. Need help.. + rep Wit Quiz.. - by vernz - 10.03.2012, 14:27

Forum Jump:


Users browsing this thread: 3 Guest(s)