Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <ocmd>
- #include <sscanf2>
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- #define MSGBOX DIALOG_STYLE_MSGBOX
- new votetimer;
- new glasanje;
- new glasanjeyes;
- new glasanjeno;
- new beingglasanje;
- new glasanjerecently[MAX_PLAYERS];
- new Text:Textdraw0;
- new Text:Textdraw1;
- new Text:Textdraw2;
- new Text:Textdraw3;
- new Text:Textdraw4;
- new Text:Textdraw5;
- new Text:Textdraw6;
- new Text:Textdraw7;
- new Text:Textdraw8;
- #define SVETLOPLAVA 0x33CCFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define SIVA "{C0C0C0}"
- #define BELA "{FFFFFF}"
- public OnFilterScriptInit()
- {
- print("Glasanje FS by Harexe 1.0");
- glasanje = 0;
- beingglasanje = 255;
- glasanjeyes = 0;
- glasanjeno = 0;
- beingglasanje = 255;
- Textdraw0 = TextDrawCreate(397.625000, 1.500000, "usebox");
- TextDrawLetterSize(Textdraw0, 0.000000, 7.655555);
- TextDrawTextSize(Textdraw0, 200.500000, 0.000000);
- TextDrawAlignment(Textdraw0, 1);
- TextDrawColor(Textdraw0, 0);
- TextDrawUseBox(Textdraw0, true);
- TextDrawBoxColor(Textdraw0, 102);
- TextDrawSetShadow(Textdraw0, 0);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawFont(Textdraw0, 0);
- Textdraw1 = TextDrawCreate(203.750000, 0.000000, "LD_SPAC:white");
- TextDrawLetterSize(Textdraw1, 0.000000, 0.000000);
- TextDrawTextSize(Textdraw1, -1.250000, 73.500000);
- TextDrawAlignment(Textdraw1, 1);
- TextDrawColor(Textdraw1, -16776961);
- TextDrawSetShadow(Textdraw1, 0);
- TextDrawSetOutline(Textdraw1, 0);
- TextDrawFont(Textdraw1, 4);
- Textdraw2 = TextDrawCreate(395.000000, 74.083328, "LD_SPAC:white");
- TextDrawLetterSize(Textdraw2, 0.000000, 0.000000);
- TextDrawTextSize(Textdraw2, -192.500000, -1.166657);
- TextDrawAlignment(Textdraw2, 1);
- TextDrawColor(Textdraw2, -16776961);
- TextDrawSetShadow(Textdraw2, 0);
- TextDrawSetOutline(Textdraw2, 0);
- TextDrawFont(Textdraw2, 4);
- Textdraw3 = TextDrawCreate(394.375000, 0.000000, "LD_SPAC:white");
- TextDrawLetterSize(Textdraw3, 0.000000, 0.000000);
- TextDrawTextSize(Textdraw3, 1.250000, 74.083328);
- TextDrawAlignment(Textdraw3, 1);
- TextDrawColor(Textdraw3, -16776961);
- TextDrawSetShadow(Textdraw3, 0);
- TextDrawSetOutline(Textdraw3, 0);
- TextDrawFont(Textdraw3, 4);
- Textdraw4 = TextDrawCreate(224.375000, 0.583338, "] Glasanje ]");
- TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
- TextDrawAlignment(Textdraw4, 1);
- TextDrawColor(Textdraw4, -1);
- TextDrawSetShadow(Textdraw4, 0);
- TextDrawSetOutline(Textdraw4, 1);
- TextDrawBackgroundColor(Textdraw4, 51);
- TextDrawFont(Textdraw4, 2);
- TextDrawSetProportional(Textdraw4, 1);
- Textdraw5 = TextDrawCreate(204.375000, 23.333328, "Bakar Bakar Bakar Bakar Bakar Bakar Bakar Bakar Bakar Bakar Bakar");
- TextDrawLetterSize(Textdraw5, 0.178749, 1.063333);
- TextDrawTextSize(Textdraw5, 397.500000, -91.583381);
- TextDrawAlignment(Textdraw5, 1);
- TextDrawColor(Textdraw5, -1);
- TextDrawUseBox(Textdraw5, true);
- TextDrawBoxColor(Textdraw5, 0);
- TextDrawSetShadow(Textdraw5, 0);
- TextDrawSetOutline(Textdraw5, 1);
- TextDrawBackgroundColor(Textdraw5, 51);
- TextDrawFont(Textdraw5, 2);
- TextDrawSetProportional(Textdraw5, 1);
- Textdraw6 = TextDrawCreate(210.000000, 56.000007, "Da");
- TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
- TextDrawAlignment(Textdraw6, 1);
- TextDrawColor(Textdraw6, -1);
- TextDrawSetShadow(Textdraw6, 0);
- TextDrawSetOutline(Textdraw6, 1);
- TextDrawBackgroundColor(Textdraw6, 51);
- TextDrawFont(Textdraw6, 2);
- TextDrawSetProportional(Textdraw6, 1);
- TextDrawSetSelectable(Textdraw6, true);
- Textdraw7 = TextDrawCreate(366.250000, 55.416660, "Ne");
- TextDrawLetterSize(Textdraw7, 0.449999, 1.600000);
- TextDrawAlignment(Textdraw7, 1);
- TextDrawColor(Textdraw7, -1);
- TextDrawSetShadow(Textdraw7, 0);
- TextDrawSetOutline(Textdraw7, 1);
- TextDrawBackgroundColor(Textdraw7, 51);
- TextDrawFont(Textdraw7, 2);
- TextDrawSetProportional(Textdraw7, 1);
- TextDrawSetSelectable(Textdraw7, true);
- Textdraw8 = TextDrawCreate(509.375000, 440.416748, "Glasanje FS by Harexe");
- TextDrawLetterSize(Textdraw8, 0.238749, 0.759999);
- TextDrawAlignment(Textdraw8, 1);
- TextDrawColor(Textdraw8, -1);
- TextDrawSetShadow(Textdraw8, 0);
- TextDrawSetOutline(Textdraw8, 1);
- TextDrawBackgroundColor(Textdraw8, 51);
- TextDrawFont(Textdraw8, 2);
- TextDrawSetProportional(Textdraw8, 1);
- return 1;
- }
- forward KrajGlasanja(playerid);
- public KrajGlasanja(playerid)
- {
- new string[128];
- format(string,sizeof(string),"[Rezultat Glasanja]: Da (%d), Ne (%d)",glasanjeyes,glasanjeno);
- SCMTA(SVETLOPLAVA,string);
- glasanjeno = 0;
- glasanjeyes = 0;
- glasanje = 0;
- TextDrawHideForAll(Textdraw0);
- TextDrawHideForAll(Textdraw1);
- TextDrawHideForAll(Textdraw2);
- TextDrawHideForAll(Textdraw3);
- TextDrawHideForAll(Textdraw4);
- TextDrawHideForAll(Textdraw5);
- TextDrawHideForAll(Textdraw6);
- TextDrawHideForAll(Textdraw7);
- TextDrawHideForAll(Textdraw8);
- for(new i;i < MAX_PLAYERS;i++)
- {
- glasanjerecently[i] = 0;
- i++;
- }
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- ocmd:gh(playerid, params[])
- {{
- new glasanjehelp[2048];
- if(IsPlayerConnected(playerid))
- {
- strcat(glasanjehelp, "{FFFFFF}|----------------------------------------------------------------------[ {0A85FF}Glasanje{FFFFFF} ]--------------------------------------------------------------------|\n\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /glasanjestart - Da pokrenete glasanje.\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /glasanjestop - Da ugasite glasanje.\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{FFFFFF}|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n", sizeof(glasanjehelp));
- ShowPlayerDialog(playerid, 9843, MSGBOX, "{FFFFFF}Glasanje Help", glasanjehelp, "Ok", "Izlaz");
- }
- return 1;
- }}
- ocmd:glasanjestart(playerid, params[],help)
- {
- if(IsPlayerConnected(playerid))
- {
- if(glasanje == 0)
- {
- for(new i;i < MAX_PLAYERS;i++)
- {
- SelectTextDraw(i, 0x00FF00FF);
- i++;
- }
- TextDrawShowForAll(Textdraw0);
- TextDrawShowForAll(Textdraw1);
- TextDrawShowForAll(Textdraw2);
- TextDrawShowForAll(Textdraw3);
- TextDrawShowForAll(Textdraw4);
- TextDrawShowForAll(Textdraw5);
- TextDrawShowForAll(Textdraw6);
- TextDrawShowForAll(Textdraw7);
- TextDrawShowForAll(Textdraw8);
- new rezultat[128],string[256];
- if(sscanf(params,"s[128]",rezultat)) return SCM(playerid,COLOR_GREY,""SIVA"[Glasanje]: "BELA"/glasanjestart [Pitanje]");
- votetimer = SetTimer("KrajGlasanja",300000,false);
- format(string,sizeof(string),"%s?",rezultat);
- TextDrawSetString(Textdraw5, string);
- glasanje = 1;
- }
- else
- {
- SCM(playerid,-1,"Vec je pokrenuto glasanje!");
- }
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == Textdraw6)
- {
- if(glasanje == 1)
- {
- if(glasanjerecently[playerid] == 0)
- {
- new string[128];
- glasanjeyes ++;
- glasanjerecently[playerid] = 1;
- new GivePlayer[MAX_PLAYER_NAME];
- GetPlayerName(beingglasanje, GivePlayer,sizeof(GivePlayer));
- SCM(playerid, SVETLOPLAVA, "Glasali ste za!");
- format(string,sizeof(string),"[Glasanje]: (%s) Da %d -- Ne %d",GivePlayer,glasanjeyes,glasanjeno);
- SCMTA(SVETLOPLAVA,string);
- CancelSelectTextDraw(playerid);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA, "Vec ste glasali!");
- CancelSelectTextDraw(playerid);
- return 1;
- }
- }
- else
- {
- SCM(playerid, SVETLOPLAVA, "Trenutno nema glasanja!");
- return 1;
- }
- }
- if(clickedid == Textdraw7)
- {
- if(glasanjerecently[playerid] == 0)
- {
- if(glasanje == 1)
- {
- new string[128];
- glasanjeno ++;
- glasanjerecently[playerid] = 1;
- new giveplayer2[MAX_PLAYER_NAME];
- GetPlayerName(beingglasanje, giveplayer2,sizeof(giveplayer2));
- SCM(playerid, SVETLOPLAVA, "Glasali ste protiv.");
- format(string,sizeof(string),"[Rezultati]: (%s) Da %d -- Ne %d",giveplayer2,glasanjeyes,glasanjeno);
- SCMTA(SVETLOPLAVA,string);
- CancelSelectTextDraw(playerid);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Trenutno nema glasanja!");
- CancelSelectTextDraw(playerid);
- return 1;
- }
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Vec ste glasali!");
- return 1;
- }
- }
- return 1;
- }
- ocmd:glasanjestop(playerid, params[],help)
- {
- if(glasanje == 1)
- {
- new string[128],sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername,sizeof(sendername));
- glasanjeyes = 0;
- glasanjeno = 0;
- glasanje = 0;
- beingglasanje = 255;
- for(new i;i < MAX_PLAYERS;i++)
- {
- glasanjerecently[i] = 0;
- i++;
- }
- KillTimer(votetimer);
- format(string,sizeof(string),"[Glasanje]: %s je prekinuo glasanje",sendername);
- SCMTA(SVETLOPLAVA,string);
- TextDrawHideForAll(Textdraw0);
- TextDrawHideForAll(Textdraw1);
- TextDrawHideForAll(Textdraw2);
- TextDrawHideForAll(Textdraw3);
- TextDrawHideForAll(Textdraw4);
- TextDrawHideForAll(Textdraw5);
- TextDrawHideForAll(Textdraw6);
- TextDrawHideForAll(Textdraw7);
- TextDrawHideForAll(Textdraw8);
- CancelSelectTextDraw(playerid);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Trenutno nema glasanja!");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement