15.04.2013, 15:58
hello when i go on to my server to test what i have done i get this bug 1st off i want my register dialog to pop up 1st but my Quiz system pops up 1st i need help with it
here is the code below
here is the code below
Код:
// Roleplay Quiz if(dialogid == DIALOG_QUIZ) { if(!response) return Kick(playerid); if(response) { if(listitem == 0) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; 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"); } if(listitem == 1) { SendClientMessage(playerid, -1,"That's the correct answer"); ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"is LOL a frequently used word in roleplay server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game"); } if(listitem == 2) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"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"); } } } // Quiz1 if(dialogid == DIALOG_QUIZ1) { if(!response) return Kick(playerid); if(response) { if(listitem == 0) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game"); } if(listitem == 1) { SendClientMessage(playerid, -1,"That's the correct answer"); ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game"); } if(listitem == 2) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game"); } } } // Quiz2 if(dialogid == DIALOG_QUIZ2) { if(!response) return Kick(playerid); if(response) { if(listitem == 0) { 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"); } if(listitem == 1) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game"); } if(listitem == 2) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game"); } if(QuizAnswers[playerid] >= 3) { SendClientMessage(playerid, -1,"You have answered 3 times wrong"); Kick(playerid); } } } // QUIZ 3 if(dialogid == DIALOG_QUIZ3) { if(!response) return Kick(playerid); if(response) { if(listitem == 0) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; 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"); } if(listitem == 1) { 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"); } if(listitem == 2) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; 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"); } if(QuizAnswers[playerid] >= 3) { SendClientMessage(playerid, -1,"you Have answered 3 times wrong"); Kick(playerid); } } } // QUIZ 4 if(dialogid == DIALOG_QUIZ4) { if(!response) return Kick(playerid); if(response) { if(listitem == 0) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; } if(listitem == 1) { SendClientMessage(playerid, -1,"That's the correct answer"); } if(listitem == 2) { SendClientMessage(playerid, -1,"Wrong answer!"); QuizAnswers[playerid] += 1; } if(QuizAnswers[playerid] >= 3) { SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time"); Kick(playerid); } else { SendClientMessage(playerid, -1,"Congratulations, you have passed the RP quiz!"); } SpawnPlayer(playerid); } } // REGISTER if(dialogid == REGISTER) { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Leave"); ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"What does RP stands for?","RealPussy\nRolePlay\nRealMoney","Select","Leave Game"); return 1; } new hashpass[129]; WP_Hash(hashpass,sizeof(hashpass),inputtext); new INI:file = INI_Open(Path(playerid)); INI_SetTag(file,"Player's Data"); INI_WriteString(file,"Password",hashpass); INI_WriteInt(file,"AdminLevel",0); INI_WriteInt(file,"VIPLevel",0); INI_WriteInt(file,"Money",500); INI_WriteInt(file,"Scores",0); INI_WriteInt(file,"Kills",0); INI_WriteInt(file,"Deaths",0); INI_Close(file); return 1; } } // Login if(dialogid == LOGIN) { if(!response) return Kick(playerid); if(response) { new hashpass[129]; WP_Hash(hashpass,sizeof(hashpass),inputtext); if(!strcmp(hashpass,pInfo[playerid][Pass])) { INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid); SetPlayerScore(playerid,pInfo[playerid][Scores]); GivePlayerMoney(playerid,pInfo[playerid][Money]); //SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in"); } else { ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Login","Welcome to Project Gaming This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Leave"); return 1; } } } return 1; }