Help with Dialogs
#1

well my login and register do work but the rest just fails .. .

{
if(dialogid == DIALOG_REGISTER)
{
if (!response) return Kick(playerid);
if(response) {
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"System:Registering...",""COL_RED"Syste m:You have entered an invalid password.\n"COL_WHITE"System: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,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
INI_WriteInt(File, "Locked", PlayerInfo[playerid][pLocked] = 0);
INI_Close(File);

SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WH ITE"System:You have successfully registered your account! Relog to save your stats! Thank you ","Ok","");

}
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
if ( !response ) return Kick ( playerid );
if( response ) {
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) {
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WH ITE"System:You have successfully logged in!","Ok","");
SpawnPlayer(playerid);
SetPlayerColor(playerid, COLOR_WHITE);
}
else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Sy stem:You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
if(dialogid == 836 )
{
if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You canceled!");
if(response)
{
if(listitem == 0)
{
SetPlayerTeam(playerid, 2);
gTeam[playerid] = 2;
SendClientMessage(playerid, COLOR_WHITE,"You can now spawn");

}
if(listitem == 1)
{
SetPlayerTeam(playerid, 1);
gTeam[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE,"You can now spawn");
}
return 1;
}
}
if(dialogid == 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
{
if(listitem == 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_STYL E_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
}
if(listitem == 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_STYL E_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
}
if(listitem == 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_STYL E_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
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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 try a, you answered 3 times wrong.Maybe another time");
Kick(playerid); // He will be kicked
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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
}
}
}
if(dialogid == DIALOG_QUIZ4)
{
if(!response) return Kick(playerid); // If he click second button he get kicked
if(response) // If he click first button
{
if(listitem == 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.
}
if(listitem == 1) // If he choose second answers wich is: Out of Character (correct one)
{
SendClientMessage(playerid, -1,"That's the correct answer");
}
if(listitem == 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;
}
return 1;
}
Can anyone help me ? ? i do not get any errors btw..
Reply
#2

what do you mean fails?
it doesnt show up,nothing happen,or what?
btw put [pawn] [ /pawn] on the script
for Ex:(with out the space)
Words
[pawn]Script[ /pawn]
Reply
#3

well the dialog shows up but when i click the function and like continue then it fails but it only fails from
pawn Код:
if(dialogid == 836 )
{
if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You canceled!");
if(response)
{
if(listitem == 0)
{
SetPlayerTeam(playerid, 2);
gTeam[playerid] = 2;
SendClientMessage(playerid, COLOR_WHITE,"You can now spawn");

}
if(listitem == 1)
{
SetPlayerTeam(playerid, 1);
gTeam[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE,"You can now spawn");
}
return 1;
}
}
if(dialogid == 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
{
if(listitem == 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_STYL E_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
}
if(listitem == 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_STYL E_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
}
if(listitem == 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_STYL E_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
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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 try a, you answered 3 times wrong.Maybe another time");
Kick(playerid); // He will be kicked
}
}
}
if(dialogid == 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
{
if(listitem == 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
}
if(listitem == 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
}
if(listitem == 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
}
}
}
if(dialogid == DIALOG_QUIZ4)
{
if(!response) return Kick(playerid); // If he click second button he get kicked
if(response) // If he click first button
{
if(listitem == 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.
}
if(listitem == 1) // If he choose second answers wich is: Out of Character (correct one)
{
SendClientMessage(playerid, -1,"That's the correct answer");
}
if(listitem == 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;
}
return 1;
}
and the rest just works great so i thought i would be in the
pawn Код:
{
if(dialogid == DIALOG_REGISTER)
{
if (!response) return Kick(playerid);
if(response) {
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"System:Registering...",""COL_RED"Syste m:You have entered an invalid password.\n"COL_WHITE"System: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,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
INI_WriteInt(File, "Locked", PlayerInfo[playerid][pLocked] = 0);
INI_Close(File);

SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WH ITE"System:You have successfully registered your account! Relog to save your stats! Thank you ","Ok","");

}
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
if ( !response ) return Kick ( playerid );
if( response ) {
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) {
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WH ITE"System:You have successfully logged in!","Ok","");
SpawnPlayer(playerid);
SetPlayerColor(playerid, COLOR_WHITE);
}
else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Sy stem:You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
but i dont seem to find the fail
so what i ment was that The sendclientmessage doesnt show up and stuff doesnt work it just doesnt work from then
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)