- 0
Problema Vote System
-
Similar Content
-
fish system
By vividsec,
- 1 reply
- 487 views
-
- 7 replies
- 2,386 views
-
- 12 replies
- 950 views
-
heist system
By DanielSy,
- 10 replies
- 664 views
-
- 0 replies
- 278 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
d@rK
Am un FS Vote System, dar cand dau /vote "Cine e cel mai tare?" (exemplu...) pur si simplu Nu Apare Votul... Imi puteti spune ce este gresit? Multumesc.
Pawno(FS):
[pawn]#include <a_samp>
//==============================================================================
#define LARANJA 0xFF6600AA
#define VERDECLARO 0x00FF0CAA
#define VERDEMEDIO 0xa5b1A3AA
#define BRANCO 0xFFFFFFAA
#define VERMELHO 0xFF0000AA
#define VERDEFRACO 0x80cf80AA
//==============================================================================
enum e_votacao
{
bool:iniciada,
sim,
nao,
total
}
new votacao[e_votacao];
new votou[MAX_PLAYERS];
//==============================================================================
public OnFilterScriptInit()
{
print("===================================");
print("==>> Filter Script of Vote! <<==");
print("==>> Created by Me <<==");
print("==>> Version RO 0.1 BETA <<==");
print("===================================");
return 1;
}
//==============================================================================
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
if(!strcmp(cmdtext, "/vot", true,5))
{
if (!IsPlayerAdmin(playerid))
{
if(!votacao[iniciada])
{
if(!strlen(cmdtext[6]))
return SendClientMessage(playerid,0xFFFFFFAA, "Usage: /vot [intrebare]");
SendClientMessageToAll(LARANJA,"====================================");
format(string, sizeof string, "==> New Vote: %s?", cmdtext[6]);
SendClientMessageToAll(VERDECLARO, string);
SendClientMessageToAll(LARANJA," ");
SendClientMessageToAll(LARANJA," > Pentru a vota foloseste:");
SendClientMessageToAll(VERDEMEDIO, "> /da - Daca esti de acord.");
SendClientMessageToAll(VERDEMEDIO, "> /nu - Daca nu esti de acord.");
SendClientMessageToAll(LARANJA,"====================================");
votacao[iniciada] = true;
votacao[sim] = 0;
votacao[nao] = 0;
GameTextForAll("~w~Noul ~r~vot~w~ a fost~b~ creat!",6000,3);
for(new i; i <MAX_PLAYERS; i++)
{
votou = false;
}
}
else
{
SendClientMessage(playerid,BRANCO,"Este deja un vot in desfasurare!");
}
}
else
{
SendClientMessage(playerid,BRANCO,"Nu ai acces la aceasta comanda!");
}
return 1;
}
if(!strcmp(cmdtext, "/da", true))
{
if(votacao[iniciada] && !votou[playerid])
{
SendClientMessage(playerid,LARANJA, "Votul tau a fost inregistrat! [DA]");
votacao[sim]++;
votacao[total]++;
votou[playerid] = true;
return 1;
}
return 0;
}
if(!strcmp(cmdtext, "/nu", true))
{
if(votacao[iniciada] && !votou[playerid])
{
SendClientMessage(playerid,LARANJA, "Votul tau a fost inregistrat! [NU]");
votacao[nao]++;
votacao[total]++;
votou[playerid] = true;
return 1;
}
return 0;
}
if(!strcmp(cmdtext, "/end", true))
{
if (IsPlayerAdmin(playerid))
{
if(votacao[iniciada])
{
SendClientMessageToAll(LARANJA,"====================================");
SendClientMessageToAll(LARANJA, "==> Vot inchis! <<==");
format(string, sizeof string, "> %d jucatori au fost de acord.", votacao[sim]);
SendClientMessageToAll(VERDEMEDIO,string);
format(string, sizeof string, "> %d jucatori nu au fost de acord.", votacao[nao]);
SendClientMessageToAll(VERDEMEDIO, string);
format(string, sizeof string, "> Aces vot a adunat %d de voturi.",votacao[total]);
SendClientMessageToAll(BRANCO, string);
if(votacao[sim] == votacao[nao])
{
SendClientMessageToAll(VERMELHO, "==> A fost egalitate!");
} else if(votacao[sim] > votacao[nao])
{
SendClientMessageToAll(VERMELHO, "==> Cei mai multi au fost de acord. [NU]");
} else if(votacao[sim] < votacao[nao])
{
SendClientMessageToAll(VERMELHO, "==> Cei mai multi nu au fost de acord. [DA]");
}
SendClientMessageToAll(LARANJA,"====================================");
GameTextForAll("~r~A Votul~w~ s-a~r~ ~b~terminat!",6000,3);
votacao[iniciada] = false;
votacao[sim] = 0;
votacao[nao] = 0;
votacao[total] = 0;
for(new i; i <MAX_PLAYERS; i++)
{
votou = false;
}
}
else
{
SendClientMessage(playerid,BRANCO, "Nici un vot nu a fost pornit!");
}
}
else
{
SendClientMessage(playerid,BRANCO, "Nu ai acces la aceasta comanda!");
}
return 1;
}
return 0;
}[/pawn]
Link to comment
Share on other sites
17 answers to this question
Recommended Posts