/* This plugin enables non-admin started votes for pistol only,restrict awp buying, low gravity, and also includes auto-responses and more. 
 * Note: you might want to turn your vote_freq down to 15 or 30 in server.cfg if your going to have a lot of voting happening (FF, Grav, other ect.)
 * Must be loaded AFTER plugin_CS. 
 * Scripts belong to respective owners, scripts borrowed from yensid and jag
 * This plugin is a plugin_democracy plus added voting, etc for Smgs, Shotguns, and Rifles
 * Thsnks to original code from BenTheMeek & KrezerJ's plugin_democracy
 */
 
/* $Id: plugin_ultimate_democracy.sma,v 1.11 1/16/02 by SR71Goku $ */
 
/* Should be compatible now with new plugin_CS. Untested! [WING] Black Knight */
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_RESTRICT 8192
#define ACCESS_VOTE_GV 8192
#define ACCESS_VOTE_FF 8192
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.0";
 
/* Change to 1 to have a pistols vote start 450 seconds in to a map */
#define AUTO_PL_VOTE 0
/* Change to 1 to have a awp vote start 1000 seconds in to a map */
#define AUTO_AW_VOTE 0
/* Change to 1 to have a gravity vote start 300 seconds in to a map */
#define AUTO_GV_VOTE 0
/* Change to 1 to have a Friendly Fire vote start 150 seconds in to a map */
#define AUTO_FF_VOTE 0
/* Change to 1 to have a Shotgun Only vote start 750 seconds in to a map*/
#define AUTO_SH_VOTE 0
/* Change to 1 to have a SMG Only vote start 600 seconds in to the map */
#define AUTO_SMG_VOTE 0
/* Change to 1 to have a Rifle Only vote start 900 seconds in to the map */
#define AUTO_RIF_VOTE 0
 
 
/* If your using yensid's plugin_ff you will have to either disable it or disable *
 * our enhanced version below by changing ENABLE_FF_VOTE & ENABLE_FF_STATUS to 0  */
 
/* Change to 0 to disable admin_pistols */
#define ENABLE_PL 1
/* Change to 0 to disable admin_awp */
#define ENABLE_AW 1
/* Change to 0 to disable admin_shotguns */
#define ENABLE_SH 1
/* Change to 0 to disable admin_smgs */
#define ENABLE_SMG 1
/* Change to 0 to disable admin_rifles */
#define ENABLE_RIF 1
/* Change to 0 to disable pistol voting */
#define ENABLE_PL_VOTE 1
/* Change to 0 to disable awp voting */
#define ENABLE_AW_VOTE 1
/* Change to 0 to disable gravity voting */
#define ENABLE_GV_VOTE 0
/* Change to 0 to disable friendly fire voting */
#define ENABLE_FF_VOTE 1
/* Change to 0 to disable shotgun only voting */
#define ENABLE_SH_VOTE 1
/* Change to 0 to disable smg only voting */
#define ENABLE_SMG_VOTE 1
/* Change to 0 to disable rifle only voting */
#define ENABLE_RIF_VOTE 1
/* Change to 0 to disable gravity status autoresponse */
#define ENABLE_GV_STATUS 0
/* Change to 0 to disable gun restriction status autoresponse */
#define ENABLE_GUN_STATUS 1
/* Change to 0 to disable friendly fire status autoresponse */
#define ENABLE_FF_STATUS 1
 
/* Change this to whatever ratio of players need to vote pistols only to change it. */
#define PL_VOTE_RATIO 51
/* Change this to whatever ratio of players need to vote awps on or off to change it */
#define AW_VOTE_RATIO 51
/* Change this to whatever ratio of players need to vote for a gravity setting to change it. */
#define GV_VOTE_RATIO 51
/* Change this to whatever ratio of players need to vote for a friendly fire setting to change it. */
#define FF_VOTE_RATIO 51
/* You can figure out the rest of them */
/* Shotguns*/
#define SH_VOTE_RATIO 51
/* Smgs */
#define SMG_VOTE_RATIO 51
/* Rifles */
#define RIF_VOTE_RATIO 51
 
/* Change this to whatever default gravity you use with your server */
new DefaultGV=800;
/* Change this to whatever you want to be low gravity */
new LowGV=200;
 
/* Here we create the variables that will allow us to give the current state of Pistol and AWP buying. Dont Change */
new NoAWP=0; 
new PistolOnly=0;
new ShotgunOnly=0;
new SmgOnly=0;
new RifleOnly=0;
 
/* Change this to the number secconds a NON-admin will have to wait to Re-Vote somthing. Like to */
/* vote_pistols again you wait ?? secconds. This stops Vote-Spams. Thanks to Wraith for the idea */
new RVfreq=180;
 
#if ENABLE_PL_VOTE==1
 
/* Change this to 1 to disable public use of vote_pistols by default */
new PLVoteOff=0;
 
#endif
#if ENABLE_AW_VOTE==1
 
/* Change this to 1 to disable public use of vote_awp by default */
new AWVoteOff=0;
 
#endif
#if ENABLE_GV_VOTE==1
 
/* Change this to 1 to disable public use of vote_gravity by default */
new GVVoteOff=0;
 
#endif
#if ENABLE_FF_VOTE==1
 
/* Change this to 1 to disable public use of vote_ff by default */
new FFVoteOff=0;
 
#endif
#if ENABLE_SH_VOTE==1
 
new SHVoteOff=0;
 
#endif
#if ENABLE_SMG_VOTE==1
 
new SMGVoteOff=0;
 
#endif
#if ENABLE_RIF_VOTE==1
 
new RIFVoteOff=0;
 
#endif
 
 
 
/**************************************/
/***** END OF SWITCHES FOR ADMINS *****/
/**************************************/
 
#if ENABLE_PL_VOTE==1
new vote_PLAllowed=1;
@PLVoteTimer() {vote_PLAllowed=1;}
#endif
 
#if ENABLE_AW_VOTE==1
new vote_AWAllowed=1;
@AWVoteTimer() {vote_AWAllowed=1;}
#endif
 
#if ENABLE_GV_VOTE==1
new vote_GVAllowed=1;
@GVVoteTimer() {vote_GVAllowed=1;}
#endif
 
#if ENABLE_FF_VOTE==1
new vote_FFAllowed=1;
@FFVoteTimer() {vote_FFAllowed=1;}
#endif
 
#if ENABLE_SH_VOTE==1
new vote_SHAllowed=1;
@SHVoteTimer() {vote_SHAllowed=1;}
#endif
 
#if ENABLE_SMG_VOTE==1
new vote_SMGAllowed=1;
@SMGVoteTimer() {vote_SMGAllowed=1;}
#endif
 
#if ENABLE_RIF_VOTE==1
new vote_RIFAllowed=1;
@RIFVoteTimer() {vote_RIFAllowed=1;}
#endif
 
 
public PistolON() {
	plugin_exec("admin_unrestrict","all");
	plugin_exec("admin_restrict","menu 2");
	plugin_exec("admin_restrict","menu 3");
	plugin_exec("admin_restrict","menu 4");
	plugin_exec("admin_restrict","menu 5");
	PistolOnly=1; 
	NoAWP=0;
	ShotgunOnly=0;
	SmgOnly=0;
	RifleOnly=0;
}
public AllON() {
	plugin_exec("admin_unrestrict","all");
	exec("mp_startmoney 800");
	NoAWP=0;
	PistolOnly=0;
	ShotgunOnly=0;
	SmgOnly=0;
	RifleOnly=0;
}
public AwpON() {
	plugin_exec("admin_unrestrict","all");
	plugin_exec("admin_restrict","awp");
	NoAWP=1; 
	PistolOnly=0;
	ShotgunOnly=0;
	SmgOnly=0;
	RifleOnly=0;
}
public ShotgunON() {
	plugin_exec("admin_unrestrict","all");
	plugin_exec("admin_restrict","menu 1");
	plugin_exec("admin_restrict","menu 3");
	plugin_exec("admin_restrict","menu 4");
	plugin_exec("admin_restrict","menu 5");
	NoAWP=0;
	PistolOnly=0;
	ShotgunOnly=1;
	SmgOnly=0;
	RifleOnly=0;
}
public SmgON() {
	plugin_exec("admin_unrestrict","all");
	plugin_exec("admin_restrict","menu 1");
	plugin_exec("admin_restrict","menu 2");
	plugin_exec("admin_restrict","menu 4");
	plugin_exec("admin_restrict","menu 5");
	NoAWP=0;
	PistolOnly=0;
	ShotgunOnly=0;
	SmgOnly=1;
	RifleOnly=0;
}
public RifleON() {
	plugin_exec("admin_unrestrict","all");
	plugin_exec("admin_restrict","menu 1");
	plugin_exec("admin_restrict","menu 3");
	plugin_exec("admin_restrict","menu 3");
	plugin_exec("admin_restrict","menu 5");
	exec("mp_startmoney 16000");
	exec("sv_restartround 10");
	NoAWP=0;
	PistolOnly=0;
	ShotgunOnly=0;
	SmgOnly=0;
	RifleOnly=1;	
}
 
 
public PLVote() {
	new strDummy[10];
	vote("Pistols only?", "All weapons", "Pistols Only", "HandlePLVote",strDummy);
}
 
public HandlePLVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = PL_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if (PistolOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  All weapons will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful. Enabled all weapons^nSpend that money...!!!");
				AllON();
			}
		} else {
			if (PistolOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "PISTOLS ONLY until voted otherwise^nThrow down all automatics or be vote kicked!");
				PistolON();
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Pistols buying only will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if (PistolOnly==0) { 
			snprintf(Text, MAX_TEXT_LENGTH, "All Weapons will remain enabled.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "Pistols Only will remain.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_PL_VOTE==1
public admin_vote_pistols(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public Pistols voting has been disabled");
		PLVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public Pistols voting has been enabled");
		PLVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_PLAllowed=0;
	set_timer("@PLVoteTimer",RVfreq,1);
	PLVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
public AWVote() {
	new strDummy[10];
	vote("Restrict buying of AWP/AWM?", "Enable AWP", "Disable AWP", "HandleAWVote",strDummy);
}
 
public HandleAWVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = PL_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if (NoAWP==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  AWP buying will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful.^nEnabled AWP and all other buying ^nSnipe away!!!");
				AllON();
			}
		} else {
			if (NoAWP==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "AWP banned until voted otherwise^nThrow those AWMs down or get vote kicked!");
				AwpON();
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Restricted AWP buying will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if (NoAWP==0) { 
			snprintf(Text, MAX_TEXT_LENGTH, "AWP buying will remain.^nNot enough votes for a change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "AWP will remain banned.^nNot enough votes for a change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_AW_VOTE==1
public admin_vote_awp(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public AWP voting has been disabled");
		AWVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public AWP voting has been enabled");
		AWVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_AWAllowed=0;
	set_timer("@AWVoteTimer",RVfreq,1);
	AWVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
public GVVote() {
	new strDummy[10];
	vote("What Gravity?", "Normal Gravity", "Low Gravity", "HandleGVVote",strDummy);
}
 
public HandleGVVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new TextB[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new strNumberB[MAX_NUMBER_LENGTH];
	new Ratio = GV_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if(getvar("sv_gravity")==DefaultGV) {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Normal Gravity will stay as is.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful. Changed to Normal Gravity ^nSo Just don't fall!!!");
				numtostr(DefaultGV,strNumberB);
				snprintf(TextB, MAX_TEXT_LENGTH, "sv_gravity %s", strNumberB);
				exec(TextB);
			}
		} else {
			if(getvar("sv_gravity")==DefaultGV) {
				snprintf(Text, MAX_TEXT_LENGTH, "OK Ok...You got your way!^nLow Gravity is On...^nJump away!");
				numtostr(LowGV,strNumberB);
				snprintf(TextB, MAX_TEXT_LENGTH, "sv_gravity %s", strNumberB);
				exec(TextB);
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Low gravity will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if(getvar("sv_gravity")==DefaultGV) {
			snprintf(Text, MAX_TEXT_LENGTH, "Normal Gravity will remain.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "LowGravity will remain.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_GV_VOTE==1
public admin_vote_gravity(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public Gravity voting has been disabled");
		GVVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public Gravity voting has been enabled");
		GVVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_GVAllowed=0;
	set_timer("@GVVoteTimer",RVfreq,1);		
	GVVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
public FFVote() {
	new strDummy[10];
	vote("Friendly Fire on?", "Yes", "No", "HandleFFVote",strDummy);
}
 
public HandleFFVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = PL_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if(getvar("mp_friendlyfire")==1) {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Friendly fire will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Friendly fire is ON!^nYour team would appreciate you not shooting them.");
				exec("mp_friendlyfire 1");
			}
		} else {
			if(getvar("mp_friendlyfire")==1) {
				snprintf(Text, MAX_TEXT_LENGTH, "OK Ok...You got your way!^nFriendly Fire Is OFF...^nShoot whomever you please!");
				exec("mp_friendlyfire 0");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Friendly fire will remain disabled.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if(getvar("mp_friendlyfire")==1) {
			snprintf(Text, MAX_TEXT_LENGTH, "Friendly fire will remain enabled.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "Friendly fire will remain disabled.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_FF_VOTE==1
public admin_vote_ff(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public Friendly Fire voting has been disabled");
		FFVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public Friendly Fire voting has been enabled");
		FFVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_FFAllowed=0;
	set_timer("@FFVoteTimer",RVfreq,1);
	FFVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
 
 
public SHVote() {
	new strDummy[10];
	vote("Shotguns only?", "All weapons", "Shotguns Only", "HandleSHVote",strDummy);
}
 
public HandleSHVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = SH_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if (ShotgunOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  All weapons will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful. Enabled all weapons^nSpend that money...!!!");
				AllON();
			}
		} else {
			if (ShotgunOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "SHOTGUNS ONLY!!^nIf you have any other gun, toss it or be vote kicked!");
				ShotgunON();
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Shotgun buying only will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if (ShotgunOnly==0) { 
			snprintf(Text, MAX_TEXT_LENGTH, "All Weapons will remain enabled.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "Pistols Only will remain.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_SH_VOTE==1
public admin_vote_shotguns(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public shotgun voting has been disabled");
		SHVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public shtgun voting has been enabled");
		SHVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_SHAllowed=0;
	set_timer("@SHVoteTimer",RVfreq,1);
	SHVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
 
public SMGVote() {
	new strDummy[10];
	vote("SMGs only?", "All weapons", "SMGs Only", "HandleSMGVote",strDummy);
}
 
public HandleSMGVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = PL_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if (SmgOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  All weapons will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful. Enabled all weapons^nSpend that money...!!!");
				AllON();
			}
		} else {
			if (SmgOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "SMG's ONLY!!!^nIf you have any other gun, toss it or be vote kicked!!");
				SmgON();
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  SMGs buying only will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if (SmgOnly==0) { 
			snprintf(Text, MAX_TEXT_LENGTH, "All Weapons will remain.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "Pistols Only will remain.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_SMG_VOTE==1
public admin_vote_smgs(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public SMGs voting has been disabled");
		SMGVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public SMGs voting has been enabled");
		SMGVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_SMGAllowed=0;
	set_timer("@SMGVoteTimer",RVfreq,1);
	SMGVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
public RIFVote() {
	new strDummy[10];
	vote("Restart round and enable rifles only?", "All weapons", "Rifles Only", "HandleRIFVote",strDummy);
}
 
public HandleRIFVote(WinningOption,HLData,VoteCount,UserCount) {
	new Text[MAX_TEXT_LENGTH];
	new strNumber[MAX_NUMBER_LENGTH];
	new Ratio = PL_VOTE_RATIO;
	new strData[MAX_DATA_LENGTH];
	new i;
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	convert_string(HLData, strData,MAX_DATA_LENGTH);
 
	if (VoteCount >= Ratio*UserCount/100) {	
		if (WinningOption==1) {
			if (RifleOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  All weapons will remain enabled.");
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote successful. Enabled all weapons^nSpend that money...!!!");
				AllON();
			}
		} else {
			if (RifleOnly==0) { 
				snprintf(Text, MAX_TEXT_LENGTH, "RIFLES ONLY!!^nRound will be restarted so that you will have enough money");
				RifleON();
			} else {
				snprintf(Text, MAX_TEXT_LENGTH, "Vote over.  Rifles buying only will remain.");
			}
		}
	} else {
		numtostr(Ratio*UserCount/100,strNumber);
		if (RifleOnly==0) { 
			snprintf(Text, MAX_TEXT_LENGTH, "All Weapons will remain.^nNot enough votes for change (needed %s)", strNumber);
		} else {
			snprintf(Text, MAX_TEXT_LENGTH, "Rifles Only will remain.^nNot enough votes for change (needed %s)", strNumber);
		}
	}
	centersay(Text,18,63,187,239);
	for(i=1; i<=maxplayers; i++) {
		strinit(Target);
		if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
			messageex(Target,Text,print_console);
		}
	}
}
#if ENABLE_RIF_VOTE==1
public admin_vote_rifles(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	say_command(User,Command,Data);
 
	if (streq(Data, "off")==1) {
		selfmessage( "Public rifles voting has been disabled");
		RIFVoteOff=1;
		return PLUGIN_HANDLED;
	}
	if (streq(Data, "on")==1) {
		selfmessage( "Public Rifles voting has been enabled");
		RIFVoteOff=0;
		return PLUGIN_HANDLED;
	}
 
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;
	}
 
	vote_RIFAllowed=0;
	set_timer("@RIFVoteTimer",RVfreq,1);
	RIFVote();
 
	return PLUGIN_HANDLED;
}
#endif
 
 
#if ENABLE_PL==1
public admin_pistols(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	new i;
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (PistolOnly==0) {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has set Pistols-only buying");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		PistolON();
	} else {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has enabled ALL WEAPONS");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AllON();
	}
	return PLUGIN_HANDLED;
}
#endif
#if ENABLE_AW==1
public admin_awp(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	new i;
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	if (NoAWP==0) {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has restricted awp buying");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AwpON();
	} else {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has enabled ALL WEAPONS");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AllON();
	}
	return PLUGIN_HANDLED;
}
#endif
#if ENABLE_SH==1
public admin_shotguns(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	new i;
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (ShotgunOnly==0) {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has set Shotgun-only buying");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		ShotgunON();
	} else {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has enabled ALL WEAPONS");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AllON();
	}
	return PLUGIN_HANDLED;
}
#endif
#if ENABLE_SMG==1
public admin_smgs(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	new i;
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (SmgOnly==0) {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has set SMG-only buying");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		SmgON();
	} else {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has enabled ALL WEAPONS");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AllON();
	}
	return PLUGIN_HANDLED;
}
#endif
#if ENABLE_RIF==1
public admin_rifles(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new maxplayers = maxplayercount();
	new SessionID;
	new Target[MAX_NAME_LENGTH];
	new Team;
	new WONID;
	new i;
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (RifleOnly==0) {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has set Rifle-only buying");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		RifleON();
	} else {
		snprintf(Text, MAX_TEXT_LENGTH, "ADMIN has enabled ALL WEAPONS");
		centersay(Text,10,0,255,0);
		for(i=1; i<=maxplayers; i++) {
			strinit(Target);
			if(playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
				messageex(Target,Text,print_console);
			}
		}
		AllON();
	}
	return PLUGIN_HANDLED;
}
#endif
 
public HandleSay(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	strstripquotes(Data);
 
#if ENABLE_GUN_STATUS==1
	new Match = FALSE;
	if (strcasestr(Data, "gun")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "buy")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "pistol")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "awp")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "awm")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "rifle")!=-1) {
		Match = TRUE;
	} 
	if (strcasestr(Data, "smg")!=-1) {
		Match = TRUE;
	}
	if (strcasestr(Data, "vote_awp")!=-1) {
		Match = FALSE;
	}
	if (strcasestr(Data, "vote_pistols")!=-1) {
		Match = FALSE;
	}
	if (strcasestr(Data, "vote_shotguns") !=1) {
		Match = FALSE;
	}
	if (strcasestr(Data, "vote_smgs") !=1) {
		Match = FALSE;
	}
	if (strcasestr(Data, "vote_rifles") !=1) {
		Match = FALSE;
	}	
 
#endif
#if ENABLE_GV_STATUS==1
	new GVMatch = FALSE;
	if (strcasestr(Data, "gravity")!=-1) {
		GVMatch = TRUE;
	}
	if (strcasestr(Data, "vote_gravity")!=-1) {
		GVMatch = FALSE;
	}
#endif
#if ENABLE_FF_STATUS==1
	new FFMatch = FALSE;
	if (strcasestr(Data, "ff on")!=-1) {
		FFMatch = TRUE;
	}
	if (strcasestr(Data, "friendly fire")!=-1) {
		FFMatch = TRUE;
	}
#endif
 
/****     What is Restricted??     ****/
#if ENABLE_GUN_STATUS==1
	if (Match==TRUE) {
		if (PistolOnly==1) { 
			centersay ("Pistols Only Buying. ^n To change say vote_pistols. ",9,0,255,0);
		} else {
			if (ShotgunOnly==1) {
				centersay ("Shotgun Only Buying. ^n To change say vote_shotguns.",9,0,255,0);
			} else {
				if (SmgOnly==1) {
					centersay ("Smg Only Buying. ^n To change say vote_smgs.",9,0,255,0);
				} else { 
					if (RifleOnly==1) {
						centersay ("Rifles Only Buying. ^n To change say vote_rifles.",9,0,255,0);		
					} else {	
						if (NoAWP==1) { 
							centersay ("AWP's Restricted Buying. ^n To change say vote_awp. ",9,0,255,0);
						} else {
							centersay ("All WEAPON Buying is currently enabled!^nTo change say vote_pistols, vote_awp^nvote_shotguns, vote_smgs, or vote_rifles",12,0,255,0); 
						}
					}
				}
			}		
		}
	}
#endif
#if ENABLE_GV_STATUS==1
	if (GVMatch==TRUE) {
		if (getvar("sv_gravity") == DefaultGV){ 
			centersay ("Normal Gravity! Don't Fall! ^n To change say vote_gravity!",7,0,255,0); 
		} else {
			new strNumber[MAX_NUMBER_LENGTH];
			new Text[MAX_TEXT_LENGTH];
			numtostr(getvar("sv_gravity"),strNumber);
			snprintf(Text, MAX_TEXT_LENGTH, "Low Gravity is on (%s). ^n To change say vote_gravity.", strNumber);
			centersay (Text,7,0,255,0);
		}
	}
#endif
#if ENABLE_FF_STATUS==1
	if (FFMatch==TRUE) {
		if (getvar("mp_friendlyfire") == 1){ 
			centersay ("Friendly fire is ON! Watch your fire!^nTo change say vote_ff",9,0,255,0); 
		} else {
			centersay ("Friendly fire is OFF. ^n Go ahead, shoot your partner. To change say vote_ff",9,0,255,0);
		}
	}
#endif
 
#if ENABLE_PL_VOTE==1
	if (strcasestr(Data, "vote_pistols")!=-1) {
		if (PLVoteOff==1) {
			say("Admin has disable public use of vote_pistols.");
		} else {
			if (vote_PLAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {
					vote_PLAllowed=0;
					set_timer("@PLVoteTimer",RVfreq,1);
					PLVote();
				}
			}
		}
	}
#endif
#if ENABLE_AW_VOTE==1
	if (strcasestr(Data, "vote_awp")!=-1) {
		if (AWVoteOff==1) {
			say("Admin has disable public use of vote_awp.");
		} else {
			if (vote_AWAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {	
					vote_AWAllowed=0;
					set_timer("@AWVoteTimer",RVfreq,1);
					AWVote();
				}
			}
		}
	}
#endif
#if ENABLE_SH_VOTE==1
	if (strcasestr(Data, "vote_shotguns")!=-1) {
		if (SHVoteOff==1) {
			say("Admin has disabled public use of vote_shotguns.");
		} else {
			if (vote_SHAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {
					vote_SHAllowed=0;
					set_timer("@SHVoteTimer",RVfreq,1);
					SHVote();
				}
			}
		}
	}
#endif
#if ENABLE_SMG_VOTE==1
	if (strcasestr(Data, "vote_smgs")!=-1) {
		if (SMGVoteOff==1) {
			say("Admin has disabled public use of vote_smgs.");
		} else {
			if (vote_SMGAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {
					vote_SMGAllowed=0;
					set_timer("@SMGVoteTimer",RVfreq,1);
					SMGVote();
				}
			}
		}
	}
#endif
#if ENABLE_RIF_VOTE==1
	if (strcasestr(Data, "vote_rifles")!=-1) {
		if (RIFVoteOff==1) {
			say("Admin has disable public use of vote_rifles.");
		} else {
			if (vote_RIFAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {
					vote_RIFAllowed=0;
					set_timer("@RIFVoteTimer",RVfreq,1);
					RIFVote();
				}
			}
		}
	}
#endif
 
 
#if ENABLE_GV_VOTE==1
	if (strcasestr(Data, "vote_gravity")!=-1) {
		if (GVVoteOff==1) {
			say("Admin has disable public use of vote_gravity.");
		} else {
			if (vote_GVAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {	
					vote_GVAllowed=0;
					set_timer("@GVVoteTimer",RVfreq,1);
					GVVote();
				}
			}
		}
	}
#endif
#if ENABLE_FF_VOTE==1
	if (strcasestr(Data, "vote_ff")!=-1) {
		if (FFVoteOff==1) {
			say("Admin has disable public use of vote_ff.");
		} else {
			if (vote_FFAllowed != 1){
				say("A vote has just been completed, sorry if you didn't like the results.");
			} else {
				if (vote_allowed()!=1) {
					say("Vote not allowed at this time.");
				} else {
					vote_FFAllowed=0;
					set_timer("@FFVoteTimer",RVfreq,1);
					FFVote();
				}
			}
		}
	}
#endif
	return PLUGIN_CONTINUE;
}
 
@PLVote() {
	if (vote_allowed()==1) {
		PLVote();
		say("[AutoVotePistols] Vote Started");
	} else {
		set_timer("@PLVote",30,1);
		say("[AutoVotePistols] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@AWVote() {
	if (vote_allowed()==1) {
		AWVote();
		say("[AutoVoteAWP] Vote Started");
	} else {
		set_timer("@AWVote",30,1);
		say("[AutoVoteAWP] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@SHVote() {
	if (vote_allowed()==1) {
		SHVote();
		say("[AutoVoteShotguns] Vote Started");
	} else {
		set_timer("@SHVote",30,1);
		say("[AutoVoteShotguns] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@SMGVote() {
	if (vote_allowed()==1) {
		SMGVote();
		say("[AutoVoteSmgs] Vote Started");
	} else {
		set_timer("@SMGVote",30,1);
		say("[AutoVoteSmgs] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@RIFVote() {
	if (vote_allowed()==1) {
		RIFVote();
		say("[AutoVoteRifles] Vote Started");
	} else {
		set_timer("@RIFVote",30,1);
		say("[AutoVoteRifles] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@GVVote() {
	if (vote_allowed()==1) {
		GVVote();
		say("[AutoVoteGravity] Vote Started");
	} else {
		set_timer("@GVVote",30,1);
		say("[AutoVoteGravity] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
@FFVote() {
	if (vote_allowed()==1) {
		FFVote();
		say("[AutoVoteFF] Vote Started");
	} else {
		set_timer("@FFVote",30,1);
		say("[AutoVoteFF] Vote not allowed at this time");
		say("Server will retry in 30 secconds");
	}
}
 
public plugin_init() {
	plugin_registerinfo("Ultimate Demcracy Plugin","Change Gravity/FF/Weapon restrictions via votes with autoresponse status",STRING_VERSION);
	plugin_registercmd("say","HandleSay",ACCESS_ALL);
#if ENABLE_PL==1
	plugin_registercmd("admin_pistols","admin_pistols",ACCESS_RESTRICT,"admin_pistols : toggles pistols only buying on and off.");
#endif
#if ENABLE_AW==1
	plugin_registercmd("admin_awp","admin_awp",ACCESS_RESTRICT,"admin_awp : toggles AWP restricted buying on and off.");
#endif
#if ENABLE_SH==1
	plugin_registercmd("admin_shotguns","admin_shotguns",ACCESS_RESTRICT,"admin_shotguns : toggles shotgun only buying on and off.");
#endif
#if ENABLE_SMG==1
	plugin_registercmd("admin_smgs","admin_smgs",ACCESS_RESTRICT,"admin_smgs : toggles smg only buying on and off.");
#endif
#if ENABLE_SH==1
	plugin_registercmd("admin_rifles","admin_rifles",ACCESS_RESTRICT,"admin_rifles : toggles rifles only buying on and off. Turning on will restart the round");
#endif
#if ENABLE_PL_VOTE==1
	plugin_registercmd("admin_vote_pistols","admin_vote_pistols",ACCESS_RESTRICT,"admin_vote_pistols : Starts a vote to enable buying of pistols only. off/on changes public use of vote_awp");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_pistols: Will start pistols only vote and give status.");
#endif
#if ENABLE_AW_VOTE==1
	plugin_registercmd("admin_vote_awp","admin_vote_awp",ACCESS_RESTRICT,"admin_vote_awp : Starts a vote to disable buying of awp. off/on changes public use of vote_awp");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_awp: Will start awp restriction vote and give status.");
#endif
#if ENABLE_GV_VOTE==1
	plugin_registercmd("admin_vote_gravity","admin_vote_gravity",ACCESS_VOTE_GV,"admin_vote_gravity : Starts a vote to enable normal/low gravity. off/on changes public use of vote_gravity");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_gravity: Will start gravity vote.");
#endif
#if ENABLE_FF_VOTE==1
	plugin_registercmd("admin_vote_ff","admin_vote_ff",ACCESS_VOTE_FF,"admin_vote_ff : Starts a vote to enable ff. off/on changes public use of vote_ff");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_ff: Will start ff vote.");
#endif
#if ENABLE_SH_VOTE==1
	plugin_registercmd("admin_vote_shotguns","admin_vote_shotguns",ACCESS_RESTRICT,"admin_vote_shotguns : Starts a vote to enable buying of shotgun only.");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_shotguns: Will start shotgun only vote and give status.");
#endif
#if ENABLE_SMG_VOTE==1
	plugin_registercmd("admin_vote_smgs","admin_vote_smgs",ACCESS_RESTRICT,"admin_vote_smgs : Starts a vote to enable buying of smgs only.");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_smgs: Will start smg only vote and give status.");
#endif
#if ENABLE_RIF_VOTE==1
	plugin_registercmd("admin_vote_rifles","admin_vote_rifles",ACCESS_RESTRICT,"admin_vote_rifles : Starts a vote to enable buying of rifles only. Turning on restarts the round");
	plugin_registerhelp("say",ACCESS_ALL,"say vote_rifles: Will start rifles only vote and give status.");
#endif
#if ENABLE_GUN_STATUS==1
	plugin_registerhelp("say",ACCESS_ALL,"say gun,buy,pistol,awp,awm: Will give gun buying status.");
#endif
#if ENABLE_GV_STATUS==1
	plugin_registerhelp("say",ACCESS_ALL,"say gravity: Will give gravity status, Clients say vote_gravity will start vote.");
#endif
#if ENABLE_FF_STATUS==1
	plugin_registerhelp("say",ACCESS_ALL,"say ff on, friendly fire: Will give ff status, Clients say vote_ff will start vote.");
#endif
 
 
#if AUTO_PL_VOTE==1	
	set_timer("@PLVote",450,1);
#endif
#if AUTO_AW_VOTE==1	
	set_timer("@AWVote",1000,1);
#endif
#if AUTO_GV_VOTE==1	
	set_timer("@GVVote",300,1);
#endif
#if AUTO_FF_VOTE==1	
	set_timer("@FFVote",150,1);
#endif
#if AUTO_SH_VOTE==1
	set_timer("@SHVote",750,1);
#endif
#if AUTO_SMG_VOTE==1
	set_timer("@SMGVote",600,1);
#endif
#if AUTO_RIF_VOTE==1
	set_timer("@RIFVote",900,1);
#endif		
	return PLUGIN_CONTINUE;
}