SA-MP Forums Archive
[AJUDA]Erro no Sistema de Votaзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA]Erro no Sistema de Votaзгo (/showthread.php?tid=190577)



[AJUDA]Erro no Sistema de Votaзгo - Lucky ® - 15.11.2010

Bom eu peguei um sistema de votaзгo por cmd e coloquei no dialog

ai ta dando uns erros...

FS: http://pastebin.com/AsKxzwbp

Erro:
Код:
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(62) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(62) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(72) : warning 225: unreachable code
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(72) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(72) : error 004: function "OnDialogResponse" is not implemented
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(74) : error 017: undefined symbol "response"
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(76) : error 017: undefined symbol "dialogid"
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(78) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(89) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(100) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\Votar em dialog by lucky.pwn(146) : error 030: compound statement not closed at the end of file (started at line 30)


10 Errors.



Re: [AJUDA]Erro no Sistema de Votaзгo - [Ips]Guh - 15.11.2010

Tenta assim,ve se da ae ( Nao testei ) =
Код:
#include <a_samp>
//----
#define LARANJA 			0xFF6600AA
#define VERDECLARO 			0x00FF0CAA
#define VERDEMEDIO          0xa5b1A3AA
#define BRANCO              0xFFFFFFAA
#define VERMELHO            0xFF0000AA
#define VERDEFRACO        	0x80cf80AA
//----

#define NUTZ1 1

#pragma tabsize 0

//----

enum e_votacao
{
	bool:iniciada,
	sim,
	nao,
	total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];

//----
public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	if(!strcmp(cmdtext, "/votacao", true,5))
	{
		if(IsPlayerAdmin(playerid))
		{
		    if(!votacao[iniciada])
		    {
   		 		if(!strlen(cmdtext[6]))
		        	return SendClientMessage(playerid,0xFFFFFFAA, "Use: /votacao [texto]");
				SendClientMessageToAll(LARANJA,"====================================");
				format(string, sizeof string, "==> Nova Votaзгo: %s?", cmdtext[6]);
				SendClientMessageToAll(VERDECLARO, string);
				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!");
			}
		} else {
			SendClientMessage(playerid,BRANCO,"Vocк nгo tem permissгo para usar este comando!");
		}
		return 1;
	}
    if (strcmp("/votar", cmdtext, true) == 0)
    {
		ShowPlayerDialog(playerid, NUTZ1, DIALOG_STYLE_LIST, "Votaзгo - By Lucky", "Sim \nNгo \nEncerrar Votaзгo", "Selecionar", "Sair");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        if(dialogid == NUTZ1) // GPS Dialog
        {
        if(listitem == 0) // Sim
        {
		if(votacao[iniciada] && !votou[playerid])
		{
			SendClientMessage(playerid,LARANJA, "Seu voto foi enviado com sucesso!");
			votacao[sim]++;
			votacao[total]++;
			votou[playerid] = true;
			return 1;
		}
		}
            else if(listitem == 1) // Nгo
            {
        if(votacao[iniciada] && !votou[playerid])
		{
			SendClientMessage(playerid,LARANJA, "Seu voto foi enviado com sucesso!");
			votacao[nao]++;
			votacao[total]++;
			votou[playerid] = true;
			return 1;
		}
            }
            else if(listitem == 2) // Encerrar Votaзгo
            {
             if(IsPlayerAdmin(playerid))
		{
			if(votacao[iniciada])
			{
			    SendClientMessageToAll(LARANJA,"====================================");
				SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
				format(string, sizeof string, "> %d jogador(es) concordaram com a pergunta.", votacao[sim]);
				SendClientMessageToAll(VERDEMEDIO,string);
				format(string, sizeof string, "> %d jogador(es) discordaram com a pergunta.", votacao[nao]);
				SendClientMessageToAll(VERDEMEDIO, string);
				format(string, sizeof string, "> Esta votaзгo teve %d votos!",votacao[total]);
				SendClientMessageToAll(BRANCO, string);
				if(votacao[sim] == votacao[nao])
				{
					SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
				} else if(votacao[sim] > votacao[nao])
				{
					SendClientMessageToAll(VERMELHO, "==> A maioria CONCORDA com a pergunta.");
				} else if(votacao[sim] < votacao[nao])
				{
					SendClientMessageToAll(VERMELHO, "==> A maioria DISCORDA com a pergunta.");
				}
				SendClientMessageToAll(LARANJA,"====================================");
				GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
				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;
    }
    return 1;
}



Re: [AJUDA]Erro no Sistema de Votaзгo - TiagoPS - 15.11.2010

LOOOOOL Tinha 2 OnPlayerCommandText, с tava definida string e desdentado indentei sem pragma tabsize
ta ai impecavel

pawn Код:
#include <a_samp>
//----
#define LARANJA             0xFF6600AA
#define VERDECLARO          0x00FF0CAA
#define VERDEMEDIO          0xa5b1A3AA
#define BRANCO              0xFFFFFFAA
#define VERMELHO            0xFF0000AA
#define VERDEFRACO          0x80cf80AA
#define NUTZ1 1

enum e_votacao
{
    bool:iniciada,
    sim,
    nao,
    total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];

//----
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    if(!strcmp(cmdtext, "/votacao", true,5))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!votacao[iniciada])
            {
                if(!strlen(cmdtext[6]))
                return SendClientMessage(playerid,0xFFFFFFAA, "Use: /votacao [texto]");
                SendClientMessageToAll(LARANJA,"====================================");
                format(string, sizeof string, "==> Nova Votaзгo: %s?", cmdtext[6]);
                SendClientMessageToAll(VERDECLARO, string);
                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!");
            }
        }
        else
        {
            SendClientMessage(playerid,BRANCO,"Vocк nгo tem permissгo para usar este comando!");
        }
        return 1;
    }
    if (strcmp("/votar", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, NUTZ1, DIALOG_STYLE_LIST, "Votaзгo - By Lucky", "Sim \nNгo \nEncerrar Votaзгo", "Selecionar", "Sair");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(dialogid == NUTZ1)
    {
        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;
                }
            }
            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;
                }
            }
            if(listitem == 2)
            {
                if(IsPlayerAdmin(playerid))
                {
                    if(votacao[iniciada])
                    {
                        SendClientMessageToAll(LARANJA,"====================================");
                        SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
                        format(string, sizeof string, "> %d jogador(es) concordaram com a pergunta.", votacao[sim]);
                        SendClientMessageToAll(VERDEMEDIO,string);
                        format(string, sizeof string, "> %d jogador(es) discordaram com a pergunta.", votacao[nao]);
                        SendClientMessageToAll(VERDEMEDIO, string);
                        format(string, sizeof string, "> Esta votaзгo teve %d votos!",votacao[total]);
                        SendClientMessageToAll(BRANCO, string);
                        if(votacao[sim] == votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
                        }
                        if(votacao[sim] > votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria CONCORDA com a pergunta.");
                        }
                        if(votacao[sim] < votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria DISCORDA com a pergunta.");
                        }
                        SendClientMessageToAll(LARANJA,"====================================");
                        GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
                        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;
            }
        }
    }
    return 1;
}



Re: [AJUDA]Erro no Sistema de Votaзгo - [Ips]Guh - 15.11.2010

Quote:
Originally Posted by TiagoPS
Посмотреть сообщение
LOOOOOL Tinha 2 OnPlayerCommandText, с tava definida string e desdentado indentei sem pragma tabsize
ta ai impecavel

pawn Код:
#include <a_samp>
//----
#define LARANJA             0xFF6600AA
#define VERDECLARO          0x00FF0CAA
#define VERDEMEDIO          0xa5b1A3AA
#define BRANCO              0xFFFFFFAA
#define VERMELHO            0xFF0000AA
#define VERDEFRACO          0x80cf80AA
#define NUTZ1 1

enum e_votacao
{
    bool:iniciada,
    sim,
    nao,
    total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];

//----
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    if(!strcmp(cmdtext, "/votacao", true,5))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!votacao[iniciada])
            {
                if(!strlen(cmdtext[6]))
                return SendClientMessage(playerid,0xFFFFFFAA, "Use: /votacao [texto]");
                SendClientMessageToAll(LARANJA,"====================================");
                format(string, sizeof string, "==> Nova Votaзгo: %s?", cmdtext[6]);
                SendClientMessageToAll(VERDECLARO, string);
                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!");
            }
        }
        else
        {
            SendClientMessage(playerid,BRANCO,"Vocк nгo tem permissгo para usar este comando!");
        }
        return 1;
    }
    if (strcmp("/votar", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, NUTZ1, DIALOG_STYLE_LIST, "Votaзгo - By Lucky", "Sim \nNгo \nEncerrar Votaзгo", "Selecionar", "Sair");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(dialogid == NUTZ1)
    {
        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;
                }
            }
            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;
                }
            }
            if(listitem == 2)
            {
                if(IsPlayerAdmin(playerid))
                {
                    if(votacao[iniciada])
                    {
                        SendClientMessageToAll(LARANJA,"====================================");
                        SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
                        format(string, sizeof string, "> %d jogador(es) concordaram com a pergunta.", votacao[sim]);
                        SendClientMessageToAll(VERDEMEDIO,string);
                        format(string, sizeof string, "> %d jogador(es) discordaram com a pergunta.", votacao[nao]);
                        SendClientMessageToAll(VERDEMEDIO, string);
                        format(string, sizeof string, "> Esta votaзгo teve %d votos!",votacao[total]);
                        SendClientMessageToAll(BRANCO, string);
                        if(votacao[sim] == votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
                        }
                        if(votacao[sim] > votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria CONCORDA com a pergunta.");
                        }
                        if(votacao[sim] < votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria DISCORDA com a pergunta.");
                        }
                        SendClientMessageToAll(LARANJA,"====================================");
                        GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
                        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;
            }
        }
    }
    return 1;
}
Foi oq percebi Tbm... Dos Dois onplayercommandtext.


Re: [AJUDA]Erro no Sistema de Votaзгo - Lucky ® - 15.11.2010

pra dar /votar ele precisa ser admin :O

pra dar /votar tem que ser qual quer um... sу pra escolher a opзгo "encerrar votacao" tem que ser admin

teria como arrumar isso para mim?


Re: [AJUDA]Erro no Sistema de Votaзгo - TiagoPS - 15.11.2010

TEnta
pawn Код:
#include <a_samp>
//----
#define LARANJA             0xFF6600AA
#define VERDECLARO          0x00FF0CAA
#define VERDEMEDIO          0xa5b1A3AA
#define BRANCO              0xFFFFFFAA
#define VERMELHO            0xFF0000AA
#define VERDEFRACO          0x80cf80AA
#define NUTZ1 1

enum e_votacao
{
    bool:iniciada,
    sim,
    nao,
    total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];

//----
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    if(strcmp(cmdtext, "/votacao", true,5))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!votacao[iniciada])
            {
                if(!strlen(cmdtext[6]))
                return SendClientMessage(playerid,0xFFFFFFAA, "Use: /votacao [texto]");
                SendClientMessageToAll(LARANJA,"====================================");
                format(string, sizeof string, "==> Nova Votaзгo: %s?", cmdtext[6]);
                SendClientMessageToAll(VERDECLARO, string);
                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!");
            }
        }
        else
        {
            SendClientMessage(playerid,BRANCO,"Vocк nгo tem permissгo para usar este comando!");
        }
        return 1;
    }
    if(strcmp("/votar", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, NUTZ1, DIALOG_STYLE_LIST, "Votaзгo - By Lucky", "Sim \nNгo \nEncerrar Votaзгo", "Selecionar", "Sair");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(dialogid == NUTZ1)
    {
        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;
                }
            }
            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;
                }
            }
            if(listitem == 2)
            {
                if(IsPlayerAdmin(playerid))
                {
                    if(votacao[iniciada])
                    {
                        SendClientMessageToAll(LARANJA,"====================================");
                        SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
                        format(string, sizeof string, "> %d jogador(es) concordaram com a pergunta.", votacao[sim]);
                        SendClientMessageToAll(VERDEMEDIO,string);
                        format(string, sizeof string, "> %d jogador(es) discordaram com a pergunta.", votacao[nao]);
                        SendClientMessageToAll(VERDEMEDIO, string);
                        format(string, sizeof string, "> Esta votaзгo teve %d votos!",votacao[total]);
                        SendClientMessageToAll(BRANCO, string);
                        if(votacao[sim] == votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
                        }
                        if(votacao[sim] > votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria CONCORDA com a pergunta.");
                        }
                        if(votacao[sim] < votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria DISCORDA com a pergunta.");
                        }
                        SendClientMessageToAll(LARANJA,"====================================");
                        GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
                        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;
            }
        }
    }
    return 1;
}



Re: [AJUDA]Erro no Sistema de Votaзгo - Lucky ® - 15.11.2010

se eu do /votar com uma votaзгo ele diss "ja tem uma votaзгo em andamento"


Re: [AJUDA]Erro no Sistema de Votaзгo - TiagoPS - 15.11.2010

LOL jб complico minhas cucas, espere por outra alma boa ajudar, nгo to conseguindo decifrar oque pode ser, й que eu to com sono, sу vo assistir CQC i vo i durmi flw


Re: [AJUDA]Erro no Sistema de Votaзгo - [Ips]Guh - 15.11.2010

Tenta assim,agora acho q ta certo,tenta ae neh :
Код:
#include <a_samp>
//----
#define LARANJA             0xFF6600AA
#define VERDECLARO          0x00FF0CAA
#define VERDEMEDIO          0xa5b1A3AA
#define BRANCO              0xFFFFFFAA
#define VERMELHO            0xFF0000AA
#define VERDEFRACO          0x80cf80AA
#define NUTZ1 1

enum e_votacao
{
    bool:iniciada,
    sim,
    nao,
    total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];

//----
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    if(strcmp(cmdtext, "/votacao", true,5))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!votacao[iniciada])
            {
                if(!strlen(cmdtext[6]))
                return SendClientMessage(playerid,0xFFFFFFAA, "Use: /votacao [texto]");
                SendClientMessageToAll(LARANJA,"====================================");
                format(string, sizeof string, "==> Nova Votaзгo: %s?", cmdtext[6]);
                SendClientMessageToAll(VERDECLARO, string);
                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,"Vocк nгo tem permissгo para usar este comando!");
        }
        else
       {
                SendClientMessage(playerid,BRANCO,"Ja existe uma votaзгo em andamento!");
            }
        return 1;
    }
    if(strcmp("/votar", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, NUTZ1, DIALOG_STYLE_LIST, "Votaзгo - By Lucky", "Sim \nNгo \nEncerrar Votaзгo", "Selecionar", "Sair");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(dialogid == NUTZ1)
    {
        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;
                }
            }
            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;
                }
            }
            if(listitem == 2)
            {
                if(IsPlayerAdmin(playerid))
                {
                    if(votacao[iniciada])
                    {
                        SendClientMessageToAll(LARANJA,"====================================");
                        SendClientMessageToAll(LARANJA, "==> Votacгo encerrada! <<==");
                        format(string, sizeof string, "> %d jogador(es) concordaram com a pergunta.", votacao[sim]);
                        SendClientMessageToAll(VERDEMEDIO,string);
                        format(string, sizeof string, "> %d jogador(es) discordaram com a pergunta.", votacao[nao]);
                        SendClientMessageToAll(VERDEMEDIO, string);
                        format(string, sizeof string, "> Esta votaзгo teve %d votos!",votacao[total]);
                        SendClientMessageToAll(BRANCO, string);
                        if(votacao[sim] == votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> Houve um empate!");
                        }
                        if(votacao[sim] > votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria CONCORDA com a pergunta.");
                        }
                        if(votacao[sim] < votacao[nao])
                        {
                            SendClientMessageToAll(VERMELHO, "==> A maioria DISCORDA com a pergunta.");
                        }
                        SendClientMessageToAll(LARANJA,"====================================");
                        GameTextForAll("~r~Votacao~w~ foi~r~ encerrada!",6000,3);
                        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;
            }
        }
    }
    return 1;
}



Re: [AJUDA]Erro no Sistema de Votaзгo - Lucky ® - 16.11.2010

badio, deu esses erros dai:


C:\Users\User\Desktop\asd.pwn(52) : warning 217: loose indentation
C:\Users\User\Desktop\asd.pwn(52) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\asd.pwn(53) : warning 217: loose indentation
C:\Users\User\Desktop\asd.pwn(56) : warning 217: loose indentation
C:\Users\User\Desktop\asd.pwn(5 : warning 217: loose indentation
C:\Users\User\Desktop\asd.pwn(66) : warning 217: loose indentation
C:\Users\User\Desktop\asd.pwn(66) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\asd.pwn(66) : error 004: function "OnDialogResponse" is not implemented
C:\Users\User\Desktop\asd.pwn(6 : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\asd.pwn(69) : error 017: undefined symbol "dialogid"
C:\Users\User\Desktop\asd.pwn(71) : error 017: undefined symbol "response"
C:\Users\User\Desktop\asd.pwn(73) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\asd.pwn(84) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\asd.pwn(95) : error 017: undefined symbol "listitem"
C:\Users\User\Desktop\asd.pwn(147) : error 030: compound statement not closed at the end of file (started at line 24)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.



Gente ta dando alguma coisa errada ali nos comandos, nгo tem nem uma mensagem que apareзa quando escreve /votar... e mesmo assim ta aparecendo quando escrevo /votar

Tem ke mostrar o dialog e ele ta mostrando as msm mensagem do comando /votar