[Ajuda] Comando funcionando errado
#8

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(dialogid == NUTZ)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(votacao[iniciada] && !votou[playerid])
                {
                    SendClientMessage(playerid,LARANJA, "Seu voto foi enviado com sucesso!");
                    votacao[sim]++;
                    votacao[total]++;
                    votou[playerid] = true;
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid,BRANCO, "Vocк Jб Votou!");
                }
            }
            if(listitem == 1)
            {
                if(votacao[iniciada] && !votou[playerid])
                {
                    SendClientMessage(playerid,LARANJA, "Seu voto foi enviado com sucesso!");
                    votacao[nao]++;
                    votacao[total]++;
                    votou[playerid] = true;
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid,BRANCO, "Vocк Jб Votou!");
                }
            }
            if(listitem == 2)
            {
                // if(PlayerInfo[playerid][pAdmin] >= 1)
                if(IsPlayerAdmin(playerid))
                {
                 ShowPlayerDialog(playerid, DialogInputEx, DIALOG_STYLE_INPUT, "Votaзгo - By Lucky", str, "Ok", "Cancelar");
                                            new str1[128];
                 format(str1, sizeof(str), "Digite aqui o que vocк gostaria \n De perguntar para os outros players.", playerid);
//               if(!strlen(inputtext[9]))
                                           new string1[128];
//               format(string, sizeof string, "==> Nova Votaзгo: %s?", inputtext[6]);
                }
            }
            if(listitem == 3)
            {
                 // if(PlayerInfo[playerid][pAdmin] >= 1)
                 if(IsPlayerAdmin(playerid))
                {
                    if(votacao[iniciada])
                    {
                        new string2[512];
                        SendClientMessageToAll(LARANJA,"====================================");
                        SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
                        format(string, sizeof string2, "> %d jogador(es) votaram em << SIM >>.", votacao[sim]);
                        SendClientMessageToAll(VERDEMEDIO,string);
                        format(string, sizeof string2, "> %d jogador(es) votaram em << NГO >>.", votacao[nao]);
                        SendClientMessageToAll(VERDEMEDIO, string);
                        format(string, sizeof string2, "> Esta votaзгo teve %d votos!",votacao[total]);
                        SendClientMessageToAll(BRANCO, string2);
                        if(votacao[sim] == votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
                        }
                        if(votacao[sim] > votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria Votou =<SIM>= <==.");
                        }
                        if(votacao[sim] < votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria Votou =<NГO>= <==");
                        }
                        SendClientMessageToAll(LARANJA,"====================================");
                        GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
                        SendClientMessageToAll(VERDEMEDIO, "Votaзгo Encerrada!");
                        votacao[iniciada] = false;
                        votacao[sim] = 0;
                        votacao[nao] = 0;
                        votacao[total] = 0;
                        for(new i; i <MAX_PLAYERS; i++)
                        {
                            votou[i] = false;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid,BRANCO, "Nenhuma votaзгo foi criada!");
                    }
                }
                else
                {
                    SendClientMessage(playerid,BRANCO, "Vocк nгo tem permissгo para usar este comando!");
                }
                return 1;
            }
        }
    }
    if(dialogid == DialogInputEx)
    {
      if(response)//Caso ele clique no primeiro botгo
        {
         if(!votacao[iniciada])
          {
                new stringa[128];
                if(!strlen(inputtext[9]))
                SendClientMessageToAll(LARANJA,"====================================");
                format(string, sizeof stringa, "==> Pergunta: %s ?", inputtext[6]);
                SendClientMessageToAll(VERDECLARO, stringa);
                SendClientMessageToAll(LARANJA,"Para votar:");
                SendClientMessageToAll(VERDEMEDIO, "Digite /votar e escolha uma das opзхes Sim e Nгo");
                SendClientMessageToAll(LARANJA,"====================================");
                                votacao[iniciada] = true;
                                votacao[sim] = 0;
                                votacao[nao] = 0;
                                GameTextForAll("~w~Nova ~r~votacao~w~ foi~b~ iniciada!",6000,3);
                                for(new i; i <MAX_PLAYERS; i++)
                                {

                                        votou[i] = false;
                                }
         }
                        else {
                               SendClientMessage(playerid,BRANCO,"Ja existe uma votaзгo em andamento!");
                              }
       }
   }
    return 1;
}
Tenta assim ^^
Reply


Messages In This Thread
[Ajuda] Comando funcionando errado - by Lucky ® - 17.11.2010, 13:49
Re: [Ajuda] Comando funcionando errado - by rjjj - 17.11.2010, 16:33
Re: [Ajuda] Comando funcionando errado - by Lucky ® - 17.11.2010, 20:46
Re: [Ajuda] Comando funcionando errado - by roginho_97 - 17.11.2010, 22:38
Re: [Ajuda] Comando funcionando errado - by Lucky ® - 17.11.2010, 22:51
Re: [Ajuda] Comando funcionando errado - by roginho_97 - 17.11.2010, 22:53
Re: [Ajuda] Comando funcionando errado - by Lucky ® - 17.11.2010, 23:04
Re: [Ajuda] Comando funcionando errado - by roginho_97 - 17.11.2010, 23:16
Re: [Ajuda] Comando funcionando errado - by Lucky ® - 17.11.2010, 23:18
Re: [Ajuda] Comando funcionando errado - by roginho_97 - 17.11.2010, 23:52

Forum Jump:


Users browsing this thread: 1 Guest(s)