03.09.2010, 15:01
Hello.
Well, I've made some questions when that you has to answer before logging in and such. The first question works fine, when you type A, B or C, it's all fine. But then at the next question when I type A, B or C again it doesn't really work. I've made it so it says "[Error]: Please answer the question by writing (A, B or C)" when you type something else, like "hello" or "what's up" etc.. Well, I can't type A, B, C in the second question then it just gives me the message. Here's the script: I hope any of you could help:
I've been checking the godfather script and such for any help, but no help there.
Well, I've made some questions when that you has to answer before logging in and such. The first question works fine, when you type A, B or C, it's all fine. But then at the next question when I type A, B or C again it doesn't really work. I've made it so it says "[Error]: Please answer the question by writing (A, B or C)" when you type something else, like "hello" or "what's up" etc.. Well, I can't type A, B, C in the second question then it just gives me the message. Here's the script: I hope any of you could help:
pawn Код:
public OnPlayerText(playerid, text[])
{
new tmp[256];
if(PlayerInfo[playerid][pRegistered] == 1)
{
if(RegQ[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("B", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("B")))
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Correct!");
RegQ[playerid] = 2;
SendClientMessage(playerid, COLOR_DARKSTATEBLUE, "--------------[El Quebrados Roleplay Registration]--------------");
SendClientMessage(playerid, COLOR_WHITE, "- What is Roleplay after all?");
SendClientMessage(playerid, COLOR_WHITE, "- [Hint]: Type A, B or C");
SendClientMessage(playerid, COLOR_WHITE, "- A) Acting like in real life.");
SendClientMessage(playerid, COLOR_WHITE, "- B) Acting like a guy you in a movie.");
SendClientMessage(playerid, COLOR_WHITE, "- C) Playing Grand Theft Auto.");
return 0;
}
else if((strcmp("A", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("A")))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: The answer was not right and you've failed, better luck next time");
SendClientMessage(playerid, COLOR_WHITE, "[Info]: Re-log and try again");
//Kick(playerid);
return 0;
}
else if((strcmp("C", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("C")))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: The answer was not right and you've failed, better luck next time");
SendClientMessage(playerid, COLOR_WHITE, "[Info]: Re-log and try again");
//Kick(playerid);
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: Please answer the question by writing (A, B or C)");
}
return 0;
}
else if(RegQ[playerid] == 2)
{
if((strcmp("A", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("A")))
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Correct!");
RegQ[playerid] = 3;
return 0;
}
else if((strcmp("B", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("B")))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: The answer was not right and you've failed, better luck next time");
SendClientMessage(playerid, COLOR_WHITE, "[Info]: Re-log and try again");
//Kick(playerid);
return 0;
}
else if((strcmp("C", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("C")))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: The answer was not right and you've failed, better luck next time");
SendClientMessage(playerid, COLOR_WHITE, "[Info]: Re-log and try again");
//Kick(playerid);
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: Please answer the question by writing (A, B or C)");
}
return 0;
}
/*else if(RegQ[playerid] == 3)
{*/
}
return 1;
}