Posts: 165
Threads: 27
Joined: Apr 2018
Reputation:
0
Help me pls,
Anybody script it for me and return of it get rep++...
Posts: 180
Threads: 3
Joined: Mar 2018
In server conf:
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;
}
Untested.
EDIT: I misunderstood. I thought that you want to change the gamemode. Sorry. Anyhow, the principle is similar, you can figure it out.
Posts: 1,915
Threads: 64
Joined: Jan 2016
Reputation:
0
« Would help if you handed out some code to aid in making this command, but you know, Scripting Help isn't really for making you a command...
But if someone was going to be kind, then they'd need some basis to go on, rather than nothing and guess everything. » - Sew_Sumi