14.05.2011, 12:05
O meu sistema de votaзгo quando eu digito /votacao ele fala:SERVER:Unknown Command!
Obrigado...
Код:
if(!strcmp(cmdtext, "/votacao", true, 8))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(!votacao[iniciada])
{
if(!cmdtext[9])
{
SendClientMessage(playerid, COLOR_GRAD2, "Use: /votacao [pergunta]");
return 1;
}
format(string, sizeof string, "==> Votaзгo: %s ?", cmdtext[9]);
SendClientMessageToAll(0xFFFFFFAA, string);
SendClientMessageToAll(0xFFF000AA, "> Se vocк concorda digite: /sim");
SendClientMessageToAll(0xFFF000AA, "> Se vocк discorda digite: /nao");
votacao[iniciada] = true;
votacao[sim] = 0;
votacao[nao] = 0;
for(new i; i < MAX_PLAYERS; i++)
{ votou[i] = false; }
} else {
SendClientMessage(playerid, COLOR_GREY,"Jб existe uma votaзгo em andamento!");
}
} else {
SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem permissгo para usar este comando!");
}
return 1;
}
if(!strcmp(cmdtext, "/sim", true))
{
if(votacao[iniciada] && !votou[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "Seu voto foi computado com sucesso!");
votacao[sim]++;
votou[playerid] = true;
return 1;
}
return 0;
}
if(!strcmp(cmdtext, "/nao", true))
{
if(votacao[iniciada] && !votou[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "Seu voto foi computado com sucesso!");
votacao[nao]++;
votou[playerid] = true;
return 1;
}
return 0;
}
if(!strcmp(cmdtext, "/encerrar", true))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(votacao[iniciada])
{
SendClientMessageToAll(0xFFFFFFAA, "==> Votaзгo encerrada!");
format(string, sizeof string, "> %d pessoas responderam sim;", votacao[sim]);
SendClientMessageToAll(0xFFF000AA,string);
format(string, sizeof string, "> %d pessoas responderam nгo;", votacao[nao]);
SendClientMessageToAll(0xFFF000AA, string);
if(votacao[sim] == votacao[nao])
{
SendClientMessageToAll(0xFF0000AA, "==> Houve um empate!");
} else if(votacao[sim] > votacao[nao])
{
SendClientMessageToAll(0xFF0000AA, "==> A maioria CONCORDA com a pergunta.");
} else if(votacao[sim] < votacao[nao])
{
SendClientMessageToAll(0xFF0000AA, "==> A maioria DISCORDA da pergunta.");
}
votacao[iniciada] = false;
votacao[sim] = 0;
votacao[nao] = 0;
for(new i; i < MAX_PLAYERS; i++)
votou[i] = false;
} else {
SendClientMessage(playerid, 0xFFFFFFAA, "Nenhuma votaзгo criada!");
}
} else {
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo tem permissгo para usar este comando!");
}
return 1;
}

