Guest User

Untitled

a guest
Aug 7th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.21 KB | None | 0 0
  1. new canVote[MAX_PLAYERS]; //asta o pui pe la inceputul gamemode-ului
  2. public OnPlayerConnect(playerid)
  3. {
  4.   canVote[playerid] = 1; //Setezi la OnPlayerConnect ca jucatorul sa poata vota
  5.   return 1;
  6. }
  7. CMD:votelider(playerid,params[])
  8. {
  9.     if(IsPlayerConnected(playerid))
  10.     {
  11.         if(votelider == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu e nici o votare in desfasurare");
  12.         {
  13.             if(canVote[playerid] == 0 )return SendClientMessage(playerid,RED,"ERROR: Tocmai ai votat!");
  14.             if(sscanf(params, "ui",id)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/votelider <Playerid>");
  15.             if(IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Jucatorul nominalizat nu este pe server.");
  16.             {
  17.                 SendClientMessageToAll(COLOR_RED, " %s l-a ales pe %d pentru functia de lider.");
  18.                 canVote[playerid] = 0;
  19.                 SetTimerEx("EditVoteStatus", 5000, false, "i", playerid); //Modifica acel 5000 cu perioada de timp dupa care poate vota iar jucatorul
  20.             }
  21.         }
  22.     }
  23.     return 1;
  24. }
  25.  
  26. forward EditVoteStatus(playerid);
  27. public EditVoteStatus(playerid)
  28. {
  29.   if(canVote[playerid] == 0)
  30.   {
  31.     canVote[playerid] = 1;
  32.   }
  33.   else
  34.   {
  35.     canVote[playerid] = 0;
  36.   }
  37.   return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment