18.08.2012, 19:28
Can someone helpme with this if a player chooses a woring answer server restarts
pawn Код:
{
case DIALOG_QUIZ: // If first dialog shows up
{
if(!response) return Kick(playerid); // If he click "Leave " 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
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"Metagaming is...","...Using OOC for IC Purpose.\n...Both of them. \n...Using IC for OOC purpose.","Select","Quit");
// Second question will show up
}
case 1: // If he choose 2nd answers, which is: Role Play (correct one)
{
// He will get a message that he answered correct
ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"Metagaming is...","...Using OOC for IC Purpose.\n...Both of them. \n...Using IC for OOC purpose.","Select","Quit");
// Second question will show up
}
case 2:
{
SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"Metagaming is...","...Using OOC for IC Purpose.\n...Both of them. \n...Using IC for OOC purpose.","Select","Quit");
// 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
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Are you allowed to driveby?","Only as a passanger\nNo,you get punished for that.\nOnly if you are roleplaying as a human.","Select","Quit");
// Next dialog will show up
}
case 1: // If he choose first answer wich is: No, it's a NON-RP word (correct one)
{
// He will get a message that he answered correct
ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Are you allowed to driveby?","Only as a passanger\nNo,you get punished for that.\nOnly if you are roleplaying as a human.","Select","Quit");
// Next dialog will show up
}
case 2:
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Are you allowed to driveby?","Only as a passanger\nNo,you get punished for that.\nOnly if you are roleplaying as a human.","Select","Quit");
// 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)
{
ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?","Inner Characteristic \nIn Character\nInside Class","Select","Quit");
// Next dialog will show up
}
case 1:
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?","Inner Characteristic \nIn Character\nInside Class","Select","Quit");
// Next dialog will show up
}
case 2:
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?","Inner Characteristic \nIn Character\nInside Class","Select","Quit");
// 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");
}
}
}
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
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"Deathmatching is attempting to kill another player...","...Who is trying to kill you.\n...Whithout a good roleplay reason.\nWith a good roleplay reason.","Select","Quit");
// Next dialog will show up
}
case 1: // If he choose first answer wich is: In Character (correct one)
{
ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"Deathmatching is attempting to kill another player...","...Who is trying to kill you.\n...Whithout a good roleplay reason.\nWith a good roleplay reason.","Select","Quit");
// Next dialog will show up
}
case 2: // If he choose first answer wich is: I'm Cool
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"Deathmatching is attempting to kill another player...","...Who is trying to kill you.\n...Whithout a good roleplay reason.\nWith a good roleplay reason.","Select","Quit");
// Next dialog will show up
}
}
if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
{
}
}
}
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
{
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)
{
}
case 2: // If he choose 3rd answer wich is: Ow ow cool
{
QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
}
}
if(QuizAnswers[playerid] >= 2) // If he reached 3 wrong answers or more
{
Kick(playerid); // He will be kicked
}
else // If he didn't have at least 3 wrong answers
{
ShowDialog(playerid, 1, DIALOG_PASS, "Register","Congratulation's,\nYou have passed the Roleplay test!\nYou can now register your account,\nEnter the desired password:", "Register", "Exit");
// thAftere quiz is finish,the player will be spawned, you can change here.
}
}
return 1;
}