04.05.2018, 18:50
In server conf:
gamemode0 grandlarc 1
gamemode1 other_gm 1
Untested.
EDIT: I misunderstood. I thought that you want to change the gamemode. Sorry. Anyhow, the principle is similar, you can figure it out.
gamemode0 grandlarc 1
gamemode1 other_gm 1
PHP код:
new bool:Voted[MAX_PLAYERS];
new Votes;
CMD:vote(playerid)
{
if(Voted[playerid]) return SendClientMessage(playerid, -1, "ERROR: You can vote only once.");
Votes++;
Voted[playerid] = true;
if(Votes == 5)
{
SendClientMessageToAll(-1, "5 players voted for next gamemode, changing..");
SendRconCommand("gmx");
}
return 1;
}
// OnPlayerDisconnect
Voted[playerid] = false;
CMD:votes(playerid)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "ERROR: You are not RCON admin.");
new string[128];
format(string, sizeof(string), "There are currently %i votes", Votes);
SendClientMessage(playerid, -1, string);
return 1;
}
EDIT: I misunderstood. I thought that you want to change the gamemode. Sorry. Anyhow, the principle is similar, you can figure it out.