Problem with a script
#1

I make a questionary for my gamemode. This is a part of my script:
Код:
if(EmTesteArmas[playerid] == 1 && Questao[playerid] == 1)
	{
	new idx;
  tmp = strtok(text, idx);
  if ((strcmp("b", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("b")))
  {
	SendClientMessage(playerid, COLOR_WHITE, "Certa Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  Questao[playerid]=2;
  PontosTesteArmas[playerid]++;
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(2) Se voce visse um traficante de armas, o que vocк faria?");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)Iria chamar a policia.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)Compraria armas dele porque й mais barato.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Espancaria o Bastardo atй que ele morresse.");
  }
  if ((strcmp("1a", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("a")))
  {
  SendClientMessage(playerid, COLOR_WHITE, "Errada Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  Questao[playerid]=2;
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(2) Se voce visse um traficante de armas, o que vocк faria?");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)Iria chamar a policia.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)Compraria armas dele porque й mais barato.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Espancaria o Bastardo atй que ele morresse.");
  }
  if ((strcmp("c", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("c")))
  {
  SendClientMessage(playerid, COLOR_WHITE, "Errada Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  Questao[playerid]=2;
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(2) Se voce visse um traficante de armas, o que vocк faria?");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)Iria chamar a policia.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)Compraria armas dele porque й mais barato.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Espancaria o Bastardo atй que ele morresse.");
  }
  }
  if(EmTesteArmas[playerid] == 1 && Questao[playerid] == 2)
	{
	new idx;
  tmp = strtok(text, idx);
  if ((strcmp("a", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("a")))
  {
  SendClientMessage(playerid, COLOR_WHITE, "Certa Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(3) Sгo armas permitidas no server, EXCETO?");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)MP5, Uzi, Sniper e Minigun.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)MP5, M4, Deagle e Bazooka.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Sniper, Bazooka, M4 e Granadas.");
  Questao[playerid]=3;
  PontosTesteArmas[playerid]++;
  }
  if ((strcmp("b", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("b")))
  {
  SendClientMessage(playerid, COLOR_WHITE, "Errada Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(3) Sгo armas permitidas no server, EXCETO?");
    SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)MP5, Uzi, Sniper e Minigun.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)MP5, M4, Deagle e Bazooka.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Sniper, Bazooka, M4 e Granadas.");
  Questao[playerid]=3;
  }
  if ((strcmp("c", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("c")))
  {
  SendClientMessage(playerid, COLOR_WHITE, "Errada Resposta, vamos a prуxima pergunta.");
  SendClientMessage(playerid, COLOR_YELLOW, "-----------------...---------------- ");
  SendClientMessage(playerid, TEAM_GROVE_COLOR, "(3) Sгo armas permitidas no server, EXCETO?");
    SendClientMessage(playerid, TEAM_BALLAS_COLOR, "A)MP5, Uzi, Sniper e Minigun.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "B)MP5, M4, Deagle e Bazooka.");
  SendClientMessage(playerid, TEAM_BALLAS_COLOR, "C)Sniper, Bazooka, M4 e Granadas.");
  Questao[playerid]=3;
  }
  }
There is 5 questions. The problem is that when a player, for example, answer letter "a", all the questions are answered letter "a" too. The correctly would be the player, in the question 1, answer "a" and pass to question 2 and answer it. How do I do to fix this
Thankss...
Reply
#2

What do I do
Reply
#3

try asking in your language section, because I can't fucking understand anything!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)