Преработка на AMX_Super Menu

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
g0gIch Beg
Потребител
Потребител
Мнения: 140
Регистриран: 20 юли 2017, 17:29
Получена благодарност: 1 път
Години: 16

Преработка на AMX_Super Menu

Мнение от g0gIch Beg » 14 юли 2018, 09:45

Ще може ли да се направят съобщенията на кодовете цветни. Няма значение как ще са направени, но да има цветовете на двата отбора и зелено.

Код: Избери всички

/* * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Super - Command Manager
 * Developed/Maintained by SuperCentral.co Scripting Team
 * Last Update: Jan 17 2014
 * 
 * Minimum Requirements
 * AMX Mod X 1.8.0
 * AMX Super 5.0
 * 
 * Credits
 * If I forgot you, let me know what you did and I will add you
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Mod X script.
 *
 *   AMX Super - Command Manager (amx_super-cmdmanager.sma)
 *   Copyright (C) 2013-2014 SuperCentral.co
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *   In addition, as a special exception, the author gives permission to
 *   link the code of this program with the Half-Life Game Engine ("HL
 *   Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *   L.L.C ("Valve"). You must obey the GNU General Public License in all
 *   respects for all of the code used other than the HL Engine and MODs
 *   from Valve. If you modify this file, you may extend this exception
 *   to your version of the file, but you are not obligated to do so. If
 *   you do not wish to do so, delete this exception statement from your
 *   version.
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #include <amxmodx>
#include <amxmisc>

#pragma semicolon 1
#define VERSION	"5.0.2"

new const g_szDisabledCmdsFilename[] = "disabled_cmds.ini";

new const g_szCmdList[][] = {
	"amx_heal",		
	"amx_armor",			
	"amx_teleport",		
	"amx_userorigin",	
	"amx_stack",			
	"amx_gravity",			
	"amx_unammo",		
	"amx_weapon",
	"amx_weaponmenu",
	"amx_drug",			
	"amx_godmode",			
	"amx_setmoney",		
	"amx_noclip",			
	"amx_speed",			
	"amx_revive",			
	"amx_bury",			
	"amx_unbury",			
	"amx_disarm",		
	"amx_slay2",		
	"amx_rocket",			
	"amx_fire",		
	"amx_flash",	
	"amx_uberslap",
	"amx_glow",
	"amx_glow2",	
	"amx_glowcolors",	
	"amx_alltalk",
	"amx_extend",
	"amx_gag",
	"amx_ungag",
	"amx_pass",
	"amx_nopass",
	"amx_transfer",
	"amx_swap",
	"amx_teamswap",
	"amx_lock",
	"amx_unlock",
	"amx_badaim",
	"amx_exec",
	"amx_restart",
	"amx_shutdown",
	"say /gravity",
	"say /alltalk",
	"say /spec",
	"say /unspec",
	"say /admin",
	"say /admins",
	"say /fixsound",
	"+adminvoice"
};


new g_pLogDisabledCmds;
new Trie: g_tDisabledCmds;


public plugin_init()
{
	register_plugin("AMX Super Cmd Manager", VERSION, "SuperCentral.co");
	register_dictionary("amx_super.txt");
	
	if((g_tDisabledCmds = TrieCreate()) == Invalid_Trie)
		set_fail_state("[AMXX] Failed to create CellTrie. Please contact the authors.");
	
	for(new i = 0; i < sizeof(g_szCmdList); i++)
	{
		if(g_szCmdList[i][0] == 'a')
			register_concmd(g_szCmdList[i], "CmdConsoleCallback");
		
		else // Not a console command.
			register_clcmd(g_szCmdList[i], "CmdClientCallback");
	}
	
	g_pLogDisabledCmds = register_cvar("amx_logdisabledcmds", "1");

	register_concmd("amx_reloadcmds", "CmdReloadCmds", ADMIN_CVAR, "Reloads all amx super commands. (see disabled_cmds.ini)");
	
	// Call it once manually to load the commands on map change.
	CmdReloadCmds(0, 0, 0);
}


public plugin_cfg()
{
	new szInfo[2];
	get_localinfo("amx_super_executed", szInfo, charsmax(szInfo));
	
	if(szInfo[0] != '1')
	{
		set_localinfo("amx_super_executed", "1");
		
		server_cmd("exec addons/amxmodx/configs/amx_super.cfg");
		server_exec();

		set_task(5.0, "TaskRemoveExecInfo");
	}
}


public TaskRemoveExecInfo()
	set_localinfo("amx_super_executed", "0");

	
public CmdReloadCmds(id, iLevel, iCid)
{
	if(id)
	{
		if(cmd_access(id, iLevel, iCid, 1))
		{
			new szName[35], szSteamid[35];
			get_user_name(id, szName, charsmax(szName));
			get_user_authid(id, szSteamid, charsmax(szSteamid));
			
			show_activity_key("AMX_SUPER_CMDMGR_RELOAD_CASE1", "AMX_SUPER_CMDMGR_RELOAD_CASE2", szName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_CMDMGR_RELOAD_LOG", szName, szSteamid);
		}
		
		else
			return PLUGIN_HANDLED;
	}
	
	new szDisabledCmdFile[64], iFile;
	get_configsdir(szDisabledCmdFile, charsmax(szDisabledCmdFile));
	format(szDisabledCmdFile, charsmax(szDisabledCmdFile), "%s/%s", szDisabledCmdFile, g_szDisabledCmdsFilename);
		
	// read commands into Trie if file exists.
	if(file_exists(szDisabledCmdFile))
	{
		// Clear our previous commands before reading new ones.
		TrieClear(g_tDisabledCmds);
		
		if((iFile = fopen(szDisabledCmdFile, "rt")))
		{
			new szCurrentCmd[32];
		
			while(!feof(iFile))
			{
				fgets(iFile, szCurrentCmd, charsmax(szCurrentCmd));
				trim(szCurrentCmd);
				
				if(!szCurrentCmd[0] || szCurrentCmd[0] == ';' || szCurrentCmd[0] == '/' && szCurrentCmd[1] == '/')
					continue;
					
				TrieSetCell(g_tDisabledCmds, szCurrentCmd, 1);
			}
						
			fclose(iFile);
		}
	
		else
			log_amx("%L", LANG_SERVER, "AMX_SUPER_CMDMGR_FILE_FAILED", g_szDisabledCmdsFilename);
	}
	
	else // file doesn't exist, make new one.
	{
		if((iFile = fopen(szDisabledCmdFile, "wt")))
		{
			fprintf(iFile, "; disabled_cmds.ini		Created by amx_super 5.0^n");
			fprintf(iFile, "; Commands added in this file will not be registered by amx super, thus will be disabled in game.^n");
			fprintf(iFile, "; 1 command per line.^n;^n; Example:^n; amx_fire");
			fclose(iFile);
		}
	}
	
	// MUST return continue so menu will also receive reload cmd.
	return PLUGIN_HANDLED_MAIN;
}


public CmdConsoleCallback(id)
{
	new szCmd[64];
	read_argv(0, szCmd, charsmax(szCmd));
	
	if(TrieKeyExists(g_tDisabledCmds, szCmd))
	{
		HandleDisabledCmd(id, szCmd, true);
		
		return PLUGIN_HANDLED;
	}

	return PLUGIN_CONTINUE;
}


public CmdClientCallback(id)
{
	new szCmd[64];
	read_argv(1, szCmd, charsmax(szCmd));
	format(szCmd, charsmax(szCmd), "say %s", szCmd);
	
	if(TrieKeyExists(g_tDisabledCmds, szCmd))
	{
		HandleDisabledCmd(id, szCmd, false);

		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}


HandleDisabledCmd(id, const szCmd[], bool: bConsole)
{
	client_print(id, bConsole ? print_console : print_chat,"%L", id, "AMX_SUPER_CMDMGR_DISABLED", szCmd); 
	
	if(get_pcvar_num(g_pLogDisabledCmds))
	{
		new szName[35], szSteamid[35];

		get_user_name(id, szName, charsmax(szName));
		get_user_authid(id, szSteamid, charsmax(szSteamid));
		
		log_amx("%L", LANG_SERVER, "AMX_SUPER_CMDMGR_DISABLED_LOG", szName, szSteamid, szCmd);
	}
}

Код: Избери всички

/* * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Super - Fun Commands
 * Developed/Maintained by SuperCentral.co Scripting Team
 * Last Update: Jan 17 2014
 * 
 * Minimum Requirements
 * AMX Mod X 1.8.0
 * AMX Super 5.0
 * 
 * Credits
 * If I forgot you, let me know what you did and I will add you
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Mod X script.
 *
 *   AMX Super - Fun Commands (amx_super-fun.sma)
 *   Copyright (C) 2013-2014 SuperCentral.co
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *   In addition, as a special exception, the author gives permission to
 *   link the code of this program with the Half-Life Game Engine ("HL
 *   Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *   L.L.C ("Valve"). You must obey the GNU General Public License in all
 *   respects for all of the code used other than the HL Engine and MODs
 *   from Valve. If you modify this file, you may extend this exception
 *   to your version of the file, but you are not obligated to do so. If
 *   you do not wish to do so, delete this exception statement from your
 *   version.
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 // Fun commands

/*
 *	Nr 		COMMAND				CALLBACK FUNCTION			ADMIN LEVEL
 *	
 *	1)		amx_heal			Cmd_Heal					ADMIN_LEVEL_A		
 *	2)		amx_armor			Cmd_Armor					ADMIN_LEVEL_A
 *	3)		amx_teleport		Cmd_Teleport				ADMIN_LEVEL_A
 *	4)		amx_userorigin		Cmd_UserOrigin				ADMIN_LEVEL_A
 *	5)		amx_stack			Cmd_Stack					ADMIN_LEVEL_A
 *	6)		amx_gravity			Cmd_Gravity					ADMIN_LEVEL_A
 *	7)		amx_unammo			Cmd_UnAmmo					ADMIN_LEVEL_A
 *	8)		amx_weapon(menu)	Cmd_Weapon(Menu)			ADMIN_LEVEL_C
 *	9)		amx_drug			Cmd_Drug					ADMIN_LEVEL_C
 *	10)		amx_godmode			Cmd_Godmode					ADMIN_LEVEL_C
 *	11)		amx_setmoney		Cmd_SetMoney				ADMIN_LEVEL_C
 *	12)		amx_noclip			Cmd_Noclip					ADMIN_LEVEL_C
 *	13)		amx_speed			Cmd_Speed					ADMIN_LEVEL_C
 *	14)		amx_revive			Cmd_Revive					ADMIN_LEVEL_C
 *	15)		amx_bury			Cmd_Bury					ADMIN_LEVEL_B 	
 *	16)		amx_unbury			Cmd_Unbury					ADMIN_LEVEL_B
 *	17)		amx_disarm			Cmd_Disarm					ADMIN_LEVEL_B
 *	18)		amx_slay2			Cmd_Slay2					ADMIN_LEVEL_B
 *	19)		amx_rocket			Cmd_Rocket					ADMIN_LEVEL_B
 *	20)		amx_fire			Cmd_Fire					ADMIN_LEVEL_B
 *	21)		amx_flash			Cmd_Flash					ADMIN_LEVEL_B
 *	22)		amx_uberslap		Cmd_UberSlap				ADMIN_LEVEL_B
 *	23)		amx_glow(2)			Cmd_Glow					ADMIN_LEVEL_D
 *	24)		amx_glowcolors		Cmd_GlowColors				ADMIN_LEVEL_D
*/ 


#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#pragma semicolon 1

#define SetPlayerBit(%1,%2)      (%1 |= (1<<(%2&31)))
#define ClearPlayerBit(%1,%2)    (%1 &= ~(1 <<(%2&31)))
#define CheckPlayerBit(%1,%2)    (%1 & (1<<(%2&31))) 

// amx_disarm
#define OFFSET_PRIMARYWEAPON        116 

// amx_glow & amx_glow2
#define MAX_COLORS 	30


// 	Used for the show_activity() / log_amx messages.
enum CmdTeam
{
	ALL,
	T,
	CT
};

new const g_szTeamNames[CmdTeam][] = 
{ 
	"all",
	"Terrorist", 
	"Counter-Terrorist" 
};


// cvar pointers
new g_pGravity;
// new g_pMaxSpeed;
new g_pAllowCatchFire;
new g_pFlashSound;

// perm checks
enum (<<=1) 
{
	PERMGOD = 1,
	PERMSPEED,
	PERMDRUGS,
	PERMNOCLIP,
	HASSPEED,
	HASGLOW
};
new g_iFlags[33];


// amx_weaponmenu
new g_iTeamMenu, g_iPlayerMenu;

// amx_speed
new bool: g_bIsFreezeTime;

// amx_fire
new g_iOnFireBit;

// amx_userorigin
new g_iUserOrigin[33][3];

// amx_unammo
new g_iUnammoBit, Float: g_iReloadTime[33];

// amx_glow, amx_glow2, amx_glowcolors
new const g_iColorValues[MAX_COLORS][3] = 
{
	{255, 0, 0},
	{255, 190, 190},
	{165, 0, 0},
	{255, 100, 100},
	{0, 0, 255},
	{0, 0, 136},
	{95, 200, 255},
	{0, 150, 255},
	{0, 255, 0},
	{180, 255, 175},
	{0, 155, 0},
	{150, 63, 0},
	{205, 123, 64},
	{255, 255, 255},
	{255, 255, 0},
	{189, 182, 0},
	{255, 255, 109},
	{255, 150, 0},
	{255, 190, 90},
	{222, 110, 0},
	{243, 138, 255},
	{255, 0, 255},
	{150, 0, 150},
	{100, 0, 100},
	{200, 0, 0},
	{220, 220, 0},
	{192, 192, 192},
	{190, 100, 10},
	{114, 114, 114},
	{0, 0, 0}
};

new const g_szColorNames[MAX_COLORS][] = 
{
	"red",
	"pink",
	"darkred",
	"lightred",
	"blue",
	"darkblue",
	"lightblue",
	"aqua",
	"green",
	"lightgreen",
	"darkgreen",
	"brown",
	"lightbrown",
	"white",
	"yellow",
	"darkyellow",
	"lightyellow",
	"orange",
	"lightorange",
	"darkorange",
	"lightpurple",
	"purple",
	"darkpurple",
	"violet",
	"maroon",
	"gold",
	"silver",
	"bronze",
	"grey",
	"off"
};
new g_iGlowColors[33][4];

// sprites for effects
new g_iSmokeSpr, g_iWhiteSpr, g_iLightSpr, g_iBlueflare2Spr, g_iMflashSpr;

// message ids
new g_iMsgDamage, g_iMsgScreenFade, g_iMsgSetFOV;


public plugin_init()
{
	register_plugin("Amx Super Fun", "5.0.2", "SuperCentral.co");
	register_dictionary("amx_super.txt");
	
	register_concmd("amx_heal", 		"Cmd_Heal", 		ADMIN_LEVEL_A, "<nick, #userid, authid or @team> <HP to give>");
	register_concmd("amx_armor", 		"Cmd_Armor", 		ADMIN_LEVEL_A, "<nick, #userid, authid or @team> <armor to give>");
	register_concmd("amx_teleport", 	"Cmd_Teleport", 	ADMIN_LEVEL_A, "<nick, #userid or authid> [x] [y] [z]");
	register_concmd("amx_userorigin", 	"Cmd_UserOrigin", 	ADMIN_LEVEL_A, "<nick, #userid or authid>");
	register_concmd("amx_stack", 		"Cmd_Stack", 		ADMIN_LEVEL_A, "<nick, #userid or authid> [0|1|2]");
	register_concmd("amx_gravity", 		"Cmd_Gravity", 		ADMIN_LEVEL_A, "<gravity #>");
	register_concmd("amx_unammo", 		"Cmd_UnAmmo", 		ADMIN_LEVEL_A, "<nick, #userid or @team> [0|1] - 0=OFF 1=ON");
	register_concmd("amx_weaponmenu", 	"Cmd_WeaponMenu", 	ADMIN_LEVEL_C, "shows the weapon menu");
	register_concmd("amx_weapon", 		"Cmd_Weapon", 		ADMIN_LEVEL_C, "<nick, #userid or @team> <weapon #>");
	register_concmd("amx_drug", 		"Cmd_Drug", 		ADMIN_LEVEL_C, "<@all, @team, nick, #userid, authid> [0|1|2] - 0=OFF 1=ON 2=ON + ON EACH ROUND");
	register_concmd("amx_godmode", 		"Cmd_Godmode", 		ADMIN_LEVEL_C, "<nick, #userid, authid or @team> [0|1|2] - 0=OFF 1=ON 2=ON + ON EACH ROUND");
	register_concmd("amx_setmoney",		"Cmd_SetMoney",		ADMIN_LEVEL_C, "<nick, #userid, authid or @team> <amount> - sets specified player's money");
	register_concmd("amx_money", 		"Cmd_SetMoney", 	ADMIN_LEVEL_C, "<nick, #userid, authid or @team> <amount> - sets specified player's money");
	register_concmd("amx_noclip", 		"Cmd_Noclip", 		ADMIN_LEVEL_C, "<nick, #userid, authid or @team> [0|1|2] - 0=OFF 1=ON 2=ON + ON EACH ROUND");
	register_concmd("amx_speed", 		"Cmd_Speed", 		ADMIN_LEVEL_C, "<nick, #userid, authid or @team> [0|1|2] - 0=OFF 1=ON 2=ON + ON EACH ROUND");
	register_concmd("amx_revive", 		"Cmd_Revive", 		ADMIN_LEVEL_C, "<nick, #userid, authid or @team>");
	register_concmd("amx_bury", 		"Cmd_Bury", 		ADMIN_LEVEL_B, "<nick, #userid, authid or @team>");
	register_concmd("amx_unbury", 		"Cmd_Unbury",		ADMIN_LEVEL_B, "<nick, #userid, authid or @team>");
	register_concmd("amx_disarm",		"Cmd_Disarm", 		ADMIN_LEVEL_B, "<nick, #userid, authid or @team>");
	register_concmd("amx_slay2", 		"Cmd_Slay2",		ADMIN_LEVEL_B, "<nick, #userid, authid or @team> [1-Lightning|2-Blood|3-Explode]");
	register_concmd("amx_rocket", 		"Cmd_Rocket", 		ADMIN_LEVEL_B, "<nick, #userid, authid or @team>");
	register_concmd("amx_fire", 		"Cmd_Fire", 		ADMIN_LEVEL_B, "<nick, #userid, authid or @team>");
	register_concmd("amx_flash", 		"Cmd_Flash", 		ADMIN_LEVEL_B, "<nick, #userid, authid or @team");
	register_concmd("amx_uberslap", 	"Cmd_UberSlap", 	ADMIN_LEVEL_B, "<nick, #userid or authid");
	register_concmd("amx_glow", 		"Cmd_Glow", 		ADMIN_LEVEL_D, "<nick, #userid, authid, or @team/@all> <color> (or) <rrr> <ggg> <bbb> <aaa> -- lasts 1 round");
	register_concmd("amx_glow2", 		"Cmd_Glow", 		ADMIN_LEVEL_D, "<nick, #userid, authid, or @team/@all> <color> (or) <rrr> <ggg> <bbb> <aaa> -- lasts forever");
	register_concmd("amx_glowcolors", 	"Cmd_GlowColors", 	ADMIN_LEVEL_D, "shows a list of colors for amx_glow and amx_glow2");
	
	// Register new cvars and get existing cvar pointers:
	g_pGravity 			= get_cvar_pointer("sv_gravity");
	// g_pMaxSpeed 		= get_cvar_pointer("sv_maxspeed");
	
	g_pAllowCatchFire 	= register_cvar("allow_catchfire", "1");
	g_pFlashSound 		= register_cvar("amx_flashsound","1");
	
	// amx_unammo
	register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
		
	// amx_weaponmenu
	g_iTeamMenu = menu_create("\rTeam?", "TeamHandler");
	menu_additem(g_iTeamMenu, "All", "1");
	menu_additem(g_iTeamMenu, "Counter-Terrorist", "2");
	menu_additem(g_iTeamMenu, "Terrorist", "3");
	menu_additem(g_iTeamMenu, "Player", "4");
	g_iPlayerMenu = menu_create("\rPlayers:", "PlayerHandler");
	
	// amx_drug
	g_iMsgSetFOV = get_user_msgid("SetFOV");
	
	// amx_speed
	RegisterHam(Ham_Item_PreFrame, "player", "FwdPlayerSpeedPost", 1);
	register_logevent("LogEventRoundStart", 2, "1=Round_Start");
	register_event("HLTV", "EventFreezeTime", "a");
	/*
		DREKES:
		set_pcvar_num() doesn't seem to take effect here.
		server_cmd() does.
	*/
	// set_pcvar_num(g_pMaxSpeed, 9999999);
	server_cmd("sv_maxspeed 999999");
	
	// message ids
	g_iMsgDamage = get_user_msgid("Damage");
	g_iMsgScreenFade = get_user_msgid("ScreenFade");
	
	// Used by several commands
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawnPost", 1);
}

/* Precache
 *---------
*/
public plugin_precache()
{
	// amx_slay2 & amx_rocket sprites
	g_iSmokeSpr 		= precache_model("sprites/steam1.spr");
	g_iWhiteSpr		= precache_model("sprites/white.spr");
	g_iLightSpr 		= precache_model("sprites/lgtning.spr");
	g_iBlueflare2Spr 	= precache_model( "sprites/blueflare2.spr");
	g_iMflashSpr 		= precache_model("sprites/muzzleflash.spr");
	
	// amx_rocket sounds
	precache_sound("ambience/thunder_clap.wav");
	precache_sound("weapons/headshot2.wav");
	precache_sound("weapons/rocketfire1.wav");
	precache_sound("weapons/rocket1.wav");
	
	// amx_fire sounds
	precache_sound("ambience/flameburst1.wav");
	precache_sound("scientist/scream21.wav");
	precache_sound("scientist/scream07.wav");
}


public plugin_cfg()
{
	new szInfo[2];
	get_localinfo("amx_super_executed", szInfo, charsmax(szInfo));
	
	if(szInfo[0] != '1')
	{
		set_localinfo("amx_super_executed", "1");
		
		server_cmd("exec addons/amxmodx/configs/amx_super.cfg");
		server_exec();

		set_task(5.0, "TaskRemoveExecInfo");
	}
}


public TaskRemoveExecInfo()
	set_localinfo("amx_super_executed", "0");

/* Player Spawn
 *-------------
*/
public FwdPlayerSpawnPost(id)
{
	if(!is_user_alive(id))
		return HAM_IGNORED;
		
	if(g_iFlags[id] & PERMDRUGS)
		set_user_drugs(id, 1);
		
	if(g_iFlags[id] & PERMGOD)
		set_user_godmode(id, 1);
	
	if(g_iFlags[id] & PERMNOCLIP)
		set_user_noclip(id, 1);
		
	if(g_iFlags[id] & PERMSPEED)
		SetSpeed(id, 2);
	
	else if(g_iFlags[id] & HASSPEED)
	{
		g_iFlags[id] &= ~HASSPEED;
		SetSpeed(id, 0);
	}
	
	if(g_iFlags[id] & HASGLOW)
		set_user_rendering(id, kRenderFxGlowShell, g_iGlowColors[id][0], g_iGlowColors[id][1], g_iGlowColors[id][2], kRenderTransAlpha, g_iGlowColors[id][3]);	
	else
		set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0);
		
	return HAM_IGNORED;
}


/* Player Disconnects
 *-------------------
*/
public client_disconnect(id)
{
	if(CheckPlayerBit(g_iOnFireBit, id))
		ClearPlayerBit(g_iOnFireBit, id);
		
	g_iFlags[id] = 0;
}


/*	1)	amx_heal
 *--------------
*/
public Cmd_Heal(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
	
	new szArg[35], szHealth[10];
	read_argv(1, szArg, charsmax(szArg));
	read_argv(2, szHealth, charsmax(szHealth));
	
	new iHealth = str_to_num(szHealth);
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid, szTargetName[35];
	
	if(iHealth <= 0)	
	{
		console_print(id, "%L", id, "AMX_SUPER_AMOUNT_GREATER");
		
		return PLUGIN_HANDLED;
	}
	
	if(szArg[0] == '@')
	{
		new iPlayers[32], iPlayersNum, CmdTeam: Team;
		
		switch(szArg[1])
		{
			case 'T', 't':
			{	
				get_players(iPlayers, iPlayersNum, "ae", "TERRORIST");
				
				Team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayersNum, "ae", "CT");
				
				Team = CT;
			}
			
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayersNum, "a");
				
				Team = ALL;
			}
		}
		
		if(!iPlayersNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}

		for(new i = 0; i < iPlayersNum; i++)
			set_user_health(iPlayers[i], iHealth);
		
		show_activity_key("AMX_SUPER_HEAL_TEAM_CASE1", "AMX_SUPER_HEAL_TEAM_CASE2", szAdminName, iHealth, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_HEAL_TEAM_LOG", szAdminName, szAdminAuthid, iHealth, g_szTeamNames[Team]);
	}
	
	else
	{	
		iTempid = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			set_user_health(iTempid, iHealth);
			
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			show_activity_key("AMX_SUPER_HEAL_PLAYER_CASE1", "AMX_SUPER_HEAL_PLAYER_CASE2", szAdminName, iHealth, szTargetName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_HEAL_PLAYER_LOG", szAdminName, szAdminAuthid, iHealth, szTargetName, szTargetAuthid);
		}
	}

	return PLUGIN_HANDLED;
}


/* 2)	amx_armor
 *---------------
*/
public Cmd_Armor(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
	
	new szArg[35], szArmor[10];
	read_argv(1, szArg, charsmax(szArg));
	read_argv(2, szArmor, charsmax(szArmor));
	
	new iArmor = str_to_num(szArmor);
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid, szTargetName[35];
	
	if(iArmor <= 0)	
	{
		console_print(id, "%L", id, "AMX_SUPER_AMOUNT_GREATER");
		
		return PLUGIN_HANDLED;
	}
	
	if(szArg[0] == '@')
	{
		new iPlayers[32], iPlayersNum, CmdTeam: Team;
		
		switch(szArg[1])
		{
			case 'T', 't':
			{	
				get_players(iPlayers, iPlayersNum, "ae", "TERRORIST");
				
				Team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayersNum, "ae", "CT");
				
				Team = CT;
			}
			
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayersNum, "a");
				
				Team = ALL;
			}
		}
		
		if(!iPlayersNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}

		for(new i = 0; i < iPlayersNum; i++)
			cs_set_user_armor(iPlayers[i], iArmor, CS_ARMOR_VESTHELM);
		
		show_activity_key("AMX_SUPER_ARMOR_TEAM_CASE1", "AMX_SUPER_ARMOR_TEAM_CASE2", szAdminName, iArmor, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_ARMOR_TEAM_LOG", szAdminName, szAdminAuthid, iArmor, g_szTeamNames[Team]);
	}
	
	else
	{	
		iTempid = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			cs_set_user_armor(iTempid, iArmor, CS_ARMOR_VESTHELM);
			
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			show_activity_key("AMX_SUPER_ARMOR_PLAYER_CASE1", "AMX_SUPER_ARMOR_PLAYER_CASE2", szAdminName, iArmor, szTargetName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_ARMOR_PLAYER_LOG", szAdminName, szAdminAuthid, iArmor, szTargetName, szTargetAuthid);
		}
	}

	return PLUGIN_HANDLED;
}


/* 3)	amx_teleport
 *------------------
*/
public Cmd_Teleport(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 5))
		return PLUGIN_HANDLED;
	
	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new iTempid = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
	
	if(iTempid)
	{
		new szOrigin1[5], szOrigin2[5], szOrigin3[5];
		read_argv(2, szOrigin1, charsmax(szOrigin1));
		read_argv(3, szOrigin2, charsmax(szOrigin2));
		read_argv(4, szOrigin3, charsmax(szOrigin3));
		
		new Float: flOrigin[3];
		flOrigin[0] = str_to_float(szOrigin1);
		flOrigin[1] = str_to_float(szOrigin2);
		flOrigin[2] = str_to_float(szOrigin3);
		
		engfunc(EngFunc_SetOrigin, iTempid, flOrigin);
		
		new szAdminName[35], szAdminAuthid[35];
		get_user_name(id, szAdminName, charsmax(szAdminName));
		get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		
		new szTargetName[35], szTargetAuthid[35];
		get_user_name(iTempid, szTargetName, charsmax(szTargetName));
		get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
		
		show_activity_key("AMX_SUPER_TELEPORT_PLAYER_CASE1", "AMX_SUPER_TELEPORT_PLAYER_CASE2", szAdminName, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_TELEPORT_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid, floatround(flOrigin[0]), floatround(flOrigin[1]), floatround(flOrigin[2]));
	}
	
	return PLUGIN_HANDLED;
}

/* 4)	amx_userorigin
 *--------------------
*/
public Cmd_UserOrigin(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2)) 
		return PLUGIN_HANDLED;

	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));

	new iTempid = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF);
	
	if(iTempid)
	{
		new szTargetName[35];
		get_user_origin(iTempid, g_iUserOrigin[id]);
		get_user_name(iTempid, szTargetName, charsmax(szTargetName));

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_TELEPORT_ORIGIN_SAVED", g_iUserOrigin[id][0], g_iUserOrigin[id][1], g_iUserOrigin[id][2], szTargetName);
	}
	
	return PLUGIN_HANDLED;
}

/* 5)	amx_stack
 *---------------
*/
public Cmd_Stack(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;

	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));

	new iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
	
	if(iTempid)
	{	
		new szType[5];
		read_argv(2, szType, charsmax(szType));
		
		new Float: flOrigin[3];
		pev(iTempid, pev_origin, flOrigin);

		new iYAxis = 36, iZAxis = 96;
		switch(str_to_num(szType))
		{
			case 0: iYAxis = 0;
			case 1: iZAxis = 0;
		}
	
		new iPlayers[32], iPlayerNum, iPlayer;
		get_players(iPlayers, iPlayerNum, "a");
		
		for(new i = 0; i < iPlayerNum ; i++)
		{
			iPlayer = iPlayers[i];
			
			if((iPlayer == id) || (get_user_flags(iPlayer) & ADMIN_IMMUNITY) && iPlayer != id) 
				continue;
				
			flOrigin[1] += iYAxis;
			flOrigin[2] += iZAxis;
			set_pev(iPlayer, pev_origin, flOrigin);
		}

		new szAdminName[35], szAdminAuthid[35];
		get_user_name(id, szAdminName, charsmax(szAdminName));
		get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		
		new szTargetName[35], szTargetAuthid[35];
		get_user_name(iTempid, szTargetName, charsmax(szTargetName));
		get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));

		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_STACK_PLAYER_MSG", szTargetName);
		
		show_activity_key("AMX_SUPER_STACK_PLAYER_CASE1", "AMX_SUPER_STACK_PLAYER_CASE2", szAdminName, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_STACK_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
	}

	return PLUGIN_HANDLED;
}

/*	6)	amx_gravity
 *-----------------
*/
public Cmd_Gravity(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))	
		return PLUGIN_HANDLED;
	
	if(read_argc() < 2)
	{
		console_print(id, "%L", id, "AMX_SUPER_GRAVITY_STATUS", get_pcvar_num(g_pGravity));
		
		return PLUGIN_HANDLED;
	}
	
	new szArg[5];
	read_argv(1, szArg, charsmax(szArg));
	set_pcvar_num(g_pGravity, str_to_num(szArg));
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	console_print(id, "%L", id, "AMX_SUPER_GRAVITY_MSG", szArg);
	
	show_activity_key("AMX_SUPER_GRAVITY_SET_CASE1", "AMX_SUPER_GRAVITY_SET_CASE2", szAdminName, szArg);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_GRAVITY_LOG", szAdminName, szAdminAuthid, szArg);
	
	return PLUGIN_HANDLED;
}

/* 7)	amx_unammo
 *----------------
*/
public Cmd_UnAmmo(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szArg1[35], szArg2[5];
	read_argv(1, szArg1, charsmax(szArg1));
	read_argv(2, szArg2, charsmax(szArg2));
	
	new iSetting = str_to_num(szArg2);
	
	new szAdminName[35], szAdminAuthid[35];
	new szTargetName[35];
	
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid;
	if(szArg1[0] == '@')
	{
		new CmdTeam: Team, iPlayers[32], iPlayerNum;
		
		switch(szArg1[1])
		{
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				Team = T;
			}
			
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				Team = ALL;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				Team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && iTempid != id)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			if(iSetting)
				SetPlayerBit(g_iUnammoBit, iTempid);
			
			else
				ClearPlayerBit(g_iUnammoBit, iTempid);
		}
		
		console_print(id, "%L", id, "AMX_SUPER_AMMO_TEAM_MSG", g_szTeamNames[Team], iSetting);
		
		show_activity_key("AMX_SUPER_AMMO_CASE1", "AMX_SUPER_AMMO_CASE2", szAdminName, g_szTeamNames[Team], iSetting);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_AMMO_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[Team], iSetting);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{	
			if(iSetting)
				SetPlayerBit(g_iUnammoBit, iTempid);
			
			else
				ClearPlayerBit(g_iUnammoBit, iTempid);
				
			new szTargetAuthid[35];
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			
			console_print(id, "%L", id, "AMX_SUPER_AMMO_PLAYER_MSG", szTargetName, iSetting);
			
			show_activity_key("AMX_SUPER_AMMO_PLAYER_CASE1", "AMX_SUPER_AMMO_PLAYER_CASE2", szAdminName, szTargetName, iSetting);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_AMMO_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid, iSetting);
		}
	}
	
	return PLUGIN_HANDLED;
}

public Event_CurWeapon(id)
{
	if(CheckPlayerBit(g_iUnammoBit, id))
	{
		new iWeaponid = read_data(2);
		new iClip = read_data(3);
	
		if(iWeaponid == CSW_C4 
		|| iWeaponid == CSW_KNIFE
		|| iWeaponid == CSW_HEGRENADE
		|| iWeaponid == CSW_SMOKEGRENADE
		|| iWeaponid == CSW_FLASHBANG) {
			return PLUGIN_CONTINUE;
		}
		
		if(!iClip)
		{
			new iSystime = get_systime();
			
			if(g_iReloadTime[id] >= iSystime - 1)
				return PLUGIN_CONTINUE;
			
			new szWeaponName[20];
			get_weaponname(iWeaponid, szWeaponName, charsmax(szWeaponName));
			
			new EntId = -1;
			while((EntId = engfunc(EngFunc_FindEntityByString, EntId, "classname", szWeaponName)) != 0)
			{	
				if(pev_valid(EntId) && pev(EntId, pev_owner) == id)
				{
					cs_set_weapon_ammo(EntId, getMaxClipAmmo(iWeaponid));
					
					break;
				}
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

getMaxClipAmmo(iWeaponid)
{
	new iClip = -1;
	
	switch(iWeaponid)
	{
		case CSW_P228: iClip = 13;
		case CSW_SCOUT, CSW_AWP: iClip = 10;
		case CSW_HEGRENADE, CSW_C4, CSW_SMOKEGRENADE, CSW_FLASHBANG, CSW_KNIFE: iClip = 0;
		case CSW_XM1014, CSW_DEAGLE: iClip = 7;
		case CSW_MAC10, CSW_AUG, CSW_SG550, CSW_MP5NAVY, CSW_M4A1, CSW_SG552, CSW_AK47: iClip = 30;
		case CSW_ELITE: iClip = 15;
		case CSW_FIVESEVEN, CSW_GLOCK18, CSW_G3SG1: iClip = 20;
		case CSW_UMP45, CSW_FAMAS: iClip = 25;
		case CSW_GALI: iClip = 35;
		case CSW_USP: iClip = 12;
		case CSW_M249: iClip = 100;
		case CSW_M3: iClip = 8;
		case CSW_P90: iClip = 50;
	}
	
	return iClip;
}		

/* 8a)	amx_weapon
 *----------------
*/
enum
{
	WEAPON_USP,
	WEAPON_GLOCK18,
	WEAPON_DEAGLE,
	WEAPON_P228,
	WEAPON_ELITE,
	WEAPON_FIVESEVEN,
	WEAPON_M3,
	WEAPON_XM1014,
	WEAPON_TMP,
	WEAPON_MAC10,
	WEAPON_MP5NAVY,
	WEAPON_P90,
	WEAPON_UMP45,
	WEAPON_FAMAS,
	WEAPON_GALIL,
	WEAPON_AK47,
	WEAPON_M4A1,
	WEAPON_SG552,
	WEAPON_AUG,
	WEAPON_SCOUT,
	WEAPON_SG550,
	WEAPON_AWP,
	WEAPON_G3SG1,
	WEAPON_M249,
	WEAPON_HEGRENADE,
	WEAPON_SMOKEGRENADE,
	WEAPON_FLASHBANG,
	WEAPON_SHIELD,
	WEAPON_C4,
	WEAPON_KNIFE,
	ITEM_KEVLAR,
	ITEM_ASSAULTSUIT,
	ITEM_THIGHPACK
};

new bpammo[] =  // 0 denotes a blank weapon id
{
	0,
	52,
	0,
	90,
	1,
	32,
	1,
	100,
	90,
	1,
	120,
	100,
	100,
	90,
	90,
	90,
	100,
	120,
	30,
	120,
	200,
	32,
	90,
	120,
	90,
	2,
	35,
	90,
	90,
	0,
	100
};
	
	

new g_szWeapons[33][] =
{
	"weapon_usp",
	"weapon_glock18",
	"weapon_deagle",
	"weapon_p228",
	"weapon_elite",
	"weapon_fiveseven",
	"weapon_m3",
	"weapon_xm1014",
	"weapon_tmp",
	"weapon_mac10",
	"weapon_mp5navy",
	"weapon_p90",
	"weapon_ump45",
	"weapon_famas",
	"weapon_galil",
	"weapon_ak47",
	"weapon_m4a1",
	"weapon_sg552",
	"weapon_aug",
	"weapon_scout",
	"weapon_sg550",
	"weapon_awp",
	"weapon_g3sg1",
	"weapon_m249",
	"weapon_hegrenade",
	"weapon_smokegrenade",
	"weapon_flashbang",
	"weapon_shield",
	"weapon_c4",
	"weapon_knife",
	"item_kevlar",
	"item_assaultsuit",
	"item_thighpack"
};

new g_szWeaponNames[][] = 
{
	"All Weapons",
	"Knife",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"Glock",
	"USP",
	"P228",
	"Deagle",
	"Fiveseven",
	"Dual Elites",
	"",
	"",
	"",
	"",
	"M3",
	"XM1014",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"TMP",
	"MAC10",
	"MP5 Navy",
	"P90",
	"UMP45",
	"",
	"",
	"",
	"",
	"Famas",
	"Galil",
	"AK47",
	"M4A1",
	"SG552",
	"AUG",
	"Scout",
	"SG550",
	"Awp",
	"G3SG1",
	"",
	"M249",
	"Kevlar and Helmit", //82
	"HE Grenade",
	"Flashbang",
	"Smoke Grenade",
	"Defuse Kit",
	"Shield",
	"",
	"",
	"",
	"C4",
	"Night Vision"
};

public Cmd_Weapon(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
	
	new szAdminName[32];
	get_user_name(id, szAdminName, 31);
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	new szArg1[32];
	read_argv(1, szArg1, 31);
	
	new szArg2[24];
	read_argv(2, szArg2, 23);
	
	new iWeapon = str_to_num(szArg2);
	
	if(szArg1[0] == '@')
	{	
		new iPlayers[32], iPlayerNum, CmdTeam: Team;
		
		
		switch(szArg1[1])
		{
			case 't', 'T':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i; i < iPlayerNum; i++)
			give_weapon(iPlayers[i], iWeapon);
					
		show_activity_key("AMX_SUPER_WEAPON_TEAM_CASE1", "AMX_SUPER_WEAPON_TEAM_CASE2", szAdminName, g_szTeamNames[Team]);

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_WEAPON_TEAM_MSG", iWeapon, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_WEAPON_TEAM_LOG", szAdminName, szAdminAuthid, iWeapon, g_szTeamNames[Team]);
	}
	
	else
	{
		new iPlayer = cmd_target(id, szArg1, 7);
		if(!iPlayer)
			return PLUGIN_HANDLED;
			
		give_weapon(iPlayer, iWeapon);
		
		new szTargetName[32];
		get_user_name(iPlayer, szTargetName, 31);
		
		new szTargetAuthid[36];
		get_user_authid(iPlayer, szTargetAuthid, 35);
		
		show_activity_key("AMX_SUPER_WEAPON_PLAYER_CASE1", "AMXX_SUPER_WEAPON_PLAYER_CASE2", szAdminName, szTargetName);

		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_WEAPON_PLAYER_MSG", iWeapon, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_WEAPON_PLAYER_LOG", szAdminName, szAdminAuthid, iWeapon, szTargetName, szTargetAuthid);
	}
	
	return PLUGIN_HANDLED;
}

/* 8b)	amx_weaponmenu
 *--------------------
*/
enum 
{ 
	All,
	Ct,
	Terro,
	Player
};

new gTeamChoice[33]
	, gPlayerName[33][34]
	, gPlayerId[33]
;

public Cmd_WeaponMenu(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;

	menu_display(id, g_iTeamMenu);
	return PLUGIN_HANDLED;
}

public CmdCallbackMenu(id)
	menu_display(id, g_iTeamMenu);

public TeamHandler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
		return PLUGIN_HANDLED;

	switch(iItem)
	{
		case 0:
			gTeamChoice[id] = All;
		
		case 1:
			gTeamChoice[id] = Ct;
		
		case 2:
			gTeamChoice[id]  = Terro;
		
		case 3:
			gTeamChoice[id] = Player;
	}
	
	if(gTeamChoice[id] != Player)
		WeaponMenu(id);
		
	else
		PlayerMenu(id);
	
	return PLUGIN_HANDLED;
}

public PlayerMenu(id)
{
	new szName[34], szId[6];
	new iPlayers[32], iPlayerNum, iTempid;
	get_players(iPlayers, iPlayerNum, "a");
	for(new i; i < iPlayerNum; i++)
	{
		iTempid = iPlayers[i];
		
		get_user_name(iTempid, szName, 33);
		num_to_str(iTempid, szId, 5);
			
		menu_additem(g_iPlayerMenu, szName, szId);
	}
	
	menu_display(id, g_iPlayerMenu);
}

public PlayerHandler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		CmdCallbackMenu(id);
		return PLUGIN_HANDLED;
	}
	
	new szInfo[6];
	new iAccess, iCallback;
	menu_item_getinfo(iMenu, iItem, iAccess, szInfo, 5, gPlayerName[id], 33, iCallback);
	
	gPlayerId[id] = str_to_num(szInfo);
	
	WeaponMenu(id);
	return PLUGIN_HANDLED;
}
	
public WeaponMenu(id)
{
	new szTitle[64], iMenu;
	
	switch(gTeamChoice[id])
	{	
		case All: 
			formatex(szTitle, charsmax(szTitle), "\rTeam: All Weapon ?");
		
		case Ct:
			formatex(szTitle, charsmax(szTitle), "\rTeam: CT Weapon ?");
		
		case Terro:
			formatex(szTitle, charsmax(szTitle), "\rTeam: T Weapon ?");
			
		case Player:
			formatex(szTitle, charsmax(szTitle), "\rPlayer: %s Weapon?", gPlayerName[id]);
	}
	
	iMenu = menu_create(szTitle, "WeaponHandler");
	
	new szInfo[6];
	for(new i; i < sizeof(g_szWeaponNames); i++)
	{
		if(strlen(g_szWeaponNames[i]))
		{
			num_to_str(i, szInfo, 5);
		
			menu_additem(iMenu, g_szWeaponNames[i], szInfo);
		}
	}
	
	menu_display(id, iMenu);
}

public WeaponHandler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		CmdCallbackMenu(id);
		return PLUGIN_HANDLED;
	}
	
	new szName[32], szInfo[6];
	new iAccess, iCallback;
	menu_item_getinfo(iMenu, iItem, iAccess, szInfo, 5, szName, 31, iCallback);
	
	new iChoice = str_to_num(szInfo);
	
	if(gTeamChoice[id] == Player)
	{
		switch(iChoice)
		{
			case 1..51:
				give_weapon(gPlayerId[id], iChoice);
			
			case 52..62:
				give_weapon(gPlayerId[id], (iChoice+30));
			
			default:
				give_weapon(gPlayerId[id], 200);
		}
	}
	
	else
	{
		new iPlayers[32], iPlayerNum;

		switch(gTeamChoice[id])
		{
			case All:
				get_players(iPlayers, iPlayerNum, "a");
			
			case Terro:
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
			
			case Ct:
				get_players(iPlayers, iPlayerNum, "ae", "CT");
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			switch(iChoice)
			{
				case 1..51:
					give_weapon(iPlayers[i], iChoice);
				
				case 52..62:
					give_weapon(iPlayers[i], (iChoice + 30));
				
				default: 
					give_weapon(iPlayers[i], 200);
			}
		}
	}
	
	menu_destroy(iMenu);
	return PLUGIN_HANDLED;
}

give_weapon(id,iWeapon)
{
	switch (iWeapon)
	{
		//Secondary g_szWeapons
		//Pistols
		case 1:
		{
			give_item(id,g_szWeapons[WEAPON_KNIFE]);
		}
		
		case 11:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_GLOCK18]);
		}
		
		case 12:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_USP]);
		}
		
		case 13:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_P228]);
		}
		
		case 14:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_DEAGLE]);
		}
		
		case 15:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_FIVESEVEN]);
		}
		
		case 16:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_ELITE]);
		}
		
		case 17:
		{
			//all pistols
			give_weapon(id,11);
			give_weapon(id,12);
			give_weapon(id,13);
			give_weapon(id,14);
			give_weapon(id,15);
			give_weapon(id,16);
		}
		
		//Primary g_szWeapons
		//Shotguns
		case 21:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_M3]);
		}
		
		case 22:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_XM1014]);
		}
		
		//SMGs
		case 31:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_TMP]);
		}
		
		case 32:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_MAC10]);
		}
		
		case 33:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_MP5NAVY]);
		}
		
		case 34:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_P90]);
		}
		
		case 35:
		{ 
			give_weapon_x(id, g_szWeapons[WEAPON_UMP45]);
		}
		
		//Rifles 
		case 40:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_FAMAS]);
		}
		
		case 41:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_GALIL]);
		}
		
		case 42:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_AK47]);
		}
		
		case 43:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_M4A1]);
		}
		
		case 44:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_SG552]);
		}
		
		case 45:
		{
			give_weapon_x(id,g_szWeapons[WEAPON_AUG]);
		}
		
		case 46:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_SCOUT]);
		}
		
		case 47:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_SG550]);
		}
		
		case 48:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_AWP]);
		}
		
		case 49:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_G3SG1]);
		}
		
		//Machine gun (M249 Para)
		case 51:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_M249]);
		}
		
		//Shield combos
		case 60:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
			give_weapon_x(id, g_szWeapons[WEAPON_GLOCK18]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		case 61:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
			give_weapon_x(id, g_szWeapons[WEAPON_USP]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		case 62:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
			give_weapon_x(id, g_szWeapons[WEAPON_P228]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		case 63:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
			give_weapon_x(id, g_szWeapons[WEAPON_DEAGLE]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		case 64:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
			give_weapon_x(id, g_szWeapons[WEAPON_FIVESEVEN]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		//Equipment 
		case 81:
		{
			give_item(id, g_szWeapons[ITEM_KEVLAR]);
		}
		
		case 82:
		{
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		case 83:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
		}
		
		case 84:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
		}
		
		case 85:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_SMOKEGRENADE]);
		}
		
		case 86:
		{
			give_item(id, g_szWeapons[ITEM_THIGHPACK]);
		}
		
		case 87:
		{
			give_item(id, g_szWeapons[WEAPON_SHIELD]);
		}
		
		//All ammo
		case 88:
		{
			new iWeapons[32], WeaponNum;

			get_user_weapons(id, iWeapons, WeaponNum);
			for(new i; i < WeaponNum; i++) 
				cs_set_user_bpammo(id, iWeapons[i], bpammo[iWeapons[i]]);

		}
		
		//All grenades
		case 89:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_SMOKEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
		}
		
		//C4
		case 91:
		{
			give_item(id, g_szWeapons[WEAPON_C4]);
			cs_set_user_plant(id, 1, 1);
		}
		
		case 92:
		{
			cs_set_user_nvg(id, 1);
		}
		
		//AWP Combo.
		case 100:
		{
			give_weapon_x(id, g_szWeapons[WEAPON_AWP]);
			give_weapon_x(id, g_szWeapons[WEAPON_DEAGLE]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
			give_weapon_x(id, g_szWeapons[WEAPON_SMOKEGRENADE]);
			give_item(id, g_szWeapons[ITEM_ASSAULTSUIT]);
		}
		
		//Money case.
 		case 160:
		{
			cs_set_user_money(id, 16000, 1);
		}
		
		//AllWeapons
		case 200:
		{
			//all up to wpnindex 51 are given.. replace w loop
			give_weapon_x(id, g_szWeapons[WEAPON_USP]);
			give_weapon_x(id, g_szWeapons[WEAPON_GLOCK18]);
			give_weapon_x(id, g_szWeapons[WEAPON_DEAGLE]);
			give_weapon_x(id, g_szWeapons[WEAPON_P228]);
			give_weapon_x(id, g_szWeapons[WEAPON_ELITE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FIVESEVEN]);
			give_weapon_x(id, g_szWeapons[WEAPON_M3]);
			give_weapon_x(id, g_szWeapons[WEAPON_XM1014]);
			give_weapon_x(id, g_szWeapons[WEAPON_TMP]);
			give_weapon_x(id, g_szWeapons[WEAPON_MAC10]);
			give_weapon_x(id, g_szWeapons[WEAPON_MP5NAVY]);
			give_weapon_x(id, g_szWeapons[WEAPON_P90]);
			give_weapon_x(id, g_szWeapons[WEAPON_UMP45]);
			give_weapon_x(id, g_szWeapons[WEAPON_FAMAS]);
			give_weapon_x(id, g_szWeapons[WEAPON_GALIL]);
			give_weapon_x(id, g_szWeapons[WEAPON_AK47]);
			give_weapon_x(id, g_szWeapons[WEAPON_M4A1]);
			give_weapon_x(id, g_szWeapons[WEAPON_SG552]);
			give_weapon_x(id, g_szWeapons[WEAPON_AUG]);
			give_weapon_x(id, g_szWeapons[WEAPON_SCOUT]);
			give_weapon_x(id, g_szWeapons[WEAPON_SG550]);
			give_weapon_x(id, g_szWeapons[WEAPON_AWP]);
 			give_weapon_x(id, g_szWeapons[WEAPON_G3SG1]);
			give_weapon_x(id, g_szWeapons[WEAPON_M249]);
			give_weapon_x(id, g_szWeapons[WEAPON_HEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_SMOKEGRENADE]);
			give_weapon_x(id, g_szWeapons[WEAPON_FLASHBANG]);
		}
		
		default: return false;
	}
	
	return true;
}

stock give_weapon_x(id, const szWeapon[])
{
	give_item(id, szWeapon);
	
	new iWeaponid = get_weaponid(szWeapon);
	
	if(iWeaponid)
		cs_set_user_bpammo(id, iWeaponid, bpammo[iWeaponid]);
}


/* 9)	amx_drug
 *--------------
*/
public Cmd_Drug(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szArg1[24];
	read_argv(1, szArg1, 23);
	
	new szLength[6];
	read_argv(2, szLength, 2);
	
	new szAdminName[32], szAdminAuthid[32];
	get_user_name( id, szAdminName, 31 );
	get_user_authid( id, szAdminAuthid, 31 );
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, iPlayer, CmdTeam: Team;

		switch(szArg1[1])
		{
			case 't', 'T':	
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iPlayer = iPlayers[i];
			
			if((get_user_flags(iPlayer) & ADMIN_IMMUNITY) && iPlayer != id)
			{
				get_user_name(iPlayer, szArg1, charsmax(szArg1));
				console_print(id, "%L", "AMX_SUPER_TEAM_IMMUNITY", szArg1);
				
				continue;
			}
			
			set_user_drugs(iPlayers[i], str_to_num(szLength));
		}
		


		show_activity_key("AMX_SUPER_DRUG_TEAM_CASE1", "AMX_SUPER_DRUG_TEAM_CASE2", szAdminName, g_szTeamNames[Team]);

		console_print( id, "%L", id, "AMX_SUPER_DRUG_TEAM_MSG", g_szTeamNames[Team]);
		log_amx( "%L", LANG_SERVER, "AMX_SUPER_DRUG_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[Team]);
	}
	
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(!iPlayer)
			return PLUGIN_HANDLED;

		set_user_drugs(iPlayer, str_to_num(szLength));
		
		new szTargetName[32], szTargetAuthid[32];
		get_user_name( iPlayer, szTargetName, 31 );
		get_user_authid( iPlayer, szTargetAuthid, 31 );

		show_activity_key("AMX_SUPER_DRUG_PLAYER_CASE1", "AMX_SUPER_DRUG_PLAYER_CASE2", szAdminName, szTargetName);

		console_print( id, "%L", id, "AMX_SUPER_DRUG_PLAYER_MSG", szTargetName );
		log_amx( "%L", LANG_SERVER, "AMX_SUPER_DRUG_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid );
	}
	
	return PLUGIN_HANDLED;
}

set_user_drugs(id, x)
{
	switch(x)
	{
		case 1,2:
		{
			message_begin(MSG_ONE, g_iMsgSetFOV, _, id);
			write_byte(180);
			message_end();
			
			if (x == 2)
				g_iFlags[id] |= PERMDRUGS;
		}

		default:
		{
			message_begin(MSG_ONE, g_iMsgSetFOV, _, id);
			write_byte(90);
			message_end();
			
			g_iFlags[id] &= ~PERMDRUGS;
		}
	}
}

/*	10)		amx_godmode
 *---------------------
*/
public Cmd_Godmode(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szAdminName[32];
	get_user_name(id, szAdminName, 31);
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	new szArg1[24];
	read_argv(1, szArg1, 23);
	
	new szLength[6];
	read_argv(2, szLength, 2);
	
	new iGodmodeFlags = str_to_num(szLength);
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, iTempid, CmdTeam: Team;
		
		switch(szArg1[1])
		{
			case 't', 'T':	
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if(!iGodmodeFlags)
				g_iFlags[iTempid] &= ~PERMGOD;
				
			else if(iGodmodeFlags == 2)
				g_iFlags[iTempid] |= PERMGOD;
				
			set_user_godmode(iTempid, !!iGodmodeFlags);
			
		}

		show_activity_key("AMX_SUPER_GODMODE_TEAM_CASE1", "AMX_SUPER_GODMODE_TEAM_CASE2", szAdminName, iGodmodeFlags, g_szTeamNames[Team]);

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_GODMODE_TEAM_MSG", iGodmodeFlags, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GODMODE_TEAM_LOG", szAdminName, szAdminAuthid, iGodmodeFlags, g_szTeamNames[Team]);
	}
	
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(!iPlayer)
			return PLUGIN_HANDLED;

		new szTargetName[32], szTargetAuthid[35];
		get_user_name(iPlayer, szTargetName, 31);
		get_user_authid(iPlayer, szTargetAuthid, charsmax(szTargetAuthid));
		
		set_user_godmode(iPlayer, !!iGodmodeFlags);
		
		if(!iGodmodeFlags)
			g_iFlags[iPlayer] &= ~PERMGOD;
			
		else if (iGodmodeFlags == 2)
			g_iFlags[iPlayer] |= PERMGOD;

		show_activity_key("AMX_SUPER_GODMODE_PLAYER_CASE1", "AMX_SUPER_GODMODE_PLAYER_CASE2", szAdminName, iGodmodeFlags, szTargetName);

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_GODMODE_PLAYER_MSG", iGodmodeFlags, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GODMODE_PLAYER_LOG", szAdminName, szAdminAuthid, iGodmodeFlags, szTargetName, szTargetAuthid);
	}
	
	return PLUGIN_HANDLED;
}

/* 11)	amx_setmoney
 *-------------------
*/

// TODO: UPDATE ALL NON-EN ML STRINGS
public Cmd_SetMoney(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	new szAdminName[32];
	get_user_name(id, szAdminName, 31);
	
	new szArg1[32];
	read_argv(1, szArg1, 31);
	
	new szArg2[32];
	read_argv(2, szArg2, 31);
	
	new iMoney = str_to_num(szArg2);
	if(iMoney > 16000)
		iMoney = 16000;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, CmdTeam: Team;
		
		switch(szArg1[1])
		{
			case 't', 'T':	
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i = 0; i < iPlayerNum; i++)				
			cs_set_user_money(iPlayers[i], iMoney);
	
		show_activity_key("AMX_SUPER_GIVEMONEY_TEAM_CASE1", "AMX_SUPER_GIVEMONEY_TEAM_CASE2", szAdminName, g_szTeamNames[Team], iMoney);
		
		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_GIVEMONEY_TEAM_MSG", g_szTeamNames[Team], iMoney);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GIVEMONEY_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[Team], iMoney);
	}
	
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF);
		if(!iPlayer)
			return PLUGIN_HANDLED;
		
		cs_set_user_money(iPlayer, iMoney);
		
		new szTargetName[32];
		get_user_name(iPlayer, szTargetName, 31);
		
		new szTargetAuthid[36];
		get_user_authid(iPlayer, szTargetAuthid, 35);
		
		show_activity_key("AMX_SUPER_GIVEMONEY_PLAYER_CASE1", "AMX_SUPER_GIVEMONEY_PLAYER_CASE2", szAdminName, szTargetName, iMoney);
		
		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_GIVEMONEY_PLAYER_MSG", szTargetName, iMoney);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GIVEMONEY_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid, iMoney);
	}
	
	return PLUGIN_HANDLED;
}

/* 12)	amx_noclip
 *----------------
*/
public Cmd_Noclip(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szAdminName[32];
	get_user_name(id, szAdminName, 31);
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	new szArg1[24];
	read_argv(1, szArg1, 23);
	
	new szLength[6];
	read_argv(2, szLength, 2);
	
	new iSetting = str_to_num(szLength);
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, iTempid, CmdTeam: Team;
	
		switch(szArg1[1])
		{
			case 't', 'T':	
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
						
			if(!iSetting)
				g_iFlags[iTempid] &= ~PERMNOCLIP;
				
			else if (iSetting == 2)
				g_iFlags[iTempid] |= PERMNOCLIP;
				
			set_user_noclip(iTempid, !!iSetting);

		}
				
		show_activity_key("AMX_SUPER_NOCLIP_TEAM_CASE1", "AMX_SUPER_NOCLIP_TEAM_CASE2", szAdminName, iSetting, g_szTeamNames[Team]);
		
		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_NOCLIP_TEAM_MSG", iSetting, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_NOCLIP_TEAM_LOG", szAdminName, szAdminAuthid, iSetting, g_szTeamNames[Team]);
	}
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		if(!iPlayer)
			return PLUGIN_HANDLED;

		new szTargetName[32];
		get_user_name(iPlayer, szTargetName, 31);
		
		new szTargetAuthid[36];
		get_user_authid(iPlayer, szTargetAuthid, 35);

		set_user_noclip(iPlayer, !!iSetting);
		
		if(!iSetting)
			g_iFlags[iPlayer] &= ~PERMNOCLIP;
			
		else if (iSetting == 2)
			g_iFlags[iPlayer] |= PERMNOCLIP;

		
		show_activity_key("AMX_SUPER_NOCLIP_PLAYER_CASE1", "AMX_SUPER_NOCLIP_PLAYER_CASE2", szAdminName, iSetting, szTargetName);

		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_NOCLIP_PLAYER_MSG",iSetting, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_NOCLIP_PLAYER_LOG", szAdminName, szAdminAuthid, iSetting, szTargetName, szTargetAuthid);
	}
	
	return PLUGIN_HANDLED;
}

/* 13)	amx_speed
 *---------------
*/
public LogEventRoundStart()
	g_bIsFreezeTime = false;

public EventFreezeTime()
	g_bIsFreezeTime = true;
	
public FwdPlayerSpeedPost(id)
{
	if(!g_bIsFreezeTime && (g_iFlags[id] & HASSPEED) || (g_iFlags[id] & PERMSPEED))
		SetSpeed(id, 1);
}
		
public Cmd_Speed(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szAdminName[32];
	get_user_name(id, szAdminName, 31);
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	new szArg1[24];
	read_argv(1, szArg1, 23);
	
	new szLength[6];
	read_argv(2, szLength, 2);
	
	new iSpeedFlag = str_to_num(szLength);
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, CmdTeam: Team;
		
		switch(szArg1[1])
		{
			case 't', 'T':	
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				Team = T;
			}
			
			case 'c', 'C':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				Team = CT;
			}
			
			case 'a', 'A':
			{
				get_players(iPlayers, iPlayerNum, "a");
				Team = ALL;
			}
		}
		
		for(new i = 0; i < iPlayerNum; i++)
			SetSpeed(iPlayers[i], iSpeedFlag);
		
		show_activity_key("AMX_SUPER_SPEED_TEAM_CASE1", "AMX_SUPER_SPEED_TEAM_CASE2", szAdminName, iSpeedFlag, g_szTeamNames[Team]);

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_SPEED_TEAM_MSG", iSpeedFlag, g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_SPEED_TEAM_LOG", szAdminName, szAdminAuthid, iSpeedFlag, g_szTeamNames[Team]);
	}
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		if(!iPlayer)
			return PLUGIN_HANDLED;
			
		new szTargetName[32];
		get_user_name(iPlayer, szTargetName, 31);
		
		SetSpeed(iPlayer, iSpeedFlag);

		show_activity_key("AMX_SUPER_SPEED_PLAYER_CASE1", "AMX_SUPER_SPEED_PLAYER_CASE2", szAdminName, iSpeedFlag, szTargetName);

		console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_SPEED_PLAYER_MSG", iSpeedFlag, szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_SPEED_PLAYER_LOG", szAdminName, szAdminAuthid, iSpeedFlag, szTargetName);
	}
	
	return PLUGIN_HANDLED;
}

SetSpeed(id, iSetting)
{
	if(!iSetting)
	{
		// Provided by ConnorMcLeod from cs_reset_user_maxspeed function in some of his plugns
		new Float:flMaxSpeed;
		
		switch ( get_user_weapon(id) )
		{
			case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = 210.0;
			case CSW_M249 : flMaxSpeed = 220.0;
			case CSW_AK47 : flMaxSpeed = 221.0;
			case CSW_M3, CSW_M4A1 : flMaxSpeed = 230.0;
			case CSW_SG552 : flMaxSpeed = 235.0;
			case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = 240.0;
			case CSW_P90 : flMaxSpeed = 245.0;
			case CSW_SCOUT : flMaxSpeed = 260.0;
			default : flMaxSpeed = 250.0;
		}
		set_user_maxspeed(id, flMaxSpeed);
		
		g_iFlags[id] &= ~HASSPEED;
		g_iFlags[id] &= ~PERMSPEED;
	}
	
	else
	{
		new iFlag = iSetting == 2 ? PERMSPEED : HASSPEED;
		g_iFlags[id] |= iFlag;
			
		set_user_maxspeed(id, (get_user_maxspeed(id) * 2.0));
	}
}

/* 14)	amx_revive
 *----------------
*/
public Cmd_Revive(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szArg1[24];
	read_argv(1, szArg1, 23);
	
	new szAdminName[34];
	get_user_name(id, szAdminName, 33);
	
	new szAdminAuthid[36];
	get_user_authid(id, szAdminAuthid, 35);
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, iPlayer, CmdTeam: Team;
		get_players(iPlayers, iPlayerNum);

		switch(szArg1[1])
		{
			case 't', 'T': Team = T;
			case 'c', 'C': Team = CT;
			case 'a', 'A': Team = ALL;
		}		
		
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iPlayer = iPlayers[i];
			
			switch(Team)
			{
				case T:
				{
					if(cs_get_user_team(iPlayer) == CS_TEAM_T)
						ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
				}
				
				case CT:
				{
					if(cs_get_user_team(iPlayer) == CS_TEAM_CT)
						ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
				}
				
				case ALL:
				{
					if(CS_TEAM_UNASSIGNED < cs_get_user_team(iPlayer) < CS_TEAM_SPECTATOR)
						ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
				}
			}
		}
		
		show_activity_key("AMX_SUPER_REVIVE_TEAM_CASE1", "AMX_SUPER_REVIVE_TEAM_CASE2", szAdminName, g_szTeamNames[Team]);
	
		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_REVIVE_TEAM_MSG", g_szTeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_REVIVE_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[Team]);
	}
	else
	{
		new iPlayer = cmd_target(id, szArg1, CMDTARGET_ALLOW_SELF);
		if(!iPlayer || !(CS_TEAM_UNASSIGNED < cs_get_user_team(iPlayer) < CS_TEAM_SPECTATOR))
			return PLUGIN_HANDLED;

		ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
		
		new szTargetName[34];
		get_user_name(iPlayer, szTargetName, 33);
		
		new szTargetAuthid[36];
		get_user_authid(iPlayer, szTargetAuthid, 35);
		
		show_activity_key("AMX_SUPER_REVIVE_PLAYER_CASE1", "AMX_SUPER_REVIVE_PLAYER_CASE2", szAdminName, szTargetName);
		
		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_REVIVE_PLAYER_MSG", szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_REVIVE_PLAYER_LOG",szAdminName, szTargetAuthid, szTargetName, szTargetAuthid);
	}
	
	return PLUGIN_HANDLED;
}

/* 15)	amx_bury
 *--------------
*/
public Cmd_Bury(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szArg1[32];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szTargetName[32];
	
	new szAdminName[32];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	
	new szAdminAuthid[25];
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && iTempid != id)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
				
			BuryPlayer(iTempid);
		}
		
		show_activity_key("AMX_SUPER_BURY_TEAM_CASE1", "AMX_SUPER_BURY_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		
		log_amx("%L", LANG_SERVER, "AMX_SUPER_BURY_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			BuryPlayer(iTempid);
			
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			
			new szTargetAuthid[25];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			
			log_amx("%L", LANG_SERVER, "AMX_SUPER_BURY_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			show_activity_key("AMX_SUPER_BURY_PLAYER_CASE1", "AMX_SUPER_BURY_PLAYER_CASE2", szAdminName, szTargetName);

			console_print(id, "%L", id, "AMX_SUPER_BURY_MSG", szTargetName);
		}
	}
	
	return PLUGIN_HANDLED;
}

BuryPlayer(iTempid)
{
	new szVictimName[32];
	get_user_name(iTempid, szVictimName, charsmax(szVictimName));
	
	new iWeapons[32], iWeapon;
	get_user_weapons(iTempid, iWeapons, iWeapon);
	
	new szWeaponName[32];
	for(new i = 0; i < iWeapon; i++)
	{
		get_weaponname(iWeapons[i], szWeaponName, charsmax(szWeaponName));
		engclient_cmd(iTempid, "drop", szWeaponName);
	}
	
	engclient_cmd(iTempid, "weapon_knife");
	
	new Float: flOrigin[3];
	pev(iTempid, pev_origin, flOrigin);
	
	flOrigin[2] -= 30.0;
	engfunc(EngFunc_SetOrigin, iTempid, flOrigin);
}

/*	16)		amx_unbury
 *--------------------
*/
public Cmd_Unbury(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szArg1[32];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szTargetName[32];
	
	new szAdminName[32];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	
	new szAdminAuthid[25];
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		
	new iTempid;
	
	if(szArg1[0] == '@')
	{	
		new iPlayers[32], iPlayerNum, CmdTeam: team;
	
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{			
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && iTempid != id)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			UnburyPlayer(iTempid);
		}
			
		show_activity_key("AMX_SUPER_UNBURY_TEAM_CASE1", "AMX_SUPER_UNBURY_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_UNBURY_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			UnburyPlayer(iTempid);
			
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			
			
			new szTargetAuthid[25];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));

			log_amx("%L", LANG_SERVER, "AMX_SUPER_UNBURY_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			show_activity_key("AMX_SUPER_UNBURY_PLAYER_CASE1", "AMX_SUPER_UNBURY_PLAYER_CASE2", szAdminName, szTargetName);
			
			console_print(id, "%L", id, "AMX_SUPER_UNBURY_MSG", szTargetName);
			
		}
	}

	return PLUGIN_HANDLED;
}

UnburyPlayer(iTempid)
{
	new szVictimName[32];
	get_user_name(iTempid, szVictimName, charsmax(szVictimName));
	
	new Float: flOrigin[3];
	pev(iTempid, pev_origin, flOrigin);
	
	flOrigin[2] += 35.0;
	engfunc(EngFunc_SetOrigin, iTempid, flOrigin);
}

/* 17)	amx_disarm
 *----------------
*/
public Cmd_Disarm(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;

	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szAdminName[35], szTargetName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	
	new szAdminAuthid[35];
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && iTempid != id)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			strip_user_weapons(iTempid);
			set_pdata_int(iTempid, OFFSET_PRIMARYWEAPON, 0);		// Bugfix.
			give_item(iTempid, "weapon_knife");
		}
			
		show_activity_key("AMX_SUPER_DISARM_TEAM_CASE1", "AMX_SUPER_DISARM_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_DISARM_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			strip_user_weapons(id);
			set_pdata_int(id, OFFSET_PRIMARYWEAPON, 0);
			give_item(id, "weapon_knife");
			
			new szTargetAuthid[25];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));

			log_amx("%L", LANG_SERVER, "AMX_SUPER_DISARM_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			show_activity_key("AMX_SUPER_DISARM_PLAYER_CASE1", "AMX_SUPER_DISARM_PLAYER_CASE2", szAdminName, szTargetName);

			console_print(id, "%L", id, "AMX_SUPER_DISARM_MSG", szTargetName);
		}
	}
	
	return PLUGIN_HANDLED;
}

/* 18)	amx_slay2
 *---------------
*/
public Cmd_Slay2(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szArg1[35], szSetting[2];
	
	new szAdminName[35], szTargetName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	
	new szAdminAuthid[35];
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid, CmdTeam: team;
	
	read_argv(1, szArg1, charsmax(szArg1));
	read_argv(2, szSetting, charsmax(szSetting));
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && iTempid != id)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			slay_player(iTempid, str_to_num(szSetting));
		}
			
		show_activity_key("AMX_SUPER_SLAY2_TEAM_CASE1", "AMX_SUPER_SLAY2_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_SLAY2_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			slay_player(iTempid, str_to_num(szSetting));
			
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			
			new szTargetAuthid[25];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			
			log_amx("%L", LANG_SERVER, "AMX_SUPER_SLAY2_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			show_activity_key("AMX_SUPER_SLAY2_PLAYER_CASE1", "AMX_SUPER_SLAY2_PLAYER_CASE2", szAdminName, szTargetName);
			
			console_print(id, "%L", id, "AMX_SUPER_SLAY2_PLAYER_MSG", szTargetName);
		}
	}
	
	return PLUGIN_HANDLED;
}

slay_player(iVictim,type)
{
	new iOrigin[3];
	get_user_origin(iVictim, iOrigin);

	iOrigin[2] -= 26;

	switch(type)
	{
		case 1:
		{
			new iSourceOrigin[3];
			iSourceOrigin[0] = iOrigin[0] + 150;
			iSourceOrigin[1] = iOrigin[1] + 150;
			iSourceOrigin[2] = iOrigin[2] + 400;
			lightning(iSourceOrigin, iOrigin);
			
			emit_sound(iVictim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
		}
		
		case 2:
		{
			blood(iOrigin);
			emit_sound(iVictim,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
		}
		case 3: 
			explode(iOrigin);
	}
	
	user_kill(iVictim, 1);
}

explode(iOrigin[3]) 
{
	//Blast Circles
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin);
	write_byte(21);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2] + 16);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2] + 1936);
	write_short(g_iWhiteSpr);
	write_byte(0); // startframe
	write_byte(0); // framerate
	write_byte(2); // life
	write_byte(16); // width
	write_byte(0); // noise
	write_byte(188); // r
	write_byte(220); // g
	write_byte(255); // b
	write_byte(255); //brightness
	write_byte(0); // speed
	message_end();

	//Explosion2
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(12);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	write_byte(188); // byte (scale in 0.1's)
	write_byte(10); // byte (framerate)
	message_end();

	//Smoke
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin);
	write_byte(5);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	write_short(g_iSmokeSpr);
	write_byte(2);
	write_byte(10);
	message_end();
}

blood(iOrigin[3]) 
{
	//LAVASPLASH
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(10);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	message_end();
}

lightning (iOrigin[3],iOrigin2[3]) 
{
	//Lightning
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(0);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	write_coord(iOrigin2[0]);
	write_coord(iOrigin2[1]);
	write_coord(iOrigin2[2]);
	write_short(g_iLightSpr);
	write_byte(1); // framestart
	write_byte(5); // framerate
	write_byte(2); // life
	write_byte(20); // width
	write_byte(30); // noise
	write_byte(200); // r, g, b
	write_byte(200); // r, g, b
	write_byte(200); // r, g, b
	write_byte(200); // brightness
	write_byte(200); // speed
	message_end();

	//Sparks
	message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin2);
	write_byte(9);
	write_coord(iOrigin2[0]);
	write_coord(iOrigin2[1]);
	write_coord(iOrigin2[2]);
	message_end();

	//Smoke
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin2);
	write_byte(5);
	write_coord(iOrigin2[0]);
	write_coord(iOrigin2[1]);
	write_coord(iOrigin2[2]);
	write_short(g_iSmokeSpr);
	write_byte(10);
	write_byte(10);
	message_end();
}

/* 19)	amx_rocket
 *----------------
*/
new g_iRocketZAxis[33];

public Cmd_Rocket(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
		
	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szAdminName[35], szTargetName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum, CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && id != iTempid)
			{	
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			emit_sound(iTempid, CHAN_WEAPON , "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
			set_user_maxspeed(iTempid,0.01);
			
			set_task(1.2, "Task_Rocket_LiftOff" , iTempid);
		}
		
		console_print(id, "%L", id, "AMX_SUPER_ROCKET_TEAM_MSG", g_szTeamNames[team]);
		
		show_activity_key("AMX_SUPER_ROCKET_TEAM_CASE1", "AMX_SUPER_ROCKET_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_ROCKET_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			emit_sound(iTempid, CHAN_WEAPON, "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
			set_user_maxspeed(iTempid, 0.01);
			
			set_task(1.2, "Task_Rocket_LiftOff", iTempid);
			
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
						
			show_activity_key("AMX_SUPER_ROCKET_PLAYER_CASE1", "AMX_SUPER_ROCKET_PLAYER_CASE2", szAdminName, szTargetName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_ROCKET_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			
			console_print(id, "%L", id, "AMX_SUPER_ROCKET_PLAYER_MSG", szTargetName);
		}
	}
	
	return PLUGIN_HANDLED;
}
		
public Task_Rocket_LiftOff(iVictim)
{
	if(!is_user_alive(iVictim))
		return;
		
	set_user_gravity(iVictim, -0.50);
	client_cmd(iVictim, "+jump;wait;wait;-jump");
	emit_sound(iVictim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM);
	
	rocket_effects(iVictim);
}

public rocket_effects(iVictim)
{
	if(!is_user_alive(iVictim)) 
		return;

	new iOrigin[3];
	get_user_origin(iVictim,iOrigin);

	message_begin(MSG_ONE, g_iMsgDamage, {0,0,0}, iVictim);
	write_byte(30); // dmg_save
	write_byte(30); // dmg_take
	write_long(1<<16); // visibleDamageBits
	write_coord(iOrigin[0]); // damageOrigin.x
	write_coord(iOrigin[1]); // damageOrigin.y
	write_coord(iOrigin[2]); // damageOrigin.z
	message_end();

	if(g_iRocketZAxis[iVictim] == iOrigin[2]) 
		rocket_explode(iVictim);

	g_iRocketZAxis[iVictim] = iOrigin[2];

	//Draw Trail and effects

	//TE_SPRITETRAIL - line of moving glow sprites with gravity, fadeout, and collisions
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(15);
	write_coord(iOrigin[0]); // coord, coord, coord (start)
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	write_coord(iOrigin[0]); // coord, coord, coord (end)
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2] - 30);
	write_short(g_iBlueflare2Spr); // short (sprite index)
	write_byte(5); // byte (count)
	write_byte(1); // byte (life in 0.1's)
	write_byte(1);  // byte (scale in 0.1's)
	write_byte(10); // byte (velocity along vector in 10's)
	write_byte(5);  // byte (randomness of velocity in 10's)
	message_end();

	//TE_SPRITE - additive sprite, plays 1 cycle
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
	write_byte(17);
	write_coord(iOrigin[0]);  // coord, coord, coord (position)
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2] - 30);
	write_short(g_iMflashSpr); // short (sprite index)
	write_byte(15); // byte (scale in 0.1's)
	write_byte(255); // byte (brightness)
	message_end();

	set_task(0.2, "rocket_effects", iVictim);
}

public rocket_explode(iVictim)
{
	if(is_user_alive(iVictim)) 
	{
		new iOrigin[3];
		get_user_origin(iVictim, iOrigin);

		// blast circles
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin);
		write_byte(21);
		write_coord(iOrigin[0]);
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2] - 10);
		write_coord(iOrigin[0]);
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2] + 1910);
		write_short(g_iWhiteSpr);
		write_byte(0); // startframe
		write_byte(0); // framerate
		write_byte(2); // life
		write_byte(16); // width
		write_byte(0); // noise
		write_byte(188); // r
		write_byte(220); // g
		write_byte(255); // b
		write_byte(255); //brightness
		write_byte(0); // speed
		message_end();

		//Explosion2
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(12);
		write_coord(iOrigin[0]);
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2]);
		write_byte(188); // byte (scale in 0.1's)
		write_byte(10); // byte (framerate)
		message_end();

		//smoke
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin);
		write_byte(5);
		write_coord(iOrigin[0]);
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2]);
		write_short(g_iSmokeSpr);
		write_byte(2);
		write_byte(10);
		message_end();

		user_kill(iVictim, 1);
	}

	//stop_sound
	emit_sound(iVictim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM);

	set_user_maxspeed(iVictim, 1.0);
	set_user_gravity(iVictim, 1.00);
}

/* 20)	amx_fire
 *--------------
*/
public Cmd_Fire(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
		
	new szAdminName[35], szAdminAuthid[35], szTargetName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum;
		new CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && id != iTempid)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
		
			SetPlayerBit(g_iOnFireBit, iTempid);
			
			ignite_effects(iTempid);
			ignite_player(iTempid);
		}
		
		show_activity_key("AMX_SUPER_FIRE_TEAM_CASE1", "AMX_SUPER_FIRE_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_FIRE_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			SetPlayerBit(g_iOnFireBit, iTempid);
			
			ignite_effects(iTempid);
			ignite_player(iTempid);
		
			show_activity_key("AMX_SUPER_FIRE_PLAYER_CASE1", "AMX_SUPER_FIRE_PLAYER_CASE2", szAdminName, szTargetName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_FIRE_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			
			console_print(id, "%L", id, "AMX_SUPER_FIRE_PLAYER_MSG", szTargetName);
		}
	}
	
	return PLUGIN_HANDLED;
}
	
public ignite_effects(id)  
{
	if(is_user_alive(id) && CheckPlayerBit(g_iOnFireBit, id))
    {
		new iOrigin[3];
		get_user_origin(id, iOrigin);
		
		//TE_SPRITE - additive sprite, plays 1 cycle
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(17);
		write_coord(iOrigin[0]);  // coord, coord, coord (position)
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2]);
		write_short(g_iMflashSpr); // short (sprite index)
		write_byte(20); // byte (scale in 0.1's)
		write_byte(200); // byte (brightness)
		message_end();
		
		//Smoke
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
		write_byte(5);
		write_coord(iOrigin[0]);// coord coord coord (position)
		write_coord(iOrigin[1]);
		write_coord(iOrigin[2]);
		write_short(g_iSmokeSpr);// short (sprite index)
		write_byte(20); // byte (scale in 0.1's)
		write_byte(15); // byte (framerate)
		message_end();
		
		set_task(0.2, "ignite_effects", id);
	}
	
	else    
	{
		if(CheckPlayerBit(g_iOnFireBit, id))
		{
			emit_sound(id, CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH);
			ClearPlayerBit(g_iOnFireBit, id);
		}
	}
}

public ignite_player(id)   
{
	if(is_user_alive(id) && CheckPlayerBit(g_iOnFireBit, id)) 
	{
		new iIdOrigin[3];
				
		new iHealth = get_user_health(id);
		get_user_origin(id, iIdOrigin);
		
		//create some damage
		set_user_health(id, iHealth - 10);
		
		message_begin(MSG_ONE, g_iMsgDamage, _, id);
		write_byte(30); // dmg_save
		write_byte(30); // dmg_take
		write_long(1<<21); // visibleDamageBits
		write_coord(iIdOrigin[0]); // damageOrigin.x
		write_coord(iIdOrigin[1]); // damageOrigin.y
		write_coord(iIdOrigin[2]); // damageOrigin.z
		message_end();
		
		//create some sound
		emit_sound(id, CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM);
		
		//Ignite Others 
		if(get_pcvar_num(g_pAllowCatchFire)) 
		{       
			new iTempOriginOrigin[3];
			
			new iPlayers[32], iPlayerNum, iTempid;
			get_players(iPlayers, iPlayerNum, "a");
			
			new szVictimName[32], szIgniterName[32]; 
			
			for(new i = 0; i < iPlayerNum; ++i) 
			{                   
				iTempid = iPlayers[i];
				
				get_user_origin(iTempid, iTempOriginOrigin);
				
				if(get_distance(iIdOrigin, iTempOriginOrigin) < 100)
				{ 
					if(!CheckPlayerBit(g_iOnFireBit, iTempid)) 
					{ 
						get_user_name(iTempid, szVictimName, charsmax(szVictimName));
						get_user_name(id, szIgniterName, charsmax(szIgniterName)); 
						
						emit_sound(iTempid, CHAN_WEAPON, "scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH); 
						client_print(0, print_chat, "* [AMX] OH! NO! %s has caught %s on fire!", szIgniterName, szVictimName);
						
						SetPlayerBit(g_iOnFireBit, iTempid);
						
						ignite_player(iTempid);
						ignite_effects(iTempid);
					}                
				} 
			}           
		} 
		
		//Call Again in 2 seconds       
		set_task(2.0, "ignite_player", id);       
	}    
} 

/* 21)	amx_flash
 *---------------
*/
public Cmd_Flash(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szArg1[35], szTargetName[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum;
		new CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && id != iTempid)
			{
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			Flash_Player(iTempid);
		}
		
		console_print(id, "%L", id, "AMX_SUPER_FLASH_TEAM_MSG", g_szTeamNames[team]);
		
		show_activity_key("AMX_SUPER_FLASH_TEAM_CASE1", "AMX_FLASH_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_FLASH_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			Flash_Player(iTempid);
			
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			console_print(id, "%L", id, "AMX_SUPER_FLASH_PLAYER_MSG", szTargetName);
			
			show_activity_key("AMX_SUPER_FLASH_PLAYER_CASE1", "AMX_SUPER_FLASH_PLAYER_CASE2", szAdminName, szTargetName);
			
			log_amx("%L", LANG_SERVER, "AMX_SUPER_FLASH_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
		}
	}
	
	return PLUGIN_HANDLED;
}

Flash_Player(id)
{
	message_begin(MSG_ONE, g_iMsgScreenFade, {0,0,0}, id);
	write_short(1<<15);
	write_short(1<<10);
	write_short(1<<12);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	message_end();

	if(get_pcvar_num(g_pFlashSound))
		emit_sound(id, CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH);
}

/* 22)	amx_uberslap
 *------------------
*/
public Cmd_UberSlap(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
	new szArg1[35];
	read_argv(1, szArg1, charsmax(szArg1));
	
	new szTargetName[35], szAdminName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
			
	new szAdminAuthid[35];
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	new iTempid;
	
	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum;
		new CmdTeam: team;
		
		switch(szArg1[1])
		{
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum, "a");
				
				team = ALL;
			}
			
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "ae", "TERRORIST");
				
				team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "ae", "CT");
				
				team = CT;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if((get_user_flags(iTempid) & ADMIN_IMMUNITY) && id != iTempid)
			{	
				get_user_name(iTempid, szTargetName, charsmax(szTargetName));
				
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
			
			set_task(0.1, "Slap_Player", iTempid, _, _, "a", 100);
		}
		
		show_activity_key("AMX_SUPER_UBERSLAP_TEAM_CASE1", "AMX_SUPER_UBERSLAP_TEAM_CASE2", szAdminName, g_szTeamNames[team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_UBERSLAP_TEAM_LOG", szAdminName, szAdminAuthid, g_szTeamNames[team]);
	}
	
	else
	{
		iTempid = cmd_target(id, szArg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE);
		
		if(iTempid)
		{
			get_user_name(iTempid, szTargetName, charsmax(szTargetName));
			
			new szTargetAuthid[35];
			get_user_authid(iTempid, szTargetAuthid, charsmax(szTargetAuthid));
					
			set_task(0.1, "Slap_Player", iTempid, _, _, "a", 100);
			
			show_activity_key("AMX_SUPER_UBERSLAP_PLAYER_CASE1", "AMX_SUPER_UBERSLAP_PLAYER_CASE2", szAdminName, szTargetName);
			log_amx("%L", LANG_SERVER, "AMX_SUPER_UBERSLAP_PLAYER_LOG", szAdminName, szAdminAuthid, szTargetName, szTargetAuthid);
			
			console_print(id, "%L", id, "AMX_SUPER_UBERSLAP_PLAYER_MSG", szTargetName);
		}
	}

	return PLUGIN_HANDLED;
}

public Slap_Player(id)
{
	if(get_user_health(id) > 1)
		user_slap(id, 1);
	
	else
		user_slap(id, 0);
}

/* 23)	amx_glow(2)
 *-----------------
*/
public Cmd_Glow(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
		
	new szArg0[20], szArg1[35], szColor[20], szGreen[3], szBlue[3], szAlpha[3];
	read_argv(0, szArg0, charsmax(szArg0)); 			
	read_argv(1, szArg1, charsmax(szArg1));		
	read_argv(2, szColor, charsmax(szColor));		
	read_argv(3, szGreen, charsmax(szGreen));
	read_argv(4, szBlue, charsmax(szBlue));
	read_argv(5, szAlpha, charsmax(szAlpha));
	
	new iRed, iGreen, iBlueNum, iAlpha;
	
	new bool: bOff;
	new bool: bGlow2;
	
	if(szArg0[8] == '2')
		bGlow2 = true;
		
	else 
		bGlow2 = false;
		
	if(!strlen(szGreen))
	{
		new bool: bIsValidColor = false;
		
		for(new i = 0; i < MAX_COLORS; i++)
		{
			if(equali(szColor, g_szColorNames[i]))
			{	
				iRed = g_iColorValues[i][0];
				iGreen = g_iColorValues[i][1];
				iBlueNum = g_iColorValues[i][2];
				iAlpha = 255;
				
				if(equali(szColor, "off"))
					bOff = true;
				
				else 
					bOff = false;
					
				bIsValidColor = true;
				
				break;
			}
		}
		
		if(!bIsValidColor)
		{ 
			console_print(id, "%L", LANG_PLAYER, "AMX_SUPER_GLOW_INVALID_COLOR");
			
			return PLUGIN_HANDLED;
		}
	}
	
	else
	{
		iRed = str_to_num(szColor);
		iGreen = str_to_num(szGreen);
		iBlueNum = str_to_num(szBlue);
		iAlpha = str_to_num(szAlpha);
		
		clamp(iRed, 0, 255);
		clamp(iGreen, 0, 255);
		clamp(iBlueNum, 0, 255);
		clamp(iAlpha, 0, 255);
	}
	
	new iTempid;
	new szAdminName[34], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));

	if(szArg1[0] == '@')
	{
		new iPlayers[32], iPlayerNum;
		
		if(equali(szArg1[1], "T"))
			copy(szArg1[1], charsmax(szArg1), "TERRORIST");
		
		if(equali(szArg1[1], "ALL"))
			get_players(iPlayers, iPlayerNum, "a");
		
		else
			get_players(iPlayers, iPlayerNum, "ae", szArg1[1]);
			
		for(new i = 0; i < iPlayerNum; i++)
		{
			iTempid = iPlayers[i];
			
			if(bGlow2)
			{
				g_iGlowColors[iTempid][0] = iRed;
				g_iGlowColors[iTempid][1] = iGreen;
				g_iGlowColors[iTempid][2] = iBlueNum;
				g_iGlowColors[iTempid][3] = iAlpha;
				
				g_iFlags[iTempid] |= HASGLOW;
				
			}
			
			else
			{
				arrayset(g_iGlowColors[iTempid], 0, 4);
				g_iFlags[iTempid] &= ~HASGLOW;
			}
			
			set_user_rendering(iTempid, kRenderFxGlowShell, iRed, iGreen, iBlueNum, kRenderTransAlpha, iAlpha);
		}
		
		if(bOff)
			show_activity_key("AMX_SUPER_GLOW_TEAM_OFF_CASE1", "AMX_SUPER_GLOW_TEAM_OFF_CASE2", szAdminName, szArg1[1]);
		
		else
			show_activity_key("AMX_SUPER_GLOW_TEAM_CASE1", "AMX_SUPER_GLOW_TEAM_CASE2", szAdminName, szArg1[1]);
		
		console_print(id, "%L", id, "AMX_SUPER_GLOW_TEAM_MSG", szArg1[1]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GLOW_TEAM_LOG", szAdminName, szAdminAuthid, szArg1[1]);
	}

	else
	{
		iTempid = cmd_target(id, szArg1, 2);
		
		if(!iTempid)
			return PLUGIN_HANDLED;
			
		if(bGlow2)
		{
			g_iGlowColors[iTempid][0] = iRed;
			g_iGlowColors[iTempid][1] = iGreen;
			g_iGlowColors[iTempid][2] = iBlueNum;
			g_iGlowColors[iTempid][3] = iAlpha;
			
			g_iFlags[iTempid] |= HASGLOW;
		}
		
		else
		{
			arrayset(g_iGlowColors[iTempid], 0, sizeof(g_iGlowColors[]));
			g_iFlags[iTempid] &= ~HASGLOW;
		}
		
		set_user_rendering(iTempid, kRenderFxGlowShell, iRed, iGreen, iBlueNum, kRenderTransAlpha, iAlpha);
		
		new szTargetName[35];
		get_user_name(iTempid, szTargetName, charsmax(szTargetName));
		
		if(bOff)
			show_activity_key("AMX_SUPER_GLOW_PLAYER_OFF_CASE1", "AMX_SUPER_GLOW_PLAYER_OFF_CASE2", szAdminName, szTargetName);
			
		else
			show_activity_key("AMX_SUPER_GLOW_PLAYER_CASE1", "AMX_SUPER_GLOW_PLAYER_CASE2", szAdminName, szTargetName);

		console_print(id, "%L", id, "AMX_SUPER_GLOW_TEAM_MSG", szTargetName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_GLOW_TEAM_LOG", szAdminName, szAdminAuthid, szTargetName);
	}
	return PLUGIN_HANDLED;
}

/* 24)	amx_glowcolors
 *--------------------
*/
public Cmd_GlowColors(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
	
	console_print(id, "Colors:");
	
	for(new i = 0; i < MAX_COLORS; i++)
		console_print(id, "%i %s", i + 1, g_szColorNames[i]);
	
	console_print(id, "Example: ^"amx_glow superman yellow^"");
	
	return PLUGIN_HANDLED;
}

Код: Избери всички

/* * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Super - Menu
 * Developed by Ryan "YamiKaitou" LeBlanc
 * Maintained by SuperCentral.co Scripting Team
 * Last Update: Jan 17 2014
 * 
 * Minimum Requirements
 * AMX Mod X 1.8.0
 * AMX Super 5.0
 * 
 * Credits
 * AMX Mod X Dev Team (for their plmenu.amxx plugin)
 * bmann|420 (for creating the AMX Super plugin)
 * |PJ|Shorty (for assisting me in finding out the get_concmd function)
 * If I forgot you, let me know what you did and I will add you
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Mod X script.
 *
 *   AMX Super - Menu (amx_super-menu.sma)
 *   Copyright (C) 2008-2010 Ryan "YamiKaitou" LeBlanc
 *   Copyright (C) 2013-2014 SuperCentral.co
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *   In addition, as a special exception, the author gives permission to
 *   link the code of this program with the Half-Life Game Engine ("HL
 *   Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *   L.L.C ("Valve"). You must obey the GNU General Public License in all
 *   respects for all of the code used other than the HL Engine and MODs
 *   from Valve. If you modify this file, you may extend this exception
 *   to your version of the file, but you are not obligated to do so. If
 *   you do not wish to do so, delete this exception statement from your
 *   version.
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>

#define PLUGIN  "AMX_Super Menu"
#define AUTHOR  "SuperCentral.co"
#define VERSION "5.0.2"

enum 
{
	ALLTALK = 1,
	LOCK,
	UNLOCK,
	EXTEND,
	GRAVITY,
	FIRE,
	FLASH,
	DISARM,
	ROCKET,
	UBERSLAP,
	REVIVE,
	QUIT,
	DRUG,
	TEAMSWAP,
	HEAL,
	ARMOR,
	STACK,
	BURY,
	UNBURY,
	SLAY,
	GOD,
	NOCLIP,
	SPEED,
	UNAMMO,
	SWAP,
	SETMONEY,
	BADAIM,
	GAG,
	UNGAG,
	MAXVALUE
}

new const g_szDisabledCmdsFilename[] = "disabled_cmds.ini";

new Trie:g_tDisabledCmds;

new g_hMainMenu, g_hAllTalkMenu, g_hExtendMenu, g_hGravityMenu;

new g_pMenuEnabled;

new g_iMenuPosition[33], g_iMenuPlayers[33][35], g_iMenuPlayersNum[33], g_iMenuProperties[33], g_iMenuProperties2[33], g_iMenu[33];
new g_szMenuPlayerName[33][32];

new g_szMenuName[64];
new g_iAllKeys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;
new g_hCallback;
new Array:g_aValueArray[MAXVALUE];
new g_iAccessLevel[MAXVALUE];

new g_szMenuCommands[][128] = 
{
	"status",
	"amx_alltalk %s",
	"amx_lock %s",
	"amx_unlock %s",
	"amx_extend %s",
	"amx_gravity %s",
	"amx_fire ^"%s^"",
	"amx_flash ^"%s^"",
	"amx_disarm ^"%s^"",
	"amx_rocket ^"%s^"",
	"amx_uberslap ^"%s^"",
	"amx_revive ^"%s^"",
	"amx_quit ^"%s^"",
	"amx_drug ^"%s^" 1",
	"amx_teamswap",
	"amx_heal ^"%s^" %d",
	"amx_armor ^"%s^" %d",
	"amx_stack ^"%s^" %d",
	"amx_bury ^"%s^"",
	"amx_unbury ^"%s^"",
	"amx_slay2 ^"%s^" %d",
	"amx_godmode ^"%s^" %d",
	"amx_noclip ^"%s^" %d",
	"amx_speed ^"%s^" %d",
	"amx_unammo ^"%s^" %d",
	"amx_swap ^"%s^" ^"%s^"",
	"amx_money ^"%s^" %d",
	"amx_badaim ^"%s^" %d 0",
	"amx_gag ^"%s^" %s %d",
	"amx_ungag ^"%s^""
};

new g_szCommands[][64] = 
{
	"nothing",
	"amx_alltalk",
	"amx_lock",
	"amx_unlock",
	"amx_extend",
	"amx_gravity",
	"amx_fire",
	"amx_flash",
	"amx_disarm",
	"amx_rocket",
	"amx_uberslap",
	"amx_revive",
	"amx_quit",
	"amx_drug",
	"amx_teamswap",
	"amx_heal",
	"amx_armor",
	"amx_stack",
	"amx_bury",
	"amx_unbury",
	"amx_slay2",
	"amx_godmode",
	"amx_noclip",
	"amx_speed",
	"amx_unammo",
	"amx_swap",
	"amx_money",
	"amx_badaim",
	"amx_gag",
	"amx_ungag"
};

new bool:g_bCommandManagerEnabled;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_cvar("amx_super_menu",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY);
	g_pMenuEnabled = register_cvar("amx_supermenu_enabled", "1");
	register_dictionary("amx_super_menu.txt");
	register_dictionary("common.txt");
	
	// Register New Menus
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU0");
	g_hMainMenu = menu_create(g_szMenuName, "MainMenuHandler");
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU1");
	g_hAllTalkMenu = menu_create(g_szMenuName, "AllTalkMenuHandler");
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU4");
	g_hExtendMenu = menu_create(g_szMenuName, "ExtendMenuHandler");
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU5");
	g_hGravityMenu = menu_create(g_szMenuName, "GravityMenuHandler");
	
	g_tDisabledCmds = TrieCreate();
	
	g_bCommandManagerEnabled = is_plugin_loaded("AMX Super Cmd Manager") == -1 ? false : true;
	
	// Register g_hCallbacks
	g_hCallback = menu_makecallback("MenuCallback");    
	
	// Register Old Menus
	register_menucmd(register_menuid("Lock Menu"), g_iAllKeys, "LockMenuHandler");
	register_menucmd(register_menuid("Player1 Menu"), g_iAllKeys, "Player1MenuHandler");
	register_menucmd(register_menuid("Player2 Menu"), g_iAllKeys, "Player2MenuHandler");
	register_menucmd(register_menuid("Gag Menu"), g_iAllKeys, "GagMenuHandler");
	
	register_clcmd("say", "HandleSay");
	register_clcmd("say_team", "HandleSay");
	register_concmd("supermenu", "HandleCmd", ADMIN_MENU, " - Bring up the menu for AMX_Super");
	register_concmd("amx_supermenu", "HandleCmd", ADMIN_MENU, " - Bring up the menu for AMX_Super");
	register_concmd("supermenu_edit", "HandleCmd", ADMIN_MENU, " - Allows you to edit the values the menu displays");
	register_concmd("amx_supermenu_edit", "HandleCmd", ADMIN_MENU, " - Allows you to edit the values the menu displays");
	register_concmd("amx_reloadcmds", "CmdReloadCmds", ADMIN_CVAR, "Reloads all amx super commands. (see disabled_cmds.ini)");
	
	arrayset(g_iAccessLevel, -2, MAXVALUE);
	
	AddMenuItem("AMX_Super Menu", "amx_supermenu", ADMIN_MENU, PLUGIN);
	
	CmdReloadCmds(0, 0, 0); 
}

public CmdReloadCmds(id, iLevel, iCid)
{
	if(!g_bCommandManagerEnabled || (id && !cmd_access(id, iLevel, iCid, 1)))
		return PLUGIN_HANDLED;
	
	new szDisabledCmdFile[64], iFile;
	get_configsdir(szDisabledCmdFile, charsmax(szDisabledCmdFile));
	format(szDisabledCmdFile, charsmax(szDisabledCmdFile), "%s/%s", szDisabledCmdFile, g_szDisabledCmdsFilename);
		
	// read commands into Trie if file exists.
	if(file_exists(szDisabledCmdFile))
	{
		// Clear our previous commands before reading new ones.
		TrieClear(g_tDisabledCmds);
		
		if((iFile = fopen(szDisabledCmdFile, "rt")))
		{
			new szCurrentCmd[32];
		
			while(!feof(iFile))
			{
				fgets(iFile, szCurrentCmd, charsmax(szCurrentCmd));
				trim(szCurrentCmd);
				
				if(!szCurrentCmd[0] || szCurrentCmd[0] == ';' || szCurrentCmd[0] == '/' && szCurrentCmd[1] == '/')
					continue;
					
				TrieSetCell(g_tDisabledCmds, szCurrentCmd, 1);
			}
			
			fclose(iFile);
		}
	
		else            // TODO: ML
			log_amx("[AMXX] Failed to open '%s' !", g_szDisabledCmdsFilename);
	}

	return PLUGIN_CONTINUE;
}

public plugin_cfg()
{
	new iIndex = 0, szCommand[64], iFlags, szInfo[128], iFlag = 52428799, k;
	new iMax = get_concmdsnum(iFlag);
	
	while(iIndex <= iMax)
	{
		get_concmd(iIndex++, szCommand, charsmax(szCommand), iFlags, szInfo, charsmax(szInfo), iFlag);
		
		k = 1;
		while (k < MAXVALUE && !equal(szCommand, g_szCommands[k])) k++;
		
		if (k != MAXVALUE) g_iAccessLevel[k] = iFlags;
	}
	
	BuildArrays();
	BuildMenu();
}

public HandleSay(id)
{
	new szArg[32];
	read_argv(1, szArg, charsmax(szArg));
	
	if (equal(szArg, "/supermenu"))
	{
		menu_display(id, g_hMainMenu, 0);
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

public HandleCmd(id, iLevel, iCid)
{
	new szCommand[64];
	read_argv(0, szCommand, charsmax(szCommand));
		
	if (equal(szCommand, "supermenu") || equal(szCommand, "amx_supermenu"))
		menu_display(id, g_hMainMenu, 0);
	else if (equal(szCommand, "supermenu_edit") || equal(szCommand, "amx_supermenu_edit"))
	{
		if (read_argc() < 2)
		{
			client_print(id, print_console, "%L", id, "AMXSUPER_NOPARM");
			client_print(id, print_console, "%L %s <menu to edit> <value1> [value2] [value3] [value4] ...", id, "USAGE", szCommand);
			return PLUGIN_HANDLED;
		}
		
		new szType[10], iValue, Array:aTemp = ArrayCreate();
		read_argv(1, szType, charsmax(szType));
		
		if (equal(szType, "extend"))
			iValue = EXTEND;
		else if (equal(szType, "gravity"))
			iValue = GRAVITY;
		else if (equal(szType, "heal"))
			iValue = HEAL;
		else if (equal(szType, "armor"))
			iValue = ARMOR;
		else if (equal(szType, "money"))
			iValue = SETMONEY;
		else if (equal(szType, "badaim"))
			iValue = BADAIM;
		else if (equal(szType, "gag"))
			iValue = GAG;
		
		if (!(get_user_flags(id) & g_iAccessLevel[iValue]))
		{
			client_print(id, print_console, "%L", id, "NO_ACC_COM");
			return PLUGIN_HANDLED;
		}
		new szMessage[256], iMax = ArraySize(Array:g_aValueArray[iValue]), k = (iValue == BADAIM) ? 2 : 0;
		if (read_argc() < 3)
		{
			client_print(id, print_console, "%L", id, "AMXSUPER_NOPARM");
			client_print(id, print_console, "%L %s %s <value1> [value2] [value3] [value4] ...", id, "USAGE", szCommand, szType);
			format(szMessage, charsmax(szMessage), "%d", ArrayGetCell(Array:g_aValueArray[iValue], k++));
			while (k < iMax)
				format(szMessage, charsmax(szMessage), "%s, %d", szMessage, ArrayGetCell(Array:g_aValueArray[iValue], k++));
			client_print(id, print_console, "%L: %s", id, "AMXSUPER_CURRENT", szType, szMessage);
			return PLUGIN_HANDLED;
		}
		
		if (iValue == EXTEND)
		{
			menu_destroy(g_hExtendMenu);
			
			// Recreating it and building it
			format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU4");
			g_hExtendMenu = menu_create(g_szMenuName, "extendMenu");
			
			new szArg[4], k = 2;
			while(k)
			{
				read_argv(k, szArg, charsmax(szArg));
				if(equal(szArg, "")) break;
				ArrayPushCell(aTemp, str_to_num(szArg));
				k++;
				format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_EXTEND", szArg);
				menu_additem(g_hExtendMenu, g_szMenuName, szArg);
			}
		}
		else if (iValue == GRAVITY)
		{
			menu_destroy(g_hGravityMenu);
			
			// Recreating it and building it
			format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_MENU5");
			g_hGravityMenu = menu_create(g_szMenuName, "GravityMenuHandler");
			
			new szArg[6], k = 2;
			while (k)
			{
				read_argv(k, szArg, charsmax(szArg));
				if (equal(szArg, "")) break;
				ArrayPushCell(aTemp, str_to_num(szArg));
				k++;
				menu_additem(g_hGravityMenu, szArg, szArg);
			}
		}
		else
		{
			if (iValue == BADAIM)
			{
				ArrayPushCell(aTemp, 0);
				ArrayPushCell(aTemp, 1);
			}
			new szArg[6], k = 2;
			while(k)
			{
				read_argv(k, szArg, charsmax(szArg));
				if (equal(szArg, "")) break;
				ArrayPushCell(aTemp, str_to_num(szArg));
				k++;
			}
		}
		
		iMax = ArraySize(aTemp), k = 0;
		format(szMessage, charsmax(szMessage), "%d", ArrayGetCell(aTemp, k++));
		while(k < iMax)
			format(szMessage, charsmax(szMessage), "%s, %d", szMessage, ArrayGetCell(aTemp, k++));
		client_print(id, print_console, "%L: %s", id, "AMXSUPER_CURRENT", szType, szMessage);
		g_aValueArray[iValue] = aTemp;
	}   
	return PLUGIN_HANDLED;
}

BuildArrays()
{
	g_aValueArray[EXTEND] = ArrayCreate();
	for (new k = 5; k < 16; k+=5)
		ArrayPushCell(Array:g_aValueArray[EXTEND], k);
	for (new k = 30; k < 61; k+=15)
		ArrayPushCell(Array:g_aValueArray[EXTEND], k);
	
	g_aValueArray[GRAVITY] = ArrayCreate();
	for (new k = 0; k < 7; k++)
		ArrayPushCell(Array:g_aValueArray[GRAVITY], k * 200);
	
	g_aValueArray[HEAL] = ArrayCreate();
	g_aValueArray[ARMOR] = ArrayCreate();
	ArrayPushCell(Array:g_aValueArray[HEAL], 10);
	ArrayPushCell(Array:g_aValueArray[ARMOR], 10);
	for (new k = 1; k < 5; k++)
	{
		ArrayPushCell(Array:g_aValueArray[HEAL], k * 25);
		ArrayPushCell(Array:g_aValueArray[ARMOR], k * 25);
	}
	ArrayPushCell(Array:g_aValueArray[HEAL], 200);
	ArrayPushCell(Array:g_aValueArray[ARMOR], 200);
	
	g_aValueArray[SETMONEY] = ArrayCreate();
	for (new k = 500; k < 16001; k*=2)
		ArrayPushCell(Array:g_aValueArray[SETMONEY], k);
	
	g_aValueArray[BADAIM] = ArrayCreate();
	ArrayPushCell(Array:g_aValueArray[BADAIM], 0);
	ArrayPushCell(Array:g_aValueArray[BADAIM], 1);
	for (new k = 5; k < 16; k+=5)
		ArrayPushCell(Array:g_aValueArray[BADAIM], k);
	for (new k = 30; k < 61; k+=15)
		ArrayPushCell(Array:g_aValueArray[BADAIM], k);
	
	g_aValueArray[GAG] = ArrayCreate();
	ArrayPushCell(Array:g_aValueArray[GAG], 30);
	ArrayPushCell(Array:g_aValueArray[GAG], 60);
	ArrayPushCell(Array:g_aValueArray[GAG], 300);
	for (new k = 600; k < 1801; k+=600)
		ArrayPushCell(Array:g_aValueArray[GAG], k);
}

BuildMenu()
{
	new szValue[20];
	
	// Build Main Menu
	for (new iNum = 1; iNum < MAXVALUE; iNum++)
	{
		if (iNum == UNLOCK || iNum == UNBURY || iNum == UNGAG)
			continue;
		
		new szKey[17], szNum[3];
		format(szKey, charsmax(szKey), "AMXSUPER_MENU%d", iNum);
		format(szNum, charsmax(szNum), "%d", iNum);
		format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, szKey);
		if (g_iAccessLevel[iNum] != -2)
			menu_additem(g_hMainMenu, g_szMenuName, szNum, _, g_hCallback);
	}
	
	// Build Alltalk Menu
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_ENABLE");
	menu_additem(g_hAllTalkMenu, g_szMenuName, "1");
	format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_DISABLE");
	menu_additem(g_hAllTalkMenu, g_szMenuName, "0");
	
	// Build Extend Menu
	for (new k = 0; k < 6; k++)
	{
		format(szValue, charsmax(szValue), "%d", ArrayGetCell(Array:g_aValueArray[EXTEND], k));
		format(g_szMenuName, charsmax(g_szMenuName), "%L", LANG_PLAYER, "AMXSUPER_EXTEND", szValue);
		menu_additem(g_hExtendMenu, g_szMenuName, szValue);
	}
	
	// Build Gravity Menu
	for (new k = 0; k < 6; k++)
	{
		format(szValue, charsmax(szValue), "%d", ArrayGetCell(Array:g_aValueArray[GRAVITY], k));
		menu_additem(g_hGravityMenu, szValue, szValue);
	}
}

GetMenuPlayers(&iNum, iMenu)
{
	new iTemp[32], iPlayers[35], k;
	
	switch(iMenu)
	{
		case FIRE, FLASH, DISARM, ROCKET, UBERSLAP, DRUG, HEAL, ARMOR, STACK, BURY, UNBURY, SLAY, GOD, NOCLIP, SPEED, UNAMMO, BADAIM:
			get_players(iTemp, iNum, "a");
		
		case REVIVE:
			get_players(iTemp, iNum, "b");
		
		case GAG:
			get_players(iTemp, iNum, "c");
			
		default:
			get_players(iTemp, iNum);
	}
	
	for (k = 0; k < iNum; k++) iPlayers[k] = iTemp[k];
	/*
	if(iMenu == SWAP)
	{
		iPlayers[k] = 34;
		iPlayers[k+1] = 35;
		iNum += 2;
	}
	
	else
	*/
	if(iMenu != SWAP && iMenu != GAG)
	{
		iPlayers[k] = 33;
		iPlayers[k+1] = 34;
		iPlayers[k+2] = 35;
		iNum += 3;
	}
	
	return iPlayers;
}

public MenuCallback(id, hMenu, iItem)
{
	if (iItem < 0)
		return ITEM_DISABLED;
	
	new szCommand[3], iAccess, hCallback;
	menu_item_getinfo(hMenu, iItem, iAccess, szCommand, 2, _, _, hCallback);
	
	new iNum = str_to_num(szCommand);
	
	if(TrieKeyExists(g_tDisabledCmds, g_szCommands[iNum]))
		return ITEM_DISABLED;
		
	if (get_user_flags(id) & g_iAccessLevel[iNum])
		return ITEM_ENABLED;
		
	return ITEM_DISABLED;
}

public MainMenuHandler(id, hMenu, iItem)
{
	if (iItem < 0)
		return PLUGIN_CONTINUE;
	
	new szCommand[3];
	new iAccess, hCallback;
	menu_item_getinfo(hMenu, iItem, iAccess, szCommand, 2, _, _, hCallback);
	
	new iNum = str_to_num(szCommand);
		
	g_iMenuProperties[id] = 0;
	g_iMenuPosition[id] = 0;
	
	switch(iNum)
	{
		case ALLTALK:
			menu_display(id, g_hAllTalkMenu, 0);
		case LOCK, UNLOCK:
			DisplayLockMenu(id);
		case EXTEND:
			menu_display(id, g_hExtendMenu, 0);
		case GRAVITY:
			menu_display(id, g_hGravityMenu, 0);
		case TEAMSWAP:
		{
			client_cmd(id, g_szCommands[TEAMSWAP]);
			return PLUGIN_HANDLED;
		}
		case GAG:
			DisplayGagMenu(id, 0);
		case FIRE, FLASH, DISARM, ROCKET, UBERSLAP, REVIVE, QUIT, DRUG, SWAP:
			DisplayPlayer1Menu(id, 0, iNum);
		case HEAL, ARMOR, STACK, BURY, UNBURY, SLAY, GOD, NOCLIP, SPEED, UNAMMO, SETMONEY, BADAIM:
			DisplayPlayer2Menu(id, 0, iNum);
	}
	
	return PLUGIN_CONTINUE;
}

public AllTalkMenuHandler(id, hMenu, iItem)
{       
	if (iItem == MENU_EXIT)
	{   
		if(get_pcvar_num(g_pMenuEnabled))
			menu_display(id, g_hMainMenu, 0);
			
		return PLUGIN_CONTINUE;
	}
	if (iItem < 0)
		return PLUGIN_CONTINUE;
	
	new szCommand[3], iAccess, hCallback;
	menu_item_getinfo(hMenu, iItem, iAccess, szCommand, 2,_,_, hCallback);
	
	client_cmd(id, g_szMenuCommands[ALLTALK], szCommand);
	
	return PLUGIN_HANDLED;  
}

public LockMenuHandler(id, iKey)
{
	new szTeam[6];
	switch(iKey)
	{
		case 0:
			format(szTeam, charsmax(szTeam), "CT");
		case 1:
			format(szTeam, charsmax(szTeam), "T");
		case 2:
			format(szTeam, charsmax(szTeam), "Auto");
		case 3:
			format(szTeam, charsmax(szTeam), "Spec");
		case 4:
		{
			if (g_iMenuProperties[id] == LOCK)
				g_iMenuProperties[id] = UNLOCK;
			else
				g_iMenuProperties[id] = LOCK;
				
			DisplayLockMenu(id);
			return PLUGIN_HANDLED;
		}
		case 9:
		{
			if (get_pcvar_num(g_pMenuEnabled))
				menu_display(id, g_hMainMenu, 0);

			return PLUGIN_HANDLED;
		}
		default: return PLUGIN_HANDLED;
	}
	
	client_cmd(id, g_szMenuCommands[g_iMenuProperties[id]], szTeam);
	
	DisplayLockMenu(id);
	
	return PLUGIN_HANDLED;
}

DisplayLockMenu(id)
{
	new szMenuBody[1000], szLine[100];
	
	format(szMenuBody, charsmax(szMenuBody), "\y");
	if (g_iMenuProperties[id] == LOCK)
		format(szLine, charsmax(szLine), "%L ^n", id, "AMXSUPER_LOCK");
	else
	{
		format(szLine, charsmax(szLine), "%L ^n", id, "AMXSUPER_UNLOCK");
		g_iMenuProperties[id] = UNLOCK;
	}
	
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "^n\w^n");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "1. %L ^n", id, "AMXSUPER_TEAMCT");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "2. %L ^n", id, "AMXSUPER_TEAMT");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "3. %L ^n", id, "AMXSUPER_TEAMAUTO");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "4. %L ^n", id, "AMXSUPER_TEAMSPEC");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	if (g_iMenuProperties[id] == LOCK)
		format(szLine, charsmax(szLine), "^n5. %L ^n", id, "AMXSUPER_LOCK");
	else
		format(szLine, charsmax(szLine), "^n5. %L ^n", id, "AMXSUPER_UNLOCK");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	format(szLine, charsmax(szLine), "^n^n0. %L", id, "EXIT");
	add(szMenuBody, charsmax(szMenuBody), szLine);
	new iKeys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;
		
	show_menu(id, iKeys, szMenuBody, -1, "Lock Menu");
}

public ExtendMenuHandler(id, hMenu, iItem)
{
	if (iItem == MENU_EXIT && get_pcvar_num(g_pMenuEnabled))
	{
		menu_display(id, g_hMainMenu, 0);
		return PLUGIN_CONTINUE;
	}
	if (iItem < 0)
		return PLUGIN_CONTINUE;
	
	new szCommand[4], iAccess, hCallback;
	menu_item_getinfo(hMenu, iItem, iAccess, szCommand, 3,_,_, hCallback);
	
	client_cmd(id, g_szMenuCommands[EXTEND], szCommand);
	
	return PLUGIN_HANDLED;
}

public GravityMenuHandler(id, hMenu, iItem)
{
	if (iItem == MENU_EXIT && get_pcvar_num(g_pMenuEnabled))
	{
		menu_display(id, g_hMainMenu, 0);
		return PLUGIN_CONTINUE;
	}
	if (iItem < 0)
		return PLUGIN_CONTINUE;
	
	new szCommand[5], iAccess, hCallback;
	menu_item_getinfo(hMenu, iItem, iAccess, szCommand, 4,_,_, hCallback);
	
	client_cmd(id, g_szMenuCommands[GRAVITY], szCommand);
	
	return PLUGIN_HANDLED;
}

public Player1MenuHandler(id, iKey)
{
	switch (iKey)
	{
		case 8: DisplayPlayer1Menu(id, ++g_iMenuPosition[id], g_iMenu[id]);
		case 9: DisplayPlayer1Menu(id, --g_iMenuPosition[id], g_iMenu[id]);
		default:
		{
			new iPlayer = g_iMenuPlayers[id][g_iMenuPosition[id] * 8 + iKey];
			new szName[32];
			
			if (g_iMenu[id] != SWAP)
			{
				switch (iPlayer)
				{
					case 33: format(szName, charsmax(szName), "@ALL");
					case 34: format(szName, charsmax(szName), "@T");
					case 35: format(szName, charsmax(szName), "@CT");
					default: get_user_name(iPlayer, szName, charsmax(szName));
				}
				client_cmd(id, g_szMenuCommands[g_iMenu[id]], szName);
			}
			else
			{
				get_user_name(iPlayer, szName, charsmax(szName));
				
				if (equal(g_szMenuPlayerName[id], ""))
				{
					format(g_szMenuPlayerName[id], 31, "%s", szName);
					g_iMenuPosition[id] = 0;
					DisplayPlayer1Menu(id, g_iMenuPosition[id], g_iMenu[id]);
				}
				else
				{
					client_cmd(id, g_szMenuCommands[SWAP], g_szMenuPlayerName[id], szName);
					format(g_szMenuPlayerName[id], 31, "");
				}
			}
		}
	}
	
	DisplayPlayer1Menu(id, g_iMenuPosition[id], g_iMenu[id]); 
	
	return PLUGIN_HANDLED;
}

DisplayPlayer1Menu(id, iPos, iMenu)
{
	if (iPos < 0)
	{
		if (get_pcvar_num(g_pMenuEnabled))
			menu_display(id, g_hMainMenu, 0);
		return;
	}
	
	g_iMenu[id] = iMenu;
	g_iMenuPlayers[id] = GetMenuPlayers(g_iMenuPlayersNum[id], iMenu);

	new szMenuBody[1024];
	new b = 0;
	new i;
	new szName[32];
	new iStart = iPos * 8;
	
	if (iStart >= g_iMenuPlayersNum[id])
		iStart = iPos = g_iMenuPosition[id] = 0;
	
	new szKey[17];
	format(szKey, charsmax(szKey), "AMXSUPER_MENU%d", iMenu);
	new iLen = format(szMenuBody, 1023, "\y%L\R%d/%d^n\w^n", id, szKey, iPos + 1, (g_iMenuPlayersNum[id] / 8 + ((g_iMenuPlayersNum[id] % 8) ? 1 : 0)));
	new iEnd = iStart + 8;
	new iKeys = MENU_KEY_0;

	if (iEnd > g_iMenuPlayersNum[id])
		iEnd = g_iMenuPlayersNum[id];

	for (new a = iStart; a < iEnd; ++a)
	{
		i = g_iMenuPlayers[id][a];
		
		if (g_iMenu[id] != SWAP)
			switch (i)
			{
				case 33: format(szName, charsmax(szName), "%L", id, "AMXSUPER_ALL");
				case 34: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMT");
				case 35: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMCT");
				default: get_user_name(i, szName, 31);
			}
		else
			get_user_name(i, szName, 31);
		
		if (i < 33 && i != id && access(i, ADMIN_IMMUNITY))
		{
			++b;
			iLen += format(szMenuBody[iLen], 1023-iLen, "\d\r%d. \w%s^n\w", b, szName);
		} else {
			iKeys |= (1<<b);
				
			if (i < 33 && is_user_admin(i))
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s \r*^n\w", ++b, szName);
			else
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s^n", ++b, szName);
		}
	}

	if (iEnd != g_iMenuPlayersNum[id])
	{
		format(szMenuBody[iLen], 1023-iLen, "^n\r9. \w%L...^n\r0. \w%L", id, "MORE", id, iPos ? "BACK" : "EXIT");
		iKeys |= MENU_KEY_9;
	}
	else
		format(szMenuBody[iLen], 1023-iLen, "^n\r0. \w%L", id, iPos ? "BACK" : "EXIT");

	show_menu(id, iKeys, szMenuBody, -1, "Player1 Menu");
}

public Player2MenuHandler(id, iKey)
{
	switch (iKey)
	{
		case 7:
		{
			switch (g_iMenu[id])
			{
				case HEAL, ARMOR, SETMONEY: if (++g_iMenuProperties[id] > 5) g_iMenuProperties[id] = 0;
				case STACK, GOD, NOCLIP: if (++g_iMenuProperties[id] > 2) g_iMenuProperties[id] = 0;
				case SLAY: if (++g_iMenuProperties[id] > 3) g_iMenuProperties[id] = 1;
				case SPEED, UNAMMO, BURY, UNBURY: if (++g_iMenuProperties[id] > 1) g_iMenuProperties[id] = 0;
				case BADAIM: if (++g_iMenuProperties[id] > 7) g_iMenuProperties[id] = 0;
			}
			DisplayPlayer2Menu(id, g_iMenuPosition[id], g_iMenu[id]);
		}
		case 8: DisplayPlayer2Menu(id, ++g_iMenuPosition[id], g_iMenu[id]);
		case 9: DisplayPlayer2Menu(id, --g_iMenuPosition[id], g_iMenu[id]);
		default:
		{
			new iPlayer = g_iMenuPlayers[id][g_iMenuPosition[id] * 7 + iKey];
			new szName[32];
			
			switch (iPlayer)
			{
				case 33: format(szName, charsmax(szName), "@ALL");
				case 34: format(szName, charsmax(szName), "@T");
				case 35: format(szName, charsmax(szName), "@CT");
				default: get_user_name(iPlayer, szName, charsmax(szName));
			}
			
			switch (g_iMenu[id])
			{
				case HEAL, ARMOR, BADAIM, SETMONEY: client_cmd(id, g_szMenuCommands[g_iMenu[id]], szName, ArrayGetCell(Array:g_aValueArray[g_iMenu[id]], g_iMenuProperties[id]));
				case STACK, SLAY, GOD, NOCLIP, SPEED, UNAMMO: client_cmd(id, g_szMenuCommands[g_iMenu[id]], szName, g_iMenuProperties[id]);
				case BURY, UNBURY: client_cmd(id, g_szMenuCommands[g_iMenuProperties[id] ? UNBURY : BURY], szName);
			}
		}
	}
	
	DisplayPlayer2Menu(id, g_iMenuPosition[id], g_iMenu[id]);
	
	return PLUGIN_HANDLED;
}

DisplayPlayer2Menu(id, iPos, iMenu)
{
	if (iPos < 0)
	{
		if (get_pcvar_num(g_pMenuEnabled))
			menu_display(id, g_hMainMenu, 0);
		return;
	}
	
	g_iMenu[id] = iMenu;
	g_iMenuPlayers[id] = GetMenuPlayers(g_iMenuPlayersNum[id], iMenu);

	new szMenuBody[1024];
	new b = 0;
	new i;
	new szName[32];
	new iStart = iPos * 7;
	
	if (iStart >= g_iMenuPlayersNum[id])
		iStart = iPos = g_iMenuPosition[id] = 0;
	
	new szKey[20];
	if (iMenu == BURY || iMenu == UNBURY)
		format(szKey, charsmax(szKey), "AMXSUPER_%s", (g_iMenuProperties[id]) ? "UNBURY" : "BURY");
	else
		format(szKey, charsmax(szKey), "AMXSUPER_MENU%d", iMenu);
	new iLen = format(szMenuBody, 1023, "\y%L\R%d/%d^n\w^n", id, szKey, iPos + 1, (g_iMenuPlayersNum[id] / 7 + ((g_iMenuPlayersNum[id] % 7) ? 1 : 0)));
	new iEnd = iStart + 7;
	new iKeys = MENU_KEY_0;

	if (iEnd > g_iMenuPlayersNum[id])
		iEnd = g_iMenuPlayersNum[id];

	for (new a = iStart; a < iEnd; ++a)
	{
		i = g_iMenuPlayers[id][a];
		
		switch (i)
		{
			case 33: format(szName, charsmax(szName), "%L", id, "AMXSUPER_ALL");
			case 34: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMT");
			case 35: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMCT");
			default: get_user_name(i, szName, 31);
		}
		
		if (i < 33 && i != id && access(i, ADMIN_IMMUNITY))
		{
			++b;
			iLen += format(szMenuBody[iLen], 1023-iLen, "\d\r%d. \w%s^n\w", b, szName);
		} else {
			iKeys |= (1<<b);
				
			if (i < 33 && is_user_admin(i))
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s \r*^n\w", ++b, szName);
			else
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s^n", ++b, szName);
		}
	}
	
	new szOption[20];
	if (iMenu == HEAL || iMenu == ARMOR || iMenu == BADAIM || iMenu == SETMONEY)
		format(szOption, charsmax(szOption), "%d", ArrayGetCell(Array:g_aValueArray[iMenu], g_iMenuProperties[id]));
		
	switch (iMenu)
	{
		case HEAL: iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, "AMXSUPER_HEAL", szOption);
		case ARMOR: iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, "AMXSUPER_ARMOR", szOption);
		case STACK: iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, "AMXSUPER_STACK", g_iMenuProperties[id]);
		case BURY, UNBURY: iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, (g_iMenuProperties[id]) ? "AMXSUPER_BURY" : "AMXSUPER_UNBURY");
		case SLAY:
		{
			if(!g_iMenuProperties[id])
				g_iMenuProperties[id] = 1;
				
			formatex(szKey, charsmax(szKey), "AMXSUPER_SLAY%d", g_iMenuProperties[id]);
			iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, szKey);
		}
		case GOD, NOCLIP, SPEED, UNAMMO:
		{
			format(szKey, charsmax(szKey), "AMXSUPER_GOD%d", g_iMenuProperties[id]);
			iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, szKey);
		}
		case BADAIM:
		{
			format(szKey, charsmax(szKey), "AMXSUPER_%s", (g_iMenuProperties[id] < 2) ? (g_iMenuProperties[id]) ? "GOD0" : "GOD1" : "MINS");
			if (g_iMenuProperties[id] < 2)
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, szKey);
			else
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, szKey, szOption);
		}
		case SETMONEY: iLen += format(szMenuBody[iLen], 1023-iLen, "\r8. \w%L", id, "AMXSUPER_SET", szOption);
	}
	iKeys |= MENU_KEY_8;
		
	if (iEnd != g_iMenuPlayersNum[id])
	{
		format(szMenuBody[iLen], 1023-iLen, "^n\r9. \w%L...^n\r0. \w%L", id, "MORE", id, iPos ? "BACK" : "EXIT");
		iKeys |= MENU_KEY_9;
	}
	else
		format(szMenuBody[iLen], 1023-iLen, "^n\r0. \w%L", id, iPos ? "BACK" : "EXIT");
	
	show_menu(id, iKeys, szMenuBody, -1, "Player2 Menu");
}

public GagMenuHandler(id, iKey)
{
	switch (iKey)
	{
		case 6:
		{
			if (++g_iMenuProperties[id] > 5) g_iMenuProperties[id] = 0;
			DisplayGagMenu(id, g_iMenuPosition[id]);
		}
		case 7:
		{
			if (++g_iMenuProperties2[id] > 7) g_iMenuProperties2[id] = 0;
			DisplayGagMenu(id, g_iMenuPosition[id]);
		}
		case 8: DisplayGagMenu(id, ++g_iMenuPosition[id]);
		case 9: DisplayGagMenu(id, --g_iMenuPosition[id]);
		default:
		{
			new iPlayer = g_iMenuPlayers[id][g_iMenuPosition[id] * 6 + iKey];
			new szName[32];
			
			// Drekes: Removed @TEAM values.
			get_user_name(iPlayer, szName, charsmax(szName));
			/*
			switch (iPlayer)
			{
				case 33: format(szName, charsmax(szName), "@ALL");
				case 34: format(szName, charsmax(szName), "@T");
				case 35: format(szName, charsmax(szName), "@CT");
				default: get_user_name(iPlayer, szName, charsmax(szName));
			}
			*/
			
			if (g_iMenuProperties2[id] == 7)
				client_cmd(id, g_szMenuCommands[UNGAG], szName);
			else
			{
				new szFlags[4];
				
				switch (g_iMenuProperties2[id])
				{
					case 0: format(szFlags, charsmax(szFlags), "a");
					case 1: format(szFlags, charsmax(szFlags), "b");
					case 2: format(szFlags, charsmax(szFlags), "c");
					case 3: format(szFlags, charsmax(szFlags), "ab");
					case 4: format(szFlags, charsmax(szFlags), "ac");
					case 5: format(szFlags, charsmax(szFlags), "bc");
					case 6: format(szFlags, charsmax(szFlags), "abc");
				}
				
				client_cmd(id, g_szMenuCommands[GAG], szName, szFlags, ArrayGetCell(Array:g_aValueArray[g_iMenu[id]], g_iMenuProperties[id]));
			}
		}
	}
	
	DisplayGagMenu(id, g_iMenuPosition[id]);
	
	return PLUGIN_HANDLED;
}

DisplayGagMenu(id, iPos)
{
	if (iPos < 0)
	{
		if (get_pcvar_num(g_pMenuEnabled))
			menu_display(id, g_hMainMenu, 0);
		return;
	}

	g_iMenuPlayers[id] = GetMenuPlayers(g_iMenuPlayersNum[id], GAG);
	g_iMenu[id] = GAG;

	new szMenuBody[1024];
	new b = 0;
	new i;
	new szName[32];
	new iStart = iPos * 6;
	
	if (iStart >= g_iMenuPlayersNum[id])
		iStart = iPos = g_iMenuPosition[id] = 0;
	
	new szKey[20];
	format(szKey, charsmax(szKey), "AMXSUPER_MENU%d", GAG);
	new iLen = format(szMenuBody, 1023, "\y%L\R%d/%d^n\w^n", id, szKey, iPos + 1, (g_iMenuPlayersNum[id] / 6 + ((g_iMenuPlayersNum[id] % 6) ? 1 : 0)));
	new iEnd = iStart + 6;
	new iKeys = MENU_KEY_0|MENU_KEY_7|MENU_KEY_8;

	if (iEnd > g_iMenuPlayersNum[id])
		iEnd = g_iMenuPlayersNum[id];

	for (new a = iStart; a < iEnd; ++a)
	{
		i = g_iMenuPlayers[id][a];
		get_user_name(i, szName, 31);
		/*
		switch (i)
		{
			case 33: format(szName, charsmax(szName), "%L", id, "AMXSUPER_ALL");
			case 34: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMT");
			case 35: format(szName, charsmax(szName), "%L", id, "AMXSUPER_TEAMCT");
			default: get_user_name(i, szName, 31);
		}
		*/
		
		if (i < 33 && i != id && access(i, ADMIN_IMMUNITY))
		{
			++b;
			iLen += format(szMenuBody[iLen], 1023-iLen, "\d\r%d. \w%s^n\w", b, szName);
		} else {
			iKeys |= (1<<b);
				
			if (i < 33 && is_user_admin(i))
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s \r*^n\w", ++b, szName);
			else
				iLen += format(szMenuBody[iLen], 1023-iLen, "\r%d. \w%s^n", ++b, szName);
		}
	}
	
	new szOption[20];
	format(szOption, charsmax(szOption), "%d", ArrayGetCell(Array:g_aValueArray[g_iMenu[id]], g_iMenuProperties[id]));
	iLen += format(szMenuBody[iLen], 1023-iLen, "7. %L^n", id, "AMXSUPER_MINS", szOption);
	
	switch (g_iMenuProperties2[id])
	{
		case 0: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L^n", id, "AMXSUPER_GAGA");
		case 1: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L^n", id, "AMXSUPER_GAGB");
		case 2: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L^n", id, "AMXSUPER_GAGC");
		case 3: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L & %L^n", id, "AMXSUPER_GAGA", id, "AMXSUPER_GAGB");
		case 4: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L & %L^n", id, "AMXSUPER_GAGA", id, "AMXSUPER_GAGC");
		case 5: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L & %L^n", id, "AMXSUPER_GAGB", id, "AMXSUPER_GAGC");
		case 6: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L & %L & %L^n", id, "AMXSUPER_GAGA", id, "AMXSUPER_GAGB", id, "AMXSUPER_GAGC");
		case 7: iLen += format(szMenuBody[iLen], 1023-iLen, "8. %L^n", id, "AMXSUPER_UNGAG");
	}
	
	if (iEnd != g_iMenuPlayersNum[id])
	{
		format(szMenuBody[iLen], 1023-iLen, "^n9. %L...^n0. %L", id, "MORE", id, iPos ? "BACK" : "EXIT");
		iKeys |= MENU_KEY_9;
	}
	else
		format(szMenuBody[iLen], 1023-iLen, "^n0. %L", id, iPos ? "BACK" : "EXIT");

	show_menu(id, iKeys, szMenuBody, -1, "Gag Menu");
}

Код: Избери всички

/* * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Super - Other Commands
 * Developed/Maintained by SuperCentral.co Scripting Team
 * Last Update: Jan 17 2014
 * 
 * Minimum Requirements
 * AMX Mod X 1.8.0
 * AMX Super 5.0
 * 
 * Credits
 * If I forgot you, let me know what you did and I will add you
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Mod X script.
 *
 *   AMX Super - Other Commands (amx_super-others.sma)
 *   Copyright (C) 2013-2014 SuperCentral.co
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *   In addition, as a special exception, the author gives permission to
 *   link the code of this program with the Half-Life Game Engine ("HL
 *   Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *   L.L.C ("Valve"). You must obey the GNU General Public License in all
 *   respects for all of the code used other than the HL Engine and MODs
 *   from Valve. If you modify this file, you may extend this exception
 *   to your version of the file, but you are not obligated to do so. If
 *   you do not wish to do so, delete this exception statement from your
 *   version.
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /*
* -) DEAD CHAT 
* -) LOADING SOUNDS 
* -) SPECTATOR BUG FIX 
* -) "SHOWNDEAD" SCOREBOARD FIX 
* -) AFK BOMB TRANSFER 
* -) C4 TIMER 
* -) STATS MARQUEE REMOVE
* -) SPAWN PROTECTION 
* -) AFK Manager
*/
/*********************
*					 *
* Customizable stuff *
*					 * 
*********************/

/*** Loading sounds ***/
// #define CUSTOM_LOADING_SONGS		// Uncomment this if you use custom loading songs
new g_szSoundList[][] = 
{
	"media/Half-Life01",
	"media/Half-Life02",
	"media/Half-Life03",
	"media/Half-Life04",
	"media/Half-Life06",
	"media/Half-Life08",
	"media/Half-Life10",
	"media/Half-Life11",
	"media/Half-Life12",
	"media/Half-Life13",
	"media/Half-Life14",
	"media/Half-Life15",
	"media/Half-Life16",
	"media/Half-Life17"
};


/*** Damage HUD ***/
// #define DAMAGE_RECEIVED			// If uncommented, Damage HUD also shows received damage

/*** AFK Manager **/
#define AFK_ADMIN_IMMUNE 		ADMIN_IMMUNITY // Which flag for admins not to be kicked for being AFK
#define AFK_CHECK_INTERVAL 		5		// How often to check for AFK players

#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define fm_fake_touch(%1,%2) dllfunc(DLLFunc_Touch, %1, %2)

/*** C4 timer ***/
new const g_szC4TimerMsg[] = "Detonation time initialized.";	// HUD message printed when bomb is planted.

/*********************
*					 *
* End customisations *
*					 * 
*********************/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <csx>

#pragma semicolon 1

new const g_szC4TimerSprites[][] = { "bombticking", "bombticking1" };

// Cvar pointers
new g_pEnterMsg;
new g_pLeaveMsg;
new g_pEnterMsgEnable;
new g_pLeaveMsgEnable;
new g_pHostname;
new g_pDamage;
new g_pLoadingSounds;
new g_pC4TimerTeams;
new g_pC4TimerFlash;
new g_pC4TimerMsg;
new g_pC4TimerSprite;
new g_pC4Timer;
new g_pStatsMarquee;
new g_pStaMarPlayerAmount;
new g_pStaMarHudPos;
new g_pStaMarFullTime;
new g_pStaMarTimeInBetween;
new g_pSpawnProtect;
new g_pSpawnProtectTime;
new g_pSpawnProtectGlow;
new g_pSpawnProtectMsg;
new g_pFreezeTime;
new g_pAFKTransferTime;
new g_pAFKTransferTime_Dispatch;
new g_pAFKImmuneTime;
new g_pAFKMaxTime;
new g_pAFKCheckAllow;
new g_pReservation;

// damage done
new g_iSyncHud;

#if defined DAMAGE_RECEIVED
	new g_iSyncHud2;
#endif

// C4 Timer
new g_iMsgShowTimer;
new g_iMsgRoundTime;
new g_iMsgScenario;

// AFK Manager
new bool:g_bFreezetime;
new bool:g_bSpawn;
new bool:g_bBombPlanting;
new g_iBombCarrier;
new g_iOrigin[33][3];
new g_iTime[33];
new g_iAFKTime[33];
new g_iSpecGameTime[33];

new const g_szSpecKickChat[] = "AMX_SUPER_AFK_SPEC_KICK_CHAT";
new const g_szAFKKickChat[]  = "AMX_SUPER_AFK_KICK_CHAT";
new const g_szAFKSpecChat[] = "AMX_SUPER_AFK_TO_SPEC_CHAT";

new const g_szTeamName[2][] = {"TERRORIST", "CT"};

// Stats marquee
new g_iCurrentRankPos;


// enter / leave messages
new g_szName[33][35];


// "Showndead" scoreboard fix
new g_iMsgTeamInfo;


// Misc
new g_iMaxPlayers;

public plugin_init()
{
	register_plugin("Amx Super Others", "5.0.2", "SuperCentral.co");
	
	g_pLeaveMsgEnable					= register_cvar("amx_leavemessage_enable", "1");
	g_pEnterMsgEnable 					= register_cvar("amx_joinmessage_enable", "1");
	g_pEnterMsg 						= register_cvar("amx_join_message", "%name% has joined!\nEnjoy the Server!\nCurrent Ranking is %rankpos%");
	g_pLeaveMsg 						= register_cvar("amx_leave_message", "%name% has left!\nHope to see you back sometime."); 
	g_pDamage							= register_cvar("bullet_damage", "1");
	g_pLoadingSounds					= register_cvar("amx_loadsong", "1");
	g_pC4TimerTeams						= register_cvar("amx_showc4timer", "3");
	g_pC4TimerFlash						= register_cvar("amx_showc4flash", "1");
	g_pC4TimerMsg						= register_cvar("amx_showc4msg", "1");
	g_pC4TimerSprite					= register_cvar("amx_showc4sprite", "1");
	g_pStatsMarquee 					= register_cvar("stats_marquee", "1");
	g_pStaMarPlayerAmount 				= register_cvar("amx_marqplayeramount","40");
	g_pStaMarHudPos						= register_cvar("amx_marqvertlocation","2");
	g_pStaMarFullTime 					= register_cvar("amx_marqfulltime", "600");
	g_pStaMarTimeInBetween 				= register_cvar("amx_marqtimebetween","6.0");
	g_pSpawnProtect 					= register_cvar("amx_spawnprotect", "1");
	g_pSpawnProtectTime 				= register_cvar("amx_spawnprotect_time", "3");
	g_pSpawnProtectGlow 				= register_cvar("amx_spawnprotect_glow", "1");
	g_pSpawnProtectMsg					= register_cvar("amx_spawnprotect_message", "1");
	g_pAFKTransferTime_Dispatch			= register_cvar("afk_bombtransfer_fm_DispatchSpawn","7");
	g_pAFKTransferTime 					= register_cvar("afk_bombtransfer_time", "15");
	g_pAFKImmuneTime					= register_cvar("amx_immune_time","5");
	g_pAFKMaxTime						= register_cvar("amx_max_afktime","45");
	g_pAFKCheckAllow					= register_cvar("amx_afkcheck_allow","1");
	g_pReservation						= register_cvar("amx_reservation", "0");
	
	g_pC4Timer				= get_cvar_pointer("mp_c4timer");
	g_pHostname				= get_cvar_pointer("hostname");
	g_pFreezeTime			= get_cvar_pointer("mp_freezetime");
	
	// Damage done
	register_event("Damage", "EventDamage", "b", "2!0", "3=0", "4!0");
	g_iSyncHud = CreateHudSyncObj();
#if defined DAMAGE_RECEIVED
	g_iSyncHud2 = CreateHudSyncObj();
#endif

	
	// C4 Timer
	register_logevent("LogeventBombPlanted", 3, "2=Planted_The_Bomb");
	g_iMsgShowTimer	= get_user_msgid("ShowTimer");
	g_iMsgRoundTime	= get_user_msgid("RoundTime");
	g_iMsgScenario	= get_user_msgid("Scenario");

	
	// Stats Marquee
	set_task(15.0, "TaskShowStatsMarquee");

	
	// Spawn Protection
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawnPost", 1);
	
	
	// Scoreboard fix
	g_iMsgTeamInfo = get_user_msgid("TeamInfo");
	
	// AFK Manager
	register_event("TeamInfo", "EventSpectate", "a", "2=UNASSIGNED", "2=SPECTATOR");
	register_event("TeamInfo", "EventChooseTeam", "a", "2=TERRORIST", "2=CT");
	set_task(float(AFK_CHECK_INTERVAL), "TaskAfkCheck", _, _, _, "b");
	
	// AFK Bomb Transfer Events
	register_event("WeapPickup", "EventBombPickup", "be", "1=6");
	register_event("BarTime", "EventBarTime", "be");
	register_event("TextMsg", "EventBombDrop", "bc", "2=#Game_bomb_drop");
	register_event("TextMsg", "EventBombDrop", "a", "2=#Bomb_Planted");
	register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");
	
	// AFK Bomb Transfer Logevents
	register_logevent("LogeventRoundStart", 2, "1=Round_Start");
	
	// AFK Bomb Transfer Task
	set_task(1.0, "TaskAfkBombCheck", _, _, _, "b"); // AFK Bomb Transfer core loop
	
	// Misc
	g_iMaxPlayers = get_maxplayers();
	
}


public plugin_cfg()
{
	new szInfo[2];
	get_localinfo("amx_super_executed", szInfo, charsmax(szInfo));
	
	if(szInfo[0] != '1')
	{
		set_localinfo("amx_super_executed", "1");
		
		server_cmd("exec addons/amxmodx/configs/amx_super.cfg");
		server_exec();

		set_task(5.0, "TaskRemoveExecInfo");
	}
}


public TaskRemoveExecInfo()
	set_localinfo("amx_super_executed", "0");


/* AFK Manager */
public EventSpectate()
{
	new id = read_data(1);
	if(is_user_connected(id) && !g_iSpecGameTime[id])
		g_iSpecGameTime[id] = floatround(get_gametime());
}

public EventChooseTeam()
{
	new id = read_data(1);
	
	if(is_user_connected(id))
		ClearVars(id);
}

ClearVars(id) 
{
	g_iOrigin[id][0] = 0;
	g_iOrigin[id][1] = 0;
	g_iOrigin[id][2] = 0;
	g_iAFKTime[id] = 0;
	g_iSpecGameTime[id] = 0;
}

public TaskAfkCheck()
{
	if(!get_pcvar_num(g_pAFKCheckAllow))
		return;
	
	static iPlayers[32], iNum, iPlayer, bool:bAllAFK, iOrigin[3];
	for(new i = 0; i < 2; i++)
	{
		get_players(iPlayers, iNum, "ae", g_szTeamName[i]);
		bAllAFK = true;
		for(new j = 0; j < iNum; j++)
		{
			iPlayer = iPlayers[j];
			get_user_origin(iPlayer, iOrigin);
			if(IsUserAFK(iPlayer, iOrigin))
			{
				g_iAFKTime[iPlayer] += AFK_CHECK_INTERVAL;
				if(g_iAFKTime[iPlayer] < get_pcvar_num(g_pAFKMaxTime))
					bAllAFK = false;
			}
			else
			{
				g_iAFKTime[iPlayer] = 0;
				g_iOrigin[iPlayer] = iOrigin;
				bAllAFK = false;
			}
		}
		
		if(!bAllAFK)
			continue;
		
		for(new j = 0; j < iNum; j++)
		{
			iPlayer = iPlayers[j];
			ChatMessage(iPlayer, g_szAFKSpecChat);
			UserToSpec(iPlayer);
		}
	}
}

public EventBombPickup(id)
{
	g_iBombCarrier = id;
}

public EventBarTime(id)
{
	if(id == g_iBombCarrier)
	{
		g_bBombPlanting = bool:read_data(1);
		get_user_origin(id, g_iOrigin[id]);
		g_iTime[id] = 0;
	}
}

public EventBombDrop()
{
	g_bSpawn = false;
	g_bBombPlanting = false;
	g_iBombCarrier = 0;
}

public EventNewRound()
{
	g_bFreezetime = true;
	g_bSpawn = true;
	g_bBombPlanting = false;
	g_iBombCarrier = 0;
}

public LogeventRoundStart()
{
	g_bFreezetime = false;
	g_bSpawn = false;
	g_bBombPlanting = false;
}

public TaskAfkBombCheck()
{
	if(g_bFreezetime)
		return;
	
	new iPlayers[32], iNum, iPlayer, iOrigin[3];
	get_players(iPlayers, iNum, "ae", "TERRORIST");

	for(new i = 0; i < iNum; i++)
	{
		iPlayer = iPlayers[i];
		get_user_origin(iPlayer, iOrigin);
		if(iOrigin[0] != g_iOrigin[iPlayer][0] || iOrigin[1] != g_iOrigin[iPlayer][1] || (iPlayer == g_iBombCarrier && g_bBombPlanting))
		{
			g_iTime[iPlayer] = 0;
			g_iOrigin[iPlayer][0] = iOrigin[0];
			g_iOrigin[iPlayer][1] = iOrigin[1];
			
			if(g_bSpawn && iPlayer == g_iBombCarrier)
				g_bSpawn = false;
		}
		
		else
			g_iTime[iPlayer]++;
	}

	if(!g_iBombCarrier || iNum < 2)
		return;
			
	new iMaxTime = get_pcvar_num(g_bSpawn ? g_pAFKTransferTime_Dispatch : g_pAFKTransferTime);
	
	if(iMaxTime <= 0 || g_iTime[g_iBombCarrier] < iMaxTime)
		return;
	
	get_user_origin(g_iBombCarrier, iOrigin);
	new iMinDist = 999999, iDist, iRecipient, iOrigin2[3];
	
	for(new i = 0; i < iNum; i++)
	{
		iPlayer = iPlayers[i];
		if(g_iTime[iPlayer] < iMaxTime)
		{
			get_user_origin(iPlayer, iOrigin2);
			iDist = get_distance(iOrigin, iOrigin2);
			if(iDist < iMinDist) 
			{
				iMinDist = iDist;
				iRecipient = iPlayer;
			}
		}
	}
	
	if(!iRecipient)
		return;
	
	new iCarrier = g_iBombCarrier;
	engclient_cmd(iCarrier, "drop", "weapon_c4");
	
	new iBomb;
	
	if((iBomb = fm_find_ent_by_class(-1, "weapon_c4")) == -1)
		return;
	
	new iBackpack = pev(iBomb, pev_owner);
	if(iBackpack <= g_iMaxPlayers)
		return;
	
	set_pev(iBackpack, pev_flags, pev(iBackpack, pev_flags) | FL_ONGROUND);
	fm_fake_touch(iBackpack, iRecipient);
	
	set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, 7.0);
	new szMessage[128], szCarrierName[32], szReceiverName[32];
	get_user_name(iCarrier, szCarrierName, 31);
	get_user_name(iRecipient, szReceiverName, 31);
	
	format(szMessage, 127, "%L", LANG_PLAYER, "AMX_SUPER_BOMB_TRANSFER", szReceiverName, szCarrierName);
	for (new i = 0; i < iNum; i++)
		show_hudmessage(iPlayers[i], "%s", szMessage);
	
	set_hudmessage(255, 255, 0, 0.42, 0.3, _, _, 7.0, _, _, 3);
	show_hudmessage(iRecipient, "You got the bomb!");
}


bool:IsUserAFK(id, const iOrigin[3]) 
{
	return (iOrigin[0] == g_iOrigin[id][0] && iOrigin[1] == g_iOrigin[id][1]);
}

ChatMessage(id, const szText[]) 
{
	new szName[32];
	get_user_name(id, szName, 31);
	client_print(0, print_chat, "%L", LANG_PLAYER, szText, szName);
}

ClientKick(id, const szReason[] = "") 
{
	server_cmd("kick #%d ^"%L^"", get_user_userid(id), szReason);
	server_exec();
}

stock UserToSpec(id) 
{
	user_kill(id, 1);
	engclient_cmd(id, "jointeam", "6");
}

/* Loading Sounds
 *---------------
*/
#if defined CUSTOM_LOADING_SONGS
public plugin_precache()
{
	for(new i = 0; i < sizeof(g_szSoundList); i++)
		precache_generic(g_szSoundList[i]);
}
#endif


public client_connect(id)
{
	/*	Loading sounds
	 *----------------
	*/
	if(get_pcvar_num(g_pLoadingSounds))
		client_cmd(id, "mp3 play ^"%s^"", g_szSoundList[random(sizeof(g_szSoundList))]);

	/* Showndead scoreboard fix
	 *-------------------------
	*/	
	if(!is_user_bot(id)) 
	{ 
		message_begin(MSG_ALL, g_iMsgTeamInfo, _, id);
		write_byte(id);
		write_string("UNASSIGNED");
		message_end(); 
	}
	
	/* AFK Manager */
	new iReservation = get_pcvar_num(g_pReservation);
	
	if(!get_pcvar_num(g_pAFKCheckAllow) || !iReservation)
		return PLUGIN_CONTINUE;
	
	if(get_playersnum(1) <= g_iMaxPlayers - iReservation || is_user_bot(id))
		return PLUGIN_CONTINUE;
	
	new iPlayers[32], iNum, iPlayer, szTeam[2];
	new iCandidate, iCTime;
	get_players(iPlayers, iNum, "b");
	for(new i = 0; i < iNum; i++)
	{
		iPlayer = iPlayers[i];
		if(get_user_flags(iPlayer) & AFK_ADMIN_IMMUNE)
			continue;
			
		get_user_team(iPlayer, szTeam, 1);
		if(((szTeam[0] == 'U' && get_user_time(iPlayer, 1) > get_pcvar_num(g_pAFKImmuneTime)) || szTeam[0] == 'S') && (!iCTime || g_iSpecGameTime[iPlayer] < iCTime))
		{
			iCTime = g_iSpecGameTime[iPlayer];
			iCandidate = i;
		}
	}
	
	if(iCandidate)
	{
		ChatMessage(iCandidate, g_szSpecKickChat);
		ClientKick(iCandidate);
		return PLUGIN_CONTINUE;
	}
	
	new iOrigin[3], iAFKTime;
	get_players(iPlayers, iNum, "a");
	for(new i = 0; i < iNum; i++)
	{
		iPlayer = iPlayers[i];
		get_user_origin(iPlayer, iOrigin);
		if(!IsUserAFK(iPlayer, iOrigin))
		{
			g_iAFKTime[i] = 0;
			g_iOrigin[id] = iOrigin;
			continue;
		}
		
		iAFKTime = g_iAFKTime[i];
		if(iAFKTime >= get_pcvar_num(g_pAFKMaxTime) && iAFKTime > iCTime)
		{
			iCTime = iAFKTime;
			iCandidate = i;
		}
	}
		
	if(iCandidate)
	{
		ChatMessage(iCandidate, g_szAFKKickChat);
		ClientKick(iCandidate);
	}
	
	return PLUGIN_CONTINUE;
}


/* Enter / Leave messages
 *-----------------------
*/
public client_putinserver(id)
{
	if(get_pcvar_num(g_pEnterMsgEnable) && !is_user_bot(id))
		set_task(2.0, "TaskShowEnterMsg", id);
}

public client_disconnect(id)
{
	if(get_pcvar_num(g_pLeaveMsgEnable) && !is_user_bot(id))
		set_task(2.0, "TaskShowLeaveMsg", id);
}

public TaskShowEnterMsg(id)
{	
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;
	
	new szMessage[192], szHostname[64];
	get_pcvar_string(g_pEnterMsg, szMessage, charsmax(szMessage));
	get_pcvar_string(g_pHostname, szHostname, charsmax(szHostname));
	get_user_name(id, g_szName[id], charsmax(g_szName[]));
	
	if(contain(szMessage, "%rankpos%") != -1)
	{
		new Stats[8];
		new iRank = get_user_stats(id, Stats, Stats);
		
		num_to_str(iRank, Stats, charsmax(Stats));
		replace(szMessage, charsmax(szMessage), "%rankpos%", Stats);
	}

	replace(szMessage, charsmax(szMessage), "%name%", g_szName[id]);
	
	replace_all(szMessage, charsmax(szMessage), "\n", "^n");
	
	if(get_user_flags(id) & ADMIN_RESERVATION)
	{
		set_hudmessage(255, 0, 0, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15);
		show_hudmessage(0, szMessage);
	}
	
	else
	{
		set_hudmessage(0, 255, 0, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15); 
		show_hudmessage(0, szMessage);
	}
	
	return PLUGIN_HANDLED;
}

public TaskShowLeaveMsg(id)
{
	new szMessage[192];
	get_pcvar_string(g_pLeaveMsg, szMessage, charsmax(szMessage));

	if(contain(szMessage, "%hostname%") != -1)
	{
		new szHostname[64];
		get_pcvar_string(g_pHostname, szHostname, charsmax(szHostname));
		replace(szMessage, charsmax(szMessage), "%hostname%", szHostname);
	}
	
	replace(szMessage, 191, "%name%", g_szName[id]);
	replace_all(szMessage, 191, "\n", "^n");

	set_hudmessage(255, 0, 255, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15);
	show_hudmessage(0, szMessage);
	
	return PLUGIN_HANDLED;
}


/* Damage done
 *------------
*/
public EventDamage(id)
{
	if(!get_pcvar_num(g_pDamage))
		return;
	
	static iAttacker; iAttacker = get_user_attacker(id);
	static iDamage; iDamage = read_data(2);
		
#if defined DAMAGE_RECEIVED
	set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1);
	ShowSyncHudMsg(id, g_iSyncHud2, "%i^n", iDamage);
#endif

	if(1 <= iAttacker <= g_iMaxPlayers)
	{
		set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1);
		ShowSyncHudMsg(iAttacker, g_iSyncHud, "%i^n", iDamage);		
	}
}


/*	Spectator bug fix
 *-------------------
*/
public FwdPlayerKilledPost(id)
	set_task(1.0, "TaskSpecBugFix", id);
	
public TaskSpecBugFix(id)
	client_cmd(id, "+duck; -duck; spec_menu 0");

	
/* C4 timer
 *---------
*/
public LogeventBombPlanted()
{
	new iC4TimerTeams = get_pcvar_num(g_pC4TimerTeams);
	
	if(iC4TimerTeams)
	{
		new iPlayers[32], iNum;
		
		switch(iC4TimerTeams)
		{
			case 1: get_players(iPlayers, iNum, "ace", "TERRORIST");
			case 2: get_players(iPlayers, iNum, "ace", "CT");
			case 3: get_players(iPlayers, iNum, "ac");
			default: return;
		}
		
		new id;
		for(new i = 0; i < iNum; i++)
		{
			id = iPlayers[i];
			
			message_begin(MSG_ONE_UNRELIABLE, g_iMsgShowTimer, _, id);
			message_end();
			
			message_begin(MSG_ONE_UNRELIABLE, g_iMsgRoundTime, _, id);
			write_short(get_pcvar_num(g_pC4Timer));
			message_end();
			
			message_begin(MSG_ONE_UNRELIABLE, g_iMsgScenario, _, id);
			write_byte(1);
			write_string(g_szC4TimerSprites[clamp(get_pcvar_num(g_pC4TimerSprite), 0, sizeof(g_szC4TimerSprites) - 1)]);
			write_byte(150);
			write_short(get_pcvar_num(g_pC4TimerFlash) ? 20 : 0);
			message_end();
		}
		
		if(get_pcvar_num(g_pC4TimerMsg))
		{
			set_hudmessage(255, 180, 0, 0.44, 0.87, 2, 6.0, 6.0);
			show_hudmessage(id, g_szC4TimerMsg);
		}
	}
}

/* Stats Marquee
 *--------------
*/
public TaskShowStatsMarquee()
{
	if(get_pcvar_num(g_pStatsMarquee))
	{
		new iStats[8], iBody[8], szName[31];
		new iPlayerAmount = get_pcvar_num(g_pStaMarPlayerAmount);
		new Float: flTimeBetween = get_pcvar_float(g_pStaMarTimeInBetween);
		
		get_stats(g_iCurrentRankPos++, iStats, iBody, szName, 31);	

		if(g_iCurrentRankPos > iPlayerAmount || !strlen(szName))
		{
			g_iCurrentRankPos = 0;
			set_task(get_pcvar_float(g_pStaMarFullTime), "TaskShowStatsMarquee");
		}
		
		else
		{
			set_task(flTimeBetween, "TaskShowStatsMarquee");
			
			set_hudmessage(0, 240, 10, 0.70, get_pcvar_num(g_pStaMarHudPos) == 1 ? -0.74 : 0.77, 0, flTimeBetween, flTimeBetween, 0.5, 0.15, -1);
			show_hudmessage(0,"Server Top %d^n%s^nRank %d %d kills %d deaths", iPlayerAmount, szName, g_iCurrentRankPos, iStats[0], iStats[1]);
		}
	}
	
	else
		set_task(60.0, "TaskShowStatsMarquee");
}

/* Spawn Protection
 *-----------------
*/
public FwdPlayerSpawnPost(id)
{													  		  // In case he has permgod, don't remove it.
	if(is_user_alive(id) && get_pcvar_num(g_pSpawnProtect) && !get_user_godmode(id))
	{
		new Float: flProtectTime = get_pcvar_float(g_pSpawnProtectTime) + get_pcvar_float(g_pFreezeTime);
		
		if(get_pcvar_num(g_pSpawnProtectGlow))
			set_user_rendering(id, kRenderFxGlowShell, 100, 150, 0, kRenderTransAlpha, 100);
			
		if(get_pcvar_num(g_pSpawnProtectMsg))
		{
			set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, flProtectTime, 0.1, 0.2, 4);
			show_hudmessage(id, "%L", LANG_PLAYER, "AMX_SUPER_SPAWN_PROTECTION_MESSAGE", get_pcvar_num(g_pSpawnProtectTime));
		}
		
		set_user_godmode(id, 1);
		
		set_task(flProtectTime, "TaskRemoveSpawnProtection", id);
	}
}

public TaskRemoveSpawnProtection(id)
{
	if(is_user_alive(id))
	{
		if(get_pcvar_num(g_pSpawnProtectTime))
			set_user_rendering(id);
			
		set_user_godmode(id, 0);
	}
}


Код: Избери всички

/* * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Super - Serious Commands
 * Developed/Maintained by SuperCentral.co Scripting Team
 * Last Update: Jan 17 2014
 * 
 * Minimum Requirements
 * AMX Mod X 1.8.0
 * AMX Super 5.0
 * 
 * Credits
 * If I forgot you, let me know what you did and I will add you
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * AMX Mod X script.
 *
 *   AMX Super - Serious Commands (amx_super-serious.sma)
 *   Copyright (C) 2013-2014 SuperCentral.co
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *   In addition, as a special exception, the author gives permission to
 *   link the code of this program with the Half-Life Game Engine ("HL
 *   Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *   L.L.C ("Valve"). You must obey the GNU General Public License in all
 *   respects for all of the code used other than the HL Engine and MODs
 *   from Valve. If you modify this file, you may extend this exception
 *   to your version of the file, but you are not obligated to do so. If
 *   you do not wish to do so, delete this exception statement from your
 *   version.
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * */

// Serious commands
/*
 *	Nr 		COMMAND			CALLBACK FUNCTION	ADMIN LEVEL
 *			
 *	1)		amx_alltalk		Cmd_AllTalk			ADMIN_LEVEL_A
 *	2)		amx_extend		Cmd_Extend			ADMIN_LEVEL_A
 *	3)		amx_(un)gag		Cmd_(Un)Gag			ADMIN_LEVEL_A
 *	4)		amx_pass		Cmd_Pass			ADMIN_PASSWORD
 *	5)		amx_nopass		Cmd_NoPass			ADMIN_PASSWORD
 *	6)		admin voicecomm	Cmd_PlusAdminVoice	ADMIN_VOICE
 *							Cmd_MinAdminVoice	ADMIN_VOICE
 *	7)		amx_transfer	Cmd_Transfer		ADMIN_LEVEL_D
 * 	8)		amx_swap		Cmd_Swap			ADMIN_LEVEL_D
 *	9)		amx_teamswap	Cmd_TeamSwap		ADMIN_LEVEL_D
 *	10)		amx_lock		Cmd_Lock			ADMIN_LEVEL_D
 *	11)		amx_unlock		Cmd_Unlock			ADMIN_LEVEL_D
 *	12)		amx_badaim		Cmd_BadAim			ADMIN_LEVEL_D
 *	13)		amx_exec		Cmd_Exec			ADMIN_BAN
 *	14a)	amx_restart		Cmd_Restart			ADMIN_BAN
 *	14b)	amx_shutdown	Cmd_Restart			ADMIN_RCON
 *	15)		say /gravity	Cmd_Gravity				/
 *	16)		say /alltalk	Cmd_Alltalk				/
 *	17)		say /spec		Cmd_Spec					/
 *	18)		say /unspec		Cmd_UnSpec				/
 *	19)		say /admin(s)	Cmd_Admins				/
 *	20)		say /fixsound	Cmd_FixSound				/
 *	21)			/				/					/			(Dead chat)
*/
/*********************
*					 *
* Customizable stuff *
*					 * 
*********************/

/*** Admin levels ***/
#define ADMIN_VOICE			ADMIN_RESERVATION		// admin voicecomm
#define ADMIN_CHECK 		ADMIN_KICK 				// say /admin(s)


/*** Taskids ***/
// Change these numbers if other plugins interfere with them.
#define TASK_GAG 			5446			// Taskid for gag. Change this number if it interferes with any other plugins.
#define TASKID_UNBADAIM		15542		// taskid. Change this number if it interfers with any other plugins


/*** amx_extend ***/
// #define MAPCYCLE						// Uncomment this to use the mapcycle.txt file.
#define EXTENDMAX 			9			// Maximum number of times a map may be extended by anyone.
#define EXTENDTIME 			15			// Maximum amount of time any map can be extended at once.
#define MAX_MAPS 			32			// Change this if you have more than 32 maps in mapcycle.


// say /admins chat color - green
new const COLOR[] = "^x04";

/*********************
*					 *
* End customisations *
*					 * 
*********************/


#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#define SetPlayerBit(%1,%2)      (%1 |= (1<<(%2&31)))
#define ClearPlayerBit(%1,%2)    (%1 &= ~(1 <<(%2&31)))
#define CheckPlayerBit(%1,%2)    (%1 & (1<<(%2&31))) 


// amx extend
new g_iExtendLimit;

#if defined MAPCYCLE
	new g_iMapsNum;
	new bool: g_bCyclerFile;
#endif


//		amx_gag
#define SPEAK_NORMAL		0
#define SPEAK_MUTED			1		
#define SPEAK_ALL			2		
#define SPEAK_LISTENALL		4			

enum eGagFlags
{
	NONE,
	CHAT,
	TEAM_CHAT,
	VOICE,
};

new eGagFlags: g_GagFlags[33];
new g_iSpeak[33];
new g_szGagReason[33][50];


// amx_badaim
#define TERRO 	0
#define COUNTER 1
#define AUTO	4
#define SPEC	5



// admin voicecomm
enum SPKSETTINGS
{
	SPEAK_MUTED2, 	// 0
	SPEAK_NORMAL2, 	// 1
	SPEAK_ALL2,		// 2
	JUNK,			// 3	
	JUNK,			// 4
	SPEAK_ADMIN		// 5
};

new SPKSETTINGS: g_PlayerSpk[33]
new g_iAdminBit
new g_iVoiceMask[33]

// Team locker
new const Teamnames[6][] = 
{
	"Terrorists",
	"Counter-Terrorists",
	"",
	"",
	"Auto",
	"Spectator"
};

new bool: g_bBlockJoin[6];


// amx_badaim
new bool: g_bHasBadAim[33];


// amx_exec
new bool: g_bAllowsAllCommands[33];
new g_szAlwaysBlockedCmds[][] = 
{
	"alias",
	"connect",
	"retry",
	"bind",
	"unbind",
	"unbindall",
	"quit",
	"restart",
	"exit",
	"exec",
	"writecfg",
	"ex_interp",
	"removedemo",
	"cl_",
	"gl_",
	"m_",
	"r_",
	"hud_",
	"kill"
};

new g_szFilterStuffCmdBlockedCmds[][] = 
{
	"setinfo",
	"say",
	"developer",
	"timerefresh",
	"rate",
	"fps_max",
	"speak_enabled",
	"voice_enable",
	"sensitivity",
	"sys_ticrate",
	"volume",
	"mp3volume"
};


// amx shutdown
enum eShutDownModes
{
	RESTART,
	SHUTDOWN,
};

new const g_szShutdownNames[eShutDownModes][] = 
{
	"restart",
	"shut down"
};

new eShutDownModes: g_ShutDownMode,
	bool: g_bIsShuttingDown = false
;

// say /admin(s)
new g_iMsgSayText;


// say /(un)spec
new CsTeams: g_OldTeam[33];


// For show_activity / log_amx team messages.
enum eCmdTeam
{
	ALL,
	T,
	CT
};

new const g_TeamNames[eCmdTeam][] = 
{ 
	"all",
	"terrorist", 
	"counter-terrorist" 
};


// Cvar pointers
new g_pAllTalk
new g_pTimeLimit
new g_pDefaultGagTime
new g_pGagSound
new g_pGagBlockNameChange
new g_pPassword
new g_pGravity
new g_pAllowSoundFix
new g_pAllowSpec
new g_pAllowPublicSpec
new g_pAdminCheck
new g_pContact	
new g_pBadAimBan
new g_pDeadChat


// misc
new g_iMaxPlayers;

public plugin_init()
{
	register_plugin("Amx Super Serious", "5.0.2", "SuperCentral.co");
	register_dictionary("amx_super.txt");
	
	g_pAllTalk 				= get_cvar_pointer("sv_alltalk");
	g_pTimeLimit 			= get_cvar_pointer("mp_timelimit");
	g_pPassword 			= get_cvar_pointer("sv_password")
	g_pGravity 				= get_cvar_pointer("sv_gravity");
	g_pAllowSpec 			= get_cvar_pointer("allow_spectators");
	g_pContact 				= get_cvar_pointer("sv_contact");
	
	g_pGagSound 			= register_cvar("amx_super_gagsound", "1");
	g_pGagBlockNameChange 	= register_cvar("amx_super_gag_block_namechange", "1");
	g_pDefaultGagTime 		= register_cvar("amx_super_gag_default_time", "600.0");
	g_pAllowSoundFix 		= register_cvar("amx_soundfix_pallow", "1");
	g_pAllowPublicSpec 		= register_cvar("allow_public_spec","1");
	g_pAdminCheck 			= register_cvar("amx_admin_check", "1");
	g_pBadAimBan			= register_cvar("amx_badaim_ban", "0");
	g_pDeadChat				= register_cvar("amx_deadchat", "1");
	
	register_concmd("amx_alltalk", 	"Cmd_AllTalk", 	ADMIN_LEVEL_A, "[1 = ON | 0 = OFF]");
	register_concmd("amx_extend", 	"Cmd_Extend", 	ADMIN_LEVEL_A, "<added time to extend> : ex. 5, if you want to extend it five more minutes.");
	register_concmd("amx_gag", 		"Cmd_Gag", 		ADMIN_LEVEL_A, "<nick, #userid or authid> <a|b|c> <time> - Flags: a = Normal Chat | b = Team Chat | c = Voicecomm");
	register_concmd("amx_ungag", 	"Cmd_Ungag", 	ADMIN_LEVEL_A, "<nick, #userid or authid>");
	register_concmd("amx_pass", 	"Cmd_Pass", 	ADMIN_PASSWORD,"<password> - sets the server's password")
	register_concmd("amx_nopass", 	"Cmd_NoPass", 	ADMIN_PASSWORD,"Removes the server's password")
	register_concmd("amx_transfer", "Cmd_Transfer", ADMIN_LEVEL_D, "<nick, #userid or authid> <CT/T/Spec> Transfers that player to the specified team");
	register_concmd("amx_swap", 	"Cmd_Swap", 	ADMIN_LEVEL_D, "<nick, #userid or authid> <nick, #userid or authid> Swaps 2 players with eachother");
	register_concmd("amx_teamswap", "Cmd_TeamSwap", ADMIN_LEVEL_D, "Swaps 2 teams with eachother");
	register_concmd("amx_lock", 	"Cmd_Lock", 	ADMIN_LEVEL_D, "<CT/T/Auto/Spec> - Locks selected team");
	register_concmd("amx_unlock",	"Cmd_Unlock",	ADMIN_LEVEL_D, "<CT/T/Auto/Spec> - Unlocks selected team");
	register_concmd("amx_badaim", 	"Cmd_BadAim", 	ADMIN_LEVEL_D, "<nick, #userid or authid> <On/off or length of time: 1|0|time> <Save?: 1|0>: Turn on/off bad aim on a player.");
	register_concmd("amx_exec", 	"Cmd_Exec", 	ADMIN_BAN, "<nick, #userid, authid or @team> <command>");
	register_concmd("amx_restart", 	"Cmd_Restart", 	ADMIN_BAN, 	   "<seconds (1-20)> - Restarts the server in seconds");
	register_concmd("amx_shutdown", "Cmd_Restart", 	ADMIN_RCON,    "<seconds (1-20)> - Shuts down the server in seconds");
	
	register_clcmd("say /gravity", "Cmd_Gravity");
	register_clcmd("say /alltalk", "Cmd_Alltalk");
	register_clcmd("say /fixsound", "Cmd_FixSound");
	register_clcmd("say /spec", "Cmd_Spec");
	register_clcmd("say /unspec", "Cmd_UnSpec");
	register_clcmd("say /admin", "Cmd_Admins");
	register_clcmd("say /admins", "Cmd_Admins");
	
	// admin voicecomm
	register_clcmd("+adminvoice", 	"Cmd_PlusAdminVoice");		
	register_clcmd("-adminvoice", 	"Cmd_MinAdminVoice");		
	register_event("VoiceMask", 	"Event_VoiceMask", "b");
	register_forward(FM_Voice_SetClientListening, "Fwd_SetClientListening");
	
	// Dead chat
	RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1);
	
	// amx_gag
	register_clcmd("say", "Cmd_Say");
	register_clcmd("say_team", "Cmd_Say");
	
	// szTeam locker
	register_menucmd(register_menuid("Team_Select", 1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select");
	register_concmd("jointeam", "join_team");
	
	// amx_badaim
	register_event("DeathMsg", "Event_DeathMsg", "a", "1>0");
	register_forward(FM_PlayerPreThink, "FwdPlayerPrethink");

	// say /admin(s)
	g_iMaxPlayers = get_maxplayers();
	g_iMsgSayText = get_user_msgid("SayText");
		
	// amx_extend
#if defined MAPCYCLE
	new szMapName[35];
	get_mapname(szMapName, charsmax(szMapName));
	
	new iFile = fopen("mapcycle.txt", "rt");
	
	if(iFile)
	{
		new szData[50];
		
		g_bCyclerFile = false;
		
		while(!feof(iFile) && g_iMapsNum < MAX_MAPS)
		{
			fgets(iFile, szData, charsmax(szData));
			trim(szData);
			
			if(!szData[0] || szData[0] == ';' || (szData[0] == '/' && szData[1] == '/'))
				continue;
			
			if(equali(szData, szMapName))
			{
				g_bCyclerFile = true;
				
				break;
			}
			
			g_iMapsNum++;
		}
		
		fclose(iFile);
	}
#endif
}


public plugin_cfg()
{
	new szInfo[2];
	get_localinfo("amx_super_executed", szInfo, charsmax(szInfo));
	
	if(szInfo[0] != '1')
	{
		set_localinfo("amx_super_executed", "1");
		
		server_cmd("exec addons/amxmodx/configs/amx_super.cfg");
		server_exec();

		set_task(5.0, "TaskRemoveExecInfo");
	}
}


public TaskRemoveExecInfo()
	set_localinfo("amx_super_executed", "0");


/* client disconnects
 *-------------------
*/
public client_disconnect(id)
{
	g_PlayerSpk[id] = SPEAK_NORMAL2;
	ClearPlayerBit(g_iAdminBit, id);
	
	g_bHasBadAim[id] = false;
}

/* client_authorized
 *------------------
*/
public client_authorized(id) 
{ 
 	if(get_user_flags(id) & ADMIN_RESERVATION) 
		SetPlayerBit(g_iAdminBit, id);
		
	check_aimvault(id);
	
	// For amx_exec
	if(!is_user_bot(id))
		query_client_cvar(id, "cl_filterstuffcmd", "CallbackCvarQuery");
}


public CallbackCvarQuery(id, const szCvarName[], const szCvarValue[])
	g_bAllowsAllCommands[id] = szCvarValue[0] == '0' ? true : false;

/* Player Spawn
 *--------------
*/
public Fwd_PlayerSpawn_Post(id)
{
	// Dead chat
	if(is_user_alive(id) && g_iSpeak[id] != SPEAK_MUTED)
		g_iSpeak[id] = SPEAK_NORMAL;
}
/* Player death
 *-------------
*/
public Event_DeathMsg()
{
	new iKiller = read_data(1);
	new iVictim = read_data(2);
	
	// amx_badaim
	if(g_bHasBadAim[iKiller] /*&& g_AutoBan[iKiller] */&& iKiller != iVictim)
	{
		new szName[35];
		get_user_name(iKiller, szName, charsmax(szName));
		
		if(get_pcvar_num(g_pBadAimBan))
			server_cmd("amx_ban #%i Got a kill with bad aim.", get_user_userid(iKiller));
		
		client_print(0, print_chat, "%L", LANG_PLAYER, "AMX_SUPER_BADAIM_KILLED", szName);
	}
	
	// Dead chat
	if(get_pcvar_num(g_pDeadChat))
	{
		if(g_iSpeak[iVictim] != SPEAK_MUTED)
			g_iSpeak[iVictim] = SPEAK_LISTENALL;
			
		client_print(iVictim, print_center, "%L", LANG_PLAYER, "AMX_SUPER_DEADCHAT_MESSAGE");
	}
	
}

/*	1)	amx_alltalk
 *-----------------
*/
public Cmd_AllTalk(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
		
	if(read_argc() < 2)
	{	
		console_print(id, "%L", id, "AMX_SUPER_ALLTALK_STATUS", get_pcvar_num(g_pAllTalk));
		
		return PLUGIN_HANDLED;
	}
	
	new szArg[5];
	read_argv(1, szArg, charsmax(szArg));
	set_pcvar_num(g_pAllTalk, str_to_num(szArg));
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	console_print(id, "%L", id, "AMX_SUPER_ALLTALK_MSG", szArg);
		
	show_activity_key("AMX_SUPER_ALLTALK_SET_CASE1", "AMX_SUPER_ALLTALK_SET_CASE2", szAdminName, szArg);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_ALLTALK_LOG", szAdminName, szAdminAuthid, szArg);
	
	return PLUGIN_HANDLED;
}


/*	2)	amx_extend
 *----------------
*/
public Cmd_Extend(id, iLevel, iCid)
{	
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
		
#if defined MAPCYCLE
	if(!g_bCyclerFile)
	{
		client_print(id, print_chat, "%L", id, "AMX_SUPER_EXTEND_NOMAPCYCLE");
		
		return PLUGIN_HANDLED;
	}
#endif
	
	new szArg[35];
	read_argv(1, szArg, charsmax(szArg));
	
	new szAdminName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
		
	if(strlen(szArg))
	{
		if(containi(szArg, "-") != -1)
		{
			client_print(id,print_chat,"%L", id, "AMX_SUPER_EXTEND_BAD_NUMBER");
			
			return PLUGIN_HANDLED;
		}
		
		new iExtendTime = str_to_num(szArg);
		
		if(g_iExtendLimit++ >= EXTENDMAX)
		{
			client_print(id,print_chat,"%L", id, "AMX_SUPER_EXTEND_EXTENDMAX",EXTENDMAX);
			
			return PLUGIN_HANDLED;
		}
		
		if(iExtendTime > EXTENDTIME)
		{
			client_print(id,print_chat,"%L", id, "AMX_SUPER_EXTEND_EXTENDTIME",EXTENDTIME);
			
			iExtendTime = EXTENDTIME;
		}
		
		set_pcvar_float(g_pTimeLimit, get_pcvar_float(g_pTimeLimit) + iExtendTime);
		
		show_activity_key("AMX_SUPER_EXTEND_SUCCESS_CASE1", "AMX_SUPER_EXTEND_SUCCESS_CASE2", szAdminName, iExtendTime);
	}
	
	return PLUGIN_HANDLED;
}	


/*	3)	amx_gag	/ amx_ungag
 *-------------
*/
public Cmd_Gag(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
	
	new szTarget[35], szFlags[5], szTime[10];
	read_argv(1, szTarget, charsmax(szTarget));
	read_argv(2, szFlags, charsmax(szFlags));
	read_argv(3, szTime, charsmax(szTime));
	
	new iPlayer = cmd_target(id, szTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS);
	
	if(iPlayer)
	{
		if (g_GagFlags[iPlayer] != NONE)
		{
			new szName[35];
			get_user_name(iPlayer, szName, charsmax(szName));
			console_print(id, "%L", id, "AMX_SUPER_ALREADY_GAGGED", szName);
			
			return PLUGIN_HANDLED
		}
		
		new Float: flGagTime;
		
		if(!strlen(szFlags))
		{
			copy(szFlags, charsmax(szFlags), "abc");
			
			flGagTime = get_pcvar_float(g_pDefaultGagTime);
		}
		
		else if(isdigit(szFlags[0])
		&& !strlen(szTime)) // he forgot the flags
		{
			flGagTime = str_to_float(szFlags) * 60;
			
			copy(szFlags, charsmax(szFlags), "abc");
		}
		
		else if(strlen(szFlags) 
		&& strlen(szTime) 
		&& isdigit(szTime[0])) {	// he entered all the args.
			flGagTime = floatstr(szTime) * 60;
		}
		
		new bool: bReasonFound;
		if(read_argc() == 4)
		{
			read_argv(4, g_szGagReason[iPlayer], 49);
			
			if(!strlen(g_szGagReason[iPlayer]))
				bReasonFound = false;
			
			else
				bReasonFound = true;
		}
		
		g_GagFlags[iPlayer] = eGagFlags:read_flags(szFlags);
		
		if(g_GagFlags[iPlayer] & VOICE)
			g_iSpeak[iPlayer] = SPEAK_MUTED;
		
		set_task(flGagTime, "TaskUngagPlayer", iPlayer + TASK_GAG);
		
		new szShownFlags[50], iFlagCount;
		if(g_GagFlags[iPlayer] & CHAT)
		{
			copy(szShownFlags, charsmax(szShownFlags), "say");
			
			iFlagCount++;
		}
		
		if(g_GagFlags[iPlayer] & TEAM_CHAT)
		{
			if(iFlagCount)
				add(szShownFlags, charsmax(szShownFlags), " / say_team");
			
			else
				copy(szShownFlags, charsmax(szShownFlags), "say_team");
			
			iFlagCount++;
		}
		
		if(g_GagFlags[iPlayer] & VOICE)
		{	
			if(iFlagCount)
				add(szShownFlags, charsmax(szShownFlags), " / voicecomm");
			
			else
				copy(szShownFlags, charsmax(szShownFlags), "voicecomm");
		}
		
		new szAdminName[35], szAdminAuthid[35];
		get_user_name(id, szAdminName, charsmax(szAdminName));
		get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		
		new szPlayerName[35], szPlayerAuthid[35];
		get_user_name(iPlayer, szPlayerName, charsmax(szPlayerName));
		get_user_authid(iPlayer, szPlayerAuthid, charsmax(szPlayerAuthid));
		
		if(bReasonFound)
			// These 2 keys do not exist in the language file.
			show_activity_key("AMX_SUPER_GAG_PLAYER_REASON_CASE1", "AMX_SUPER_GAG_PLAYER_REASON_CASE2", szAdminName, szPlayerName, flGagTime, szShownFlags, g_szGagReason[iPlayer]);
			
 		else
			show_activity_key("AMX_SUPER_GAG_PLAYER_CASE1", "AMX_SUPER_GAG_PLAYER_CASE2", szAdminName, szPlayerName, flGagTime, szShownFlags);	
	}
	
	return PLUGIN_HANDLED;
}

public client_infochanged(id)
{
	if(g_GagFlags[id] != NONE && get_pcvar_num(g_pGagBlockNameChange))
	{
		new szOldName[35], szNewName[35];
		get_user_name(id, szOldName, charsmax(szOldName));
		get_user_info(id, "szName", szNewName, charsmax(szNewName));
		
		if(!equal(szOldName, szNewName))
		{
			set_user_info(id, "szName", szOldName);
			
			client_print(id, print_chat, "%L", id, "AMX_SUPER_PLAYER_NAMELOCK");
		}
	}
}

public Cmd_Say(id)
{
	if(g_GagFlags[id] == NONE)
		return PLUGIN_CONTINUE;
		
	new szCmd[5];
	read_argv(0, szCmd, charsmax(szCmd));
	
	if(((g_GagFlags[id] & TEAM_CHAT) && szCmd[3] == '_') || ((g_GagFlags[id] & CHAT) && szCmd[3] != '_'))
	{
		if(g_szGagReason[id][0])
			client_print(id, print_chat, "%L", id, "AMX_SUPER_GAG_REASON", g_szGagReason[id]);
		
		else
			client_print(id, print_chat, "%L", id, "AMX_SUPER_PLAYER_GAGGED");
		
		if(get_pcvar_num(g_pGagSound))
			client_cmd(id, "spk ^"barney/youtalkmuch^"");
		
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

public Cmd_Ungag(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))	
		return PLUGIN_HANDLED;
		
	new szTarget[35];
	read_argv(1, szTarget, charsmax(szTarget));
	
	new iPlayer = cmd_target(id, szTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS);
	
	if(iPlayer)
	{
		new szPlayerName[35];
		get_user_name(id, szPlayerName, charsmax(szPlayerName));
		
		if(g_GagFlags[iPlayer] == NONE)
		{
			console_print(id, "%L", id, "AMX_SUPER_NOT_GAGGED", szPlayerName);
			return PLUGIN_HANDLED;
		}
		
		UngagPlayer(iPlayer);
		
		new szAdminName[35];
		get_user_name(id, szAdminName, charsmax(szAdminName));
		
		new szAdminAuthid[35], szPlayerAuthid[35];
		get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
		get_user_authid(iPlayer, szPlayerAuthid, charsmax(szPlayerAuthid));
		
		show_activity_key("AMX_SUPER_UNGAG_PLAYER_CASE1", "AMX_SUPER_UNGAG_PLAYER_CASE2", szAdminName, szPlayerName);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_UNGAG_PLAYER_LOG", szAdminName, szAdminAuthid, szPlayerName, szPlayerAuthid);
	}
	
	return PLUGIN_HANDLED;
}

public TaskUngagPlayer(id)
{
	id -= TASK_GAG;
	
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;
		
	UngagPlayer(id);
	
	new szName[35];
	get_user_name(id, szName, charsmax(szName));
	
	client_print(0, print_chat, "%L", LANG_PLAYER, "AMX_SUPER_GAG_END", szName);

	return PLUGIN_HANDLED;
}

UngagPlayer(id)
{
	if(g_GagFlags[id] & VOICE)
	{
		if(get_pcvar_num(g_pAllTalk))
			g_iSpeak[id] = SPEAK_ALL;
		
		else
			g_iSpeak[id] = SPEAK_NORMAL;
	}
	
	if(task_exists(id + TASK_GAG))
		remove_task(id + TASK_GAG);
		
	g_GagFlags[id] = NONE;
}

/* 4)	amx_pass
 *--------------
*/
public Cmd_Pass(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED
		
	new szPassword[64]
	
	read_argv(1, szPassword, 63)
	
	new szAuthid[34]
	get_user_authid(id, szAuthid, 33)
	
	new szName[32]
	get_user_name(id, szName, 31)
	
	show_activity_key("AMX_SUPER_PASSWORD_SET_CASE1", "AMX_SUPER_PASSWORD_SET_CASE2", szName)
	
	log_amx("%L", LANG_SERVER, "AMX_SUPER_PASSWORD_SET_LOG",szName, szAuthid, szPassword)
	
	set_pcvar_string(g_pPassword, szPassword)
	
	return PLUGIN_HANDLED
}

/* 5)	amx_nopass
 *----------------
*/
public Cmd_NoPass(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED
	
	new szAuthid[34]
	get_user_authid(id, szAuthid, 33)
	
	new szName[32]
	get_user_name(id, szName, 31)
	
	show_activity_key("AMX_SUPER_PASSWORD_REMOVE_CASE1", "AMX_SUPER_PASSWORD_REMOVE_CASE2", szName)
	
	log_amx("%L", LANG_SERVER, "AMX_SUPER_PASSWORD_REMOVE_LOG",szName, szAuthid)
	
	set_pcvar_string(g_pPassword, "")
	
	return PLUGIN_HANDLED
}

/* 6)	admin voicecomm
 *---------------------
*/
public Cmd_PlusAdminVoice(id)
{
	if(!CheckPlayerBit(g_iAdminBit, id))
	{
		client_print(id, print_chat, "%L", id, "AMX_SUPER_VOCOM_NO_ACCESS");
		
		return PLUGIN_HANDLED;
	}

	client_cmd(id, "+voicerecord");
	g_PlayerSpk[id] = SPEAK_ADMIN;

	new szAdminName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));

	new iPlayers[32], iPlayerNum, iTempid;
	get_players(iPlayers, iPlayerNum, "ch");
 
	for(new i = 0; i < iPlayerNum; i++)
	{
		iTempid = iPlayers[i];
		
		if(CheckPlayerBit(g_iAdminBit, iTempid) && iTempid != id)
				client_print(iTempid, print_chat, "%L", iTempid, "AMX_SUPER_VOCOM_SPEAKING1", szAdminName);
	}
	
	client_print(id, print_chat, "%L", id, "AMX_SUPER_VOCOM_SPEAKING2", szAdminName);
	
	return PLUGIN_HANDLED;
}

public Cmd_MinAdminVoice(id) 
{
	if(is_user_connected(id)) 
	{ 
		client_cmd(id,"-voicerecord");
		
		if(g_PlayerSpk[id] == SPEAK_ADMIN) 
			g_PlayerSpk[id] = SPEAK_NORMAL2;
	}
	
	return PLUGIN_HANDLED;
}

public Event_VoiceMask(id)
	g_iVoiceMask[id] = read_data(2);
	
// Shared with amx gag.
public Fwd_SetClientListening(Reciever, Sender, listen)
{	
	if(Reciever == Sender)
		return FMRES_IGNORED;
	
	if(g_PlayerSpk[Sender] == SPEAK_ADMIN) 
	{
		if(CheckPlayerBit(g_iAdminBit, Reciever))
			engfunc(EngFunc_SetClientListening, Reciever, Sender, SPEAK_NORMAL2);
			
		else
			engfunc(EngFunc_SetClientListening, Reciever, Sender, SPEAK_MUTED2);

		return FMRES_SUPERCEDE;
	}
	
	else if(g_iVoiceMask[Reciever] & 1 << (Sender - 1)) 
	{
		engfunc(EngFunc_SetClientListening, Reciever, Sender, SPEAK_MUTED);
		
		forward_return(FMV_CELL, false);
	}
	
	switch(g_iSpeak[Reciever])
	{	
		case SPEAK_MUTED:
		{
			engfunc(EngFunc_SetClientListening, Reciever, Sender, 0);
			forward_return(FMV_CELL, 0);
			
			return FMRES_SUPERCEDE;
		}
		
		case SPEAK_ALL, SPEAK_LISTENALL:
		{
			engfunc(EngFunc_SetClientListening, Reciever, Sender, 1);
			forward_return(FMV_CELL, 1);
			
			return FMRES_SUPERCEDE;
		}
	}
		
	return FMRES_IGNORED;
}
	
/* 7)	amx_transfer
 *------------------
*/
public Cmd_Transfer(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
	
	new szTarget[35], szTeam[5];
	read_argv(1, szTarget, charsmax(szTarget));
	read_argv(2, szTeam, charsmax(szTeam));
	strtoupper(szTeam);
	
	new iTempid = cmd_target(id, szTarget, 2);
	
	if(!iTempid)
		return PLUGIN_HANDLED;
	
	new szTeamName[35];
	new CsTeams:iCurrentTeam = cs_get_user_team(iTempid)

	if(!strlen(szTeam))
	{	
		cs_set_user_team(iTempid, iCurrentTeam == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);
		formatex(szTeamName, charsmax(szTeamName), "%s", Teamnames[_:iCurrentTeam - 1]);
	}
	
	else
	{
		new CsTeams:iArgTeam
		switch(szTeam[0])
		{
			case 'C': iArgTeam = CS_TEAM_CT;
			case 'T': iArgTeam = CS_TEAM_T;
			case 'S': iArgTeam = CS_TEAM_SPECTATOR;
			default:
			{
				console_print(id, "%L", id, "AMX_SUPER_TEAM_INVALID");
				return PLUGIN_HANDLED;
			}
		}
		
		if (iArgTeam == iCurrentTeam)
		{
			console_print(id, "%L", id, "AMX_SUPER_TRANSFER_PLAYER_ALREADY")
			return PLUGIN_HANDLED
		}
		
		else
		{
			/*
			if (iArgTeam == CS_TEAM_SPECTATOR)
				user_silentkill(iTempid)
				
			cs_set_user_team(iTempid, iArgTeam)
			
			if (iArgTeam != CS_TEAM_SPECTATOR)
				ExecuteHamB(Ham_CS_RoundRespawn, iTempid)
				
			*/
			cs_set_user_team(iTempid, iArgTeam)
			
			if(iArgTeam == CS_TEAM_SPECTATOR)
				user_silentkill(iTempid);
				
			else
				ExecuteHamB(Ham_CS_RoundRespawn, iTempid);

			// using teamnames variable if szTeam != spec
			formatex(szTeamName, charsmax(szTeamName), "%s", iArgTeam == CS_TEAM_SPECTATOR ? "Spectator" : Teamnames[_:iArgTeam - 1])
		}
	}
	
	new szAdminName[35], szPlayerName[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_name(iTempid, szPlayerName, charsmax(szPlayerName));
	
	new szAuthid[35];
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	show_activity_key("AMX_SUPER_TRANSFER_PLAYER_CASE1", "AMX_SUPER_TRANSFER_PLAYER_CASE2", szAdminName, szPlayerName, szTeamName);

	client_print(iTempid, print_chat, "%L", iTempid, "AMX_SUPER_TRANSFER_PLAYER_TEAM", szTeamName);

	console_print(id, "%L", id, "AMX_SUPER_TRANSFER_PLAYER_CONSOLE", szAdminName, szTeamName);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_TRANSFER_PLAYER_LOG", szAdminName, szAuthid, szPlayerName, szTeamName);
	
	return PLUGIN_HANDLED;
}
	
/* 8)	amx_swap
 *--------------
*/
public Cmd_Swap(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
		
	new szArg1[35], szArg2[35];
	read_argv(1, szArg1, charsmax(szArg1));
	read_argv(2, szArg2, charsmax(szArg2));
	
	new iTempid1 = cmd_target(id, szArg1, 2);
	new iTempid2 = cmd_target(id, szArg2, 2);
	
	if(!iTempid1 || !iTempid2)
		return PLUGIN_HANDLED;
		
	new CsTeams: iTeam1 = cs_get_user_team(iTempid1);
	new CsTeams: iTeam2 = cs_get_user_team(iTempid2);
	
	if(iTeam1 == iTeam2)
	{
		client_print(id, print_console, "%L", id, "AMX_SUPER_TRANSFER_PLAYER_ERROR_CASE1");
		
		return PLUGIN_HANDLED;
	}
	
	if(iTeam1 == CS_TEAM_UNASSIGNED || iTeam2 == CS_TEAM_UNASSIGNED)
	{
		client_print(id, print_console, "%L", id, "AMX_SUPER_TRANSFER_PLAYER_ERROR_CASE2");
		
		return PLUGIN_HANDLED;
	}
	
	cs_set_user_team(iTempid1, iTeam2);
	ExecuteHamB(Ham_CS_RoundRespawn, iTempid1);
	
	cs_set_user_team(iTempid2, iTeam1);
	ExecuteHamB(Ham_CS_RoundRespawn, iTempid2);
	
	if(iTeam1 == CS_TEAM_SPECTATOR)
		user_silentkill(iTempid2);
	
	if(iTeam2 == CS_TEAM_SPECTATOR)
		user_silentkill(iTempid1);
	
	new szPlayerName1[35], szPlayerName2[35], szAdminName[35], szAuthid[35];
	get_user_name(iTempid1, szPlayerName1, charsmax(szPlayerName1));
	get_user_name(iTempid2, szPlayerName2, charsmax(szPlayerName2));
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	show_activity_key("AMX_SUPER_TRANSFER_SWAP_PLAYERS_SUCCESS_CASE1", "AMX_SUPER_TRANSFER_SWAP_PLAYERS_SUCCESS_CASE2", szAdminName, szPlayerName1, szPlayerName2);

	client_print(iTempid1, print_chat, "%L", iTempid1, "AMX_SUPER_TRANSFER_SWAP_PLAYERS_MESSAGE1", szPlayerName2);
	client_print(iTempid2, print_chat, "%L", iTempid2, "AMX_SUPER_TRANSFER_SWAP_PLAYERS_MESSAGE2", szPlayerName1);

	client_print(id, print_console, "%L", id, "AMX_SUPER_TRANSFER_SWAP_PLAYERS_CONSOLE", szPlayerName1, szPlayerName2);
	
	log_amx("%L", LANG_PLAYER, "AMX_SUPER_TRANSFER_SWAP_PLAYERS_LOG", szAdminName, szAuthid, szPlayerName1, szPlayerName2);
	
	return PLUGIN_HANDLED;
}

/* 9)	amx_teamswap
 *------------------
*/
public Cmd_TeamSwap(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 1))
		return PLUGIN_HANDLED;
		
	new iPlayers[32], iPlayerNum, iTempid, CsTeams: iTeam;
	get_players(iPlayers, iPlayerNum);
	
	for(new i = 0; i < iPlayerNum; i++)
	{
		iTempid = iPlayers[i];
		iTeam = cs_get_user_team(iTempid);
		
		if(CS_TEAM_UNASSIGNED < iTeam < CS_TEAM_SPECTATOR)
		{
			cs_set_user_team(iTempid, cs_get_user_team(iTempid) == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);
			ExecuteHamB(Ham_CS_RoundRespawn, iTempid);
		}
	}
	
	new szName[35], szAuthid[35];
	get_user_name(id, szName, charsmax(szName));
	get_user_authid(id, szAuthid, charsmax(szAuthid));

	show_activity_key("AMX_SUPER_TRANSFER_SWAP_TEAM_SUCCESS_CASE1", "AMX_SUPER_TRANSFER_SWAP_TEAM_SUCCESS_CASE2", szName);

	console_print(id,"%L", id, "AMX_SUPER_TRANSFER_SWAP_TEAM_MESSAGE");
	
	log_amx("%L", LANG_SERVER, "AMX_SUPER_TRANSFER_SWAP_TEAM_LOG", szName,szAuthid);
	
	return PLUGIN_HANDLED;
}

/* 10)	amx_lock
 *--------------
*/
public Cmd_Lock(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szArg[7];
	read_argv(1, szArg, charsmax(szArg));
	strtoupper(szArg);
	
	new iTeam;
	switch(szArg[0])
	{
		case 'T': iTeam = TERRO;
		case 'C': iTeam = COUNTER;		
		case 'A': iTeam = AUTO;
		case 'S': iTeam = SPEC;
		default:
		{	
			client_print(id, print_console, "%L", id, "AMX_SUPER_TEAM_INVALID");
			
			return PLUGIN_HANDLED;
		}	
	}
		
	g_bBlockJoin[iTeam] = true;
	
	new szName[35], szAuthid[35];
	get_user_name(id, szName, charsmax(szName));
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	show_activity_key("AMX_SUPER_TEAM_LOCK_CASE1", "AMX_SUPER_TEAM_LOCK_CASE2", szName, Teamnames[iTeam]);

	console_print(id, "%L", id, "AMX_SUPER_TEAM_LOCK_CONSOLE", Teamnames[iTeam]);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_LOCK_TEAMS_LOG", szName, szAuthid, Teamnames[iTeam]);

	return PLUGIN_HANDLED;
}

/* 11)	amx_unlock
 *----------------
*/
public Cmd_Unlock(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 2))
		return PLUGIN_HANDLED;
	
	new szArg[7], iTeam;
	read_argv(1, szArg, charsmax(szArg));
	strtoupper(szArg);
	
	// comments set by juann, since we use strtoupper we don't need to check for lower case chars
	switch(szArg[0])
	{
		case 'T': iTeam = TERRO;
		case 'C': iTeam = COUNTER;
		case 'A': iTeam = AUTO;
		case 'S': iTeam = SPEC;
		default:
		{	
			client_print(id, print_console, "%L", id, "AMX_SUPER_TEAM_INVALID");
			
			return PLUGIN_HANDLED;
		}	
	}
	
	g_bBlockJoin[iTeam] = false;
	
	new szName[32], szAuthid[35];
	get_user_name(id, szName, charsmax(szName));
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	show_activity_key("AMX_SUPER_TEAM_UNLOCK_CASE1", "AMX_SUPER_TEAM_UNLOCK_CASE2", szName, Teamnames[iTeam]);
	
	console_print(id, "%L", id, "AMX_SUPER_TEAM_UNLOCK_CONSOLE", Teamnames[iTeam]);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_UNLOCK_TEAMS_LOG", szName, szAuthid, Teamnames[iTeam]);

	return PLUGIN_HANDLED;
}

/* Team locker
 *------------
*/
public team_select(id, key) 
{ 
	if(g_bBlockJoin[key])
	{
		engclient_cmd(id, "chooseteam");
		
		return PLUGIN_HANDLED;
	} 		
	
	return PLUGIN_CONTINUE;
} 

public join_team(id) 
{		
	new szArg[3];
	read_argv(1, szArg, charsmax(szArg));
	
	if(g_bBlockJoin[str_to_num(szArg) - 1])
	{
		engclient_cmd(id, "chooseteam");
		
		return PLUGIN_HANDLED;
	} 

	return PLUGIN_CONTINUE; 
}

/* 12)	amx_badaim
 *----------------
*/
public Cmd_BadAim(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;
		
	new szTarget[35], szTime[10], szSave[2];
	
	read_argv(1, szTarget, charsmax(szTarget));
	read_argv(2, szTime, charsmax(szTime));
	read_argv(3, szSave, charsmax(szSave));
	
	if(!strlen(szTime))
	{
		console_print(id, "%L", id, "AMX_SUPER_BADAIM_CONSOLE");
		
		return PLUGIN_HANDLED;
	}
	
	new iTime = str_to_num(szTime);

	if(iTime < 0)
	{
		console_print(id, "%L", id, "AMX_SUPER_BADAIM_BADTIME");
		
		return PLUGIN_HANDLED;
	}
	
	new iTempid = cmd_target(id, szTarget, 2);

	if(!iTempid)
		return PLUGIN_HANDLED;
			
	new szName[35];
	get_user_name(iTempid, szName, charsmax(szName));
	
	switch(iTime)
	{
		case 0:
		{
			if(!g_bHasBadAim[iTempid])
			{
				console_print(id, "%L", id, "AMX_SUPER_BADAIM_NO_BADAIM", szName);
				
				return PLUGIN_HANDLED;
			}
			
			g_bHasBadAim[iTempid] = false;
			
			console_print(id, "%L", id, "AMX_SUPER_BADAIM_UNDO",szName);

			set_aimvault(iTempid, 0);
		}
		
		case 1:
		{
			if(g_bHasBadAim[iTempid])
			{
				console_print(id, "%L", id, "AMX_SUPER_BADAIM_CURRENT", szName);
				
				return PLUGIN_HANDLED;
			}
						
			g_bHasBadAim[iTempid] = true;
			
			console_print(id, "%L", id, "AMX_SUPER_BADAIM_WORSE", szName);
		}
		
		default: // Timed
		{
			if(g_bHasBadAim[iTempid])
				console_print(id, "%L", id, "AMX_SUPER_BADAIM_MESSAGE1",szName, iTime);
				
			else
				console_print(id, "%L", id, "AMX_SUPER_BADAIM_MESSAGE2",szName, iTime);
				
			g_bHasBadAim[iTempid] = true;
			
			new iTaskData[3];
			iTaskData[0] = id;
			iTaskData[1] = iTempid;
			
			set_task(float(iTime), "Task_UnBadAim", iTempid + TASKID_UNBADAIM, iTaskData, 2);
		}
	}
	
	new iSave = str_to_num(szSave);
	
	if(iSave)
	{
		if(iTime > 1)
			console_print(id, "%L", id, "AMX_SUPER_BADAIM_BAN");

		else
			set_aimvault(iTempid, 1);
	}
	
	new szPlayerName[32], szAuthid[32];
	get_user_name(id, szPlayerName, 31);
	get_user_authid(id, szAuthid, 31);

	log_amx( "%L", LANG_PLAYER, "AMX_SUPER_BADAIM_LOG", szPlayerName, szAuthid, g_bHasBadAim[iTempid] == true? "set" : "removed", szName);
	
	return PLUGIN_HANDLED;
}

public Task_UnBadAim(iTaskData[])
{
	new id = iTaskData[0];
	new iTempid = iTaskData[1];
	
	new szName[35];
	get_user_name(iTempid, szName, charsmax(szName));

	client_print(id, print_chat, "%L", id, "AMX_SUPER_BADAIM_NO_BADAIM_MESSAGE", szName);	
	console_print(id, "%L", id, "AMX_SUPER_BADAIM_NO_BADAIM_MESSAGE_CONSOLE", szName);

	g_bHasBadAim[iTempid] = false;
}

public set_aimvault(id, iValue)
{
	new szAuthid[35];
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	new szVaultKey[51];
	formatex(szVaultKey, charsmax(szVaultKey), "BADAIM_%s", szAuthid);

	if(vaultdata_exists(szVaultKey))
		remove_vaultdata(szVaultKey);
	
	if(iValue == 1)
		set_vaultdata(szVaultKey, "1");
}

public check_aimvault(id)
{
	new szAuthid[35];
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	new szVaultKey[51];
	format(szVaultKey,50,"BADAIM_%s",szAuthid);

	if(vaultdata_exists(szVaultKey))
		g_bHasBadAim[id] = true;
}

public FwdPlayerPrethink(id)
{
	if(g_bHasBadAim[id])
	{
		static Float: BadAimVec[3] = {100.0, 100.0, 100.0};
		set_pev(id, pev_punchangle, BadAimVec);
	}
}


/* 13)	amx_exec
 *--------------
*/
public Cmd_Exec(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED;

	new szTarget[35], szTargetName[35], szCommand[64];
	read_argv(1, szTarget, charsmax(szTarget));
	read_argv(2, szCommand, charsmax(szCommand));
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	new bIsFilteredCmd = false;
	
	// Check if command is a banned one.
	for(new i = 0; i < sizeof(g_szAlwaysBlockedCmds); i++)
	{
		if(containi(szCommand, g_szAlwaysBlockedCmds[i]) > -1)
		{
			// TODO: Add ML support.
			console_print(id, "The command %s is banned and does not work on iPlayers.", szCommand);
			
			if(szTarget[0] != '@')
			{
				new iPlayer = cmd_target(id, szTarget, CMDTARGET_ALLOW_SELF);
				
				if(iPlayer)
					get_user_name(iPlayer, szTarget, charsmax(szTarget));
			}
			
			log_amx("ADMIN %s <%s> used banned command '%s' on '%s'", szAdminName, szAdminAuthid, szCommand, szTarget);
			
			return PLUGIN_HANDLED;
		}
	}
	
	// Check if the command is a filtered one.
	for(new i = 0; i < sizeof(g_szFilterStuffCmdBlockedCmds); i++)
	{
		if(containi(szCommand, g_szFilterStuffCmdBlockedCmds[i]) > -1)
		{
			bIsFilteredCmd = true;
			break;
		}
	}
	
	new iPlayer;
	
	if(szTarget[0] == '@')
	{
		new iPlayers[32], iPlayerNum, eCmdTeam: Team;
		
		switch(szTarget[1])
		{
			case 'T', 't':
			{
				get_players(iPlayers, iPlayerNum, "e", "TERRORIST");
				
				Team = T;
			}
			
			case 'C', 'c':
			{
				get_players(iPlayers, iPlayerNum, "e", "CT");
				
				Team = CT;
			}
			
			case 'A', 'a':
			{
				get_players(iPlayers, iPlayerNum);
				
				Team = ALL;
			}
		}
		
		if(!iPlayerNum)
		{
			console_print(id, "%L", id, "AMX_SUPER_NO_PLAYERS");
			
			return PLUGIN_HANDLED;
		}
		
		for(new i = 0; i < iPlayerNum; i++)
		{
			iPlayer = iPlayers[i];
			
			if((get_user_flags(iPlayer) & ADMIN_IMMUNITY) && iPlayer != id)
			{
				get_user_name(iPlayer, szTargetName, charsmax(szTargetName));
				console_print(id, "%L", id, "AMX_SUPER_TEAM_IMMUNITY", szTargetName);
				
				continue;
			}
						
			else if(bIsFilteredCmd && !g_bAllowsAllCommands[iPlayer])
			{
				// TODO: Add ML support.
				get_user_name(iPlayer, szTargetName, charsmax(szTargetName));
				console_print(id, "The command %s is banned and does not work on iPlayers.", szCommand);
				continue;
			}
			
			client_cmd(iPlayer, szCommand);
		}
		
		show_activity_key("AMX_SUPER_EXEC_TEAM_CASE1", "AMX_SUPER_EXEC_TEAM_CASE2", szAdminName, szCommand, g_TeamNames[Team]);
		log_amx("%L", LANG_SERVER, "AMX_SUPER_EXEC_TEAM_LOG", szAdminName, szAdminAuthid, szCommand, g_TeamNames[Team]);
	}
	
	else
	{
		iPlayer = cmd_target(id, szTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
		
		if(iPlayer)
		{
			new szTargetAuthid[35];
			get_user_name(iPlayer, szTargetName, charsmax(szTargetName));
			get_user_authid(iPlayer, szTargetAuthid, charsmax(szTargetAuthid));
			
			// TODO: Add translation for this.
			if(bIsFilteredCmd && !g_bAllowsAllCommands[iPlayer])
			{
				console_print(id, "Cannot execute command '%s' on player %s", szCommand, szTargetName);
				log_amx("ADMIN %s <%s> used banned command '%s' on '%s'", szAdminName, szAdminAuthid, szCommand, szTargetName);
			}

			else
			{
				client_cmd(iPlayer, szCommand);
			
				show_activity_key("AMX_SUPER_EXEC_PLAYER_CASE1", "AMX_SUPER_EXEC_PLAYER_CASE2", szAdminName, szCommand, szTargetName);
				log_amx("%L", LANG_SERVER, "AMX_SUPER_EXEC_PLAYER_LOG", szAdminName, szAdminAuthid, szCommand, szTargetName, szTargetAuthid);
			}
		}
	}
	
	return PLUGIN_HANDLED;
}

/* 14)	amx_restart / shutdown
 *----------------------------
*/
public Cmd_Restart(id, iLevel, iCid)
{
	if(g_bIsShuttingDown || !cmd_access(id, iLevel, iCid, 2))	
		return PLUGIN_HANDLED;
	
	new szCmd[14];
	read_argv(0, szCmd, charsmax(szCmd));
	
	if(equali(szCmd, "amx_restart"))
		g_ShutDownMode = RESTART;
	
	else
		g_ShutDownMode = SHUTDOWN;
		
	new szTime[4];
	read_argv(1, szTime, charsmax(szTime));
	
	new iTime = str_to_num(szTime);
	
	if(!(1 <= iTime <= 20))
	{
		console_print(id, "%L", id, "AMX_SUPER_SHUTDOWN_CONSOLE");
		
		return PLUGIN_HANDLED;
	}
	
	
	g_bIsShuttingDown = true;
	
	new iCount;
	for(iCount = iTime; iCount != 0; iCount--)
		set_task(float(abs(iCount - iTime)), "TaskShutDown", iCount);
	
	set_task(float(iTime), "TaskShutDown");	
	
	
	new szAdminName[35], szAdminAuthid[35];
	get_user_name(id, szAdminName, charsmax(szAdminName));
	get_user_authid(id, szAdminAuthid, charsmax(szAdminAuthid));
	
	show_activity_key("AMX_SUPER_SHUTDOWN_CASE1", "AMX_SUPER_SHUTDOWN_CASE2", szAdminName, g_szShutdownNames[g_ShutDownMode], iTime);
	log_amx("%L", LANG_SERVER, "AMX_SUPER_SHUTDOWN_MESSAGE_LOG", szAdminName, id, szAdminAuthid, g_szShutdownNames[g_ShutDownMode]);
	
	return PLUGIN_HANDLED;
}

public TaskShutDown(iNumber)
{
	if(!iNumber)
	{
		if(g_ShutDownMode == RESTART)
			server_cmd("restart");
		
		else
			server_cmd("quit");
	}
	
	new szNum[32];
	num_to_word(iNumber, szNum, charsmax(szNum));
	
	client_cmd(0, "spk ^"fvox/%s^"", szNum);
}

/* 15)	say /gravity
 *------------------
*/
public Cmd_Gravity(id)
{
	client_print(id, print_chat, "%L", id, "AMX_SUPER_GRAVITY_CHECK", get_pcvar_num(g_pGravity));
	
	return PLUGIN_HANDLED;
}

/* 16)	say /alltalk
 *------------------
*/
public Cmd_Alltalk(id)
{
	client_print(id, print_chat, "%L", id, "AMX_SUPER_ALLTALK_STATUS", get_pcvar_num(g_pAllTalk));
	
	return PLUGIN_HANDLED;
}

/* 17)	say /spec
 *---------------
*/
public Cmd_Spec(id)
{
	new CsTeams: Team = cs_get_user_team(id);
	
	if(( Team == CS_TEAM_CT || Team == CS_TEAM_T ) && get_pcvar_num(g_pAllowSpec) || get_pcvar_num(g_pAllowPublicSpec)) 
	{
		if(is_user_alive(id))
		{
			user_kill(id);
			
			cs_set_user_deaths( id, cs_get_user_deaths(id) - 1);
			set_user_frags( id, get_user_frags(id) + 1);
		}
		
		g_OldTeam[id] = Team;
		
		cs_set_user_team(id, CS_TEAM_SPECTATOR);
	}

	return PLUGIN_HANDLED;
}

/* 18)	say /unspec
 *-----------------
*/
public Cmd_UnSpec(id)
{
	if(g_OldTeam[id])
	{
		cs_set_user_team(id, g_OldTeam[id]);
		g_OldTeam[id] = CS_TEAM_UNASSIGNED;
	}
	
	return PLUGIN_HANDLED;
}

/* 19)	say /admin(s)
 *-------------------
*/
public Cmd_Admins(id) 
{
	new szMessage[256];
	
	if(get_pcvar_num(g_pAdminCheck))
	{
		new szAdminNames[33][32];
		new szContactInfo[256], szContact[112];
		new i, iCount, x, iLen;
		
		for(i = 1 ;i <= g_iMaxPlayers; i++)
		{
			if(is_user_connected(i) && (get_user_flags(i) & ADMIN_CHECK))
				get_user_name(i, szAdminNames[iCount++], 31);
		}
		
		iLen = format(szMessage, 255, "%s ADMINS ONLINE: ",COLOR);
		
		if(iCount > 0) 
		{
			for(x = 0 ; x < iCount ; x++) 
			{
				iLen += format(szMessage[iLen], 255-iLen, "%s%s ", szAdminNames[x], x < (iCount-1) ? ", ":"");
				
				if(iLen > 96 ) 
				{
					print_message(id, szMessage);
					iLen = format(szMessage, 255, "%s ",COLOR);
				}
			}
			
			print_message(id, szMessage);
		}
		
		else 
		{
			iLen += format(szMessage[iLen], 255-iLen, "No admins online.");
			print_message(id, szMessage);
		}
		
		get_pcvar_string(g_pContact, szContact, 63);
		
		if(szContact[0])  
		{
			format(szContactInfo, 111, "%s Contact Server Admin -- %s", COLOR, szContact);
			print_message(id, szContactInfo);
		}
	}
	
	else
	{
		formatex(szMessage, 255, "^x04 Admin Check is currently DISABLED.");
		print_message(id, szMessage);
	}
}

print_message(id, szMsg[]) 
{		
	message_begin(MSG_ONE, g_iMsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(szMsg)
	message_end()
}

/* 20)	say /fixsound
 *-------------------
*/
public Cmd_FixSound(id)
{
	if(get_pcvar_num(g_pAllowSoundFix))
	{
		client_cmd(id, "stopsound; room_type 00");
		client_cmd(id, "stopsound");
		
		client_print(id, print_chat, "%L", id, "AMX_SUPER_SOUNDFIX");
	}
	
	else
		client_print(id, print_chat, "%L", id, "AMX_SUPER_SOUNDFIX_DISABLED");
	
	return PLUGIN_HANDLED;
} 

Потребителски аватар

OciXCrom™ MKD
Администратор
Администратор
Мнения: 4212
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 29 пъти
Получена благодарност: 247 пъти
Години: 21
Контакти:

Преработка на AMX_Super Menu

Мнение от OciXCrom™ MKD » 22 юли 2018, 22:01

Ето доста лесен начин по който можеш да ги промениш:

1. Изтегли най-новата версия на cromchat.inc и добави файла в scripting/include.
2. Добави #include <cromchat> в плъгините и компилирай ги.
3. Добави цветните кодове където и както искаш в lang файла на плъгина - data/lang/amx_super.txt.

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 3 госта