gamemode vote
#1

ok, i have 2 gamemodes on my server, a stunt GM and a RP GM, i found a filterscript to make a votelike thing, but its so old that all the links are dead
how hard would it be to script this?

or does someone have this filterscript?
Reply
#2

Not hard at all..
Just make a varieble with two options.
Reply
#3

ok, menus is the easiest way for me to do something like this, i made a way so that if someone hits vote yes, it changes the gamemode, how can i make it so it uses how many players voted and uses percentage to change the mode or to not change it?
Reply
#4

Post all your variebles and all what you've done already.
Reply
#5

this is a little bit of what i have, i dont understand how to make it check how many votes are what and how to script this kinda thing
Code:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#if defined FILTERSCRIPT
new Menu:tpm;
new Menu:tpm2;
new Voteyes;
new Voteno;
forward VoteTimer(giveplayerid);
#define COLOR_GREEN 0x33AA33AA
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Gamemode Vote by Andy");
	print("--------------------------------------\n");


	tpm2 = CreateMenu("Votemenu", 1, 200.0, 100.0, 150.0, 150.0);
	
	AddMenuItem(tpm, 0, "Vote Yes");
	AddMenuItem(tpm, 0, "Vote No");
	
  tpm = CreateMenu("Gamemodes", 1, 200.0, 100.0, 150.0, 150.0);
	AddMenuItem(tpm, 1, "Stunt Gamemode");
	AddMenuItem(tpm, 1, "Roleplay Gamemode");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
 if(strcmp(cmdtext, "/votemenu", true) == 0)
	{
			ShowMenuForPlayer(tpm,playerid);
  		TogglePlayerControllable(playerid,1);
		return 1;
	}
	return 0;
}
public OnPlayerExitedMenu(playerid)
{
  TogglePlayerControllable(playerid,0);
  return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:CurrentMenu = GetPlayerMenu(playerid);
	if(CurrentMenu == tpm)
  {
	  switch(row)
		{
      case 0:
		  {
			Voteyes = 1;
			}
      case 1:
		  {
			Voteno = 1;
      SendRconCommand("Changemode WC-RP");
      }
		}
	}
	return 1;
}
public VoteTimer(giveplayerid)
{
	new string[STRING];
	if(Votes == 1)
	{
		format(string, sizeof(string), "Gamemode has been Changed", Name(giveplayerid));
		SendClientMessageToAll(YELLOW, string);
		SendRconCommand("Changemode WC-RP");
	}
	else if(Voteno == 1)
	return 1;
}

//      GivePlayerWeapon(playerid,34,750);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)