Помощ с HNS_Upgrades

Въпроси и проблеми свързани с AMXModX.
Аватар
YankoNL
Извън линия
Потребител
Потребител
Мнения: 163
Регистриран на: 06 Апр 2017, 09:07
Местоположение: Варна
Се отблагодари: 22 пъти
Получена благодарност: 9 пъти

Помощ с HNS_Upgrades

Мнение от YankoNL » 21 Ное 2018, 13:55

Здравейте, днес отново реших да пробвам следния Upgrade плъгин за HNS. Всичко си работи, но има бъг който прави играчите невидими когато са от противоположния отбор. Сигурен съм че е то този плъгин, понеже направих тест като спирах всеки плъгин едни по един. Оставих само HNS_Upgrade да работи, но играчите пак са невидими. След спирането на въпросния плъгин всичко се оправя. Ако някои знае какъв е проблема, моля да пише.
Благодаря предварително!
Ето и кода:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <fvault>
#include <hamsandwich>
#include <fun>
#include <WPMGPrintChatColor>
#include <fakemeta>

#if AMXX_VERSION_NUM < 183
	#define client_disconnected client_disconnect
	#define argbreak strbreak
#endif

// If the player hasn't ever been to your server, they will get this much xp to start with
#define ENTRY_XP			350

// The VIP Flag for more XP
#define VIP_BONUS			ADMIN_LEVEL_A

// These determine if these abilities should be enabled or disabled
// 1 = enabled
// 0 = disabled

#define ENABLE_GRENADE			1
#define ENABLE_FLASHBANG_1		1
#define ENABLE_FLASHBANG_2		1
#define ENABLE_SMOKEGRENADE		1
#define ENABLE_TERR_HEALTH		1
#define ENABLE_CT_HEALTH		1
#define ENABLE_TERR_ARMOR		1
#define ENABLE_CT_ARMOR			1
#define ENABLE_TERR_RESPAWN		1
#define ENABLE_CT_RESPAWN		1
#define ENABLE_TERR_NOFALL		1
#define ENABLE_CT_NOFALL		1
#define ENABLE_TERR_INCREASEDMG		1
#define ENABLE_CT_INCREASEDMG		1
#define ENABLE_TERR_REGENERATION	1
#define ENABLE_CT_REGENERATION		1
#define ENABLE_TERR_INVISIBILITY	1
#define ENABLE_CT_INVISIBILITY		1


// The maximum level for each ability

#define MAXLEVEL_GRENADE		8
#define MAXLEVEL_FLASHBANG_1		8
#define MAXLEVEL_FLASHBANG_2		8
#define MAXLEVEL_SMOKEGRENADE		8
#define MAXLEVEL_TERR_HEALTH		10
#define MAXLEVEL_CT_HEALTH		10
#define MAXLEVEL_TERR_ARMOR		6
#define MAXLEVEL_CT_ARMOR		6
#define MAXLEVEL_TERR_RESPAWN		4
#define MAXLEVEL_CT_RESPAWN		4
#define MAXLEVEL_TERR_NOFALL		8
#define MAXLEVEL_CT_NOFALL		8
#define MAXLEVEL_TERR_INCREASEDMG	5
#define MAXLEVEL_CT_INCREASEDMG		5
#define MAXLEVEL_TERR_REGENERATION	4
#define MAXLEVEL_CT_REGENERATION	5
#define MAXLEVEL_TERR_INVISIBILITY	8
#define MAXLEVEL_CT_INVISIBILITY	6


// The xp amount required to buy the first level

#define FIRST_XP_GRENADE		200
#define FIRST_XP_FLASHBANG_1		100
#define FIRST_XP_FLASHBANG_2		100
#define FIRST_XP_SMOKEGRENADE		200
#define FIRST_XP_TERR_HEALTH		200
#define FIRST_XP_CT_HEALTH		200
#define FIRST_XP_TERR_ARMOR		400
#define FIRST_XP_CT_ARMOR		400
#define FIRST_XP_TERR_RESPAWN		12800
#define FIRST_XP_CT_RESPAWN		12800
#define FIRST_XP_TERR_NOFALL		400
#define FIRST_XP_CT_NOFALL		400
#define FIRST_XP_TERR_INCREASEDMG	25600
#define FIRST_XP_CT_INCREASEDMG		25600
#define FIRST_XP_TERR_REGENERATION	2700
#define FIRST_XP_CT_REGENERATION	2700
#define FIRST_XP_TERR_INVISIBILITY	5000
#define FIRST_XP_CT_INVISIBILITY	5000


// The maximum chance possible for this ability (happens when player has maximum level)

#define CHANCE_MAX_GRENADE		100
#define CHANCE_MAX_FLASHBANG_1		100
#define CHANCE_MAX_FLASHBANG_2		100
#define CHANCE_MAX_SMOKEGRENADE		100
#define CHANCE_MAX_TERR_RESPAWN		60
#define CHANCE_MAX_CT_RESPAWN		60
#define CHANCE_MAX_TERR_NOFALL		80
#define CHANCE_MAX_CT_NOFALL		80


// The maximum amount possible for this ability (happens when player has maximum level)

#define MAX_CT_AMOUNT_HEALTH		MAXLEVEL_CT_HEALTH * 10
#define MAX_TERR_AMOUNT_HEALTH		MAXLEVEL_TERR_HEALTH * 10
#define MAX_CT_AMOUNT_ARMOR		MAXLEVEL_CT_ARMOR * 10
#define MAX_TERR_AMOUNT_ARMOR		MAXLEVEL_TERR_ARMOR * 10
#define MAX_CT_AMOUNT_INCREASEDMG	MAXLEVEL_CT_INCREASEDMG * 10
#define MAX_TERR_AMOUNT_INCREASEDMG	MAXLEVEL_TERR_INCREASEDMG * 10
#define MAX_CT_AMOUNT_REGENERATION	MAXLEVEL_CT_REGENERATION * 10
#define MAX_TERR_AMOUNT_REGENERATION	MAXLEVEL_TERR_REGENERATION * 10
#define MAX_CT_AMOUNT_INVISIBILITY	200
#define MAX_TERR_AMOUNT_INVISIBILITY	150


new const szPrefix[] = "!t[!gHNS Upgrades!t]!y"
new const szMenuPrefix[] = "\r[\yHNS Upgrades\r]\y "
new const szDataBase[] = "HNS_Upgrades"

// =================================================
// STOP EDITING HERE
// =================================================

#define VERSION "1.0"

new const g_team_names[CsTeams][] =
{
	"Spectator",
	"Terrorist",
	"Counter-Terrorist",
	"Spectator"
}

enum _:Grenades
{
	NADE_HE,
	NADE_FL1,
	NADE_FL2,
	NADE_SM
}

enum _:eNadeData
{
	NADE_STATUS,
	NADE_NAMES[32],
	NADE_CLASSNAME[32],
	NADE_MAX_LEVEL,
	NADE_FIRST_XP,
	NADE_MAX_CHANCE
}
new const g_eNades[Grenades][eNadeData] =
{
	{ ENABLE_GRENADE, "HE Grenade", "weapon_hegrenade", MAXLEVEL_GRENADE, FIRST_XP_GRENADE, CHANCE_MAX_GRENADE },
	{ ENABLE_FLASHBANG_1, "Flashbang #1", "weapon_flashbang", MAXLEVEL_FLASHBANG_1, FIRST_XP_FLASHBANG_1, CHANCE_MAX_FLASHBANG_1 },
	{ ENABLE_FLASHBANG_2, "Flashbang #2", "weapon_flashbang", MAXLEVEL_FLASHBANG_2, FIRST_XP_FLASHBANG_2, CHANCE_MAX_FLASHBANG_2 },
	{ ENABLE_SMOKEGRENADE, "Frost Nade", "weapon_smokegrenade", MAXLEVEL_SMOKEGRENADE, FIRST_XP_SMOKEGRENADE, CHANCE_MAX_SMOKEGRENADE }
}
new const g_any_nade_enabled = ENABLE_GRENADE + ENABLE_FLASHBANG_1 + ENABLE_FLASHBANG_2 + ENABLE_SMOKEGRENADE

enum _:eHealthData
{
	HP_STATUS,
	HP_NAMES[32],
	HP_AMOUNT,
	HP_MAX_LEVEL,
	HP_FIRST_XP
}

new const g_eHealth[CsTeams][eHealthData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_HEALTH, "T Extra Health", MAX_TERR_AMOUNT_INCREASEDMG, MAXLEVEL_TERR_HEALTH, FIRST_XP_TERR_HEALTH },
	{ ENABLE_CT_HEALTH, "CT Extra Health", MAX_CT_AMOUNT_HEALTH, MAXLEVEL_CT_HEALTH, FIRST_XP_CT_HEALTH },
	{ 0, "", 0, 0, 0 }
}
new const g_any_health_enabled = ENABLE_TERR_HEALTH + ENABLE_CT_HEALTH


enum _:eArmorData
{
	AP_STATUS,
	AP_NAMES[32],
	AP_AMOUNT,
	AP_MAX_LEVEL,
	AP_FIRST_XP
}

new const g_eArmor[CsTeams][eArmorData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_ARMOR, "T Extra Armor", MAX_TERR_AMOUNT_ARMOR, MAXLEVEL_TERR_ARMOR, FIRST_XP_TERR_ARMOR },
	{ ENABLE_CT_ARMOR, "CT Extra Armor", MAX_CT_AMOUNT_ARMOR, MAXLEVEL_CT_ARMOR, FIRST_XP_CT_ARMOR },
	{ 0, "", 0, 0, 0 }
}
new const g_any_armor_enabled = ENABLE_TERR_ARMOR + ENABLE_CT_ARMOR

enum _:eRespawnData
{
	RESPAWN_STATUS,
	RESPAWN_NAMES[32],
	RESPAWN_MAX_CHANCE,
	RESPAWN_MAX_LEVEL,
	RESPAWN_FIRST_XP
}

new const g_eRespawn[CsTeams][eRespawnData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_RESPAWN, "T Respawn Chance", CHANCE_MAX_TERR_RESPAWN, MAXLEVEL_TERR_RESPAWN, FIRST_XP_TERR_RESPAWN },
	{ ENABLE_CT_RESPAWN, "CT Respawn Chance", CHANCE_MAX_CT_RESPAWN, MAXLEVEL_CT_RESPAWN, FIRST_XP_CT_RESPAWN },
	{ 0, "", 0, 0, 0 }
}
new const g_any_respawn_enabled = ENABLE_TERR_RESPAWN + ENABLE_CT_RESPAWN

enum _:eNoFallDamageData
{
	NFL_STATUS,
	NFL_NAMES[32],
	NFL_MAX_CHANCE,
	NFL_MAX_LEVEL,
	NFL_FIRST_XP
}

new const g_eNoFallDamage[CsTeams][eNoFallDamageData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_NOFALL, "T Fall Damage Reducer", CHANCE_MAX_TERR_NOFALL, MAXLEVEL_TERR_NOFALL, FIRST_XP_TERR_NOFALL },
	{ ENABLE_CT_NOFALL, "CT Fall Damage Reducer", CHANCE_MAX_CT_NOFALL, MAXLEVEL_CT_NOFALL, FIRST_XP_CT_NOFALL },
	{ 0, "", 0, 0, 0 }
}
new const g_any_nofall_enabled = ENABLE_TERR_NOFALL + ENABLE_CT_NOFALL

enum _:eDamageData
{
	DMG_STATUS,
	DMG_NAMES[32],
	DMG_AMOUNT,
	DMG_MAX_LEVEL,
	DMG_FIRST_XP
}

new const g_eDamage[CsTeams][eDamageData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_INCREASEDMG, "T Increase Damage", MAX_TERR_AMOUNT_INCREASEDMG, MAXLEVEL_TERR_INCREASEDMG, FIRST_XP_TERR_INCREASEDMG },
	{ ENABLE_CT_INCREASEDMG, "CT Increase Damage", MAX_CT_AMOUNT_INCREASEDMG, MAXLEVEL_CT_INCREASEDMG, FIRST_XP_CT_INCREASEDMG },
	{ 0, "", 0, 0, 0 }
}
new const g_any_damage_enabled = ENABLE_TERR_INCREASEDMG + ENABLE_CT_INCREASEDMG

enum _:eRegenData
{
	REGEN_STATUS,
	REGEN_NAMES[32],
	REGEN_AMOUNT,
	REGEN_MAX_LEVEL,
	REGEN_FIRST_XP
}

new const g_eRegenerate[CsTeams][eRegenData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_REGENERATION, "T Regeneration", MAX_TERR_AMOUNT_REGENERATION, MAXLEVEL_TERR_REGENERATION, FIRST_XP_TERR_REGENERATION },
	{ ENABLE_CT_REGENERATION, "CT Regeneration", MAX_CT_AMOUNT_REGENERATION, MAXLEVEL_CT_REGENERATION, FIRST_XP_CT_REGENERATION },
	{ 0, "", 0, 0, 0 }
}
new const g_any_regenerate_enabled = ENABLE_TERR_REGENERATION + ENABLE_CT_REGENERATION

enum _:eInvisibilityData
{
	INVIS_STATUS,
	INVIS_NAMES[32],
	INVIS_AMOUNT,
	INVIS_MAX_LEVEL,
	INVIS_FIRST_XP
}

new const g_eInvis[CsTeams][eInvisibilityData] =
{
	{ 0, "", 0, 0, 0 },
	{ ENABLE_TERR_INVISIBILITY, "T Invisibility", MAX_TERR_AMOUNT_INVISIBILITY, MAXLEVEL_TERR_INVISIBILITY, FIRST_XP_TERR_INVISIBILITY },
	{ ENABLE_CT_INVISIBILITY, "CT Invisibility", MAX_CT_AMOUNT_INVISIBILITY, MAXLEVEL_CT_INVISIBILITY, FIRST_XP_CT_INVISIBILITY },
	{ 0, "", 0, 0, 0 }
}
new const g_any_invisibility_enabled = ENABLE_TERR_INVISIBILITY + ENABLE_CT_INVISIBILITY

#define ANY_ABILITY_ENABLED (g_any_nade_enabled || g_any_health_enabled || g_any_armor_enabled || g_any_respawn_enabled || g_any_nofall_enabled || g_any_damage_enabled || g_any_regenerate_enabled || g_any_invisibility_enabled)

#define DAMAGE_ALPHA_RESET		6
#define TASK_ID_RESET			4163

#define IN_MOVEMENT			(IN_FORWARD|IN_MOVELEFT|IN_MOVERIGHT|IN_BACK)

enum ePData
{
	gHealth, gArmor, gRespawn, gNoFallDamage, gDamage, gRegenerate, gInvisibility
}
new g_iNadeLevels[33][Grenades]
new g_iLevels[33][ePData][CsTeams]
new g_iPoints[33]
new g_IsFirstConnect[33], g_bConnected[33], g_bUsedRevive[33]
new g_szName[33][32]
new g_iMaxPlayers

new g_iAlpha[33]
new g_IsMoving[33]
new g_iStopAlpha[33]
new g_iInterval[33]

enum eCvarsData
{
	HS_KILL_VIP,
	KILL_VIP,
	HS_KILL,
	KILL,
	SURVIVE_VIP,
	SURVIVE,
	WIN_VIP,
	WIN
}

new iCvars[eCvarsData]

new const g_szCommands[][] =
{
	"say /upg", "say_team /upg", "say /upgrade", "say_team /upgrade", "say /upgrades", "say_team /upgrades"
}

public plugin_init()
{
	register_plugin("HNS Upgrades", VERSION, "Exolent, Edit: AJW1337//")
	
	for (new i = 0; i < sizeof g_szCommands; i++)
		register_clcmd(g_szCommands[i], "Command_Upgrade")
	
	register_clcmd("XP_Amount", "Command_XP_Amount", ADMIN_RCON)
	register_clcmd("Give_XP_To_All_Players", "GiveAllPlayersXP", ADMIN_RCON)
	
	register_event("DeathMsg", "EventDeathMsg", "a")
	register_logevent("EventRoundEnd", 2, "1=Round_End")
	
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1)
	RegisterHam(Ham_Killed, "player", "FwdPlayerKilled", 1)
	RegisterHam(Ham_TakeDamage, "player", "FwdPlayerTakeDamage")
	
	register_forward(FM_CmdStart, "FwdCmdStart")
	register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1)
	
	iCvars[HS_KILL_VIP] = register_cvar("hnsxp_hs_kill_vip", "60")
	iCvars[KILL_VIP] = register_cvar("hnsxp_kill_vip", "30")
	iCvars[HS_KILL] = register_cvar("hnsxp_hs_kill", "30")
	iCvars[KILL] = register_cvar("hnsxp_kill", "15")
	iCvars[SURVIVE_VIP] = register_cvar("hnsxp_survive_vip", "20")
	iCvars[SURVIVE] = register_cvar("hnsxp_survive", "10")
	iCvars[WIN_VIP] = register_cvar("hnsxp_win_vip", "20")
	iCvars[WIN] = register_cvar("hnsxp_win", "10")

	g_iMaxPlayers = get_maxplayers()
}
public plugin_natives()
{
	register_native("hnsxp_get_user_xp", "native_hnsxp_get_user_xp")
	register_native("hnsxp_set_user_xp", "native_hnsxp_set_user_xp")
}
public native_hnsxp_get_user_xp(iPlugin, iParams)
{
	new id = get_param(1)
	
	if (!is_user_connected(id))
		return -1
	
	return g_iPoints[id]
}
public native_hnsxp_set_user_xp(iPlugin, iParams)
{
	new id = get_param(1)
	
	if (!is_user_connected(id))
		return false
	
	g_iPoints[id] = get_param(2)
	Save_Data(id, g_szName[id])
	return true
}
public client_putinserver(id)
{
	if (!is_user_bot(id) || !is_user_hltv(id))
	{
		get_user_name(id, g_szName[id], charsmax(g_szName[]))
		set_task(0.1, "Load_Data", id, g_szName[id], sizeof(g_szName[]))
	}
}

public client_disconnected(id)
{
	Save_Data(id, g_szName[id])
	
	g_szName[id][0] = 0
	g_bConnected[id] = false
	g_IsFirstConnect[id] = 0
	g_bUsedRevive[id] = 0
	g_iAlpha[id] = 255
	g_IsMoving[id] = 0
	remove_task(TASK_ID_RESET + id)
}
public Command_Upgrade(id)
{
	static szTitle[128];
	formatex(szTitle, charsmax(szTitle), "%sMain Menu^n\yYour XP\d: \w%i \r][ \yPage\d:\r", szMenuPrefix, g_iPoints[id])
	
	new iMenu = menu_create(szTitle, "MainMenu_Handler")
	
	new szText[64]
	formatex( szText, charsmax(szText), "\yHelp%s", get_user_flags(id) & ADMIN_RCON ? "" : "^n" )
	menu_additem(iMenu, szText, "*")
	
	if (get_user_flags(id) & ADMIN_RCON)
		menu_additem(iMenu, "\yAdmin \wMenu^n", "1")
	
	if (g_any_nade_enabled)
		menu_additem(iMenu, "\yGrenades \wMenu", "2")
	
	if (g_any_health_enabled)
		menu_additem(iMenu, "\yHealth \wMenu", "3")
		
	if (g_any_armor_enabled)
		menu_additem(iMenu, "\yArmor \wMenu", "4")
		
	if (g_any_respawn_enabled)
		menu_additem(iMenu, "\yRespawn \wMenu", "5")
	
	if (g_any_nofall_enabled)
		menu_additem(iMenu, "\yFall Damage \wMenu", "6")
		
	if (g_any_damage_enabled)
		menu_additem(iMenu, "\yIncrease Damage \wMenu", "7")
	
	if (g_any_regenerate_enabled)
		menu_additem(iMenu, "\yRegeneration \wMenu", "8")
		
	if (g_any_invisibility_enabled)
		menu_additem(iMenu, "\yInvisibility \wMenu", "9")
	
	if(ANY_ABILITY_ENABLED)
		menu_additem(iMenu, "\yPlayer Info \wMenu", "=")
	
	menu_display(id, iMenu)
	return PLUGIN_HANDLED
}
public MainMenu_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	switch(szData[0])
	{
		case '*':
		{
			static motd[2500]
			new len = formatex(motd, sizeof(motd) - 1, "<body style=^"background-color:#030303; color:#FF8F00^">")
			len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
			len += format(motd[len], sizeof(motd) - len - 1,	"HNS Upgrades is an experienced based addon for HideNSeek.<br>")
			len += format(motd[len], sizeof(motd) - len - 1,	"Players earn experience points by how well they play the game.<br>")
			len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
			len += format(motd[len], sizeof(motd) - len - 1,	"<table border=0>")
			len += format(motd[len], sizeof(motd) - len - 1,	"<tr><th>Action</th><th>XP</th></tr>")
			len += format(motd[len], sizeof(motd) - len - 1,	"<tr><td>Kill VIP</td><td>+%i</td></tr>", get_pcvar_num(iCvars[KILL_VIP]))
			len += format(motd[len], sizeof(motd) - len - 1,	"<tr><td>HeadShot VIP</td><td>+%i</td></tr>", get_pcvar_num(iCvars[HS_KILL_VIP]))
			len += format(motd[len], sizeof(motd) - len - 1,	"<tr><td>Kill</td><td>+%i</td></tr>", get_pcvar_num(iCvars[KILL]))
			len += format(motd[len], sizeof(motd) - len - 1,	"<tr><td>HeadShot</td><td>+%i</td></tr>", get_pcvar_num(iCvars[HS_KILL]))
			len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
			len += format(motd[len], sizeof(motd) - len - 1,	"With these XP points, you can buy upgrades.<br>")
			len += format(motd[len], sizeof(motd) - len - 1,	"For a list of these upgrades, type /upgrade again and view the other menus inside.")
			len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
			len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
			
			show_motd(id, motd, "HNS Upgrades Info")
		}
		case '1': ToggleXpMenu(id)
		case '2': ShowGrenadesMenu(id)
		case '3': ShowHealthMenu(id)
		case '4': ShowArmorMenu(id)
		case '5': ShowRespawnMenu(id)
		case '6': ShowNoFallMenu(id)
		case '7': ShowIncreaseDmgMenu(id)
		case '8': ShowRegenerateMenu(id)
		case '9': ShowInvisibilityMenu(id)
		case '=': ShowPlayersMenu(id)
	}
	return PLUGIN_HANDLED
}
public ShowGrenadesMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sGrenades \wMenu^n^n\dNote: \yGrenade abilities are for \rT's\y Only!", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Grenades_Handler")
	
	new iCallBack = menu_makecallback("Grenades_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp,iPercent, szItem[64], szNumId[6]
	
	for (new i = 0; i < Grenades; i++)
	{
		if (g_eNades[i][NADE_STATUS])
		{
			iLevel = g_iNadeLevels[id][i] + 1
			iPercent = g_eNades[i][NADE_MAX_CHANCE] * iLevel / g_eNades[i][NADE_MAX_LEVEL]
			
			if (g_iNadeLevels[id][i] < g_eNades[i][NADE_MAX_LEVEL])
			{
				iExp = g_eNades[i][NADE_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i%%) \r[\w%i XP\r]", g_eNades[i][NADE_NAMES], iLevel, iPercent, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i%%) \r[\wMaxed Out!\r]", g_eNades[i][NADE_NAMES], iLevel, g_eNades[i][NADE_MAX_CHANCE])
			
			num_to_str(i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Grenades_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500]
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Grenades ability for the XP Mod is for Terrorists only.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Grenades ability contains the HE Grenade, 2 Flashbangs, and Frost Nade.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"These are the grenades you are given when you receive the your items after the hide timer ends.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		
		for (new i = 0; i < Grenades; i++)
		{
			if (g_eNades[i][NADE_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<th>%s</th>", g_eNades[i][NADE_NAMES])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Chance Intervals</th>")
		for (new i = 0; i < Grenades; i++)
		{
			if (g_eNades[i][NADE_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i%%</td>", (g_eNades[i][NADE_MAX_CHANCE] / g_eNades[i][NADE_MAX_LEVEL]))
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new i = 0; i < Grenades; i++)
		{
			if (g_eNades[i][NADE_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eNades[i][NADE_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Chance</th>")
		for (new i = 0; i < Grenades; i++)
		{
			if (g_eNades[i][NADE_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i%%</td>", g_eNades[i][NADE_MAX_CHANCE])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Grenades Info")
	}
	else
	{	
		new iUpgrade = str_to_num(szData)
		
		new iLevel = g_iNadeLevels[id][iUpgrade] + 1
		new iExp = g_eNades[iUpgrade][NADE_FIRST_XP] * (1 << (iLevel - 1))
		new iPercent = g_eNades[iUpgrade][NADE_MAX_CHANCE] * iLevel / g_eNades[iUpgrade][NADE_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iNadeLevels[id][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s!t %i Level !y(!g%i%%!y) for !t%i XP", szPrefix, g_eNades[iUpgrade][NADE_NAMES], iLevel, iPercent, iExp)
	}
	ShowGrenadesMenu(id)
	return PLUGIN_HANDLED
}
public Grenades_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
		
	new iUpgrade = str_to_num(szData)
	if (g_iNadeLevels[id][iUpgrade] == g_eNades[iUpgrade][NADE_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eNades[iUpgrade][NADE_FIRST_XP] * (1 << g_iNadeLevels[id][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}
public ShowHealthMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sHealth \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Health_Handler")
	
	new iCallBack = menu_makecallback("Health_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iAmount, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eHealth[i][HP_STATUS])
		{
			iLevel = g_iLevels[id][gHealth][i] + 1
			iAmount = g_eHealth[i][HP_AMOUNT] * iLevel / g_eHealth[i][HP_MAX_LEVEL]
			
			if (g_iLevels[id][gHealth][i] < g_eHealth[i][HP_MAX_LEVEL])
			{
				iExp = g_eHealth[i][HP_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i HP) \r[\w%i XP\r]", g_eHealth[i][HP_NAMES], iLevel, iAmount, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i HP) \r[\wMaxed Out!\r]", g_eHealth[i][HP_NAMES], iLevel, g_eHealth[i][HP_AMOUNT])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Health_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Health ability is the amount of HP that is added to your spawn health.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eHealth[i][HP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Health Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eHealth[i][HP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eHealth[i][HP_AMOUNT] / g_eHealth[i][HP_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eHealth[i][HP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eHealth[i][HP_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Health</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eHealth[i][HP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eHealth[i][HP_AMOUNT])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Health Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gHealth][iUpgrade] + 1
		new iExp = g_eHealth[iUpgrade][HP_FIRST_XP] * (1 << (iLevel - 1))
		new iAmount = g_eHealth[iUpgrade][HP_AMOUNT] * iLevel / g_eHealth[iUpgrade][HP_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gHealth][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g%i HP!y) for !t%i XP", szPrefix, g_eHealth[iUpgrade][HP_NAMES], iLevel, iAmount, iExp)
		
	}
	ShowHealthMenu(id)
	return PLUGIN_HANDLED
}
public Health_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gHealth][iUpgrade] == g_eHealth[iUpgrade][HP_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eHealth[iUpgrade][HP_FIRST_XP] * (1 << g_iLevels[id][gHealth][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowArmorMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sArmor \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Armor_Handler")
	
	new iCallBack = menu_makecallback("Armor_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iAmount, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eArmor[i][AP_STATUS])
		{
			iLevel = g_iLevels[id][gArmor][i] + 1
			iAmount = g_eArmor[i][AP_AMOUNT] * iLevel / g_eArmor[i][AP_MAX_LEVEL]
			
			if (g_iLevels[id][gArmor][i] < g_eArmor[i][AP_MAX_LEVEL])
			{
				iExp = g_eArmor[i][AP_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i AP) \r[\w%i XP\r]", g_eArmor[i][AP_NAMES], iLevel, iAmount, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i AP) \r[\wMaxed Out!\r]", g_eArmor[i][AP_NAMES], iLevel, g_eArmor[i][AP_AMOUNT])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Armor_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Armor ability is the amount of AP that given to you at spawn.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Armor Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eArmor[i][AP_AMOUNT] / g_eArmor[i][AP_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eArmor[i][AP_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Armor</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eArmor[i][AP_AMOUNT])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Armor Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gArmor][iUpgrade] + 1
		new iExp = g_eArmor[iUpgrade][AP_FIRST_XP] * (1 << (iLevel - 1))
		new iAmount = g_eArmor[iUpgrade][AP_AMOUNT] * iLevel / g_eArmor[iUpgrade][AP_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gArmor][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g%i AP!y) for !t%i XP", szPrefix, g_eArmor[iUpgrade][AP_NAMES], iLevel, iAmount, iExp)
		
	}
	ShowArmorMenu(id)
	return PLUGIN_HANDLED
}
public Armor_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gArmor][iUpgrade] == g_eArmor[iUpgrade][AP_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eArmor[iUpgrade][AP_FIRST_XP] * (1 << g_iLevels[id][gArmor][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowRespawnMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sRespawn \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Respawn_Handler")
	
	new iCallBack = menu_makecallback("Respawn_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iPercent, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eRespawn[i][RESPAWN_STATUS])
		{
			iLevel = g_iLevels[id][gRespawn][i] + 1
			iPercent = g_eRespawn[i][RESPAWN_MAX_CHANCE] * iLevel / g_eRespawn[i][RESPAWN_MAX_LEVEL]
			
			if (g_iLevels[id][gRespawn][i] < g_eRespawn[i][RESPAWN_MAX_LEVEL])
			{
				iExp = g_eRespawn[i][RESPAWN_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i%%) \r[\w%i XP\r]", g_eRespawn[i][RESPAWN_NAMES], iLevel, iPercent, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i%%) \r[\wMaxed Out!\r]", g_eRespawn[i][RESPAWN_NAMES], iLevel, g_eRespawn[i][RESPAWN_MAX_CHANCE])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Respawn_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Respawn ability is chance to be respawned when you die.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Chance Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eRespawn[i][RESPAWN_MAX_CHANCE] / g_eRespawn[i][RESPAWN_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eRespawn[i][RESPAWN_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Chance</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eRespawn[i][RESPAWN_MAX_CHANCE])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Respawn Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gRespawn][iUpgrade] + 1
		new iExp = g_eRespawn[iUpgrade][RESPAWN_FIRST_XP] * (1 << (iLevel - 1))
		new iPercent = g_eRespawn[iUpgrade][RESPAWN_MAX_CHANCE] * iLevel / g_eRespawn[iUpgrade][RESPAWN_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gRespawn][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g%i%%!y) for !t%i XP", szPrefix, g_eRespawn[iUpgrade][RESPAWN_NAMES], iLevel, iPercent, iExp)
		
	}
	ShowRespawnMenu(id)
	return PLUGIN_HANDLED
}
public Respawn_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gRespawn][iUpgrade] == g_eRespawn[iUpgrade][RESPAWN_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eRespawn[iUpgrade][RESPAWN_FIRST_XP] * (1 << g_iLevels[id][gRespawn][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowNoFallMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sNo Fall Damage \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "NoFallDamage_Handler")
	
	new iCallBack = menu_makecallback("NoFallDamage_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iPercent, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eNoFallDamage[i][NFL_STATUS])
		{
			iLevel = g_iLevels[id][gNoFallDamage][i] + 1
			iPercent = g_eNoFallDamage[i][NFL_MAX_CHANCE] * iLevel / g_eNoFallDamage[i][NFL_MAX_LEVEL]
			
			if (g_iLevels[id][gNoFallDamage][i] < g_eNoFallDamage[i][NFL_MAX_LEVEL])
			{
				iExp = g_eNoFallDamage[i][NFL_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i%%) \r[\w%i XP\r]", g_eNoFallDamage[i][NFL_NAMES], iLevel, iPercent, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i%%) \r[\wMaxed Out!\r]", g_eNoFallDamage[i][NFL_NAMES], iLevel, g_eNoFallDamage[i][NFL_MAX_CHANCE])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public NoFallDamage_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Fall Damage ability reduces the amount of damage inflicted from falling.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eNoFallDamage[i][NFL_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Reduction Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eNoFallDamage[i][NFL_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eNoFallDamage[i][NFL_MAX_CHANCE] / g_eNoFallDamage[i][NFL_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eNoFallDamage[i][NFL_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eNoFallDamage[i][NFL_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Chance</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eNoFallDamage[i][NFL_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eNoFallDamage[i][NFL_MAX_CHANCE])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP No Fall Damage Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gNoFallDamage][iUpgrade] + 1
		new iExp = g_eNoFallDamage[iUpgrade][NFL_FIRST_XP] * (1 << (iLevel - 1))
		new iPercent = g_eNoFallDamage[iUpgrade][NFL_MAX_CHANCE] * iLevel / g_eNoFallDamage[iUpgrade][NFL_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gNoFallDamage][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g%i%%!y) for !t%i XP", szPrefix, g_eNoFallDamage[iUpgrade][NFL_NAMES], iLevel, iPercent, iExp)
		
	}
	ShowNoFallMenu(id)
	return PLUGIN_HANDLED
}
public NoFallDamage_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gNoFallDamage][iUpgrade] == g_eNoFallDamage[iUpgrade][NFL_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eNoFallDamage[iUpgrade][NFL_FIRST_XP] * (1 << g_iLevels[id][gNoFallDamage][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowIncreaseDmgMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sIncrease Damage \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Damage_Handler")
	
	new iCallBack = menu_makecallback("Damage_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iAmount, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eDamage[i][DMG_STATUS])
		{
			iLevel = g_iLevels[id][gDamage][i] + 1
			iAmount = g_eDamage[i][DMG_AMOUNT] * iLevel / g_eDamage[i][DMG_MAX_LEVEL]
			
			if (g_iLevels[id][gDamage][i] < g_eDamage[i][DMG_MAX_LEVEL])
			{
				iExp = g_eDamage[i][DMG_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (+%i DMG) \r[\w%i XP\r]", g_eDamage[i][DMG_NAMES], iLevel, iAmount, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (+%i DMG) \r[\wMaxed Out!\r]", g_eDamage[i][DMG_NAMES], iLevel, g_eDamage[i][DMG_AMOUNT])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Damage_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Increase Damage ability is the amount of damage added to your attack.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eDamage[i][DMG_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Increase Damage Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eDamage[i][DMG_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eDamage[i][DMG_AMOUNT] / g_eDamage[i][DMG_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eDamage[i][DMG_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eDamage[i][DMG_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Increase Damage</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eDamage[i][DMG_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eDamage[i][DMG_AMOUNT])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Increase Damage Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gDamage][iUpgrade] + 1
		new iExp = g_eDamage[iUpgrade][DMG_FIRST_XP] * (1 << (iLevel - 1))
		new iAmount = g_eDamage[iUpgrade][DMG_AMOUNT] * iLevel / g_eDamage[iUpgrade][DMG_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gDamage][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g+%i DMG!y) for !t%i XP", szPrefix, g_eDamage[iUpgrade][DMG_NAMES], iLevel, iAmount, iExp)
		
	}
	ShowIncreaseDmgMenu(id)
	return PLUGIN_HANDLED
}
public Damage_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gDamage][iUpgrade] == g_eDamage[iUpgrade][DMG_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eDamage[iUpgrade][DMG_FIRST_XP] * (1 << g_iLevels[id][gDamage][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowRegenerateMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sRegenerate \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Regenerate_Handler")
	
	new iCallBack = menu_makecallback("Regenerate_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, iAmount, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eRegenerate[i][REGEN_STATUS])
		{
			iLevel = g_iLevels[id][gRegenerate][i] + 1
			iAmount = g_eRegenerate[i][REGEN_AMOUNT] * iLevel / g_eRegenerate[i][REGEN_MAX_LEVEL]
			
			if (g_iLevels[id][gRegenerate][i] < g_eRegenerate[i][REGEN_MAX_LEVEL])
			{
				iExp = g_eRegenerate[i][REGEN_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i (%i HP) \r[\w%i XP\r]", g_eRegenerate[i][REGEN_NAMES], iLevel, iAmount, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i (%i HP) \r[\wMaxed Out!\r]", g_eRegenerate[i][REGEN_NAMES], iLevel, g_eRegenerate[i][REGEN_AMOUNT])
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public Regenerate_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Regenerate Health ability is the amount of HP that you get from killing enemies.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eRegenerate[i][REGEN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Regenerate Health Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eRegenerate[i][REGEN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eRegenerate[i][REGEN_AMOUNT] / g_eRegenerate[i][REGEN_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eRegenerate[i][REGEN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eRegenerate[i][REGEN_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Regenerate Health</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eRegenerate[i][REGEN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eRegenerate[i][REGEN_AMOUNT])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Regenerate Health Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gRegenerate][iUpgrade] + 1
		new iExp = g_eRegenerate[iUpgrade][REGEN_FIRST_XP] * (1 << (iLevel - 1))
		new iAmount = g_eRegenerate[iUpgrade][REGEN_AMOUNT] * iLevel / g_eRegenerate[iUpgrade][REGEN_MAX_LEVEL]
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gRegenerate][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !y(!g%i HP!y) for !t%i XP", szPrefix, g_eRegenerate[iUpgrade][REGEN_NAMES], iLevel, iAmount, iExp)
		
	}
	ShowRegenerateMenu(id)
	return PLUGIN_HANDLED
}

public Regenerate_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gRegenerate][iUpgrade] == g_eRegenerate[iUpgrade][REGEN_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eRegenerate[iUpgrade][REGEN_FIRST_XP] * (1 << g_iLevels[id][gRegenerate][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}

public ShowInvisibilityMenu(id)
{
	static szTitle[128]
	formatex(szTitle, charsmax(szTitle), "%sInvisibility \wMenu", szMenuPrefix)
	
	new iMenu = menu_create(szTitle, "Invisibility_Handler")
	
	new iCallBack = menu_makecallback("Invisibility_CallBack")
	
	menu_additem(iMenu, "\yHelp^n", "*", _, iCallBack)
	
	static iLevel, iExp, szItem[64], szNumId[6]
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		if (g_eInvis[i][INVIS_STATUS])
		{
			iLevel = g_iLevels[id][gInvisibility][i] + 1
			
			if (g_iLevels[id][gInvisibility][i] < g_eInvis[i][INVIS_MAX_LEVEL])
			{
				iExp = g_eInvis[i][INVIS_FIRST_XP] * (1 << (iLevel - 1))
				formatex(szItem, charsmax(szItem), "%s: \yLevel %i \r[\w%i XP\r]", g_eInvis[i][INVIS_NAMES], iLevel, iExp)
			}
			else
				formatex(szItem, charsmax(szItem), "\w%s: \yLevel %i \r[\wMaxed Out!\r]", g_eInvis[i][INVIS_NAMES], iLevel)
				
			num_to_str(_:i, szNumId, charsmax(szNumId))
			menu_additem(iMenu, szItem, szNumId, _, iCallBack)
		}
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}

public Invisibility_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	if (szData[0] == '*')
	{
		static motd[2500];
		new len = formatex(motd, sizeof(motd) - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">")
		len += format(motd[len], sizeof(motd) - len - 1,	"The Invisibility ability makes you vanish.<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<br>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th></th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eInvis[i][INVIS_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<th>%s</th>", g_team_names[i])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Invisibility Intervals</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eInvis[i][INVIS_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", (g_eInvis[i][INVIS_AMOUNT] / g_eInvis[i][INVIS_MAX_LEVEL]))
			
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Level</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eInvis[i][INVIS_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eInvis[i][INVIS_MAX_LEVEL])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"<th>Max Invisibility</th>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++ )
		{
			if (g_eInvis[i][INVIS_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1,	"<td>%i</td>", g_eInvis[i][INVIS_AMOUNT])
		}
		len += format(motd[len], sizeof(motd) - len - 1,	"</tr>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</table>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</p>")
		len += format(motd[len], sizeof(motd) - len - 1,	"</body>")
		
		show_motd(id, motd, "XP Invisibility Info")
	}
	else
	{
		new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
		
		new iLevel = g_iLevels[id][gInvisibility][iUpgrade] + 1
		new iExp = g_eInvis[iUpgrade][INVIS_FIRST_XP] * (1 << (iLevel - 1))
		
		g_iPoints[id] -= iExp
		g_iLevels[id][gInvisibility][iUpgrade] = iLevel
		
		Save_Data(id, g_szName[id])
		
		ScreenFade(id, 1.0, 1.0, 255, 255, 0, 120)
		
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You have bought !g%s !tLevel %i !yfor !t%i XP", szPrefix, g_eInvis[iUpgrade][INVIS_NAMES], iLevel, iExp)
		
	}
	ShowInvisibilityMenu(id)
	return PLUGIN_HANDLED
}

public Invisibility_CallBack(id, iMenu, Item)
{
	static szData[6], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	
	if (szData[0] == '*')
		return ITEM_ENABLED
	
	new CsTeams:iUpgrade = CsTeams:str_to_num(szData)
	if(g_iLevels[id][gInvisibility][iUpgrade] == g_eInvis[iUpgrade][INVIS_MAX_LEVEL])
		return ITEM_DISABLED
		
	new iExp = g_eInvis[iUpgrade][INVIS_FIRST_XP] * (1 << g_iLevels[id][gInvisibility][iUpgrade])
	if (g_iPoints[id] < iExp)
		return ITEM_DISABLED
		
	return ITEM_ENABLED
}


public ShowPlayersMenu(id)
{
	new iMenu = menu_create("Player Info Menu", "PlayersMenu_Handler");
	
	new szName[32], szIp[36]
	
	for (new i = 1; i <= g_iMaxPlayers; i++)
	{
		if (!is_user_connected(i))
			continue
			
		get_user_name(i, szName, charsmax(szName))
		get_user_ip(i, szIp,charsmax(szIp), 1)
		
		menu_additem(iMenu, szName, szIp)
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu)
}
public PlayersMenu_Handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	static szData[36], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), _, _, iCallBack)
	menu_destroy(iMenu)
	
	new iPlayer = find_player("d", szData)
	if (!is_user_connected(iPlayer))
	{
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	
	new szName[32]
	get_user_name(iPlayer, szName, charsmax(szName))
	
	static motd[2500];
	new len = copy(motd, sizeof(motd) - 1, "<html>");
	len += format(motd[len], sizeof(motd) - len - 1, "<b><font size=^"4^">Name:</font></b> %s<br><br>", szName)
	len += format(motd[len], sizeof(motd) - len - 1, "<b><font size=^"4^">XP:</font></b> %i<br><br>", g_iPoints[iPlayer])
	if (g_any_nade_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<b><font size=^"4^">Grenades Levels:</font></b><br>")
		for (new i = 0; i < Grenades; i++)
		{
			if (g_eNades[i][NADE_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i<br>", g_eNades[i][NADE_NAMES], g_iNadeLevels[iPlayer][i], g_eNades[i][NADE_MAX_LEVEL])
		}
	}
	if (g_any_health_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Health Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if (g_eHealth[i][HP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i HP)<br>",\
					g_eHealth[i][HP_NAMES], g_iLevels[iPlayer][gHealth][i], g_eHealth[i][HP_MAX_LEVEL],\
					(g_eHealth[i][HP_AMOUNT] * g_iLevels[iPlayer][gHealth][i] /  g_eHealth[i][HP_MAX_LEVEL]), g_eHealth[i][HP_AMOUNT])
		}
	}
	if (g_any_armor_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Armor Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if (g_eArmor[i][AP_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i AP)<br>",\
					g_eArmor[i][AP_NAMES], g_iLevels[iPlayer][gArmor][i], g_eArmor[i][AP_MAX_LEVEL],\
					(g_eArmor[i][AP_AMOUNT] * g_iLevels[iPlayer][gArmor][i] /  g_eArmor[i][AP_MAX_LEVEL]), g_eArmor[i][AP_AMOUNT])
		}
	}
	if (g_any_respawn_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Respawn Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if(g_eRespawn[i][RESPAWN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i %%)<br>",\
					g_eRespawn[i][RESPAWN_NAMES], g_iLevels[iPlayer][gRespawn][i], g_eRespawn[i][RESPAWN_MAX_LEVEL],\
					(g_eRespawn[i][RESPAWN_MAX_CHANCE] * g_iLevels[iPlayer][gRespawn][i] / g_eRespawn[i][RESPAWN_MAX_LEVEL]), g_eRespawn[i][RESPAWN_MAX_CHANCE])
		}
	}
	if (g_any_nofall_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">No Fall Damage Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if(g_eNoFallDamage[i][NFL_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i %%)<br>",\
					g_eNoFallDamage[i][NFL_NAMES], g_iLevels[iPlayer][gNoFallDamage][i], g_eNoFallDamage[i][NFL_MAX_LEVEL],\
					(g_eNoFallDamage[i][NFL_MAX_CHANCE] * g_iLevels[iPlayer][gNoFallDamage][i] / g_eNoFallDamage[i][NFL_MAX_LEVEL]), g_eNoFallDamage[i][NFL_MAX_CHANCE])
		}
	}
	if (g_any_damage_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Increase Damage Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if (g_eDamage[i][DMG_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i Attack Damage)<br>",\
					g_eDamage[i][DMG_NAMES], g_iLevels[iPlayer][gDamage][i], g_eDamage[i][DMG_MAX_LEVEL],\
					(g_eDamage[i][DMG_AMOUNT] * g_iLevels[iPlayer][gDamage][i] /  g_eDamage[i][DMG_MAX_LEVEL]), g_eDamage[i][DMG_AMOUNT])
		}
	}
	if (g_any_regenerate_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Regeneration Levels:</font></b><br>")
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if (g_eRegenerate[i][REGEN_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i (%i/%i HP)<br>",\
					g_eRegenerate[i][REGEN_NAMES], g_iLevels[iPlayer][gRegenerate][i], g_eRegenerate[i][REGEN_MAX_LEVEL],\
					(g_eRegenerate[i][REGEN_AMOUNT] * g_iLevels[iPlayer][gRegenerate][i] /  g_eRegenerate[i][REGEN_MAX_LEVEL]), g_eRegenerate[i][REGEN_AMOUNT])
		}
	}
	if (g_any_invisibility_enabled)
	{
		len += format(motd[len], sizeof(motd) - len - 1, "<br><b><font size=^"4^">Invisibility Levels:</font></b><br>");
		for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		{
			if(g_eInvis[i][INVIS_STATUS])
				len += format(motd[len], sizeof(motd) - len - 1, "<b>%s:</b> %i/%i<br>", g_eInvis[i][INVIS_NAMES], g_iLevels[iPlayer][gInvisibility][i], g_eInvis[i][INVIS_MAX_LEVEL])
		}
	}
	
	len += format(motd[len], charsmax(motd) - len, "</html>")
	
	show_motd(id, motd, "HNS Upgrade Player Info")
	
	ShowPlayersMenu(id)
	return PLUGIN_HANDLED
}

public FwdPlayerSpawn(id)
{
	if (is_user_alive(id))
	{
		set_task(2.0, "task_GiveNades", id)

		set_task(float(get_cvar_num("hns_hidetime")) + 1.0, "task_delayedSpawn", id)
	}
}

public task_delayedSpawn(id)
{
	if (is_user_alive(id))
	{
		new CsTeams:iTeam = cs_get_user_team(id)
		
		if (iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
		{
			 if (g_IsFirstConnect[id])
			 {
				PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s It is your first time playing this HNS Upgrades, so you are rewarded with !g%i XP!y.", szPrefix, ENTRY_XP)
				PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You earn !gXP!y based upon your gameplay, and you can buy more levels in the menu.", szPrefix)
				PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s Type !g/upgrade!y to view what you can get!", szPrefix)
				
				g_IsFirstConnect[id] = 0
			 }
			 else
			 {
			 	if (g_eHealth[iTeam][HP_STATUS])
				{
					new iHealth = g_eHealth[iTeam][HP_AMOUNT] * g_iLevels[id][gHealth][iTeam] / g_eHealth[iTeam][HP_MAX_LEVEL]
					
					if (iHealth > 0)
						set_user_health(id, get_user_health(id) + iHealth)
				}
				
				if (g_eArmor[iTeam][AP_STATUS])
				{
					new iArmor = g_eArmor[iTeam][AP_AMOUNT] * g_iLevels[id][gArmor][iTeam] / g_eArmor[iTeam][AP_MAX_LEVEL]
					
					if (iArmor == 0)
						cs_set_user_armor(id, iArmor, CS_ARMOR_NONE)
					else if (iArmor < 100)
						cs_set_user_armor(id, iArmor, CS_ARMOR_KEVLAR)
					else
						cs_set_user_armor(id, iArmor, CS_ARMOR_VESTHELM)
				}
				
				if(g_eInvis[iTeam][INVIS_STATUS])
				{
					new alpha = g_eInvis[iTeam][INVIS_AMOUNT] * g_iLevels[id][gInvisibility][iTeam] / g_eInvis[iTeam][INVIS_MAX_LEVEL]
					
					g_iAlpha[id] = 255 - alpha
					g_IsMoving[id] = 1
					remove_task(TASK_ID_RESET + id)
				}
			}
		}
	}
}

public task_GiveNades(id)
{
	if (is_user_alive(id))
	{
		new CsTeams:iTeam = cs_get_user_team(id)
		
		if (iTeam == CS_TEAM_T)
		{
			static iPercent
			
			for (new i = 0; i < Grenades; i++)
			{
				if (g_eNades[i][NADE_STATUS])
				{
					iPercent = g_eNades[i][NADE_MAX_CHANCE] * g_iNadeLevels[id][i] / g_eNades[i][NADE_MAX_LEVEL]
					
					if (iPercent > 0 && (iPercent == 100 || random_num(1, 100) <= iPercent) && is_user_alive(id))
					{
						give_item(id, g_eNades[i][NADE_CLASSNAME])
						
						if (iPercent < 100)
							PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You received your !t%s !y(!g%i%% Chance!y)", szPrefix, g_eNades[i][NADE_NAMES], iPercent)
					}
				}
			}
		}
	}
}

public FwdPlayerKilled(iVictim, iKiller, iShouldGib)
{
	if (!g_bUsedRevive[iVictim])
	{
		new CsTeams:iTeam = cs_get_user_team(iVictim)
		
		if (iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
		{
			if (g_eRespawn[iTeam][RESPAWN_STATUS])
			{
				new iPercent = g_eRespawn[iTeam][RESPAWN_MAX_CHANCE] * g_iLevels[iVictim][gRespawn][iTeam] / g_eRespawn[iTeam][RESPAWN_MAX_LEVEL]
				
				if (random_num(1, 100) <= iPercent)
				{
					if (HasTeamMateAlive(iVictim, iTeam))
					{
						set_task(0.5, "task_RespawnVictim", iVictim)
						g_bUsedRevive[iVictim] = 1
						
						PrintChatColor(iVictim, PRINT_COLOR_PLAYERTEAM, "%s You have been respawned! (!g%i%% Chance!y)", szPrefix, iPercent)
					}
				}
			}
		}
	}
}
public task_RespawnVictim(id)
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	
stock HasTeamMateAlive(id, CsTeams:iTeam)
{
	for ( new i = 1; i <= g_iMaxPlayers; i++ )
	{
		if (i == id)
			continue
		
		if (is_user_alive(i) && cs_get_user_team(i) == iTeam)
			return 1
	}
	return 0
}

public FwdPlayerTakeDamage(iVictim, Inflictor, iAttacker, Float:flDamage, iDamageBits)
{
	if (is_user_alive(iVictim))
	{
		new CsTeams:iTeam = cs_get_user_team(iVictim)
		
		if (iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
		{
			if (iDamageBits == (1<<5))
			{
				if (g_eNoFallDamage[iTeam][NFL_STATUS])
				{
					new iPercent = g_eNoFallDamage[iTeam][NFL_MAX_CHANCE] * g_iLevels[iVictim][gNoFallDamage][iTeam] / g_eNoFallDamage[iTeam][NFL_MAX_LEVEL]
					new Float:flReduction = float(floatround((flDamage * float(iPercent) / 100.0), floatround_floor))
							
					if (iPercent > 0)
					{
						set_hudmessage(0, 127, 255, -1.0, 0.90, 0, 3.0, 3.0, 0.1, 0.2, 4)
						show_hudmessage(iVictim, "Fall Damage: %.1f", (flDamage - flReduction))
						SetHamParamFloat(4, flDamage - flReduction)
					}
				}
			}
			
			if (g_eInvis[iTeam][INVIS_STATUS])
			{
				new alpha = g_eInvis[iTeam][INVIS_AMOUNT] * g_iLevels[iVictim][gInvisibility][iTeam] / g_eInvis[iTeam][INVIS_MAX_LEVEL]
				
				if (alpha > 0)
				{
					g_iAlpha[iVictim] = 255
					g_iInterval[iVictim] = 0
					g_iStopAlpha[iVictim] = alpha
					
					remove_task(TASK_ID_RESET + iVictim)
					set_task(1.0, "TaskResetAlpha", (TASK_ID_RESET + iVictim))
				}
			}
		}
	}
		
	if (is_user_alive(iAttacker))
	{
		new CsTeams:iTeam = cs_get_user_team(iAttacker)
		
		if (g_eDamage[iTeam][DMG_STATUS])
		{
			new iDamageBoost = g_eDamage[iTeam][DMG_AMOUNT] * g_iLevels[iAttacker][gDamage][iTeam] / g_eDamage[iTeam][DMG_MAX_LEVEL]
					
			SetHamParamFloat(4, flDamage + iDamageBoost)
		}
	}
}

public TaskResetAlpha(taskid)
{
	new id = taskid - TASK_ID_RESET
	
	if (++g_iInterval[id] <= DAMAGE_ALPHA_RESET)
	{
		g_iAlpha[id] = 255 - g_iStopAlpha[id] * g_iInterval[id] / DAMAGE_ALPHA_RESET

		if (g_iInterval[id] < DAMAGE_ALPHA_RESET)
			set_task(1.0, "TaskResetAlpha", (TASK_ID_RESET + id))
	}
}
public FwdCmdStart(id, uc_handle, random_seed)
{
	if (is_user_alive(id))
	{
		new buttons = get_uc(uc_handle, UC_Buttons)
		g_IsMoving[id] = (buttons & IN_MOVEMENT || (buttons & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
	}
}

public FwdAddToFullPack(es, e, ent, host, host_flags, player, pSet)
{
	if (player)
	{
		if (g_iAlpha[ent] != 255 && cs_get_user_team(ent) != cs_get_user_team(host))
		{
			set_es(es, ES_RenderMode, kRenderTransAdd)
			set_es(es, ES_RenderAmt, g_iAlpha[ent] / (g_IsMoving[ent] + 1))
		}
	}
}
	
public EventDeathMsg()
{
	new iKiller = read_data(1)
	, iVictim = read_data(2)
	, iHeadShot = read_data(3)
	
	if (!is_user_connected(iKiller) || iVictim == iKiller)
		return
		
	new CsTeams:iTeam = cs_get_user_team(iKiller)
	if (g_eRegenerate[iTeam][REGEN_STATUS])
	{
		new iRegeneration = g_eRegenerate[iTeam][REGEN_AMOUNT] * g_iLevels[iKiller][gRegenerate][iTeam] / g_eRegenerate[iTeam][REGEN_MAX_LEVEL]
		
		if (iRegeneration)
		{
			set_user_health(iKiller, get_user_health(iKiller) + iRegeneration)
			ScreenFade(iKiller, 0.8, 0.8, 255, 0, 0, 100)
		}
	}
		
	new iExp, szVictimName[32]
	get_user_name(iVictim, szVictimName, charsmax(szVictimName))
		
	if (get_user_flags(iKiller) & VIP_BONUS)
		iExp = iHeadShot ? get_pcvar_num(iCvars[HS_KILL_VIP]) : get_pcvar_num(iCvars[KILL_VIP])
	else
		iExp = iHeadShot ? get_pcvar_num(iCvars[HS_KILL]) : get_pcvar_num(iCvars[KILL])
		
	g_iPoints[iKiller] += iExp
	PrintChatColor(iKiller, PRINT_COLOR_PLAYERTEAM, "%s You gained !g%i XP!y for killing !t%s", szPrefix, iExp, szVictimName)
	
	if (g_bConnected[iKiller])
		Save_Data(iKiller, g_szName[iKiller])
}

public EventRoundEnd()
{
	new iHider, iSeeker, iHiderAlive
	
	for (new id = 1; id <= g_iMaxPlayers; id++)
	{
		if (is_user_connected(id))
		{
			switch(cs_get_user_team(id))
			{
				case CS_TEAM_CT:
				{
					if (!iSeeker)
						iSeeker = id
				}
				case CS_TEAM_T:
				{
					if (!iHider)
					{
						iHider = id
						
						if (!iHiderAlive && is_user_alive(id))
							iHiderAlive = id
					}
				}
			}
			
			if (iSeeker && iHider && iHiderAlive)
				break
		}
	}
	new iExp
	
	if (iHiderAlive > 1)
	{
		for (new id = 1; id <= g_iMaxPlayers; id++)
		{
			if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
			{
				iExp = (get_user_flags(id) & VIP_BONUS) ? get_pcvar_num(iCvars[SURVIVE_VIP]) : get_pcvar_num(iCvars[SURVIVE])
				g_iPoints[id] += iExp
				
				PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You gained!g %i XP!y for !tsurviving!y!", szPrefix, iExp)
				
				if (g_bConnected[id])
					Save_Data(id, g_szName[id])
			}
		}
	}
	
	if (iSeeker > 1 && !iHiderAlive)
	{
		for (new id = 1; id <= g_iMaxPlayers; id++)
		{
			if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
			{
				iExp = (get_user_flags(id) & VIP_BONUS) ? get_pcvar_num(iCvars[WIN_VIP]) : get_pcvar_num(iCvars[WIN])
				g_iPoints[id] += iExp
				
				PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s You gained!g %i XP!y for !twinning !ythe round!", szPrefix, iExp)
				
				if (g_bConnected[id])
					Save_Data(id, g_szName[id])
			}
		}
	}
}

new g_iPlayer[33], g_iMenuType[33]

public Command_XpMenu(id, level, cid)
{
	if (!cmd_access(id, level, cid, 1))
		goto Handled
		
	ToggleXpMenu(id)
	
	Handled:
	return PLUGIN_HANDLED
}
public ToggleXpMenu(id)
{
	static szTitle[64]
	formatex(szTitle, charsmax(szTitle), "\r[\yHNS Upgrades\r] \d~ \wAdmin XP Menu")
	new iMenu = menu_create(szTitle, "xpmenu_handler")
	
	menu_additem(iMenu, "\yGive \dPlayer \rXP")
	menu_additem(iMenu, "\yTake \dPlayer \rXP^n^n")
	menu_additem(iMenu, "\yGive All Players XP")
	
	menu_setprop(iMenu, MPROP_EXITNAME, "Go Back..")
	menu_display(id, iMenu, 0)
	return PLUGIN_HANDLED
}
public xpmenu_handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		menu_destroy(iMenu)
		Command_Upgrade(id)
		return PLUGIN_HANDLED
	}
	Item++
	
	if (Item == 3)
		client_cmd(id, "messagemode Give_XP_To_All_Players")
	else
		PlayerXpMenu(id, Item)
	
	menu_destroy(iMenu)
	return PLUGIN_HANDLED
}
public GiveAllPlayersXP(id, level, cid)
{
	if (!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
		
	new szArgs[32]
	read_argv(1, szArgs, charsmax(szArgs))
	
	if (!is_str_num(szArgs))
	{
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s Invalid input, please try again.", szPrefix)
		client_cmd(id, "messagemode Give_XP_To_All_Players")
		return PLUGIN_HANDLED
	}
	
	new iExp = str_to_num(szArgs)
	
	new iPlayers[32], iNum, iPlayer
	get_players(iPlayers, iNum, "ch")
	
	for (new i; i < iNum; i++)
	{
		iPlayer = iPlayers[i]
		
		g_iPoints[iPlayer] += iExp
		
		ScreenFade(iPlayer, 1.0, 1.0, 0, 255, 0, 120)
		
		if (g_bConnected[iPlayer])
			Save_Data(iPlayer, g_szName[iPlayer])
	}
		
	new szName[32]
	get_user_name(id, szName, charsmax(szName))

	PrintChatColor(0, PRINT_COLOR_PLAYERTEAM, "%s !t%s!y give!g %d XP!y to!t All Players!y.", szPrefix, szName, iExp)
	
	ToggleXpMenu(id)
	return PLUGIN_HANDLED
}

public PlayerXpMenu(id, iType)
{
	static szTitle[64]
	formatex(szTitle, charsmax(szTitle), "Choose Player to %s XP", iType == 1 ? "Give" : "Take")
	new iMenu = menu_create(szTitle, "xp_handler")
	
	g_iMenuType[id] = iType
	
	new iPlayers[32], iNum, iPlayer
	new szName[34], szTempID[10]
	get_players(iPlayers, iNum)
	
	for(new i; i < iNum; i++)
	{
		iPlayer = iPlayers[i]
		if(!is_user_connected(iPlayer))
			continue
		
		get_user_name(iPlayer, szName, sizeof szName - 1)
		num_to_str(iPlayer, szTempID, charsmax(szTempID))
		menu_additem(iMenu, szName, szTempID)
	}
	menu_setprop(iMenu, MPROP_EXITNAME, "Go back..")
	menu_display(id, iMenu, 0)
	return PLUGIN_HANDLED
}
public xp_handler(id, iMenu, Item)
{
	if (Item == MENU_EXIT)
	{
		ToggleXpMenu(id)
		g_iMenuType[id] = 0
		return PLUGIN_HANDLED
	}
	
	new szData[6], iName[64], iAccess, iCallBack
	menu_item_getinfo(iMenu, Item, iAccess, szData, charsmax(szData), iName, charsmax(iName), iCallBack)
	
	g_iPlayer[id] = str_to_num(szData)
	
	if (!is_user_connected(g_iPlayer[id]))
	{
		g_iPlayer[id] = 0
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s The player you chose is not in the server.", szPrefix)
		return PLUGIN_HANDLED
	}
	
	PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s Player !t%s !yhas !g%i XP", szPrefix, iName, g_iPoints[g_iPlayer[id]])
	
	client_cmd(id, "messagemode XP_Amount")
	menu_destroy(iMenu)
	return PLUGIN_HANDLED
}
public Command_XP_Amount(id, level, cid)
{
	if (!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
		
	if (!g_iPlayer[id])
		return PLUGIN_HANDLED
		
	if (!is_user_connected(g_iPlayer[id]))
	{
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s The player you chose is not in the server.", szPrefix)
		return PLUGIN_HANDLED
	}
	
	new szArgs[12]
	read_argv(1, szArgs, charsmax(szArgs))
	
	if (!is_str_num(szArgs))
	{
		PrintChatColor(id, PRINT_COLOR_PLAYERTEAM, "%s Invalid input, please try again.", szPrefix)
		client_cmd(id, "messagemode XP_Amount")
		return PLUGIN_HANDLED
	}
	
	new iExp = str_to_num(szArgs)
	
	new szNames[2][32]
	get_user_name(id, szNames[0], charsmax(szNames[]))
	get_user_name(g_iPlayer[id], szNames[1], charsmax(szNames[]))
	
	switch (g_iMenuType[id])
	{
		case 1:
		{
			g_iPoints[g_iPlayer[id]] += iExp
			PrintChatColor(0, PRINT_COLOR_PLAYERTEAM, "%s !t%s!y gave !g%i XP!y to!t %s", szPrefix, szNames[0], iExp, szNames[1])
			ScreenFade(g_iPlayer[id], 1.0, 1.0, 0, 255, 0, 120)
		}
		case 2:
		{
			g_iPoints[g_iPlayer[id]] -= iExp
			PrintChatColor(0, PRINT_COLOR_PLAYERTEAM, "%s !t%s!y took !g%i XP!y from!t %s", szPrefix, szNames[0], iExp, szNames[1])
			ScreenFade(g_iPlayer[id], 1.0, 1.0, 255, 0, 0, 120)
		}
	}
	
	if (g_bConnected[g_iPlayer[id]])
		Save_Data(g_iPlayer[id], szNames[1])
	
	g_iPlayer[id] = 0
	g_iMenuType[id] = 0
	
	ToggleXpMenu(id)
	return PLUGIN_HANDLED
}

public Save_Data(id, szName[])
{
	new szData[256]
	new iLen = formatex(szData, charsmax(szData), "%i", g_iPoints[id])
	
	for (new i = 0; i < Grenades; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iNadeLevels[id][i])
		
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gHealth][i])
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gArmor][i])
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gRespawn][i])
		
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gNoFallDamage][i])
		
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gDamage][i])
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gRegenerate][i])
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
		iLen += formatex(szData[iLen], charsmax(szData) - iLen, " %i", g_iLevels[id][gInvisibility][i])
	
	fvault_set_data(szDataBase, szName, szData)
}

public Load_Data(szName[], id)
{
	if (!is_user_connected(id))
		return
	
	new szData[256]
	
	if(fvault_get_data(szDataBase, szName, szData, charsmax(szData)))
		ParseLoadedUserData(id, szData)
	else 
		CreateNewUser(id)
		
	g_bConnected[id] = true
}
public ParseLoadedUserData(id, szData[256])
{
	static szMaxSymbols[16]
	argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
	
	g_iPoints[id] = str_to_num(szMaxSymbols)
	
	for (new i = 0; i < Grenades; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iNadeLevels[id][i] = clamp(str_to_num(szMaxSymbols), 0, g_eNades[i][NADE_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gHealth][i] = clamp(str_to_num(szMaxSymbols), 0, g_eHealth[i][HP_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gArmor][i] = clamp(str_to_num(szMaxSymbols), 0, g_eArmor[i][AP_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gRespawn][i] = clamp(str_to_num(szMaxSymbols), 0, g_eRespawn[i][RESPAWN_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gNoFallDamage][i] = clamp(str_to_num(szMaxSymbols), 0, g_eNoFallDamage[i][NFL_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gDamage][i] = clamp(str_to_num(szMaxSymbols), 0, g_eDamage[i][DMG_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gRegenerate][i] = clamp(str_to_num(szMaxSymbols), 0, g_eRegenerate[i][REGEN_MAX_LEVEL])
	}
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		argbreak(szData, szMaxSymbols, charsmax(szMaxSymbols), szData, charsmax(szData))
		g_iLevels[id][gInvisibility][i] = clamp(str_to_num(szMaxSymbols), 0, g_eInvis[i][INVIS_MAX_LEVEL])
	}
}
public CreateNewUser(id)
{
	g_IsFirstConnect[id] = 1
	
	g_iPoints[id] = ENTRY_XP
	
	arrayset(g_iNadeLevels[id], 0, sizeof(g_iNadeLevels[]))
	
	for (new CsTeams:i = CS_TEAM_T; i <= CS_TEAM_CT; i++)
	{
		g_iLevels[id][gHealth][i] = 0
		g_iLevels[id][gArmor][i] = 0
		g_iLevels[id][gRespawn][i] = 0
		g_iLevels[id][gNoFallDamage][i] = 0
		g_iLevels[id][gDamage][i] = 0
		g_iLevels[id][gRegenerate][i] = 0
		g_iLevels[id][gInvisibility][i] = 0
	}
}

public client_infochanged(id)
{
	if (!is_user_connected(id))
		return PLUGIN_HANDLED
	
	new szNewName[32], szOldName[32]
	get_user_name(id, szOldName, charsmax(szOldName))
	get_user_info(id, "name", szNewName, charsmax(szNewName))
	
	if (!equal(szNewName, szOldName))
	{
		Save_Data(id, szOldName)
		set_task(0.1, "Load_Data", id, szNewName, sizeof(szNewName))
		g_szName[id] = szNewName
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

stock ScreenFade(index, Float:fDuration, Float:fHoldTime, cRed, cGreen, cBlue, cAlpha)
{
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, index)
	write_short(floatround(4096.0 * fDuration, floatround_round))
	write_short(floatround(4096.0 * fHoldTime, floatround_round))
	write_short(4096)
	write_byte(cRed)
	write_byte(cGreen)
	write_byte(cBlue)
	write_byte(cAlpha)
	message_end()
}

Аватар
YankoNL
Извън линия
Потребител
Потребител
Мнения: 163
Регистриран на: 06 Апр 2017, 09:07
Местоположение: Варна
Се отблагодари: 22 пъти
Получена благодарност: 9 пъти

Помощ с HNS_Upgrades

Мнение от YankoNL » 24 Ное 2018, 02:17

Искам да се извиня че пиша с такова закъснение, бях зает тези дни. Понеже нямам възможност да тествам скоро, вие тествали ли сте този плъгин дали работи и няма бъгове пречещи за нормалното развитие на играта?
Благодаря за съдействието ви!

Аватар
Huehue
Извън линия
Модератор
Модератор
Мнения: 352
Регистриран на: 16 Яну 2017, 23:42
Местоположение: София
Се отблагодари: 7 пъти
Получена благодарност: 171 пъти
Обратна връзка:

Помощ с HNS_Upgrades

Мнение от Huehue » 24 Ное 2018, 11:20

Пробвай така, ако не стане просто го спри като опция от кода
HNS_Upgrades.sma
(78.61 KiB) Свалено 121 пъти
HNS_Upgrades.sma
(78.61 KiB) Свалено 121 пъти
За да спреш Invisible Upgrade отиваш на следните редове:

Код за потвърждение: Избери целия код

#define ENABLE_TERR_INVISIBILITY	1
#define ENABLE_CT_INVISIBILITY		1
и променяш 1 на 0, трябва да стане така.

Код за потвърждение: Избери целия код

#define ENABLE_TERR_INVISIBILITY	0
#define ENABLE_CT_INVISIBILITY		0
LOYAL TO THE OATH OF OMERTА̀

Зад монитора мъжкари, това не го разбирам..
На живо сте мишкари, това го гарантирам!
Седиш на 30 метра от мен като препариран!
Ако има нещо брат, номерът ми е блокиран..

My GitHub Profile
GitHub

My AMXX Includes Collection
AMXX Include Libraries

My Steam Profile (from SteamDB)
  • Value: 4179€
  • Games owned: 1855
  • Games played: 754 (40%)
  • Hours on record: 4,994.9h

Аватар
YankoNL
Извън линия
Потребител
Потребител
Мнения: 163
Регистриран на: 06 Апр 2017, 09:07
Местоположение: Варна
Се отблагодари: 22 пъти
Получена благодарност: 9 пъти

Помощ с HNS_Upgrades

Мнение от YankoNL » 25 Ное 2018, 11:59

Довечера ще пробвам и ще ви докладвам тук.
Благодаря ви за съдействието!

Аватар
YankoNL
Извън линия
Потребител
Потребител
Мнения: 163
Регистриран на: 06 Апр 2017, 09:07
Местоположение: Варна
Се отблагодари: 22 пъти
Получена благодарност: 9 пъти

Помощ с HNS_Upgrades

Мнение от YankoNL » 25 Ное 2018, 22:45

След като сложа enable Invisibility на 0 играчите остават напълно невидими докато не се сменят отборите или докато не умрат. Затова май ще го оставя на 1 само ще намаля максималната невидимост на играча.

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Поддръжка / Помощ”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 10 госта