Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------[FS] Izradio: LiMiX -----------------------//
- //////////////////////////////////////////////////////////////////
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <foreach>
- #include <sscanf2>
- //////////////////////////////////////////////////////////////////
- #define LIMIX:%0(%1) \
- forward%0(%1); \
- public%0(%1)
- #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];
- /////////////////////BOJE/////////////////////////////////////////
- #define SVETLOPLAVA 0x33CCFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define SIVA "{C0C0C0}"
- #define BELA "{FFFFFF}"
- //////////////////////////////////////////////////////////////////
- LIMIX: OnFilterScriptInit()
- {
- glasanje = 0;
- beingglasanje = 255;
- glasanjeyes = 0;
- glasanjeno = 0;
- beingglasanje = 255;
- return 1;
- }
- LIMIX: 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;
- foreach(Player,i)
- {
- glasanjerecently[i] = 0;
- }
- return 1;
- }
- ////////////////////////////////ZCMD////////////////////////////////////////////
- CMD:glasanjehelp(playerid, params[])
- {
- new glasanjehelp[2048];
- if(IsPlayerConnected(playerid))
- {
- strcat(glasanjehelp, "{FFFFFF}|----------------------------------------------------------------------[ {0A85FF}Glasanje{FFFFFF} ]--------------------------------------------------------------------|\n\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /pocniglasanje - Da pokrenete glasanje.\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /ugasiglasanje - Da ugasite glasanje.\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /yes - Da glasate za.\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{0A85FF}- /no - Da glasate protiv.\n\n", sizeof(glasanjehelp));
- strcat(glasanjehelp, "{FFFFFF}|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n", sizeof(glasanjehelp));
- ShowPlayerDialog(playerid, 9843, MSGBOX, "{FFFFFF}Glasanje Help", glasanjehelp, "Ok", "Izlaz");
- }
- return 1;
- }
- CMD:pocniglasanje(playerid, params[],help)
- {
- if(IsPlayerConnected(playerid))
- {
- new rezultat[128],sendername[MAX_PLAYER_NAME],string[256];
- if(sscanf(params,"s[128]",rezultat)) return SCM(playerid,COLOR_GREY,""SIVA"[Glasanje]: "BELA"/pocniglasanje [Pitanje]");
- votetimer = SetTimer("KrajGlasanja",60000,false);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string,sizeof(string),"* %s (%d) %s?, Glasajte sa /yes ili /no",sendername,playerid,rezultat);
- SCMTA(SVETLOPLAVA,string);
- glasanje = 1;
- new y, m, d;
- new h,mi,s;
- getdate(y,m,d);
- gettime(h,mi,s);
- format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s je poceo glasanje %s",d,m,y,h,mi,s,sendername,rezultat);
- }
- return 1;
- }
- CMD:yes(playerid, params[],help)
- {
- 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);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA, "Vec ste glasali!");
- return 1;
- }
- }
- else
- {
- SCM(playerid, SVETLOPLAVA, "Trenutno nema glasanja!");
- return 1;
- }
- return 1;
- }
- CMD:no(playerid, params[],help)
- {
- 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);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Trenutno nema glasanja!");
- return 1;
- }
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Vec ste glasali!");
- return 1;
- }
- return 1;
- }
- CMD:ugasiglasanje(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;
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- glasanjerecently[i] = 0;
- }
- }
- KillTimer(votetimer);
- format(string,sizeof(string),"[Glasanje]: %s je prekinuo glasanje",sendername);
- SCMTA(SVETLOPLAVA,string);
- }
- else
- {
- SCM(playerid, SVETLOPLAVA,"Trenutno nema glasanja!");
- return 1;
- }
- return 1;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment