Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- //A Szavazórendszert magyarította: GoldTec
- #include <a_samp>
- #include <IsPlayerLAdmin>
- #define LARANJA 0xFF6600AA
- #define VERDECLARO 0x00FF0CAA
- #define VERDEMEDIO 0xa5b1A3AA
- #define BRANCO 0xFFFFFFAA
- #define VERMELHO 0xFF0000AA
- #define VERDEFRACO 0x80cf80AA
- #define COLOR_ULTRARED 0xFF0606FF
- #define COLOR_GREEN 0x33AA33AA
- enum e_votacao
- {
- bool:iniciada,
- sim,
- nao,
- total
- }
- new votacao[e_votacao];
- new votou[MAX_PLAYERS];
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[256];
- if(!strcmp(cmdtext, "/vote", true,5))
- {
- if (IsPlayerAdminLevel(playerid, 5))
- {
- if(!votacao[iniciada])
- {
- if(!strlen(cmdtext[6]))
- return SendClientMessage(playerid,COLOR_ULTRARED, "Használat: /vote [kérdés]");
- SendClientMessageToAll(LARANJA,"====================================");
- format(string, sizeof string, "==> Új kérdés: %s?", cmdtext[6]);
- SendClientMessageToAll(VERDECLARO, string);
- SendClientMessageToAll(LARANJA," ");
- SendClientMessageToAll(LARANJA," > A szavazáshoz írd be::");
- SendClientMessageToAll(VERDEMEDIO, "> /igen - Hogy igennel szavazz.");
- SendClientMessageToAll(VERDEMEDIO, "> /nem - Hogy nemmel szavazz.");
- SendClientMessageToAll(LARANJA,"====================================");
- votacao[iniciada] = true;
- votacao[sim] = 0;
- votacao[nao] = 0;
- GameTextForAll("~r~Szavazas~w~~b~ letrehozva!",6000,3);
- for(new i; i <MAX_PLAYERS; i++)
- {
- votou[i] = false;
- }
- } else {
- SendClientMessage(playerid,COLOR_ULTRARED,"Egy szavazás már el van indítva!");
- }
- } else {
- SendClientMessage(playerid,COLOR_ULTRARED,"Nincs elég magas szinted a parancs használatához!");
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/igen", true))
- {
- if(votacao[iniciada] && !votou[playerid])
- {
- SendClientMessage(playerid,LARANJA, "Sikeresen szavaztál az igenre!");
- votacao[sim]++;
- votacao[total]++;
- votou[playerid] = true;
- return 1;
- }
- return 0;
- }
- if(!strcmp(cmdtext, "/nem", true))
- {
- if(votacao[iniciada] && !votou[playerid])
- {
- SendClientMessage(playerid,LARANJA, "Sikeresen szavaztál a nemre!");
- votacao[nao]++;
- votacao[total]++;
- votou[playerid] = true;
- return 1;
- }
- return 0;
- }
- if(!strcmp(cmdtext, "/end", true))
- {
- if (IsPlayerAdminLevel(playerid, 5))
- {
- if(votacao[iniciada])
- {
- SendClientMessageToAll(LARANJA,"====================================");
- SendClientMessageToAll(LARANJA, "==> Eredmény: <<==");
- format(string, sizeof string, "> %d Játékos igennel szavazott.", votacao[sim]);
- SendClientMessageToAll(VERDEMEDIO,string);
- format(string, sizeof string, "> %d Játékos nemmel szavazott.", votacao[nao]);
- SendClientMessageToAll(VERDEMEDIO, string);
- format(string, sizeof string, "> Ennyi szavazat érkezett: %d",votacao[total]);
- SendClientMessageToAll(BRANCO, string);
- if(votacao[sim] == votacao[nao])
- {
- SendClientMessageToAll(COLOR_GREEN, "==> Döntetlen lett!");
- } else if(votacao[sim] > votacao[nao])
- {
- SendClientMessageToAll(COLOR_GREEN, "==> A legtöbb ember igennel szavazott.");
- } else if(votacao[sim] < votacao[nao])
- {
- SendClientMessageToAll(COLOR_GREEN, "==> A legtöbb ember nemmel szavazott.");
- }
- SendClientMessageToAll(LARANJA,"====================================");
- GameTextForAll("~r~A szavazasnak~w~ ~r~ ~b~vege!",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, "Nem érkezett szavazás a kérdésre!");
- }
- } else {
- SendClientMessage(playerid,COLOR_ULTRARED, "Nincs elég magas szinted a parancs használatához!");
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment