Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new canVote[MAX_PLAYERS]; //asta o pui pe la inceputul gamemode-ului
- public OnPlayerConnect(playerid)
- {
- canVote[playerid] = 1; //Setezi la OnPlayerConnect ca jucatorul sa poata vota
- return 1;
- }
- CMD:votelider(playerid,params[])
- {
- if(IsPlayerConnected(playerid))
- {
- if(votelider == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu e nici o votare in desfasurare");
- {
- if(canVote[playerid] == 0 )return SendClientMessage(playerid,RED,"ERROR: Tocmai ai votat!");
- if(sscanf(params, "ui",id)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/votelider <Playerid>");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Jucatorul nominalizat nu este pe server.");
- {
- SendClientMessageToAll(COLOR_RED, " %s l-a ales pe %d pentru functia de lider.");
- canVote[playerid] = 0;
- SetTimerEx("EditVoteStatus", 5000, false, "i", playerid); //Modifica acel 5000 cu perioada de timp dupa care poate vota iar jucatorul
- }
- }
- }
- return 1;
- }
- forward EditVoteStatus(playerid);
- public EditVoteStatus(playerid)
- {
- if(canVote[playerid] == 0)
- {
- canVote[playerid] = 1;
- }
- else
- {
- canVote[playerid] = 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment