GameMode change by Vote
#1

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++.
Reply
#2

Help me pls,
Anybody script it for me and return of it get rep++...
Reply
#3

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(stringsizeof(string), "There are currently %i votes"Votes);
    
SendClientMessage(playerid, -1string);
    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.
Reply
#4

« 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
Reply
#5

Thank you very much Kovac you are best one.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)