GameMode change by Vote - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GameMode change by Vote (
/showthread.php?tid=653429)
GameMode change by Vote -
TadePoleMG - 04.05.2018
Hi all guys
I need a script by which players vote and maximum voted map changed with message.
CMDS- /vote, /votes(for admins).
Thank you, rep++.
Re: GameMode change by Vote -
TadePoleMG - 04.05.2018
Help me pls,
Anybody script it for me and return of it get rep++...
Re: GameMode change by Vote -
kovac - 04.05.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.
Re: GameMode change by Vote -
Dayrion - 04.05.2018
« 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
Re: GameMode change by Vote -
TadePoleMG - 06.05.2018
Thank you very much Kovac

you are best one.