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.
#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;
}

#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;
}
|
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;
}
#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;
}
: warning 217: loose indentation
: warning 219: local variable "string" shadows a variable at a preceding level