eroare plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Oct 2017, 01:35

salut extreamcs eu folosesc acest addons zm 6.2
| Afiseaza codul
addon-uri/zombie-plague-the-return-sma-t335327.html
problema in felul urmator nu ma lasa sa compliez "sma"

pluginul
| Afiseaza codul
/* 
                        - | AMXMODX 1.8.3 | -
			
         _____________________________________________________
        |                                                     |
	| Zombie Plague 6.2 - Base Plugin                     |
        |                                                     |
	|       (c) AUG 2016 - Final version                  |
	|			                              |
	|         This product is a free version.             |
	|			                              |
	| By using our product you accept the Terms of Use.   |
	|			                              |
	|                                                     |
	|           - Project started by EnTeR_ -             |
	|_____________________________________________________|
	
	 _____________________________________________________
	|                                                     |
	|                    Credits:                         |
	|                                                     |
	|       * MeRcyLeZZ for original zp version           |
	|                                                     |
	|     * Hattrick for extra items and improvements       |
	|_____________________________________________________|

        
*/


#include             <     amxmodx     >
#include             <     amxmisc     >
#include             <     cstrike     >
#include             <   hamsandwich   >
#include             <     fakemeta    >
#include             <     engine      >
#include             <   chr_engine    >
#include             <       xs        >
#include             <      geoip      >
#include             <     csstats     >


#pragma tabsize    0


#if AMXX_VERSION_NUM < 183

         #assert AMX Mod X v1.8.3 or later library required!

#endif

 
#define PLUGIN    "Zombie Plague (UltimateX)"

#define VERSION              "6.2"


#define CHAT_PREFIX       "^4[ZP]^1"

#define REMINDER_DELAY        25.0

enum ClassModels
{
	OWNER,
	ADMIN,
	SNIPER,
	SURVIVOR,
	NEMESIS,
	ASSASSIN
}

new const ZP_CUSTOMIZATION_FILE [  ] = "ZombiePlague_Customization.ini";

new const ZP_EXTRAITEMS_FILE [  ] = "ZombiePlague_ExtraItems.ini";

new const ZP_ZOMBIECLASSES_FILE [  ] = "ZombiePlague_ZClasses.ini";

new const ZP_CONFIGURATION_FILE [  ] = "ZombiePlague_Configuration.cfg";

const MAX_CSDM_SPAWNS = 128;

const MAX_STATS_SAVED = 64;

const TASK_ID = 1603;

const TASK_LEADER = 37032;

const TASK_HEALTH = 1994;

new const Float: iCoords [ ] [ ] = 
{
	{ 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 }
};

enum
{
	SECTION_NONE = 0,
	SECTION_ACCESS_FLAGS,
	SECTION_PLAYER_MODELS,
	SECTION_WEAPON_MODELS,
	SECTION_SOUNDS,
	SECTION_AMBIENCE_SOUNDS,
	SECTION_HARD_CODED_ITEMS_COSTS,
	SECTION_WEATHER_EFFECTS,
	SECTION_SKY,
	SECTION_ZOMBIE_DECALS,
	SECTION_KNOCKBACK
};

enum
{
         ACCESS_MODE_INFECTION = 0,
         ACCESS_MODE_NEMESIS,
         ACCESS_MODE_ASSASSIN,
         ACCESS_MODE_SURVIVOR,
         ACCESS_MODE_SNIPER,
         ACCESS_MODE_SWARM,
         ACCESS_MODE_MULTI,
         ACCESS_MODE_PLAGUE,
         ACCESS_MODE_ARMAGEDDON,
         ACCESS_MODE_APOCALYPSE,
         ACCESS_MODE_NIGHTMARE,
         ACCESS_MAKE_ZOMBIE,
         ACCESS_MAKE_HUMAN,
         ACCESS_MAKE_NEMESIS,
         ACCESS_MAKE_ASSASSIN,
         ACCESS_MAKE_SURVIVOR,
         ACCESS_MAKE_SNIPER,
         ACCESS_RESPAWN_PLAYERS,
         ACCESS_OWNER_MODELS,
	ACCESS_ADMIN_MODELS,
         MAX_ACCESS_FLAGS
};

enum (+= 100)
{
	TASK_MODEL = 2000,
	TASK_TEAM,
	TASK_SPAWN,
	TASK_BLOOD,
	TASK_BURN,
	TASK_NVISION,
	TASK_SHOWHUD,
	TASK_MAKEZOMBIE,
	TASK_WELCOMEMSG,
	TASK_AMBIENCESOUNDS
};

/* --------------- | For TripMine | -------------- */

#define MAX_ENTITIES		        600

#define TASK_CREATE		        84765
#define TASK_REMOVE		        86766

#define MINE_CLASSNAME		        "zp_trip_mine"
#define MINE_SOUND_ACTIVATE	        "zombie_plague/mine_activate.wav"
#define MINE_SOUND_CHARGE	        "zombie_plague/mine_charge.wav"
#define MINE_SOUND_DEPLOY	        "zombie_plague/mine_deploy.wav"
#define entity_get_owner(%0)		 entity_get_int( %0, EV_INT_iuser2 )
#define entity_get_status(%0)		 entity_get_int( %0, EV_INT_iuser1 )
#define entity_get_classname(%0,%1)	 entity_get_string( %0, EV_SZ_classname, %1, charsmax( %1 ) )

/* ------------------------------------------------- */

#define ID_MODEL            (taskid - TASK_MODEL)
#define ID_TEAM             (taskid - TASK_TEAM)
#define ID_SPAWN            (taskid - TASK_SPAWN)
#define ID_BLOOD            (taskid - TASK_BLOOD)
#define ID_BURN             (taskid - TASK_BURN)
#define ID_NVISION          (taskid - TASK_NVISION)
#define ID_SHOWHUD          (taskid - TASK_SHOWHUD)

#define REFILL_WEAPONID     Args[0]

#define WPN_STARTID         MenuData [id][1]
#define WPN_MAXIDS          ArraySize(PrimaryItems)
#define WPN_SELECTION       (MenuData[id][1]+key)

#define EntityRange(%1,%2)   entity_range(%1,%2)

#define MODEL_EXPLODE	    "sprites/zerogxplode.spr"
#define SOUND_EXPLODE	    "fvox/flatline.wav"
#define JP_SMOKE_SPRITE     "sprites/smoke.spr"
#define XFIREBALL_SPRITE    "sprites/xfireball3.spr"
#define WHITE_SPRITE        "sprites/white.spr"
#define TRAIL_SPRITE        "sprites/laserbeam.spr"
#define RING_SPRITE         "sprites/shockwave.spr"
#define FIRE_SPRITE         "sprites/flame.spr"
#define SMOKE_SPRITE        "sprites/black_smoke3.spr"
#define GLASS_MODEL         "models/glassgibs.mdl"

#define TE_EXPLOSION	 3
#define TE_BEAMFOLLOW	 22
#define TE_BEAMCYLINDER	 21

const MENU_KEY_BACK = 7;
const MENU_KEY_NEXT = 8;
const MENU_KEY_EXIT = 9;

enum
{
	EXTRA_NVISION = 0,
	EXTRA_EXPLOSION_NADE,
	EXTRA_NAPALM_NADE,
	EXTRA_FROST_NADE,
	EXTRA_AWP_MAGNUM_SNIPER,
	EXTRA_M249_PARA_MACHINEGUN,
	EXTRA_SG550_AUTO_SNIPER,
	EXTRA_G3SG1_AUTO_SNIPER,
	EXTRA_JETPACK,
	EXTRA_UNLIMITEDCLIP,
	EXTRA_ARMOR_100,
	EXTRA_ARMOR_200,
	EXTRA_MULTIJUMP,
	EXTRA_TRYDER,
	EXTRA_SURVIVOR,
	EXTRA_SNIPER,
	EXTRA_NEMESIS,
	EXTRA_ASSASSIN,
	EXTRA_ANTIDOTE,
	EXTRA_MADNESS,
	EXTRA_INFECTIONBOMB,
	EXTRA_KNIFEBLINK,
	EXTRA_TRIPMINE,
	EXTRA_WEAPONS_STARTID
};

enum
{
         MODE_NONE = 0,	
         MODE_INFECTION,
         MODE_NEMESIS,
         MODE_ASSASSIN,
         MODE_SURVIVOR,
         MODE_SNIPER,
         MODE_SWARM,
         MODE_MULTI,
         MODE_PLAGUE,
         MODE_ARMAGEDDON, 
         MODE_APOCALYPSE,
         MODE_NIGHTMARE
};

const ZP_TEAM_NO_ONE = 0;
const ZP_TEAM_ANY = 0;
const ZP_TEAM_ZOMBIE = (1<<0);
const ZP_TEAM_HUMAN = (1<<1) ;	
const ZP_TEAM_NEMESIS = (1<<2);
const ZP_TEAM_SURVIVOR = (1<<3); 
const ZP_TEAM_SNIPER = (1<<4);
const ZP_TEAM_ASSASSIN = (1<<5);

new const ZP_TEAM_NAMES [ ] [ ] = 
{ 	
	"ZOMBIE , HUMAN", 
	"ZOMBIE", 
	"HUMAN", 
	"ZOMBIE , HUMAN", 
	"NEMESIS",
	"ZOMBIE , NEMESIS", 
	"HUMAN , NEMESIS", 
	"ZOMBIE , HUMAN , NEMESIS",
	"ASSASSIN", 
	"ZOMBIE , ASSASSIN", 
	"HUMAN , ASSASSIN", 
	"ZOMBIE, HUMAN, ASSASSIN",
	"NEMESIS , ASSASSIN",
	"ZOMBIE , NEMESIS , ASSASSIN",
	"HUMAN, NEMESIS, ASSASSIN",
	"ZOMBIE , HUMAN , NEMESIS , ASSASSIN",
	"SURVIVOR",
	"ZOMBIE, SURVIVOR",
	"HUMAN, SURVIVOR",
	"ZOMBIE, HUMAN, SURVIVOR",
	"NEMESIS , SURVIVOR",
	"ZOMBIE , NEMESIS , SURVIVOR",
	"HUMAN , NEMESIS , SURVIVOR",
	"ZOMBIE , HUMAN , NEMESIS , SURVIVOR",
	"ASSASSIN, SURVIVOR",
	"ZOMBIE, ASSASSIN, SURVIVOR",
	"HUMAN, ASSASSIN, SURVIVOR",
	"ZOMBIE, HUMAN, ASSASSIN, SURVIVOR",
	"NEMESIS, ASSASSIN, SURVIVOR",
	"ZOMBIE, NEMESIS, ASSASSIN, SURVIVOR",
	"HUMAN, NEMESIS, ASSASSIN, SURVIVOR",
	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SURVIVOR",
	"SNIPER",
	"ZOMBIE, SNIPER",
	"HUMAN, SNIPER",
	"ZOMBIE, HUMAN, SNIPER",
	"NEMESIS, SNIPER",
	"ZOMBIE, NEMESIS, SNIPER",
	"HUMAN, NEMESIS, SNIPER",
	"ZOMBIE, HUMAN, NEMESIS, SNIPER",
	"ASSASSIN, SNIPER",
	"ZOMBIE, ASSASSIN, SNIPER",
	"HUMAN, ASSASSIN, SNIPER",
	"ZOMBIE, HUMAN, ASSASSIN, SNIPER",
	"NEMESIS, ASSASSIN, SNIPER",
	"ZOMBIE, NEMESIS, ASSASSIN, SNIPER",
	"HUMAN, NEMESIS, ASSASSIN, SNIPER",
	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SNIPER",
	"SURVIVOR, SNIPER",
	"ZOMBIE, SURVIVOR, SNIPER",
	"HUMAN, SURVIVOR, SNIPER",
	"ZOMBIE, HUMAN, SURVIVOR, SNIPER",
	"NEMESIS, SURVIVOR, SNIPER",
	"ZOMBIE, NEMESIS, SURVIVOR, SNIPER",
	"HUMAN, NEMESIS, SURVIVOR, SNIPER",
	"ZOMBIE, HUMAN, NEMESIS, SURVIVOR, SNIPER",
	"ASSASSIN, SURVIVOR, SNIPER",
	"ZOMBIE, ASSASSIN, SURVIVOR, SNIPER",
	"HUMAN, ASSASSIN, SURVIVOR, SNIPER",
	"ZOMBIE, HUMAN, ASSASSIN, SURVIVOR, SNIPER",
	"NEMESIS, ASSASSIN, SURVIVOR, SNIPER",
	"ZOMBIE, NEMESIS, ASSASSIN, SURVIVOR, SNIPER",
	"HUMAN, NEMESIS, ASSASSIN, SURVIVOR, SNIPER",
	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SURVIVOR, SNIPER"
};

const ZCLASS_NONE = -1;

#if cellbits == 32
         const OFFSET_CLIPAMMO = 51;
#else
         const OFFSET_CLIPAMMO = 65;
#endif

const OFFSET_PAINSHOCK = 108;
const OFFSET_CSTEAMS = 114;
const OFFSET_CSMONEY = 115;
const OFFSET_CSDEATHS = 444;
const OFFSET_MODELINDEX = 491; 
const OFFSET_ACTIVE_ITEM = 373;
const OFFSET_WEAPONOWNER = 41;
const OFFSET_LINUX = 5;
const OFFSET_LINUX_WEAPONS = 4;

const HIDE_MONEY = (1<<5);
const UNIT_SECOND = (1<<12);
const DMG_HEGRENADE = (1<<24);
const USE_USING = 2;
const USE_STOPPED = 0;
const STEPTIME_SILENT = 999;
const BREAK_GLASS = 0x01;
const FFADE_IN = 0x0000;
const FFADE_STAYOUT = 0x0004;
const PEV_SPEC_TARGET = pev_iuser2;

enum
{
	FM_CS_TEAM_UNASSIGNED = 0,
	FM_CS_TEAM_T,
	FM_CS_TEAM_CT,
	FM_CS_TEAM_SPECTATOR
};

new const CS_TEAM_NAMES [ ] [ ] = 
{
         "UNASSIGNED", 
	"TERRORIST", 
	"CT", 
	"SPECTATOR" 
};

new const GetPrimaryItems [ ] [ ] = 
{ 
	"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 const GetSecondaryItems [ ] [ ] = 
{ 
	"weapon_glock18",
	"weapon_usp",
	"weapon_p228",
	"weapon_deagle",
	"weapon_fiveseven",
	"weapon_elite" 
};

new const GetAdditionalItems [ ] [ ] = 
{
	"weapon_hegrenade",
	"weapon_flashbang",
	"weapon_smokegrenade"
};

new const GetObjectiveEnts [ ] [ ] =
{
	"func_bomb_target", 
	"info_bomb_target",
	"info_vip_start",
	"func_vip_safetyzone",
	"func_escapezone",
	"hostage_entity",
	"monster_scientist",
	"func_hostage_rescue",
	"info_hostage_rescue",
	"env_fog",
	"env_rain",
	"env_snow",
	"item_longjump",
	"func_vehicle"
}

new const MAXBPAMMO [ ] = 
{
         -1, 254, -1, 
         254, 1, 254, 1, 
	254, 254, 1, 254,
	254, 254, 254, 254, 
	254, 254, 254, 254, 
	254, 254, 254, 254, 
	254, 254, 2, 254, 254, 
	254, -1, 254 
};


new const MAXCLIP [ ] = 
{
         -1, 13, -1, 
	 10, -1, 7, -1, 
	 30, 30, -1, 30, 
	 20, 25, 30, 35, 
	 25, 12, 20, 10, 
	 30, 100, 8, 30, 
	 30, 20, -1, 7, 30, 
	 30, -1, 50 
};

new const AMMOID [ ] = 
{
         -1, 9, -1, 
	 2, 12, 5, 
	 14, 6, 4, 
	 13, 10, 7, 
	 6, 4, 4, 4, 
	 6, 10, 1, 10, 
	 3, 5, 4, 10, 2, 
	 11, 8, 4, 2, -1, 7 
};

new const AMMOTYPE [ ] [ ] = 
{
         "", "357sig", "", "762nato",
	"", "buckshot", "", "45acp", 
	"556nato", "", "9mm", "57mm", 
	"45acp", "556nato", "556nato", 
	"556nato", "45acp", "9mm", "338magnum", 
	"9mm", "556natobox", "buckshot", "556nato", 
	"9mm", "762nato", "", "50ae", "556nato", 
	"762nato", "", "57mm" 
};

new const AMMOWEAPON [ ] = 
{
         0, 
	CSW_AWP,
	CSW_SCOUT, 
	CSW_M249,
	CSW_AUG,
	CSW_XM1014, 
	CSW_MAC10,
	CSW_FIVESEVEN,
	CSW_DEAGLE,
	CSW_P228,
	CSW_ELITE,
	CSW_FLASHBANG, 
	CSW_HEGRENADE,
	CSW_SMOKEGRENADE,
	CSW_C4 
};

new const WEAPONNAMES [ ] [ ] = 
{
         "",
	"P228 Compact",
	"",
	"Schmidt Scout",
	"",
	"XM1014 M4",
	"",
	"Ingram MAC-10",
	"Steyr AUG A1",
         "",
	"Dual Elite Berettas",
	"FiveseveN",
	"UMP 45",
	"SG-550 Auto-Sniper",
	"IMI Galil",
	"Famas",
         "USP .45 ACP Tactical",
	"Glock 18C",
	"AWP Magnum Sniper",
	"MP5 Navy",
	"M249 Para Machinegun",
         "M3 Super 90",
	"M4A1 Carbine",
	"Schmidt TMP",
	"G3SG1 Auto-Sniper",
	"",
	"Desert Eagle .50 AE",
         "SG-552 Commando",
	"AK-47 Kalashnikov",
	"", 
	"ES P90" 
};

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

new const SoundBuyAmmo [ ] = "items/9mmclip1.wav";
new const SoundArmorHit [ ] = "player/bhit_helmet-1.wav";
new const SoundBuyArmor [ ] = "items/tr_kevlar.wav";
new const SoundRocket [ ] = "zombie_plague/rocket_fire.wav";
new const SoundBuyJetpack [ ] = "items/gunpickup2.wav";
new const SoundGetRocket [ ] = "items/9mmclip2.wav";
new const SoundJetpack [ ] = "zombie_plague/jetpack.wav";
new const SoundJetpackBlow [ ] = "zombie_plague/jp_blow.wav";

const Float:NADE_EXPLOSION_RADIUS = 240.0;

const PEV_ADDITIONAL_AMMO = pev_iuser1;

const PEV_NADE_TYPE = pev_flTimeStepSound;

const NADE_TYPE_INFECTION = 1111;
const NADE_TYPE_EXPLODE = 2222;
const NADE_TYPE_FROST = 3333;
const NADE_TYPE_FIRE = 4444;

const PEV_FLARE_COLOR = pev_punchangle;
const PEV_FLARE_DURATION = pev_flSwimTime;

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_C4);

new const MODEL_ENT_CLASSNAME [ ] = "player_model";
new const WEAPON_ENT_CLASSNAME [ ] = "weapon_model";

const KEYS_GAMEMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;

const KEYS_BUYMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;

enum
{
	AMBIENCE_SOUNDS_INFECTION = 0,
	AMBIENCE_SOUNDS_NEMESIS,
	AMBIENCE_SOUNDS_ASSASSIN,
	AMBIENCE_SOUNDS_SURVIVOR,
	AMBIENCE_SOUNDS_SNIPER,
	AMBIENCE_SOUNDS_SWARM,
	AMBIENCE_SOUNDS_PLAGUE,
	AMBIENCE_SOUNDS_ARMAGEDDON,
	AMBIENCE_SOUNDS_APOCALYPSE,
	AMBIENCE_SOUNDS_NIGHTMARE,
	MAX_AMBIENCE_SOUNDS
};

const ZP_PLUGIN_HANDLED = 97;


new HasTripMines [33], PlantedMines [33], HasPlanting [33], HasRemoving [33], TripMineGlow, TripMineHealth, ModelTripMine [64],

Float: iSpeed = 1000.0, Float: iDelay = 1.0, iEnemy [33], InBlink [33], Float: iLastSlash [33], iCanceled [33], iSlash [33], iBlinks [33],

RocketModel [64], bool: Fly [33] = false, bool: Rocket [33] = false, bool: RSound [33] = false, bool: Shot [33] = false, Frame [33],

Float: iTime = 0.0, Float: LastRocket [33] = 0.0, 

Float: JPCal [33] = 0.0, Float: JPSound [33] = 0.0, FlyEnergy [33], HasJet [33], 

Zp_JetpackSpeed, Zp_RocketDamage, Zp_DamageRange,

Zp_JetpackUpSpeed, Zp_JetpackAccelerate, Zp_RocketDelay, Zp_RocketSpeed, Zp_FlyMaxEngery, Zp_FlyEngery, Zp_RegainEnergy, Zp_CalTime, JPSmokeSpr, xFireBallSpr, WhiteSpr,

HasUnlimitedClip [33], JumpNum [33] = 0, bool: DoJump [33] = false, MultiJumps [33] = 0,

IsTryder [33], Zp_TryderHealth, Zp_TryderArmor, UserTotalAmmo [33];

/* ---------------------- | For GamePlay | --------------------- */

new MaxPlayers, ModeAssassin, ModeSurvivor, ModeNemesis, ModeSniper,

CountDown, IsHuman [33], IsZombie [33], IsNemesis [33],

IsAssassin [33], IsSurvivor [33], IsSniper [33], FirstZombie [33], LastZombie [33], LastHuman [33],

IsFrozen [33], NoDamage [33], NVision [33], NVisionEnabled [33], ZombieClass [33],

ZombieClassNext [33], CanBuy [33], AmmoPacks [33], DamageDealt [33],

Float: LastLeapTime [33], PlayerModel [33] [32], MenuData [33] [5],  EntPlayerModel [33], EntWeaponModel [33], BurningDuration [33],

iPosition [33], NewRound, EndRound, NemesisRound, AssassinRound, SurvivorRound, SniperRound, SwarmRound, ArmageddonRound,

ApocalypseRound, NightmareRound, PlagueRound, ModeStarted, LastMode, ScoreZombies, ScoreHumans, SpawnCount_01, SpawnCount_02,

Float: Spawns_01 [MAX_CSDM_SPAWNS] [3], Float: Spawns_02 [MAX_CSDM_SPAWNS] [3], Float: ModelTargetTime,

Float: TeamsTargetTime, TrailSpr, ExploSpr, FlameSpr, SmokeSpr, GlassSpr, HExplode, FreezeTime, CZero, HamCzBots, fwSpawn, fwPrecacheSound,

ArraysCreated, LastPlayerLeaving, SwitchingTeam, iSize, 

fwRoundStart, fwRoundEnd, fwUserInfectedPre, fwUserInfectedPost, fwUserHumanizedPre, fwUserHumanizedPost, fwUserInfectAttempt, fwUserHumanizeAttempt, fwExtraItemSelected,

fwUserUnfrozen, fwUserLastZombie, fwUserLastHuman, fwDummyResult,

DBName [MAX_STATS_SAVED] [32], DBPacks [MAX_STATS_SAVED], DBZombieClass [MAX_STATS_SAVED], DBSlot,

Array: ExtraItemName_01, Array: ExtraItemCost_01, Array: ExtraItemTeam_01, iExtraItem, Array: ExtraItemRealName, Array: ExtraItemName_02, Array: ExtraItemCost_02,

Array: ExtraItemTeam_02, Array: ExtraItemNew, Array: ZClassName_01, Array: ZClassInfo_01, Array: ZClassModelsStart_01, Array: ZClassModelSend_01, Array: ZClassPlayerModel_01, Array: ZClassModelIndex_01,

Array: ZClassClawModel_01, Array: ZClassHealth_01, Array: ZClassSpeed_01, Array: ZClassGravity_01, Array: ZClassKnockback_01, iZClass, Array: ZClassRealName, Array: ZClassName_02, Array: ZClassInfo_02,

Array: ZClassHealth_02, Array: ZClassSpeed_02, Array: ZClassGravity_02, Array: ZClassKnockback_02, Array: ZClassNew, Array: ZClassModelIndex_02, Array: ZClassModelsStart_02,

Array: ZClassClawModel_02, Array: ZClassModelSend_02, Array: ZClassPlayerModel_02, AccessFlag [MAX_ACCESS_FLAGS],

Array: ModelNemesis, Array: ModelAssassin, Array: ModelSurvivor, Array: ModelSniper, Array: ModelHuman, Array: ModelOwnerHuman, Array: ModelAdminHuman,

ModelVKnifeHuman [64], ModelVKnifeNemesis [64],

ModelVKnifeAssassin [64], ModelVxm1014Survivor [64], ModelPxm1014Survivor [64], ModelVak47Survivor [64], ModelPak47Survivor [64], ModelVm4a1Survivor [64], ModelPm4a1Survivor [64], ModelVawpSniper [64], 

ModelPawpSniper [64], ModelGrenadeInfect [64], ModelGrenadeExplode [64], ModelGrenadeFire [64], ModelGrenadeFrost [64],

Array: SoundWinZombies, Array: SoundWinHumans, Array: SoundWinNoOne, Array: ZombieInfect, Array: ZombieIdle, Array: ZombiePain, Array: NemesisPain, Array: AssassinPain, Array: ZombieDie, Array: ZombieFall,

Array: ZombieMissWall, Array: ZombieHitNormal, Array: ZombieHitStab,

Array: ZombieIdleLast, Array: ZombieMadness, Array: SoundNemesis, Array: SoundAssassin, Array: SoundSurvivor, Array: SoundSniper, Array: SoundSwarm, Array: SoundMulti, Array: SoundPlague, Array: SoundArmageddon, Array: SoundApocalypse, 

Array: SoundNightmare, Array: GrenadeInfect, Array: GrenadeInfectPlayer, Array: GrenadeExplode, Array: GrenadeFrost, Array: GrenadeFrostPlayer, Array: GrenadeFrostBreak, Array: GrenadeFire, Array: GrenadeFirePlayer,

Array: SoundAntidote, AmbienceSounds [MAX_AMBIENCE_SOUNDS], Array: SoundAmbience_01, Array: SoundAmbience_02, Array: SoundAmbience_03, Array: SoundAmbience_04, Array: SoundAmbience_05, Array: SoundAmbience_06, 

Array: SoundAmbience_07, Array: SoundAmbience_08, Array: SoundAmbience_09, Array: SoundAmbience_10, Array: SoundAmbienceDuration_01, Array: SoundAmbienceDuration_02, Array: SoundAmbienceDuration_03, Array: SoundAmbienceDuration_04, 

Array: SoundAmbienceDuration_05, Array: SoundAmbienceDuration_06, Array: SoundAmbienceDuration_07, Array:SoundAmbienceDuration_08, Array: SoundAmbienceDuration_09, Array: SoundAmbienceDuration_10, Array: SoundAmbienceMp3_01,

Array: SoundAmbienceMp3_02, Array: SoundAmbienceMp3_03, Array:SoundAmbienceMp3_04, Array: SoundAmbienceMp3_05, Array: SoundAmbienceMp3_06, Array: SoundAmbienceMp3_07, Array: SoundAmbienceMp3_08, Array: SoundAmbienceMp3_09, Array: SoundAmbienceMp3_10,

Array: PrimaryItems, Array: SecondaryItems, Array: AdditionalItems, ExtraCosts [EXTRA_WEAPONS_STARTID],

AmbienceFog, FogDensity [10], FogColor [12], SkyEnable, Array:SkyNames, Array: ZombieDecals, Array: ObjectiveEnts, Float: KnockbackWeaponPower[31] = { -1.0, ... }, 

Array: ZombieMissSlash, ForceConsistency, IsConnected [33], IsAlive [33], IsBot [33], CurrentWeapon [33], PlayerName [33] [32], Float: ZombieSpeed [33], Float: ZombieKnockback [33], ZombieClassName [33] [32], Float: CachedHumanSpeed, 

Float: CachedNemesisSpeed, Float: CachedAssassinSpeed, Float: CachedSurvivorSpeed, Float: CachedSniperSpeed, CachedLeapNemesis, Float: CachedLeapNemesisCooldown,

Zp_PlagueChance, 

Zp_NemesisHealth, Zp_AssassinHealth,

Zp_NemesisChance, Zp_AssassinChance, Zp_CustomNvg, Zp_HumanHealth, 

Zp_NemesisGravity, Zp_AssassinGravity, Zp_AmmoDamage, Zp_ZombieArmor, Zp_SurvivorPainFree, Zp_SniperPainFree,

Zp_NemesisPainFree, Zp_NemesisSpeed, Zp_AssassinPainFree, Zp_AssassinSpeed, Zp_SurvivorChance, Zp_SurvivorHealth, Zp_SurvivorSpeed, Zp_SniperChance, Zp_SniperHealth, Zp_SniperSpeed, Zp_HumanSpeed, 

Zp_SwarmChance, Zp_ArmageddonChance, Zp_ApocalypseChance, Zp_NightmareChance, Zp_ZombieBleeding, Zp_RemoveDoors, 

Zp_MultiChance, Zp_AmmoInfect,

Zp_KnockbackPower, Zp_FreezeDuration,

Zp_SurvivorGravity, Zp_SniperGravity,

Zp_HumanGravity, Zp_NightmareNemesisHealth, Zp_NightmareAssassinHealth,

Zp_FireDuration, Zp_FireDamage, Zp_ApocalypseNemesisHealth, Zp_ApocalypseSurvivorHealth, Zp_ApocalypseAssassinHealth, Zp_ApocalypseSniperHealth,

Zp_KnockbackDucking, Zp_KnockbackDamage, Zp_KnockbackZvel,

Zp_NvgGive, 

Zp_ZombiePainFree, Zp_FireSlowdown,

Zp_Knockback, Zp_HumanArmor,

Zp_KnockbackDistance, Zp_NemesisDamage, Zp_AssassinDamage,

Zp_LeapNemesis, Zp_LeapNemesisForce, Zp_LeapNemesisHeight, Zp_LeapNemesisCooldown,

Zp_NightmareSurvivorHealth, Zp_NightmareSniperHealth,

Zp_NemesisMinPlayers, Zp_AssassinMinPlayers, Zp_SurvivorMinPlayers, Zp_SniperMinPlayers,

Zp_SwarmMinPlayers, Zp_MultiMinPlayers, Zp_PlagueMinPlayers, Zp_ArmageddonMinPlayers, Zp_ApocalypseMinPlayers,

Zp_NightmareMinPlayers,

Zp_MadnessDuration, Zp_PlagueNemesisNum, Zp_PlagueNemesisHealth, Zp_PlagueSurvivorHealth,

Zp_SniperDamage, Zp_PlagueSurvivorNum,

Zp_SurvivorInfiniteAmmo, Zp_SniperInfiniteAmmo, Zp_NemesisKnockback, Zp_AssassinKnockback,

Zp_StartPacks, GetModels [ClassModels], ExtraItems [EXTRA_WEAPONS_STARTID],  

MsgSync_01, MsgSync_02, MsgSync_03, MsgSync_04;

#define is_user_valid_connected(%1) (1 <= %1 <= MaxPlayers && IsConnected[%1])

#define is_user_valid_alive(%1) (1 <= %1 <= MaxPlayers && IsAlive[%1])

public plugin_natives (  )
{
	register_native ( "zp_get_user_zombie", "native_get_user_zombie", 1 );
	register_native ( "zp_get_user_nemesis", "native_get_user_nemesis", 1 );
	register_native ( "zp_get_user_assassin", "native_get_user_assassin", 1 );
	register_native ( "zp_get_user_survivor", "native_get_user_survivor", 1 );
	register_native ( "zp_get_user_sniper", "native_get_user_sniper", 1 );
	register_native ( "zp_get_user_first_zombie", "native_get_user_first_zombie", 1 );
	register_native ( "zp_get_user_last_zombie", "native_get_user_last_zombie", 1 );
	register_native ( "zp_get_user_last_human", "native_get_user_last_human", 1 );
	register_native ( "zp_get_user_zombie_class", "native_get_user_zombie_class", 1 );
	register_native ( "zp_get_user_next_class", "native_get_user_next_class", 1 );
	register_native ( "zp_set_user_zombie_class", "native_set_user_zombie_class", 1 );
	register_native ( "zp_get_user_ammo_packs", "native_get_user_ammo_packs", 1 );
	register_native ( "zp_set_user_ammo_packs", "native_set_user_ammo_packs", 1 );
	register_native ( "zp_get_zombie_maxhealth", "native_get_zombie_maxhealth", 1 );
	register_native ( "zp_get_user_nightvision", "native_get_user_nightvision", 1 );
	register_native ( "zp_set_user_nightvision", "native_set_user_nightvision", 1 );
	register_native ( "zp_infect_user", "native_infect_user", 1 );
	register_native ( "zp_disinfect_user", "native_disinfect_user", 1 );
	register_native ( "zp_make_user_nemesis", "native_make_user_nemesis", 1 );
	register_native ( "zp_make_user_assassin", "native_make_user_assassin", 1 );
	register_native ( "zp_make_user_survivor", "native_make_user_survivor", 1 );
	register_native ( "zp_make_user_sniper", "native_make_user_sniper", 1 );
	register_native ( "zp_force_buy_extra_item", "native_force_buy_extra_item", 1 );
	register_native ( "zp_override_user_model", "native_override_user_model", 1 );
	
	register_native ( "zp_has_round_started", "native_has_round_started", 1 );
	register_native ( "zp_is_nemesis_round", "native_is_nemesis_round", 1 );
	register_native ( "zp_is_assassin_round", "native_is_assassin_round", 1 );
	register_native ( "zp_is_survivor_round", "native_is_survivor_round", 1 );
	register_native ( "zp_is_sniper_round", "native_is_sniper_round", 1 );
	register_native ( "zp_is_swarm_round", "native_is_swarm_round", 1 );
	register_native ( "zp_is_plague_round", "native_is_plague_round", 1 );
	register_native ( "zp_is_armageddon_round", "native_is_armageddon_round", 1 );
	register_native ( "zp_is_apocalypse_round", "native_is_apocalypse_round", 1 );
	register_native ( "zp_is_nightmare_round", "native_is_nightmare_round", 1 );
	register_native ( "zp_get_zombie_count", "native_get_zombie_count", 1 );
	register_native ( "zp_get_human_count", "native_get_human_count", 1 );
	register_native ( "zp_get_nemesis_count", "native_get_nemesis_count", 1 );
	register_native ( "zp_get_assassin_count", "native_get_assassin_count", 1 );
	register_native ( "zp_get_survivor_count", "native_get_survivor_count", 1 ); 
	register_native ( "zp_get_sniper_count", "native_get_sniper_count", 1 );
	
	register_native ( "zp_register_extra_item", "native_register_extra_item", 1 );
	register_native ( "zp_register_zombie_class", "native_register_zombie_class", 1 );
	register_native ( "zp_get_extra_item_id", "native_get_extra_item_id", 1 );
	register_native ( "zp_get_zombie_class_id", "native_get_zombie_class_id", 1 );
}

public plugin_precache (  )
{
	precache_sound ( "fvox/flatline.wav" );
	
	precache_sound ( "fvox/one.wav" );
	
	precache_sound ( "fvox/two.wav" );
	
	precache_sound ( "fvox/three.wav" );
	
	precache_sound ( "fvox/four.wav" );
	
	precache_sound ( "fvox/five.wav" );
	
	precache_sound ( "fvox/six.wav" );
	
	precache_sound ( "fvox/seven.wav" );
	
	precache_sound ( "fvox/eight.wav" );
	
	precache_sound ( "fvox/nine.wav" );
	
	precache_sound ( "fvox/ten.wav" );
	
	ModelHuman = ArrayCreate(32, 1);
	
	ModelNemesis = ArrayCreate(32, 1);
	
	ModelAssassin = ArrayCreate(32, 1);
	
	ModelSurvivor = ArrayCreate(32, 1);
	
	ModelSniper = ArrayCreate(32, 1);
	
	ModelOwnerHuman = ArrayCreate(32, 1);
	
	ModelAdminHuman = ArrayCreate ( 32, 1 );
	
	SoundWinZombies = ArrayCreate(64, 1);
	
	SoundWinHumans = ArrayCreate(64, 1);
	
	SoundWinNoOne = ArrayCreate(64, 1);
	
	ZombieInfect = ArrayCreate(64, 1);
	
	ZombiePain = ArrayCreate(64, 1);
	
	NemesisPain = ArrayCreate(64, 1);
	
	AssassinPain = ArrayCreate(64, 1);
	
	ZombieDie = ArrayCreate(64, 1);
	
	ZombieFall = ArrayCreate(64, 1);
	
	ZombieMissSlash = ArrayCreate(64, 1);
	
	ZombieMissWall = ArrayCreate(64, 1);
	
	ZombieHitNormal = ArrayCreate(64, 1);
	
	ZombieHitStab = ArrayCreate(64, 1);
	
	ZombieIdle = ArrayCreate(64, 1);
	
	ZombieIdleLast = ArrayCreate(64, 1);
	
	ZombieMadness = ArrayCreate(64, 1);
	
	SoundNemesis = ArrayCreate(64, 1);
	
	SoundAssassin = ArrayCreate(64, 1);
	
	SoundSurvivor = ArrayCreate(64, 1);
	
	SoundSniper = ArrayCreate(64, 1);
	
	SoundSwarm = ArrayCreate(64, 1);
	
	SoundMulti = ArrayCreate(64, 1);
	
	SoundPlague = ArrayCreate(64, 1);
	
	SoundArmageddon = ArrayCreate(64, 1);
	
	SoundApocalypse = ArrayCreate(64, 1);
	
	SoundNightmare = ArrayCreate(64, 1);
	
	GrenadeInfect = ArrayCreate(64, 1);
	
	GrenadeInfectPlayer = ArrayCreate(64, 1);
	
	GrenadeFire = ArrayCreate(64, 1);
	
	GrenadeFirePlayer = ArrayCreate(64, 1);
	
	GrenadeFrost = ArrayCreate(64, 1);
	
	GrenadeFrostPlayer = ArrayCreate(64, 1);
	
	GrenadeFrostBreak = ArrayCreate(64, 1);
	
	GrenadeExplode = ArrayCreate(64, 1);
	
	SoundAntidote = ArrayCreate(64, 1);
	
	SoundAmbience_01 = ArrayCreate(64, 1);
	
	SoundAmbience_02 = ArrayCreate(64, 1);
	
	SoundAmbience_03 = ArrayCreate(64, 1);
	
	SoundAmbience_04 = ArrayCreate(64, 1);
	
	SoundAmbience_05 = ArrayCreate(64, 1);
	
	SoundAmbience_06 = ArrayCreate(64, 1);
	
	SoundAmbience_07 = ArrayCreate(64, 1);
	
	SoundAmbience_08 = ArrayCreate(64, 1);
	
	SoundAmbience_09 = ArrayCreate(64, 1);
	
	SoundAmbience_10 = ArrayCreate(64, 1);
	
	SoundAmbienceDuration_01 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_02 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_03 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_04 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_05 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_06 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_07 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_08 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_09 = ArrayCreate(1, 1);
	
	SoundAmbienceDuration_10 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_01 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_02 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_03 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_04 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_05 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_06 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_07 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_08 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_09 = ArrayCreate(1, 1);
	
	SoundAmbienceMp3_10 = ArrayCreate(1, 1);
	
	PrimaryItems = ArrayCreate ( 32, 1 );
	
	SecondaryItems = ArrayCreate ( 32, 1 );
	
	AdditionalItems = ArrayCreate(32, 1);
	
	SkyNames = ArrayCreate(32, 1);

	ZombieDecals = ArrayCreate(1, 1);
	
	ObjectiveEnts = ArrayCreate(32, 1);
	
	ExtraItemName_01 = ArrayCreate(32, 1);
	
	ExtraItemCost_01 = ArrayCreate(1, 1);
	
	ExtraItemTeam_01 = ArrayCreate(1, 1);
	
	ExtraItemRealName = ArrayCreate(32, 1);
	
	ExtraItemName_02 = ArrayCreate(32, 1);
	
	ExtraItemCost_02 = ArrayCreate(1, 1);
	
	ExtraItemTeam_02 = ArrayCreate(1, 1);
	
	ExtraItemNew = ArrayCreate(1, 1);
	
	ZClassName_01 = ArrayCreate(32, 1);
	
	ZClassInfo_01 = ArrayCreate(32, 1);
	
	ZClassModelsStart_01 = ArrayCreate(1, 1);
	
	ZClassModelSend_01 = ArrayCreate(1, 1);
	
	ZClassPlayerModel_01 = ArrayCreate(32, 1);
	
	ZClassModelIndex_01 = ArrayCreate(1, 1);
	
	ZClassClawModel_01 = ArrayCreate(32, 1);
	
	ZClassHealth_01 = ArrayCreate(1, 1);
	
	ZClassSpeed_01 = ArrayCreate(1, 1);
	
	ZClassGravity_01 = ArrayCreate(1, 1);
	
	ZClassKnockback_01 = ArrayCreate(1, 1);
	
	ZClassRealName = ArrayCreate(32, 1);
	
	ZClassName_02 = ArrayCreate(32, 1);
	
	ZClassInfo_02 = ArrayCreate(32, 1);
	
	ZClassModelsStart_02 = ArrayCreate(1, 1);
	
	ZClassModelSend_02 = ArrayCreate(1, 1);
	
	ZClassPlayerModel_02 = ArrayCreate(32, 1);
	
	ZClassModelIndex_02 = ArrayCreate(1, 1);
	
	ZClassClawModel_02 = ArrayCreate(32, 1);
	
	ZClassHealth_02 = ArrayCreate(1, 1);
	
	ZClassSpeed_02 = ArrayCreate(1, 1);
	
	ZClassGravity_02 = ArrayCreate(1, 1);
	
	ZClassKnockback_02 = ArrayCreate(1, 1);
	
	ZClassNew = ArrayCreate(1, 1);
	
	ArraysCreated = true;

	LoadCustomizationFromFiles (  );
	
	new i, Buffer [100];
	
	native_register_item ( "NightVision (single round)", ExtraCosts [EXTRA_NVISION], ZP_TEAM_HUMAN );
	
	native_register_item ( "Explosion Nade", ExtraCosts [EXTRA_EXPLOSION_NADE], ZP_TEAM_HUMAN );
	
	native_register_item ( "Napalm Nade", ExtraCosts [EXTRA_NAPALM_NADE], ZP_TEAM_HUMAN );
	
	native_register_item ( "Frost Nade", ExtraCosts [EXTRA_FROST_NADE], ZP_TEAM_HUMAN );
	
	native_register_item ( "AWP Magnum Sniper", ExtraCosts [EXTRA_AWP_MAGNUM_SNIPER], ZP_TEAM_HUMAN );
	
	native_register_item ( "M249 Para Machinegun", ExtraCosts [EXTRA_M249_PARA_MACHINEGUN], ZP_TEAM_HUMAN );
	
	native_register_item ( "SG550 Auto-Sniper", ExtraCosts [EXTRA_SG550_AUTO_SNIPER], ZP_TEAM_HUMAN );
	
	native_register_item ( "G3SG1 Auto-Sniper", ExtraCosts [EXTRA_G3SG1_AUTO_SNIPER], ZP_TEAM_HUMAN );
	
	native_register_item ( "Jetpack+Bazooka", ExtraCosts [EXTRA_JETPACK], ZP_TEAM_HUMAN );
	
	native_register_item ( "Unlimited Clip", ExtraCosts [EXTRA_UNLIMITEDCLIP], ZP_TEAM_HUMAN );
	
	native_register_item ( "Armura (100)", ExtraCosts [EXTRA_ARMOR_100], ZP_TEAM_HUMAN );
	
	native_register_item ( "Armura (200)", ExtraCosts [EXTRA_ARMOR_200], ZP_TEAM_HUMAN );
	
	native_register_item ( "Multijump +1", ExtraCosts [EXTRA_MULTIJUMP], ZP_TEAM_HUMAN );
	
	native_register_item ( "Cumpara Tryder", ExtraCosts [EXTRA_TRYDER], ZP_TEAM_HUMAN );
	
	native_register_item ( "Cumpara Survivor", ExtraCosts [EXTRA_SURVIVOR], ZP_TEAM_HUMAN );
	
	native_register_item ( "Cumpara Sniper", ExtraCosts [EXTRA_SNIPER], ZP_TEAM_HUMAN );
	
	native_register_item ( "Cumpara Nemesis", ExtraCosts [EXTRA_NEMESIS], ZP_TEAM_HUMAN );
	
	native_register_item ( "Cumpara Assassin", ExtraCosts [EXTRA_ASSASSIN], ZP_TEAM_HUMAN );
	
	native_register_item ( "T-Virus Antidote", ExtraCosts [EXTRA_ANTIDOTE], ZP_TEAM_ZOMBIE );
	
	native_register_item ( "Zombie Madness", ExtraCosts [EXTRA_MADNESS], ZP_TEAM_ZOMBIE );
	
	native_register_item ( "Infection Bomb", ExtraCosts [EXTRA_INFECTIONBOMB], ZP_TEAM_ZOMBIE );
	
	native_register_item ( "Knife Blink", ExtraCosts [EXTRA_KNIFEBLINK], ZP_TEAM_ZOMBIE );
	
	if ( ArraySize ( PrimaryItems ) == 0 )
	{
		for ( i = 0; i < sizeof GetPrimaryItems; i ++ )
			
			ArrayPushString ( PrimaryItems, GetPrimaryItems )
	}
	
	if ( ArraySize ( SecondaryItems ) == 0 )
	{
		for ( i = 0; i < sizeof GetSecondaryItems; i ++ )
			
			ArrayPushString ( SecondaryItems, GetSecondaryItems )
	}
	
	if ( ArraySize ( AdditionalItems ) == 0 )
	{
		for ( i = 0; i < sizeof GetAdditionalItems; i ++ )
			
			ArrayPushString ( AdditionalItems, GetAdditionalItems )
	}
	
	if ( ArraySize ( ObjectiveEnts ) == 0 )
	{
		for ( i = 0; i < sizeof GetObjectiveEnts; i ++ )
			
			ArrayPushString ( ObjectiveEnts, GetObjectiveEnts )
	}
	
	for ( i = 0; i < ArraySize ( ModelHuman ); i ++ )
	{
		ArrayGetString( ModelHuman, i, Buffer, charsmax ( Buffer ) );
		
		format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

		engfunc ( EngFunc_PrecacheModel, Buffer );
		
		if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
		if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
	}
	
	engfunc ( EngFunc_PrecacheModel, ModelVKnifeHuman );
	
	engfunc ( EngFunc_PrecacheModel, ModelVKnifeNemesis );
	
	engfunc ( EngFunc_PrecacheModel, ModelVKnifeAssassin );
	
	engfunc ( EngFunc_PrecacheModel, ModelVxm1014Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelPxm1014Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelVak47Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelPak47Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelVm4a1Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelPm4a1Survivor );
	
	engfunc ( EngFunc_PrecacheModel, ModelVawpSniper );
	
	engfunc ( EngFunc_PrecacheModel, ModelPawpSniper );       
	
	engfunc ( EngFunc_PrecacheModel, ModelGrenadeInfect );
	
	engfunc ( EngFunc_PrecacheModel, ModelGrenadeExplode );
	
	engfunc ( EngFunc_PrecacheModel, ModelGrenadeFire );
	
	engfunc ( EngFunc_PrecacheModel, ModelGrenadeFrost );
	
	engfunc ( EngFunc_PrecacheModel, ModelTripMine );
	
	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_ACTIVATE );
	
	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_CHARGE );
	
	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_DEPLOY );

	TrailSpr = engfunc ( EngFunc_PrecacheModel, TRAIL_SPRITE );
	
	ExploSpr = engfunc ( EngFunc_PrecacheModel, RING_SPRITE );
	
	FlameSpr = engfunc ( EngFunc_PrecacheModel, FIRE_SPRITE );
	
	SmokeSpr = engfunc ( EngFunc_PrecacheModel, SMOKE_SPRITE );
	
	GlassSpr = engfunc ( EngFunc_PrecacheModel, GLASS_MODEL );
	
	HExplode = engfunc ( EngFunc_PrecacheModel, MODEL_EXPLODE );
	
	JPSmokeSpr = engfunc ( EngFunc_PrecacheModel, JP_SMOKE_SPRITE );
	
	xFireBallSpr = engfunc ( EngFunc_PrecacheModel, XFIREBALL_SPRITE );
	
	WhiteSpr = engfunc ( EngFunc_PrecacheModel, WHITE_SPRITE );

	engfunc ( EngFunc_PrecacheSound, SOUND_EXPLODE );    	   
	
	engfunc ( EngFunc_PrecacheModel, RocketModel );
	
	precache_model ( "models/p_egon.mdl" );

	precache_model ( "models/v_egon.mdl" );

	precache_model ( "models/w_egon.mdl" );
	
	for ( i = 0; i < ArraySize ( SoundWinZombies ); i ++ )
	{
		ArrayGetString ( SoundWinZombies, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( SoundWinHumans ); i ++ )
	{
		ArrayGetString ( SoundWinHumans, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( SoundWinNoOne ); i ++ )
	{
		ArrayGetString ( SoundWinNoOne, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieInfect ); i ++ )
	{
		ArrayGetString ( ZombieInfect, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	

	for ( i = 0; i < ArraySize ( ZombiePain ); i ++ )
	{
		ArrayGetString ( ZombiePain, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( NemesisPain ); i ++ )
	{
		ArrayGetString ( NemesisPain, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( AssassinPain ); i ++ )
	{
		ArrayGetString ( AssassinPain, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( ZombieDie ); i ++ )
	{
		ArrayGetString ( ZombieDie, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieFall ); i ++ )
	{
		ArrayGetString ( ZombieFall, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieMissSlash ); i ++ )
	{
		ArrayGetString ( ZombieMissSlash, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieMissWall ); i ++ )
	{
		ArrayGetString ( ZombieMissWall, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieHitNormal ); i ++ )
	{
		ArrayGetString ( ZombieHitNormal, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieHitStab ); i ++ )
	{
		ArrayGetString ( ZombieHitStab, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( ZombieIdle ); i ++ )
	{
		ArrayGetString ( ZombieIdle, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( ZombieIdleLast ); i ++ )
	{
		ArrayGetString ( ZombieIdleLast, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( ZombieMadness ); i ++ )
	{
		ArrayGetString ( ZombieMadness, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundNemesis ); i ++ )
	{
		ArrayGetString ( SoundNemesis, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundAssassin ); i ++ )
	{
		ArrayGetString ( SoundAssassin, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( SoundSurvivor ); i ++ )
	{
		ArrayGetString ( SoundSurvivor, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundSniper ); i ++ )
	{
		ArrayGetString ( SoundSniper, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundSwarm ); i ++ )
	{
		ArrayGetString ( SoundSwarm, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundMulti ); i ++ )
	{
		ArrayGetString ( SoundMulti, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundPlague ); i ++ )
	{
		ArrayGetString ( SoundPlague, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundArmageddon ); i ++ )
	{
		ArrayGetString ( SoundArmageddon, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundApocalypse ); i ++ )
	{
		ArrayGetString ( SoundApocalypse, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( SoundNightmare ); i ++ )
	{
		ArrayGetString ( SoundNightmare, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( GrenadeInfect ); i ++ )
	{
		ArrayGetString ( GrenadeInfect, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( GrenadeInfectPlayer ); i ++ )
	{
		ArrayGetString ( GrenadeInfectPlayer, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( GrenadeFire ); i ++ )
	{
		ArrayGetString ( GrenadeFire, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( GrenadeFirePlayer ); i ++ )
	{
		ArrayGetString ( GrenadeFirePlayer, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( GrenadeFrost ); i ++ )
	{
		ArrayGetString ( GrenadeFrost, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( GrenadeFrostPlayer ); i ++ )
	{
		ArrayGetString ( GrenadeFrostPlayer, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	for ( i = 0; i < ArraySize ( GrenadeFrostBreak ); i ++ )
	{
		ArrayGetString ( GrenadeFrostBreak, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( GrenadeExplode ); i ++ )
	{
		ArrayGetString ( GrenadeExplode, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}
	
	for ( i = 0; i < ArraySize ( SoundAntidote ); i ++ )
	{
		ArrayGetString ( SoundAntidote, i, Buffer, charsmax ( Buffer ) );
		
		engfunc ( EngFunc_PrecacheSound, Buffer );
	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_01 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_01, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_01, i ) )
			{
				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	
	if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_02 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_02, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_02, i ) )
			{
				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_03 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_03, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_03, i ) )
			{
				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_04 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_04, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_04, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_05 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_05, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_05, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_06 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_06, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_06, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_07 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_07, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_07, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_08 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_08, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_08, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds[AMBIENCE_SOUNDS_APOCALYPSE] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_09 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_09, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_09, i ) )
			{
				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] )
	{
		for ( i = 0; i < ArraySize ( SoundAmbience_10 ); i ++ ) 
		{
			ArrayGetString ( SoundAmbience_10, i, Buffer, charsmax ( Buffer ) );
			
			if ( ArrayGetCell ( SoundAmbienceMp3_10, i ) )
			{
				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );
				
				engfunc ( EngFunc_PrecacheGeneric, Buffer );
			}
			else
			{
				engfunc ( EngFunc_PrecacheSound, Buffer );	
			}
		}
	}
	
	engfunc ( EngFunc_PrecacheSound, SoundBuyAmmo );
	
	engfunc ( EngFunc_PrecacheSound, SoundArmorHit );
	
	engfunc ( EngFunc_PrecacheSound, SoundRocket );
	
	engfunc ( EngFunc_PrecacheSound, SoundBuyJetpack );
	
	engfunc ( EngFunc_PrecacheSound, SoundGetRocket );
	
	engfunc ( EngFunc_PrecacheSound, SoundJetpack );
	
	engfunc ( EngFunc_PrecacheSound, SoundJetpackBlow );
	
	new Entity; 
	
	Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "hostage_entity" ) );
	
	if ( pev_valid ( Entity ) )
	{
		engfunc ( EngFunc_SetOrigin, Entity, Float: {8192.0,8192.0,8192.0} );
		
		dllfunc ( DLLFunc_Spawn, Entity );
	}
	
	if ( AmbienceFog )
	{
		Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "env_fog" ) );
		
		if ( pev_valid ( Entity ) )
		{
			fm_set_kvd ( Entity, "density", FogDensity, "env_fog" );
			
			fm_set_kvd ( Entity, "rendercolor", FogColor, "env_fog" );
		}
	}
	
	fwSpawn = register_forward ( FM_Spawn, "fmSpawn" );
	
	fwPrecacheSound = register_forward ( FM_PrecacheSound, "fmPrecacheSound" );
}

public plugin_init (  ) 
{
	register_plugin ( PLUGIN, VERSION, "ZP Dev Team" );
	
	if ( !iZClass ) set_fail_state ( "No zombie classes loaded!" );
	
	register_cvar ( "zp_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY );

	set_cvar_string ( "zp_version", VERSION );
	
	/* -------------- |   Game Menu   | ------------ */ 
	
	register_menu ( "Game Menu", KEYS_GAMEMENU, "MenuGame" );
	
	register_menu ( "Buy Menu 1", KEYS_BUYMENU, "MenuBuy_01" );
	
	register_menu ( "Buy Menu 2", KEYS_BUYMENU, "MenuBuy_02" );
	
	/* ------------- | Change Commands | ----------- */
	
	register_clcmd ( "nightvision", "cmdNightVision" );
	
	register_clcmd ( "drop", "cmdDrop" );
	
	register_clcmd ( "chooseteam", "cmdChangeTeam" );
	
	register_clcmd ( "jointeam", "cmdChangeTeam" );
	
	/* ------------- |  Buy TripMine  | -------------- */
	
	register_clcmd ( "say", "SayCommands" );
	
	register_clcmd ( "createlaser", "PlantTripMine" );
	
	register_clcmd ( "removelaser", "TakeTripMine" );
	
	register_think ( MINE_CLASSNAME, "fwThinkMine" );
	
	TripMineGlow = register_cvar ( "zp_tripmine_glow", "1" );
	
	TripMineHealth = register_cvar ( "zp_tripmine_health", "800" )
	
	/* ------------- | Block Commands | -------------- */

        register_clcmd ( "radio1", "cmdNotAllowed" );	

        register_clcmd ( "radio2", "cmdNotAllowed" );

        register_clcmd ( "radio3", "cmdNotAllowed" );

	register_clcmd ( "fullupdate","cmdNotAllowed" );
	
	register_clcmd ( "cl_setautobuy", "cmdNotAllowed" );
	
	register_clcmd ( "cl_autobuy", "cmdNotAllowed" );
	
	register_clcmd ( "cl_setrebuy", "cmdNotAllowed" );
	
	register_clcmd ( "cl_rebuy", "cmdNotAllowed" ) ;
	
	register_clcmd ( "autobuy", "cmdNotAllowed" );
	
	/* ------------- | Admin Commands | -------------- */
	
	register_clcmd ( "zp_tryder", "cmdMadeTryder" );
	
	register_clcmd ( "zp_human", "cmdMadeHuman" );
	
	register_clcmd ( "zp_survivor", "cmdMadeSurvivor" );
	
	register_clcmd ( "zp_sniper", "cmdMadeSniper" );
	
	register_clcmd ( "zp_zombie", "cmdMadeZombie" );
	
	register_clcmd ( "zp_nemesis", "cmdMadeNemesis" );
	
	register_clcmd ( "zp_assassin", "cmdMadeAssassin" );
	
	register_clcmd ( "zp_respawn", "cmdRespawn" );
	
	register_clcmd ( "mode_multi", "cmdMulti" );
	
	register_clcmd ( "mode_plague", "cmdPlague" );
	
	register_clcmd ( "mode_swarm", "cmdSwarm" );
	
	register_clcmd ( "mode_armageddon", "cmdArmageddon" );
	
	register_clcmd ( "mode_nightmare", "cmdNightmare" );
	
	register_clcmd ( "mode_apocalypse", "cmdApocalypse" );
	
	/* --------------- | Events & LogEvents | -------------- */
	
	register_event ( "DeathMsg", "evDeathMsg", "a" );	
	
	register_event ( "StatusValue", "evShowStatus", "be", "1=2", "2!0" );
	
	register_event ( "StatusValue", "evHideStatus", "be", "1=1", "2=0" );
	
	register_event ( "StatusValue", "ShowStatus", "be", "1=2", "2!0" );
	
	register_event ( "StatusValue", "HideStatus", "be", "1=1", "2=0" );

         register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );	

	register_logevent ( "leRoundStart", 2, "1=Round_Start" );

	register_logevent ( "leRoundEnd", 2, "1=Round_End" );
	
	register_event ( "AmmoX", "evAmmoX", "be" );
	
	if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] || AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] || AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] || AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] || AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] || 
	
	AmbienceSounds [AMBIENCE_SOUNDS_SWARM] || AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] || AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] || AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] || AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] )
	
	register_event ( "30", "evIntermission", "a" );
	
	register_event ( "CurWeapon", "CheckModels", "be" );
	
	/* --------------- | Ham Forwards | --------------- */
	
	RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );

	RegisterHam ( Ham_Killed, "player", "fwPlayerKilled" );

	RegisterHam ( Ham_Killed, "player", "fwPlayerKilledPost", 1 );

	RegisterHam ( Ham_TakeDamage, "player", "fwTakeDamage" );

	RegisterHam ( Ham_TakeDamage, "player", "fwTakeDamagePost", 1 );

	RegisterHam ( Ham_TraceAttack, "player", "fwTraceAttack" );

	RegisterHam ( Ham_Use, "func_tank", "fwUseStationary" );

	RegisterHam ( Ham_Use, "func_tankmortar", "fwUseStationary" );

	RegisterHam ( Ham_Use, "func_tankrocket", "fwUseStationary" );

	RegisterHam ( Ham_Use, "func_tanklaser", "fwUseStationary" );

	RegisterHam ( Ham_Use, "func_tank", "fwUseStationaryPost", 1 );

	RegisterHam ( Ham_Use, "func_tankmortar", "fwUseStationaryPost", 1 );

	RegisterHam ( Ham_Use, "func_tankrocket", "fwUseStationaryPost", 1 );

	RegisterHam ( Ham_Use, "func_tanklaser", "fwUseStationaryPost", 1 );

	RegisterHam ( Ham_Use, "func_pushable", "fwUsePushable" );

	RegisterHam ( Ham_Touch, "weaponbox", "fwTouchWeapon" );

	RegisterHam ( Ham_Touch, "armoury_entity", "fwTouchWeapon" );

	RegisterHam ( Ham_Touch, "weapon_shield", "fwTouchWeapon" );

	RegisterHam ( Ham_AddPlayerItem, "player", "fwAddPlayerItem" );
	
	RegisterHam ( Ham_Think, "grenade", "fwThinkGrenade" );
	
	for ( new i = 1; i < sizeof WEAPONENTNAMES; i++ ) if ( WEAPONENTNAMES  [0] ) RegisterHam ( Ham_Item_Deploy, WEAPONENTNAMES , "fwItemDeployPost", 1 );
	
	register_forward ( FM_SetClientKeyValue, "fwSetClientKeyValue" );
	
	register_forward ( FM_ClientDisconnect, "fwClientDisconnect" );

	register_forward ( FM_ClientDisconnect, "fwClientDisconnectPost", 1 );

	register_forward ( FM_ClientKill, "fwClientKill" );

	register_forward ( FM_EmitSound, "fwEmitSound" );
	
	register_forward ( FM_ClientUserInfoChanged, "fwClientUserInfoChanged" );

	register_forward ( FM_GetGameDescription, "fwGetGameDescription" );

	register_forward ( FM_SetModel, "fwSetModel" );
	
	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink" );
	
	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink_01" );
	
	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink_02" );
	
	register_forward ( FM_PlayerPreThink, "fmPlayerPreThink" );
	
	register_forward ( FM_TraceLine, "fwTraceLinePost", 1 );
	
	register_forward ( FM_StartFrame, "fwStartFrame" );
	
	register_forward ( FM_PlayerPostThink, "fwPlayerPostThink" );
	
	unregister_forward ( FM_Spawn, fwSpawn );

	unregister_forward ( FM_PrecacheSound, fwPrecacheSound );
	
		/* --------------- | Message Hook | --------------- */
	
	register_message ( get_user_msgid ( "CurWeapon" ), "MessageCurWeapon" );

	register_message ( get_user_msgid ( "Money" ), "MessageMoney" );

	register_message ( get_user_msgid ( "Health" ), "MessageHealth" );

	register_message ( get_user_msgid ( "ScreenFade" ), "MessageScreenFade" );

	register_message ( get_user_msgid ( "NVGToggle" ), "MessageNvgToggle" );

	register_message ( get_user_msgid ( "WeapPickup" ), "MessageWeaponPickup" );

	register_message ( get_user_msgid ( "AmmoPickup" ), "MessageAmmoPickup" );

	register_message ( get_user_msgid ( "Scenario" ), "MessageScenario" );

	register_message ( get_user_msgid ( "HostagePos" ), "MessageHostagePos" );

	register_message ( get_user_msgid ( "TextMsg" ), "MessageTextMsg" );

	register_message ( get_user_msgid ( "SendAudio" ), "MessageSendAudio" );

	register_message ( get_user_msgid ( "TeamScore" ), "MessageTeamScore" );

	register_message ( get_user_msgid ( "TeamInfo" ), "MessageTeamInfo" );
	
	/* ------------- | Global Cvar's | -------------- */
	
	Zp_JetpackSpeed = register_cvar ( "zp_jp_forward_speed", "350.0" );
	
	Zp_JetpackUpSpeed = register_cvar ( "zp_jp_up_speed", "35.0" );
	
	Zp_JetpackAccelerate = register_cvar ( "zp_jp_accelerate", "100.0" );

	Zp_RocketDelay = register_cvar ( "zp_jp_rocket_delay","12.0" );
	
	Zp_RocketSpeed = register_cvar ( "zp_jp_rocket_speed","1700" );

	Zp_RocketDamage = register_cvar ( "zp_jp_rocket_damage","950" );

	Zp_DamageRange = register_cvar ( "zp_jp_damage_radius","600" );	

	Zp_FlyMaxEngery = register_cvar ( "zp_jp_max_engery", "100" );

	Zp_FlyEngery = register_cvar ( "zp_jp_engery", "10" );

	Zp_RegainEnergy = register_cvar ( "zp_jp_regain_energy", "3" );

	Zp_CalTime = register_cvar ( "zp_jp_energy_cal", "1.0" );

	Zp_TryderHealth = register_cvar ( "zp_tryder_health", "666" );
	
	Zp_TryderArmor = register_cvar ( "zp_tryder_armor", "666" );

	Zp_PlagueChance = register_cvar ( "zp_plague_change", "180" );
	
	Zp_NemesisHealth = register_cvar ( "zp_nemesis_health", "150000" );
	
	Zp_AssassinHealth = register_cvar ( "zp_assassin_health", "35000" ); 
	
	Zp_NemesisChance = register_cvar ( "zp_nemesis_change", "40" );
	
	Zp_AssassinChance = register_cvar ( "zp_assassin_change", "50" );
	
	Zp_CustomNvg = register_cvar ( "zp_custom_nvg", "1" );
	
	Zp_HumanHealth = register_cvar ( "zp_human_health", "150" );
	
	Zp_NemesisGravity = register_cvar ( "zp_nemesis_gravity", "0.5" );
	
	Zp_AssassinGravity = register_cvar ( "zp_assassin_gravity", "0.4" );
	
	Zp_AmmoDamage = register_cvar ( "zp_ammo_damage", "500" );
	
	Zp_ZombieArmor = register_cvar ( "zp_zombie_armor", "0.75" );
	
	Zp_SurvivorPainFree = register_cvar ( "zp_survivor_pain", "1" );
	
	Zp_SniperPainFree = register_cvar ( "zp_sniper_pain", "1" );
	
	Zp_NemesisPainFree = register_cvar ( "zp_nemesis_pain", "1" );
	
	Zp_NemesisSpeed = register_cvar ( "zp_nemesis_speed", "250" );
	
	Zp_AssassinPainFree = register_cvar ( "zp_assassin_pain", "1" );
	
	Zp_AssassinSpeed = register_cvar ( "zp_assassin_speed", "600" );
	
	Zp_SurvivorChance = register_cvar ( "zp_survivor_change", "200" );
	
	Zp_SurvivorHealth = register_cvar ( "zp_survivor_health", "5000" );
	
	Zp_SurvivorSpeed = register_cvar ( "zp_survivor_speed", "230" );
	
	Zp_SniperChance = register_cvar ( "zp_sniper_change", "200" );
	
	Zp_SniperHealth = register_cvar ( "zp_sniper_health", "3000" );
	
	Zp_SniperSpeed = register_cvar ( "zp_sniper_speed", "235" );
	
	Zp_HumanSpeed = register_cvar ( "zp_human_speed", "240" ); 
	
	Zp_SwarmChance = register_cvar ( "zp_swarm_change", "150" );
	
	Zp_ArmageddonChance = register_cvar ( "zp_armageddon_change", "300" );
	
	Zp_ApocalypseChance = register_cvar ( "zp_apocalypse_change", "470" );
	
	Zp_NightmareChance = register_cvar ( "zp_nightmare_change", "190" );
	
	Zp_ZombieBleeding = register_cvar ( "zp_zombie_bleeding", "0" );
	
	Zp_RemoveDoors = register_cvar ( "zp_remove_doors", "1" );
	
	Zp_MultiChance = register_cvar ( "zp_multiple_change", "150" );
	
	Zp_AmmoInfect = register_cvar ( "zp_ammo_infect", "1" );
	
	Zp_KnockbackPower = register_cvar ( "zp_knockback_power", "1" );
	
	Zp_FreezeDuration = register_cvar ( "zp_freeze_duration", "3" );
	
	Zp_SurvivorGravity = register_cvar ( "zp_survivor_gravity", "1.0" );
	
	Zp_SniperGravity = register_cvar ( "zp_sniper_gravity", "1.0" );
	
	Zp_HumanGravity = register_cvar ( "zp_human_gravity", "1.0" );
	
	Zp_FireDuration = register_cvar ( "zp_fire_duration", "4" );
	
	Zp_FireDamage = register_cvar ( "zp_fire_damage", "20" );
	
	Zp_ApocalypseNemesisHealth = register_cvar ( "zp_apocalypse_nemesis_health", "40000" );
	
	Zp_ApocalypseSurvivorHealth = register_cvar ( "zp_apocalypse_surivor_health", "10000" );
	
	Zp_ApocalypseAssassinHealth = register_cvar ( "zp_apocalypse_assassin_health", "35000" );
	
	Zp_ApocalypseSniperHealth = register_cvar ( "zp_apocalypse_sniper_health", "8000" );
	
	Zp_KnockbackDucking = register_cvar ( "zp_knockback_ducking", "0.25" );
	
	Zp_KnockbackDamage = register_cvar ( "zp_knockback_damage", "1" );
	
	Zp_KnockbackZvel = register_cvar ( "zp_knockback_zvel", "0" );

	Zp_NvgGive = register_cvar ( "zp_nvg_give", "1" );

	Zp_ZombiePainFree = register_cvar ( "zp_zombie_pain", "1" );
	
	Zp_FireSlowdown = register_cvar ( "zp_fire_slowdown", "1" );
	
	Zp_Knockback  = register_cvar ( "zp_knockback", "1" ); 
	
	Zp_HumanArmor = register_cvar ( "zp_human_armor", "1" );
	
	Zp_KnockbackDistance = register_cvar ( "zp_knockback_distange", "500" );
	
	Zp_NemesisDamage = register_cvar ( "zp_nemesis_damage", "250" );
	
	Zp_AssassinDamage = register_cvar ( "zp_assassin_damage", "250" );
	
	Zp_LeapNemesis = register_cvar ( "zp_leap_nemesis", "1" );
	
	Zp_LeapNemesisForce = register_cvar ( "zp_leap_nemesis_force", "500" );
	
	Zp_LeapNemesisHeight = register_cvar ( "zp_leap_nemesis_height", "300" );
	
	Zp_LeapNemesisCooldown = register_cvar ( "zp_leap_nemesis_cooldown", "1.0" );
	
	Zp_NightmareNemesisHealth = register_cvar ( "zp_nightmare_nemesis_health", "40000" );
	
	Zp_NightmareAssassinHealth = register_cvar ( "zp_nightmare_assassin_health", "35000" );
	
	Zp_NightmareSurvivorHealth = register_cvar ( "zp_nightmare_survivor_health", "10000" );
	
	Zp_NightmareSniperHealth = register_cvar ( "zp_nightmare_sniper_health", "8000" );

	Zp_NemesisMinPlayers = register_cvar ( "zp_nemesis_minplayers", "1" );
	
	Zp_AssassinMinPlayers = register_cvar ( "zp_assassin_minplayers", "1" );
	
	Zp_SurvivorMinPlayers = register_cvar ( "zp_survivor_minplayers", "1" );
	
	Zp_SniperMinPlayers = register_cvar ( "zp_sniper_minplayers", "1" );

	Zp_SwarmMinPlayers = register_cvar ( "zp_swarm_minplayers", "4" );
	
	Zp_MultiMinPlayers = register_cvar ( "zp_multiple_minplayers", "6" );
	
	Zp_PlagueMinPlayers = register_cvar ( "zp_plague_minplayers", "8" );
	
	Zp_ArmageddonMinPlayers = register_cvar ( "zp_armageddon_minplayers", "6" );
	
	Zp_ApocalypseMinPlayers = register_cvar ( "zp_apocalypse_minplayers", "6" );

	Zp_NightmareMinPlayers = register_cvar ( "zp_nightmare_minplayers", "6" );
	
	Zp_MadnessDuration = register_cvar ( "zp_madness_duration", "5.0" );
	
	Zp_PlagueNemesisNum = register_cvar ( "zp_plague_nemesis_num", "2" );
	
	Zp_PlagueNemesisHealth = register_cvar ( "zp_plague_nemesis_health", "50000" );
	
	Zp_PlagueSurvivorHealth = register_cvar ( "zp_plague_surivor_health", "8000" );
	
	Zp_SniperDamage = register_cvar ( "zp_sniper_damage", "4600" );
	
	Zp_PlagueSurvivorNum = register_cvar ( "zp_plague_survivor_num", "3" );
	
	Zp_SurvivorInfiniteAmmo = register_cvar ( "zp_survivor_infinite_ammo", "1" );
	
	Zp_SniperInfiniteAmmo = register_cvar ( "zp_sniper_infinite_ammo", "1" );
	
	Zp_NemesisKnockback = register_cvar ( "zp_nemesis_knockback", "0.07" );
	
	Zp_AssassinKnockback = register_cvar ( "zp_assassin_knockback", "0.07" );
	
	Zp_StartPacks = register_cvar ( "zp_start_packs", "30" );
	
	/* --------------- | Custom Forwards | --------------- */
	
	fwRoundStart = CreateMultiForward ( "zp_round_started", ET_IGNORE, FP_CELL, FP_CELL );

	fwRoundEnd = CreateMultiForward ( "zp_round_ended", ET_IGNORE, FP_CELL );

	fwUserInfectedPre = CreateMultiForward ( "zp_user_infected_pre", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL );

	fwUserInfectedPost = CreateMultiForward ( "zp_user_infected_post", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL );

	fwUserHumanizedPre = CreateMultiForward ( "zp_user_humanized_pre", ET_IGNORE, FP_CELL, FP_CELL );

	fwUserHumanizedPost = CreateMultiForward ( "zp_user_humanized_post", ET_IGNORE, FP_CELL, FP_CELL );

	fwUserInfectAttempt = CreateMultiForward ( "zp_user_infect_attempt", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL );

	fwUserHumanizeAttempt = CreateMultiForward ( "zp_user_humanize_attempt", ET_CONTINUE, FP_CELL, FP_CELL );

	fwExtraItemSelected = CreateMultiForward ( "zp_extra_item_selected", ET_CONTINUE, FP_CELL, FP_CELL );

	fwUserUnfrozen = CreateMultiForward ( "zp_user_unfrozen", ET_IGNORE, FP_CELL );

	fwUserLastZombie = CreateMultiForward ( "zp_user_last_zombie", ET_IGNORE, FP_CELL );

	fwUserLastHuman = CreateMultiForward ( "zp_user_last_human", ET_IGNORE, FP_CELL );
	
	/* --------------- | For Game Mode | --------------- */
	
	if ( SkyEnable )
	{
		new Sky [32]; ArrayGetString ( SkyNames, random_num ( 0, ArraySize ( SkyNames ) - 1 ), Sky, charsmax ( Sky ) );

		set_cvar_string ( "sv_skyname", Sky );
	}
	
	set_cvar_num ( "sv_skycolor_r", 0 );

	set_cvar_num ( "sv_skycolor_g", 0 );

	set_cvar_num ( "sv_skycolor_b", 0 );
	
	new MyMod [6]; get_modname ( MyMod, charsmax ( MyMod ) );

	if ( equal ( MyMod, "czero") ) CZero = 1;
	
	iSize = sizeof ( iCoords );	
	
	MsgSync_01 = CreateHudSyncObj (  );	
	
         MsgSync_02 = CreateHudSyncObj (  );
	 
	MsgSync_03 = CreateHudSyncObj (  );

         MsgSync_04 = CreateHudSyncObj (  );
	 
	MaxPlayers = get_maxplayers (  );
	
	DBSlot = MaxPlayers + 1;
}

public SayCommands ( id )
{
	new Args [64]; read_args ( Args, charsmax ( Args ) )
	
	remove_quotes ( Args );
	
	new Arg_01 [16], Arg_02 [32];
	
	argbreak ( Args, Arg_01, charsmax ( Arg_01 ), Arg_02, charsmax ( Arg_02 ) );
	
	if ( equal ( Arg_01, "/donate", 7 ) )
	
		cmdDonatePacks ( id, Arg_02 );
	
	else if ( equal ( Arg_01, "/lm" ) || equal ( Arg_01, "lm" ) )
	 
	         BuyTripMine ( id );
	
}

public cmdDonatePacks ( id, Arg [ ] )
{
	new To [32], Count [10];
	
	argbreak ( Arg, To, charsmax ( To ), Count, charsmax ( Count ) );
	
	if ( !To [0] || !Count [0] )
	{
		client_print_color ( id, print_team_grey, "%s Usage^4 :^3 '/donate (Name) (Packs)'", CHAT_PREFIX );
		
		return;
	}
	
	new Reciever = cmd_target ( id, To, ( CMDTARGET_ALLOW_SELF ) );
	
	if ( !Reciever || Reciever == id )
	{
		client_print_color ( id, print_team_grey, "%s Player^3 %s^1 has not been found on the server!", CHAT_PREFIX, To );
		
		return;
	}
	
	new PacksSender = AmmoPacks [id];
	
	new Packs;
	
	if ( equal ( Count, "all" ) )
	
		Packs = PacksSender;
	else
		Packs = str_to_num ( Count );
		
	if ( Packs <= 0 )
	{
		client_print_color ( id, print_team_default, "%s Wrong ammo quantity!", CHAT_PREFIX );
		
		return;
	}
	
	if ( PacksSender <= 0 && Packs > 0 )
	{
		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );
		
		return;
	}
	
	PacksSender -= Packs;
	
	if ( PacksSender < 0 )
	{
		Packs += PacksSender;
		
		PacksSender = 0;
		
	}
	
	AmmoPacks [Reciever] += Packs;
	
	UserTotalAmmo [Reciever] += Packs
	
	AmmoPacks [id] = PacksSender;
	
	client_print_color ( 0, print_team_grey, "%s^3 %s^1 gave^4 %d packs^1 to^3 %s", CHAT_PREFIX, PlayerName [id], Packs, PlayerName [Reciever] );
}

public client_PreThink ( id )
{
	if ( !IsAlive [id] || IsAssassin [id] ) return

	new Float: FallSpeed = 50.0 * -1.0;

	new Button = get_user_button ( id );
	
	if ( Button & IN_USE ) 
	{
		new Float: Velocity [3];
		
		entity_get_vector ( id, EV_VEC_velocity, Velocity );
		
		if ( Velocity [2] < 0.0 ) 
		{
			entity_set_int ( id, EV_INT_sequence, 3 );
			
			entity_set_int ( id, EV_INT_gaitsequence, 1 );
			
			entity_set_float ( id, EV_FL_frame, 1.0 );
			
			entity_set_float ( id, EV_FL_framerate, 1.0 );

			Velocity [2] = ( Velocity [2] + 40.0 < FallSpeed ) ? Velocity [2] + 40.0 : FallSpeed;
			
			entity_set_vector ( id, EV_VEC_velocity, Velocity );
		}
	}
}

public plugin_cfg (  )
{
	new Director [32]; get_configsdir ( Director, charsmax ( Director ) );
	
	server_cmd ( "exec %s/%s", Director, ZP_CONFIGURATION_FILE );
	
	ArraysCreated = false;
	
	SaveCustomization (  );

	set_task ( 0.5, "CacheCvars" );
	
	set_task ( 0.5, "evNewRound" );
	
	set_task ( 0.5, "leRoundStart" );
}

public client_damage ( iAttacker, iVictim, iDamage )
{
	if ( IsZombie [iAttacker] || IsNemesis [iAttacker] || IsAssassin [iAttacker] ) return;
	
	if ( ++ iPosition [iAttacker] == iSize ) iPosition [iAttacker] = 0;
	
	set_hudmessage ( 0, 40, 80, Float: iCoords [iPosition [iAttacker]] [0], Float: iCoords [iPosition [iAttacker]] [1], 0, 0.1, 2.5, 0.02, 0.02, -1 );
	
	ShowSyncHudMsg ( iAttacker, MsgSync_04, "%i", iDamage );
}

public cmdNotAllowed ( id ) return PLUGIN_HANDLED;

public zp_round_started ( Mode, id )
{
	remove_task ( id + TASK_HEALTH );

         if ( Mode == MODE_NEMESIS )
	{
	       if ( !ModeNemesis ) ModeNemesis = true;
		
                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );
	}
	else if ( Mode == MODE_ASSASSIN )
	{
	       if ( !ModeAssassin ) ModeAssassin = true;
		
                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );
	}
	else if ( Mode == MODE_SURVIVOR )
	{
	       if ( !ModeSurvivor ) ModeSurvivor = true;
		
                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );
	}
	else if ( Mode == MODE_SNIPER )
	{
	       if ( !ModeSniper ) ModeSniper = true;
		
                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );
	}
}
	
public ModeInformer ( id )
{
	id -= TASK_HEALTH;
	
	if ( is_user_alive ( id ) )
	{
		static HealthString [16]; AddCommas ( get_user_health ( id ), HealthString, charsmax ( HealthString ) );
		
		if ( IsNemesis [id] )
		{
			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Nemesis^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );
		}
		else if ( IsAssassin [id] )
		{
		        client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Assassin^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );
		}
		else if ( IsSurvivor [id] )
		{
			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Survivor^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );
		}
		else if ( IsSniper [id] )
		{
			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Sniper^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );
		}
	}
}	

public evDeathMsg (  )
{	
	new iPlayers [32], iHuman, iZombie;
	
	if ( ModeNemesis )
	{
		get_players ( iPlayers, iHuman, "ah" );
		
		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%d Human%s Remaining...", iHuman - 1, iHuman == 2 ? "" : "s" );
	}
	
	if ( ModeAssassin )
	{
		get_players ( iPlayers, iHuman, "ah" );
		
		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%d Human%s Remaining...", iHuman - 1, iHuman == 2 ? "" : "s" );
	}
	
	if ( ModeSurvivor )
	{
		get_players ( iPlayers, iZombie, "ah" );
		
		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%d Zombie%s Remaining...", iZombie - 1, iZombie == 2 ? "" : "s" );
	}
	
	if ( ModeSniper )
	{
		get_players ( iPlayers, iZombie, "ah" );
		
		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%d Zombie%s Remaining...", iZombie - 1, iZombie == 2 ? "" : "s" );
	}
}

public zp_round_ended (  )
{
	for ( new id = 1; id <= MaxPlayers; id ++ )

		if ( task_exists ( id ) ) remove_task ( id );
	
	if ( ModeNemesis ) ModeNemesis = false;
	
	if ( ModeAssassin ) ModeAssassin = false;
	
	if ( ModeSurvivor ) ModeSurvivor = false;
	
	if ( ModeSniper ) ModeSniper = false;
}

public evNewRound (  )
{
	/* ---------- | Remove Extra-Items | ---------- */
	
	for ( new id = 1; id <= MaxPlayers; id ++ ) 
	{
	         iBlinks [id] = 0;
		 
		Shot [id] = true
	
	         LastRocket [id] = iTime + 14.0; 
		 
		HasUnlimitedClip [id] = false; 
		
		MultiJumps [id] = false;
		
		IsTryder [id] = false;
	}

         RemoveJetpacks (  )
	
	remove_task ( TASK_ID );
	
	CountDown = 10 - 1;
	
	set_task ( 4.0, "CheckCountDown", TASK_ID );
	
	set_task ( 0.1, "RemoveStuff" );
	
	NewRound = true;
	
	EndRound = false;
	
	NemesisRound = false;
	
	AssassinRound = false;
	
	SurvivorRound = false;
	
	SniperRound = false;
	
	SwarmRound = false;
	
	ArmageddonRound = false;
	
	ApocalypseRound = false;
	
	NightmareRound = false;
	
	PlagueRound = false;
	
	ModeStarted = false;

	FreezeTime = true;	        
	
	remove_task ( TASK_WELCOMEMSG );
	
	set_task ( 1.0, "SendWelcomeMessage", TASK_WELCOMEMSG );

	
	remove_task ( TASK_MAKEZOMBIE );
	
	set_task ( 13.0, "MakeZombieTask", TASK_MAKEZOMBIE );
}
	

public CheckCountDown (  )
{	
	new DownSpeak [11] [] = 
	{ 
		"",
		"fvox/one.wav", 
		"fvox/two.wav", 
		"fvox/three.wav", 
		"fvox/four.wav", 
		"fvox/five.wav", 
		"fvox/six.wav", 
		"fvox/seven.wav", 
		"fvox/eight.wav", 
		"fvox/nine.wav",
		"fvox/ten.wav"
	};
	
	if ( CountDown > 1 )
	{ 
		//emit_sound ( 0, CHAN_VOICE, DownSpeak [CountDown - 1], 1.0, ATTN_NORM, 0, PITCH_NORM);
		
		client_cmd ( 0, "spk %s", DownSpeak [CountDown - 1] );
		
		set_hudmessage ( 179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);	
		
		if ( CountDown != 1 ) ShowSyncHudMsg ( 0, MsgSync_01, "Infection in %i", CountDown - 1 );
		
	}
	
	-- CountDown;
	
	if ( CountDown >= 1 )
	
	         set_task ( 1.0, "CheckCountDown", TASK_ID );
	else
		remove_task ( TASK_ID );
}

public evShowStatus ( id )
{
	if ( !IsBot [id] && IsConnected [id] ) 
	{
		static AimID; AimID = read_data ( 2 );
		
		if ( IsZombie [id] == IsZombie [AimID] )
		{
			static Class [ 32], Red, Green, Blue;
			
			if ( IsZombie [id] )
			{
				Red = 255;
				
				Green = 140;
				
				Blue = 40;
				
				if ( IsNemesis [AimID] )
					
					formatex ( Class, charsmax ( Class ), "Nemesis" );
				
				else if ( IsAssassin [AimID] )
					
					formatex ( Class, charsmax ( Class ), "Assassin" );
				else
					copy ( Class, charsmax ( Class ), ZombieClassName [id] );
			}
			else
			{
				Red = 20;
				
				Green = 135;
				
				Blue = 255;
				
				if ( IsSurvivor [AimID] )
				
					formatex ( Class, charsmax ( Class ), "Survivor");
				
				else if ( IsSniper [AimID] )
					formatex ( Class, charsmax ( Class ), "Sniper ");
				else
					formatex ( Class, charsmax ( Class ), "Human" );
			}
			
			
			static HealthString [16], ArmorString [16], PacksString [16];
			
			AddCommas ( pev ( AimID, pev_health ), HealthString, charsmax ( HealthString ) );
			
			AddCommas ( pev ( AimID, pev_armorvalue ), ArmorString, charsmax ( ArmorString ) );
			
			AddCommas ( AmmoPacks [AimID], PacksString, charsmax ( PacksString ) );
			                     
			set_hudmessage ( Red, Green, Blue, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
			
			ShowSyncHudMsg ( id, MsgSync_03, "%s^n[ %s | Health: %s | Armor: %s | Ammo: %s ]", \
			PlayerName [AimID], Class, HealthString, ArmorString, PacksString );
		}
	}
}


public evHideStatus ( id ) ClearSyncHud( id, MsgSync_03 );
	

public ShowStatus ( id )
{
	if ( is_user_connected ( id ) && !IsZombie [id] )
	{
		static iTarget; iTarget = read_data ( 2 );
		
		if ( IsZombie [iTarget] )
		{	
			static HealthString [16]; AddCommas ( get_user_health ( iTarget ), HealthString, charsmax ( HealthString ) );	
			
			set_hudmessage ( 250, 4, 24, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1 );
			
			ShowSyncHudMsg ( id, MsgSync_03, "%s^n[Health: %s]", PlayerName [iTarget], HealthString );
		}
	}
}

public HideStatus ( id ) ClearSyncHud ( id, MsgSync_03 );


public leRoundStart (  ) 
{
         FreezeTime = false;

	static Entity, ClassName [32], id;
	
	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 
	{
		if ( !is_valid_ent ( Entity ) ) continue;
		
		ClassName [0] = '^0';
		
		entity_get_classname ( Entity, ClassName );
		
		if ( equal ( ClassName, MINE_CLASSNAME ) )
			
			remove_entity ( Entity );
	}
	
	for ( id = 1; id < MaxPlayers + 1; id ++ ) 
	{
		HasTripMines [id] = 0;
		
		PlantedMines [id] = 0;
	}
}

public leRoundEnd (  )
{
	remove_task ( TASK_LEADER );
	
	set_task ( 0.1, "LeaderFrags", TASK_LEADER );
	
	static Float: LastEndTime, Float: CurrentTime;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - LastEndTime < 0.5 ) return;
	
	LastEndTime = CurrentTime;
	
	static id, Team;
		
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( !IsConnected [id] ) continue;
			
		Team = fm_cs_get_user_team ( id );
			
		if ( Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED ) continue;
			
		SaveStats ( id );
	}
	
	EndRound = true;
	
	remove_task ( TASK_WELCOMEMSG );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	if ( ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && NemesisRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && AssassinRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && SurvivorRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && SniperRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && SwarmRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && PlagueRound ) || 
	
	( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && ArmageddonRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && ApocalypseRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && NightmareRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && !NemesisRound && !AssassinRound && !SurvivorRound && !SniperRound && !SwarmRound && !PlagueRound && !ArmageddonRound && !ApocalypseRound && !NightmareRound ) )
	{
	         remove_task ( TASK_AMBIENCESOUNDS );
	         
		AmbienceSoundStop (  );
	}
	
	static Sound [64];
	
	if ( !fnGetZombies (  ) )
	{
		set_hudmessage ( 20, 20, 255, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Humans defeated the plague!" );
		
		ArrayGetString ( SoundWinHumans, random_num ( 0, ArraySize ( SoundWinHumans ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		ScoreHumans ++;

		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_HUMAN );
	}
	else if ( !fnGetHumans (  ) )
	{
		set_hudmessage ( 255, 20, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Zombies have taken over the world!" );
		
		ArrayGetString ( SoundWinZombies, random_num ( 0, ArraySize ( SoundWinZombies ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		ScoreZombies ++;

		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_ZOMBIE );
	}
	else
	{
		set_hudmessage ( 20, 255, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "No one won..." );
		
		ArrayGetString ( SoundWinNoOne, random_num ( 0, ArraySize ( SoundWinNoOne ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );

		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_NO_ONE );
	}
	
	BalanceTeams (  );
}

public LeaderFrags (  )
{ 
	new iFrags;
	
	new iLeader = GetLeader_Frags ( iFrags );
	
	new Players = fnGetPlaying (  );
	
	if ( Players == 0 ) return;

	else if ( iFrags == 0 )
		
		client_print_color ( 0, print_team_default, "%s The frags leader is not found.", CHAT_PREFIX );
	else
		client_print_color ( 0, print_team_grey, "%s The frags leader is^3 %s^1 @^4 %d Frags", CHAT_PREFIX, PlayerName [iLeader], iFrags );
		
	LeaderPacks (  );
}


public LeaderPacks (  )
{
	new iAmmoPacks;
	
	new iLeader = GetLeader_Ammo ( iAmmoPacks );
	
	new Players = fnGetPlaying (  );
	
	if ( Players == 0 ) return;

	else if ( iAmmoPacks == 0 )
		
		client_print_color ( 0, print_team_default, "%s The packs leader is not found.", CHAT_PREFIX );
	else
		client_print_color ( 0, print_team_grey, "%s The packs leader is^3 %s^1 @^4 %d Packs", CHAT_PREFIX, PlayerName [iLeader], iAmmoPacks );
}

GetLeader_Ammo ( &iAmmoPacks )
{
	new iPlayers [32], iNum, id, i, iLeader, iPacks;
	
	get_players ( iPlayers, iNum, "ch" );
	
	for ( i = 0; i < iNum; i ++ )
	{
		id = iPlayers ;
		
		iPacks = AmmoPacks [id];
		
		if ( iPacks > iAmmoPacks )
		{
			iAmmoPacks = iPacks;
			
			iLeader = id;
		}
	}
	
	return iLeader;
}

GetLeader_Frags ( &iFrags )
{
	new iPlayers [32], iNum, id, i, iLeader, iFrag;
	
	get_players ( iPlayers, iNum, "ch" );
	
	for ( i = 0; i < iNum; i ++ )
	{
		id = iPlayers ;
		
		iFrag = get_user_frags ( id );
		
		if ( iFrag > iFrags )
		{
			iFrags = iFrag;
			
			iLeader = id;
		}
	}
	
	return iLeader;
}

public evIntermission (  ) remove_task ( TASK_AMBIENCESOUNDS );

public evAmmoX ( id )
{
	if ( IsZombie [id] ) return;
	
	static Type; Type = read_data ( 1 );
	
	if ( Type >= sizeof AMMOWEAPON ) return;
	
	static Weapon; Weapon = AMMOWEAPON [Type];
	
	if ( MAXBPAMMO [Weapon] <= 2 ) return;

	static Amount; Amount = read_data ( 2 );

	if ( Amount < MAXBPAMMO [Weapon] )
	{
		static Args [1]; Args [0] = Weapon;
			
		set_task ( 0.1, "RefillBpAmmo", id, Args, sizeof Args ); 		
	}
}

public fmSpawn ( Entity )
{
	if ( !pev_valid ( Entity ) ) return FMRES_IGNORED;
	
	new ClassName [32], Objective [32], size = ArraySize ( ObjectiveEnts );
	
	pev ( Entity, pev_classname, ClassName, charsmax ( ClassName ) );
	
	for ( new i = 0; i < size; i ++ )
	{
		ArrayGetString ( ObjectiveEnts, i, Objective, charsmax ( Objective ) );
		
		if ( equal ( ClassName, Objective ) )
		{
			engfunc ( EngFunc_RemoveEntity, Entity );
			
			return FMRES_SUPERCEDE;
		}
	}
	return FMRES_IGNORED;
}

public fmPrecacheSound ( const Sound[] )
{
	if ( equal ( Sound, "hostage", 7 ) ) return FMRES_SUPERCEDE;
	
	return FMRES_IGNORED;
}

public fwPlayerSpawnPost ( id )
{
	if ( !is_user_alive ( id ) || !fm_cs_get_user_team ( id ) ) return;
	
	IsAlive [id] = true;

	remove_task ( id + TASK_SPAWN );
	remove_task ( id + TASK_MODEL );
	remove_task ( id + TASK_BLOOD );
	remove_task ( id + TASK_BURN );
	remove_task ( id + TASK_NVISION );
	
	set_task ( 0.4, "TaskHideMoney", id + TASK_SPAWN );
	
	ResetVars ( id, 0 );
	
	set_task ( 0.2, "ShowMenuBuy_01", id + TASK_SPAWN );

	fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) );
	
	set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );	
	
	if ( !NewRound && fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
	{
		remove_task ( id + TASK_TEAM );
		
		fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
		
		fm_user_team_update ( id );
	}
	
	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;
	
	AlreadyHasModel = false;

	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );
		
	if ( GetModels [OWNER] && ( get_user_flags ( id ) & AccessFlag [ACCESS_OWNER_MODELS] ) )
	{
		size = ArraySize ( ModelOwnerHuman );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelOwnerHuman, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0 , size - 1 );
				
			ArrayGetString ( ModelOwnerHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else if ( GetModels [ADMIN] && ( get_user_flags ( id ) & AccessFlag [ACCESS_ADMIN_MODELS] ) )
	{
		size = ArraySize ( ModelAdminHuman );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelAdminHuman, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0 , size - 1 );
				
			ArrayGetString ( ModelAdminHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else
	{			
		size = ArraySize ( ModelHuman );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelHuman, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0, size - 1 );
				
			ArrayGetString ( ModelHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
		
	if ( !AlreadyHasModel)
	{
		if ( NewRound )
				
			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );
		else
			fmUserModelUpdate ( id + TASK_MODEL );
	}
		
	fm_set_rendering ( id );
	
	if ( IsBot [id] )
	{
		cs_set_user_nvg ( id, 0 );
		
		if ( NewRound )
		
		         set_task ( 20.0, "BotBuyExtras", id + TASK_SPAWN );
		else 
		         set_task ( 10.0, "BotBuyExtras", id + TASK_SPAWN );		
	}
	
	static WeaponEntity;
	
	WeaponEntity = fmCsGetCurrentWeaponEnt ( id );
	
	if ( pev_valid ( WeaponEntity ) ) ReplaceWeaponModels ( id, cs_get_weapon_id ( WeaponEntity ) );

	fnCheckLastZombie (  );
}

public fwPlayerKilled ( Victim, Attacker, shouldgib )
{
	IsAlive [Victim] = false;

	remove_task ( Victim + TASK_HEALTH );
	
	if ( HasJet [Victim] ) 
	{
		DropJetpack ( Victim  );
		
		HasJet [Victim ] = 0;
		
		Rocket [Victim ] = false;
		
		FlyEnergy [Victim ] = 0;
	}
	
		
	iBlinks [Victim] = 0;
		 
	Shot [Victim] = true

	HasUnlimitedClip [Victim] = false; 
		
	MultiJumps [Victim] = false;
		
	IsTryder [Victim] = false;
	
	set_task ( 0.1, "SpecNVision", Victim );
	
	if ( get_pcvar_num ( Zp_NvgGive ) == 0 && NVision [Victim] )
	{
		if ( get_pcvar_num ( Zp_CustomNvg ) ) 

		         remove_task ( Victim + TASK_NVISION );
	         
		else if ( NVisionEnabled [Victim] )

		         SetUserGNvision ( Victim, 0 );
			
		NVision [Victim] = false;
	       
		NVisionEnabled [Victim] = false;
	}
	
	if ( get_pcvar_num ( Zp_NvgGive ) == 2 && NVision [Victim] && NVisionEnabled [Victim] )
	{
		if ( get_pcvar_num ( Zp_CustomNvg ) ) 
		
		        remove_task ( Victim + TASK_NVISION );
		
		else 
		         SetUserGNvision ( Victim, 0 );
		         
		NVisionEnabled [Victim] = false;
	}
	
	if ( IsZombie [Victim] || !IsZombie [Victim] )
	{
		remove_task ( Victim + TASK_BLOOD );
		
		remove_task ( Victim + TASK_BURN );
	}
	
	if ( is_user_connected ( Victim ) && is_user_connected ( Attacker ) )
	{
		if ( ( IsNemesis [Attacker] || IsNemesis [Victim] ) || ( IsAssassin [Attacker] || IsAssassin [Victim] ) )              	
			
			SetHamParamInteger ( 3, 2 );

		if ( IsSniper [Attacker] && CurrentWeapon [Attacker] == CSW_AWP )
		{	
			SetHamParamInteger ( 3, 2 );			
			
			static Origin [3]; get_user_origin ( Victim, Origin );			
			
			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
			
			write_byte ( TE_LAVASPLASH ) ;
			
			write_coord ( Origin [0] );
			
			write_coord ( Origin [1] );
			
			write_coord ( Origin [2] - 26 ); 
			
			message_end (  );
		}
	}
	
	static SelfKill; SelfKill = ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) ? true : false;

	if ( SelfKill ) return;
	
	if ( IsZombie [Attacker] || IsNemesis [Attacker] || IsAssassin [Attacker] ) AmmoPacks [Attacker] += get_pcvar_num ( Zp_AmmoInfect );	
}


public fwPlayerKilledPost (  ) fnCheckLastZombie (  );


public fwTakeDamage ( Victim, Inflictor, Attacker, Float:Damage, DamageType )
{
	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;
	
	if ( NewRound || EndRound ) return HAM_SUPERCEDE;
	
	if ( NoDamage [Victim] ) return HAM_SUPERCEDE;

	if ( IsZombie [Attacker] == IsZombie [Victim] ) return HAM_SUPERCEDE;
	
	if ( !IsZombie [Attacker] )
	{
		if ( !IsNemesis [Victim] && !IsAssassin [Victim] && !IsSniper [Attacker] )
		{
			Damage *= get_pcvar_float ( Zp_ZombieArmor );
			
			SetHamParamFloat ( 4, Damage );
		}

		if ( !IsSurvivor [Attacker] || !IsSniper [Attacker] )
		{
			DamageDealt [Attacker] += floatround ( Damage );
			
			while ( DamageDealt [Attacker] > get_pcvar_num ( Zp_AmmoDamage ) )
			{
				AmmoPacks [Attacker] ++;
				
				DamageDealt [Attacker] -= get_pcvar_num ( Zp_AmmoDamage );
			}
		}
		
		if ( IsSniper [Attacker] && CurrentWeapon [Attacker] == CSW_AWP )
			
			SetHamParamFloat ( 4, get_pcvar_float ( Zp_SniperDamage ) );
		
		return HAM_IGNORED;
	}
	
	if ( DamageType & DMG_HEGRENADE ) return HAM_SUPERCEDE;
	
	if ( IsNemesis [Attacker] )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, get_pcvar_float ( Zp_NemesisDamage ) );
		
		return HAM_IGNORED;
	}
	else if ( IsAssassin [Attacker] )
	{
		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, get_pcvar_float ( Zp_AssassinDamage ) );
		
		return HAM_IGNORED;
	}
	
	if ( NemesisRound || AssassinRound || SurvivorRound || SniperRound || SwarmRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound || fnGetHumans (  ) == 1 ) return HAM_IGNORED;	

	if ( get_pcvar_num ( Zp_HumanArmor ) )
	{
		static Float: Armor; pev ( Victim, pev_armorvalue, Armor );

		if ( Armor > 0.0 )
		{
			emit_sound ( Victim, CHAN_BODY, SoundArmorHit, 1.0, ATTN_NORM, 0, PITCH_NORM );
			
			set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
			
			return HAM_SUPERCEDE;
		}
	}

	UserZombie ( Victim, Attacker, 0, 0, 0, 1 );
	
	return HAM_SUPERCEDE;
}

public fwTakeDamagePost ( Victim )
{
	if ( IsZombie [Victim] )
	{
		if ( IsNemesis [Victim] )
		{
			if ( !get_pcvar_num ( Zp_NemesisPainFree ) ) return;
		}
		else if ( IsAssassin [Victim] )
		{
			if ( !get_pcvar_num ( Zp_AssassinPainFree ) ) return;
		}
		else
		{
			switch ( get_pcvar_num ( Zp_ZombiePainFree ) )
			{
				case 0: return;
				
				case 2: if ( !LastZombie [Victim] ) return;
			}
		}
	}
	else
	{
		if ( IsSurvivor [Victim] )
		{
			if ( !get_pcvar_num ( Zp_SurvivorPainFree ) ) return;
		}		
		else if ( IsSniper [Victim] )
		{
			if ( !get_pcvar_num ( Zp_SniperPainFree ) ) return;
		}
		
		else return;
	}
	
	set_pdata_float ( Victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX );
}


public fwTraceAttack ( Victim, Attacker, Float: Damage, Float: Direction [3], DamageType )
{
	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;

	if ( NewRound || EndRound ) return HAM_SUPERCEDE;

	if ( NoDamage [Victim] ) return HAM_SUPERCEDE;
	
	if ( IsZombie [Attacker] == IsZombie [Victim] ) return HAM_SUPERCEDE;
	
	if ( !IsZombie [Victim] || !( DamageType & DMG_BULLET ) ) return HAM_IGNORED;
	
	if ( !get_pcvar_num ( Zp_Knockback ) ) return HAM_IGNORED;
	
	if ( IsNemesis [Victim] && get_pcvar_float ( Zp_NemesisKnockback ) == 0.0 ) return HAM_IGNORED;
	
	if ( IsAssassin [Victim] && get_pcvar_float ( Zp_AssassinKnockback ) == 0.0 ) return HAM_IGNORED;

	static Ducking;
	
	Ducking = pev ( Victim, pev_flags ) & ( FL_DUCKING | FL_ONGROUND ) == ( FL_DUCKING | FL_ONGROUND )

	if ( Ducking && get_pcvar_float ( Zp_KnockbackDucking ) == 0.0 ) return HAM_IGNORED;
	
	static Origin_01 [3], Origin_02 [3];
	
	get_user_origin ( Victim, Origin_01 );
	
	get_user_origin ( Attacker, Origin_02 );

	if ( get_distance ( Origin_01, Origin_02 ) > get_pcvar_num ( Zp_KnockbackDistance ) ) return HAM_IGNORED;
	
	static Float: Velocity [3]; pev ( Victim, pev_velocity, Velocity );
	
	if ( get_pcvar_num ( Zp_KnockbackDamage ) ) xs_vec_mul_scalar ( Direction, Damage, Direction );

	if ( get_pcvar_num ( Zp_KnockbackPower ) && KnockbackWeaponPower [CurrentWeapon [Attacker] ] > 0.0 )
		
		xs_vec_mul_scalar ( Direction, KnockbackWeaponPower [CurrentWeapon [Attacker] ], Direction );
	
	if ( Ducking ) xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_KnockbackDucking ), Direction );
	
	if ( IsNemesis [Victim] )
	
		xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_NemesisKnockback ), Direction );
	
	else if ( IsAssassin [Victim] )
	
		xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_AssassinKnockback ), Direction );
	
	else
		xs_vec_mul_scalar ( Direction, ZombieKnockback [Victim], Direction );

	xs_vec_add ( Velocity, Direction, Direction );
	
	if ( !get_pcvar_num ( Zp_KnockbackZvel ) ) Direction [2] = Velocity [2];
	
	set_pev ( Victim, pev_velocity, Direction );
	
	return HAM_IGNORED;
}


public fwUseStationary ( Entity, Caller, Activator, UseType )
{
	if ( UseType == USE_USING && is_user_valid_connected ( Caller ) && IsZombie [Caller] ) return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

public fwUseStationaryPost ( Entity, Caller, Activator, UseType )
{
	if ( UseType == USE_STOPPED && is_user_valid_connected ( Caller ) )
		
		ReplaceWeaponModels ( Caller, CurrentWeapon [Caller] )
}

public fwUsePushable (  ) return HAM_SUPERCEDE;

public fwTouchWeapon ( Weapon, id )
{
	if ( !is_user_valid_connected ( id ) ) return HAM_IGNORED;
	
	if ( IsZombie [id] || ( ( IsSurvivor [id] || IsSniper [id]) && !IsBot [id] ) ) return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

public fwAddPlayerItem ( id, WeaponEnt )
{
	static ExtraAmmo; ExtraAmmo = pev ( WeaponEnt, PEV_ADDITIONAL_AMMO );
	
	if ( ExtraAmmo )
	{
		static WeaponID; WeaponID = cs_get_weapon_id ( WeaponEnt );

		ExecuteHamB ( Ham_GiveAmmo, id, ExtraAmmo, AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
		
		set_pev ( WeaponEnt, PEV_ADDITIONAL_AMMO, 0 );
	}
}

public fwItemDeployPost ( WeaponEnt )
{
	static Owner; Owner = fm_cs_get_weapon_ent_owner ( WeaponEnt );
	
	static WeaponID; WeaponID = cs_get_weapon_id ( WeaponEnt );
	
	CurrentWeapon [Owner] = WeaponID;
	
	ReplaceWeaponModels ( Owner, WeaponID );

	if ( IsZombie [Owner] && !( ( 1 << WeaponID ) & ZOMBIE_ALLOWED_WEAPONS_BITSUM ) )
	{
		CurrentWeapon [Owner] = CSW_KNIFE;
		
		engclient_cmd ( Owner, "weapon_knife" );
	}
}


public wpn_gi_reset_weapon ( id ) ReplaceWeaponModels ( id, CSW_KNIFE );

public client_putinserver ( id )
{
	IsConnected [id] = true;
	
	Fly [id] = false;

	Rocket [id] = false;

	HasJet [id] = 0;

	FlyEnergy [id] = 0;
	
	get_user_name ( id, PlayerName [id], charsmax ( PlayerName [ ] ) );
	
	ResetVars ( id, 1 );
	
	LoadStats ( id );
	
	if ( !is_user_bot ( id ) )
	{
                  new UserIp [32], Country [44];
	
	         get_user_ip ( id, UserIp, charsmax ( UserIp ) );
	
	         geoip_country_ex ( UserIp, Country, charsmax ( Country ) );
		
		if ( equal ( Country, "" ) )

                  	 client_print_color ( 0, print_team_grey, "^1Player^4 %s^1 from^3 N/A^1 has joined the game!", PlayerName [id] );
		else
		          client_print_color ( 0, print_team_grey, "^1Player^4 %s^1 from^3 %s^1 has joined the game!", PlayerName [id], Country );
		
		set_task ( 1.0, "SpectatorHudMessage", id + TASK_SHOWHUD, _, _, "b" );
		
		set_task ( 5.0, "SendInfoMessage", id );
	}
	else 
	{
		IsBot [id] = true;
		
		if ( !HamCzBots ) set_task ( 0.1, "RegisterHamCzBots", id );
	}
}

public SendInfoMessage ( id )
{
	if ( is_user_connected ( id ) )
	{
		new Stats [8], Body [8];
	
		new RankPos = get_user_stats ( id, Stats, Body );
	
		new RankMax = get_statsnum (  );
	
		new HostName [64]; get_cvar_string ( "hostname", HostName, charsmax ( HostName ) );
	
		set_dhudmessage ( 0, 255, 0, 0.05, 0.22, 2, 0.02, 1.0, 0.05, 6.0 )
	
		show_dhudmessage ( id, "Welcome, %s^nWe hope you enjoy you stay here!^n^n%s^n^nYou rank is %d from %d", PlayerName [id], HostName, RankPos, RankMax );
	}
}

public fwClientDisconnect(id)
{
	if ( IsAlive [id] ) CheckRound ( id );
	
	Fly [id] = false;

	Rocket [id] = false;

	HasJet [id] = 0;

	FlyEnergy [id] = 0;
	
	SaveStats ( id );
	
	HasTripMines [id] = 0;
	
	HasPlanting [id] = false;
	
	HasRemoving [id] = false;
	
	if ( PlantedMines [id] )
	{
		fwRemoveMinesByOwner ( id );
		
		PlantedMines [id] = 0;
	}
	
	remove_task ( id + TASK_TEAM );
	remove_task ( id + TASK_MODEL );
	remove_task ( id + TASK_SPAWN );
	remove_task ( id + TASK_BLOOD );
	remove_task ( id + TASK_BURN );
	remove_task ( id + TASK_NVISION );
	remove_task ( id + TASK_SHOWHUD );
	remove_task ( id + TASK_HEALTH );
	remove_task ( id + TASK_REMOVE );
	remove_task ( id + TASK_CREATE );
	
	IsConnected [id] = false;
	
	IsBot [id] = false;
	
	IsAlive [id] = false;
}


public fwClientDisconnectPost (  ) fnCheckLastZombie (  );

public fwClientKill (  ) return FMRES_SUPERCEDE;


public fwEmitSound ( id, Channel, const Sample [], Float: Volume, Float: Attn, Flags, Pitch )
{
	if ( is_user_alive ( id ) ) 
	{
		new Clip, Ammo;
		
		new Weapon = get_user_weapon ( id, Clip, Ammo )
		
		if ( HasJet [id] && Weapon == CSW_KNIFE ) 
		{
			if ( equal ( Sample, "weapons/knife_slash1.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_slash2.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_deploy1.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_hitwall1.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_hit1.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_hit2.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_hit3.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_hit4.wav" ) ) return FMRES_SUPERCEDE;
			
			if ( equal ( Sample, "weapons/knife_stab.wav" ) ) return FMRES_SUPERCEDE;
		}
	}
	if ( Sample [0] == 'h' && Sample [1] == 'o' && Sample [2] == 's' && Sample [3] == 't' && Sample [4] == 'a' && Sample [5] == 'g' && Sample [6] == 'e' )
		
		return FMRES_SUPERCEDE;
	
	if ( !is_user_valid_connected ( id ) || !IsZombie [id] )
		
		return FMRES_IGNORED;
	
	static Sound [64];

	if ( Sample [7] == 'b' && Sample [8] == 'h' && Sample [9] == 'i' && Sample [10] == 't' )
	{
		if ( IsNemesis [id] )
		{
			ArrayGetString ( NemesisPain, random_num ( 0, ArraySize ( NemesisPain ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
		}
		else if ( IsAssassin [id] )
		{
			ArrayGetString ( AssassinPain, random_num ( 0, ArraySize ( AssassinPain ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
		}
		else
		{
			ArrayGetString ( ZombiePain, random_num ( 0, ArraySize ( ZombiePain ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
		}
		
		return FMRES_SUPERCEDE;
	}

	if ( Sample [8] == 'k' && Sample [9] == 'n' && Sample [10] == 'i' )
	{
		if ( Sample [14] == 's' && Sample [15] == 'l' && Sample [16] == 'a' )
		{
			ArrayGetString ( ZombieMissSlash, random_num ( 0, ArraySize ( ZombieMissSlash ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
			
			return FMRES_SUPERCEDE;
		}
		if ( Sample [14] == 'h' && Sample [15] == 'i' && Sample [16] == 't') 
		{
			if ( Sample [17] == 'w' ) 
			{
			         ArrayGetString ( ZombieMissWall, random_num ( 0, ArraySize ( ZombieMissWall ) - 1 ), Sound, charsmax ( Sound ) );
			
			         emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
			
				return FMRES_SUPERCEDE;
			}
			else
			{
			         ArrayGetString ( ZombieHitNormal, random_num ( 0, ArraySize ( ZombieHitNormal ) - 1 ), Sound, charsmax ( Sound ) );
			
			         emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
			
				return FMRES_SUPERCEDE;
			}
		}
		if ( Sample [14] == 's' && Sample [15] == 't' && Sample [16] == 'a')
		{
			ArrayGetString ( ZombieHitStab, random_num ( 0, ArraySize ( ZombieHitStab ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
			
			return FMRES_SUPERCEDE;
		}
	}

	if ( Sample [7] == 'd' && ( ( Sample [8] == 'i' && Sample [9] == 'e' ) || ( Sample [8] == 'e' && Sample [9] == 'a' ) ) )
	{
		ArrayGetString ( ZombieDie, random_num ( 0, ArraySize ( ZombieDie ) - 1 ), Sound, charsmax ( Sound ) );
			
		emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
		
		return FMRES_SUPERCEDE;
	}

	if ( Sample [10] == 'f' && Sample [11] == 'a' && Sample [12] == 'l' && Sample [13] == 'l' )
	{
		ArrayGetString ( ZombieFall, random_num ( 0, ArraySize ( ZombieFall ) - 1 ), Sound, charsmax ( Sound ) );
			
		emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );
		
		return FMRES_SUPERCEDE;
	}
	
	return FMRES_IGNORED;
}

public fwSetClientKeyValue ( id, const infobuffer[], const key [] )
{
	if ( key [0] == 'm' && key [1] == 'o' && key [2] == 'd' && key [3] == 'e' && key [4] == 'l' )
		return FMRES_SUPERCEDE;
	
	return FMRES_IGNORED;
}

public fwClientUserInfoChanged ( id, Buffer )
{ 
        if ( !is_user_connected ( id ) ) return FMRES_IGNORED;

	static CurrentModel [32];
		
	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) )

	if ( !equal ( CurrentModel, PlayerModel [id] ) && !task_exists ( id + TASK_MODEL ) )
		
		fm_cs_set_user_model ( id + TASK_MODEL );

	static NewName [32]; engfunc( EngFunc_InfoKeyValue, Buffer, "name", NewName, charsmax ( NewName ) );
	
	if ( equal ( NewName, PlayerName [id] ) ) return FMRES_IGNORED;
	
	copy ( PlayerName [id], charsmax ( PlayerName [] ), NewName );

	PlayerName [id] = NewName;

	return FMRES_IGNORED;
}

public fwGetGameDescription (  )
{
	forward_return ( FMV_STRING, "Counter-Strike" );
	
	return FMRES_SUPERCEDE;
}

public fwSetModel ( 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 ( IsZombie [pev ( Entity, pev_owner )] )
	{
		if ( Model [9] == 'h' && Model [10] == 'e' )
		{
			fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 250, 0, kRenderNormal, 16 );
			
			message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte ( TE_BEAMFOLLOW) ;
			write_short ( Entity );
			write_short ( TrailSpr );
			write_byte ( 10 );
			write_byte ( 10 );
			write_byte ( 0 );
			write_byte ( 250 );
			write_byte ( 0 );
			write_byte ( 200 );
			message_end (  );
			
			set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION );
		}
	}
	else if ( Model [9] == 'h' && Model [10] == 'e' ) 
	{
		fm_set_rendering ( Entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16 );
		
		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
		write_byte ( TE_BEAMFOLLOW );
		write_short ( Entity );
		write_short ( TrailSpr );
		write_byte ( 10 );
		write_byte ( 10 );
		write_byte ( 200 );
		write_byte ( 0 );
		write_byte ( 0 );
		write_byte ( 200 );
		message_end (  );
		
		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_EXPLODE );
	}
	else if ( Model [9] == 'f' && Model [10] == 'l' )
	{
		fm_set_rendering ( Entity, kRenderFxGlowShell, 250, 100, 0, kRenderNormal, 16 );
		
		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
		write_byte ( TE_BEAMFOLLOW );
		write_short ( Entity );
		write_short ( TrailSpr );
		write_byte ( 10 );
		write_byte ( 10 );
		write_byte ( 250 );
		write_byte ( 40 );
		write_byte ( 0 );
		write_byte ( 200 );
		message_end (  );

		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_FIRE );
	}
	else if ( Model[9] == 's' && Model[10] == 'm' ) 
	{
		fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16 );

		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
		write_byte ( TE_BEAMFOLLOW );
		write_short ( Entity );
		write_short ( TrailSpr);
		write_byte ( 10 );
		write_byte ( 10 );
		write_byte ( 0 );
		write_byte ( 100 );
		write_byte ( 200 );
		write_byte ( 200 );
		message_end (  );
		
		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_FROST );
	}
}

public fwThinkGrenade ( Entity )
{
	if ( !pev_valid ( Entity ) ) return HAM_IGNORED;

	static Float: DmgTime, Float: CurrentTime;
	
	pev ( Entity, pev_dmgtime, DmgTime );
	
	CurrentTime = get_gametime (  );
	
	if ( DmgTime > CurrentTime ) return HAM_IGNORED;
	
	switch ( pev ( Entity, PEV_NADE_TYPE ) )
	{
		case NADE_TYPE_INFECTION:
		{
			InfectionExplode ( Entity )
			
			return HAM_SUPERCEDE;
		}
		case NADE_TYPE_EXPLODE: 
		{
			HeExplode ( Entity );
			
			return HAM_SUPERCEDE;
		}
		case NADE_TYPE_FIRE:
		{
			FireExplode ( Entity );
			
			return HAM_SUPERCEDE;
		}
		case NADE_TYPE_FROST: 
		{
			FrostExplode ( Entity );
			
			return HAM_SUPERCEDE;
		}
	}
	
	return HAM_IGNORED;
}

public fwPlayerPreThink ( id )
{
	if ( !IsAlive [id] ) return;
	
	if ( IsZombie [id] && !IsNemesis [id] && IsAssassin [id] )
		
		set_pev ( id, pev_flTimeStepSound, STEPTIME_SILENT );
	
	if ( IsFrozen [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 ( IsZombie [id] )
		{
			if ( IsNemesis [id] )
			
				set_pev ( id, pev_maxspeed, CachedNemesisSpeed );
			
			else if ( IsAssassin [id] )
			
				set_pev ( id, pev_maxspeed, CachedAssassinSpeed );
			
			else
			
				set_pev ( id, pev_maxspeed, ZombieSpeed [id] )
		}
		else
		{
			if ( IsSurvivor [id] )
			
				set_pev ( id, pev_maxspeed, CachedSurvivorSpeed );
			
			else if ( IsSniper [id] )
			
			         set_pev(id, pev_maxspeed, CachedSniperSpeed );
			
			else						    
				
				set_pev(id, pev_maxspeed, CachedHumanSpeed );			
		}
	}	
	
	static Float: CoolDown, Float: CurrentTime;
	
	if ( IsZombie [id] && IsNemesis [id] )
	{
		if ( !CachedLeapNemesis ) return;
			
		CoolDown = CachedLeapNemesisCooldown;
	}
	else return;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - LastLeapTime [id] < CoolDown ) return;
	
	if ( !IsBot [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;

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

	velocity_by_aim ( id, get_pcvar_num ( Zp_LeapNemesisForce ), Velocity ) 
	
	Velocity [2] = get_pcvar_float ( Zp_LeapNemesisHeight );
	
	set_pev ( id, pev_velocity, Velocity );
	
	LastLeapTime [id] = CurrentTime;
}

public fwPlayerPreThink_01 ( id )
{
	if ( !is_user_alive ( id ) || IsZombie [id] || !MultiJumps [id] ) return PLUGIN_CONTINUE;
	
	new nBut = pev ( id, pev_button );
		
	new oBut = pev ( id, pev_oldbuttons );
		
	if ( ( nBut & IN_JUMP ) && !( pev ( id, pev_flags ) & FL_ONGROUND ) && !( oBut & IN_JUMP ) )
	{
		 if ( JumpNum [id] < MultiJumps [id] )
		 {
			 DoJump [id] = true;
				
			 JumpNum [id] ++;
				
			 return PLUGIN_CONTINUE;
		 }
	 }
	 if ( ( nBut & IN_JUMP ) && ( pev ( id, pev_flags ) & FL_ONGROUND ) )
	 {
		 JumpNum [id] = 0;
			
		 return PLUGIN_CONTINUE;
	 }
	 
	 return PLUGIN_CONTINUE;
}

public fmPlayerPreThink ( id )
{
	if ( CheckValidPlayer ( id ) ) 
	{
		new iWeaponID = get_user_weapon(id);
	
		if ( iWeaponID != CSW_KNIFE || !IsZombie [id] )
		{
			OPCancel ( id );
			
			return FMRES_IGNORED;
		}
		
		if ( iBlinks [id] == 0 ) return FMRES_IGNORED;
	
		new Button = pev ( id, pev_button );
	
		if ( !( Button & IN_ATTACK ) && !( Button & IN_ATTACK2 ) )
		{
			OPCancel ( id );
			
			return FMRES_IGNORED;
		}
	
		if ( iSlash [id] ) iSlash [id] = 0;
	
		OPNearEnemy ( id );
	
		if ( InBlink [id] )
		{
			OPSetBlink ( id );
			
			OPBlink ( id );
			
			iCanceled [id] = 0;
		}
	}	
	
	return FMRES_IGNORED;
}

public cmdNightVision ( id )
{
	if ( NVision [id] )
	{
		NVisionEnabled [id] = !( NVisionEnabled [id] )
		
		if ( get_pcvar_num ( Zp_CustomNvg ) )
		{
			remove_task ( id + TASK_NVISION );
			
			if ( NVisionEnabled [id] ) set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );
		}
		else
			SetUserGNvision ( id, NVisionEnabled [id] );
	}
	
	return PLUGIN_HANDLED;
}

public cmdDrop ( id )
{
	if ( IsSurvivor [id] || IsSniper [id] || IsTryder [id] ) return PLUGIN_HANDLED;
	
	if ( HasJet [id] ) 
	{
		new Clip, Ammo;
		
		new Weapon = get_user_weapon ( id, Clip, Ammo );
		
		if ( Weapon == CSW_KNIFE ) 
		{
			DropJetpack ( id )
			
			if ( !IsZombie [id] )
			{
				entity_set_string ( id, EV_SZ_viewmodel, "models/v_knife.mdl" );
				
				entity_set_string ( id, EV_SZ_weaponmodel, "models/p_knife.mdl" );
			}
			return PLUGIN_HANDLED
		}
	}
	
	return PLUGIN_CONTINUE;
}

public cmdChangeTeam ( id )
{
	static Team; Team = fm_cs_get_user_team ( id );
	
	if ( Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED ) return PLUGIN_CONTINUE;
	
	ShowMenuGame ( id );
	
	return PLUGIN_HANDLED;
}

ShowMenuGame ( id )
{
	static Menu [250], Len;
	
	Len = 0;
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\yGame Menu^n^n" );
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r1. \wBuy Weapons^n" );

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r2. \wBuy Extra Items^n" );

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r3. \wChoose Zombie Class^n" );

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r4. \wUnstuck^n" );

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r5. \wJoin Spectators^n^n" );
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n^n\r0. \wExit" );
	
	show_menu ( id, KEYS_GAMEMENU, Menu, -1, "Game Menu" );
}

public ShowMenuBuy_01 ( taskid )
{
	static id;
	
	( taskid > MaxPlayers ) ? ( id = ID_SPAWN ) : ( id = taskid );
	
	if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] ) return;
	
	if ( IsBot [id] )
	{
		BuyPrimaryWeapon ( id, random_num ( 0, ArraySize ( PrimaryItems ) - 1 ) );
		
		MenuBuy_02 ( id, random_num ( 0, ArraySize ( SecondaryItems ) - 1 ) );
		
		return;
	}
	
	static Menu [300], WeaponName [32], Len, Weapons, MaxLoops;
	
	Len = 0;
	
	MaxLoops = min ( WPN_STARTID + 7, WPN_MAXIDS );
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\yPrimary Menu %s/2^n^n", WPN_STARTID + 7 < WPN_MAXIDS ? "1" : "2" );
	
	for ( Weapons = WPN_STARTID; Weapons < MaxLoops; Weapons ++ )
	{
		ArrayGetString ( PrimaryItems, Weapons, WeaponName, charsmax ( WeaponName ) );
		
		Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r%d. \w%s^n", Weapons - WPN_STARTID + 1,WEAPONNAMES [ get_weaponid ( WeaponName ) ])
	}

	if ( WPN_STARTID + 7 >= WPN_MAXIDS )

	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r8. \wBack" );
	else
	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\d8. Back" );
	
	if ( WPN_STARTID + 7 < WPN_MAXIDS )

	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r9. \wMore" );
	else
	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\d9. More" );
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r0. \wExit" );
	
	show_menu ( id, KEYS_BUYMENU, Menu, -1, "Buy Menu 1" )
}


ShowMenuBuy_02 ( id )
{
	static Menu [250], WeaponName [32], Len, Weapons, MaxLoops;
	
	Len = 0;
	
	MaxLoops = ArraySize ( SecondaryItems );

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\ySecondary Menu^n^n" );
	
	for ( Weapons = 0; Weapons < MaxLoops; Weapons ++ ) 
	{
		ArrayGetString ( SecondaryItems, Weapons, WeaponName, charsmax ( WeaponName ) )
		
		Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r%d. \w%s^n", Weapons + 1, WEAPONNAMES [ get_weaponid ( WeaponName ) ] )
	}
	
	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len,  "^n^n\r0. \wExit" );
	
	show_menu ( id, KEYS_BUYMENU, Menu, -1, "Buy Menu 2" );
}

ShowMenuExtras ( id )
{
	static MenuID, Menu [128], Item, Team, Buffer [32];
	
	formatex ( Menu, charsmax ( Menu ), "\yExtra Items" );
	
	MenuID = menu_create ( Menu, "MenuExtras" );
	
	for ( Item = 0; Item < iExtraItem; Item ++ )
	{        
		Team = ArrayGetCell ( ExtraItemTeam_01, Item );

		if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && !( Team & ZP_TEAM_ZOMBIE ) ) || ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && !( Team & ZP_TEAM_HUMAN ) ) || ( IsNemesis [id] && !( Team & ZP_TEAM_NEMESIS ) ) || ( IsAssassin [id] && !( Team & ZP_TEAM_ASSASSIN ) ) || ( IsSurvivor [id] && !( Team & ZP_TEAM_SURVIVOR ) ) || ( IsSniper [id] && !( Team & ZP_TEAM_SNIPER ) ) ) continue;
		
		switch ( Item )
		{        
			case EXTRA_NVISION:
			{
				if ( !ExtraItems [EXTRA_NVISION] ) continue;

				formatex ( Buffer, charsmax ( Buffer ), "NightVision (single round)" );
			}
			case EXTRA_EXPLOSION_NADE:
			{
				if ( !ExtraItems [EXTRA_EXPLOSION_NADE] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Explosion Nade" );
			}
			case EXTRA_NAPALM_NADE:
			{
				if ( !ExtraItems [EXTRA_NAPALM_NADE] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Napalm Nade" );
			}
			case EXTRA_FROST_NADE:
			{
				if ( !ExtraItems [EXTRA_FROST_NADE] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Frost Nade" );
			}
			case EXTRA_AWP_MAGNUM_SNIPER:
			{
				if ( !ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "AWP Magnum Sniper" );
			}
			case EXTRA_M249_PARA_MACHINEGUN:
			{
				if ( !ExtraItems [EXTRA_M249_PARA_MACHINEGUN] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "M249 Para Machinegun" );
			}
			case EXTRA_SG550_AUTO_SNIPER:
			{
				if ( !ExtraItems [EXTRA_SG550_AUTO_SNIPER] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "SG550 Auto-Sniper" );
			}
			case EXTRA_G3SG1_AUTO_SNIPER:
			{
				if ( !ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "G3SG1 Auto-Sniper" );
			}
			case EXTRA_JETPACK:
			{
				if ( !ExtraItems [EXTRA_JETPACK] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Jetpack+Bazooka" );
			}
			case EXTRA_UNLIMITEDCLIP:
			{
				if ( !ExtraItems [EXTRA_UNLIMITEDCLIP] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Unlimited Clip" );
			}
			case EXTRA_ARMOR_100:
			{
				if ( !ExtraItems [EXTRA_ARMOR_100] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Armura (100)" );
			}
			case EXTRA_ARMOR_200:
			{
				if ( !ExtraItems [EXTRA_ARMOR_200] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Armura (200)" );
			}
			case EXTRA_MULTIJUMP:
			{
				if ( !ExtraItems [EXTRA_MULTIJUMP] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Multijump +1" );
			}
			case EXTRA_TRYDER:
			{
				if ( !ExtraItems [EXTRA_TRYDER] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Tryder" );
			}
			case EXTRA_SURVIVOR:
			{
				if ( !ExtraItems [EXTRA_SURVIVOR] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Survivor" );
			}
			case EXTRA_SNIPER:
			{
				if ( !ExtraItems [EXTRA_SNIPER] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Sniper" );
			}
			case EXTRA_NEMESIS:
			{
				if ( !ExtraItems [EXTRA_NEMESIS] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Nemesis" );
			}
			case EXTRA_ASSASSIN:
			{
				if ( !ExtraItems [EXTRA_ASSASSIN] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Assassin" );
			}
			case EXTRA_ANTIDOTE:
			{
				if ( !ExtraItems [EXTRA_ANTIDOTE] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "T-Virus Antidote" );
			}
			case EXTRA_MADNESS:
			{
				if ( !ExtraItems [EXTRA_MADNESS] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Zombie Madness" );
			}
			case EXTRA_INFECTIONBOMB:
			{
				if ( !ExtraItems [EXTRA_INFECTIONBOMB] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Infection Bomb" );
			}
			case EXTRA_KNIFEBLINK:
			{
				if ( !ExtraItems [EXTRA_KNIFEBLINK] ) continue;
				
				formatex ( Buffer, charsmax ( Buffer ), "Knife Blink" );
			}
			default:
		         {
				ArrayGetString ( ExtraItemName_01, Item, Buffer, charsmax ( Buffer ) );
		         }
	         }                                                                                  
	
	         formatex ( Menu, charsmax ( Menu ), "%s \y%d ammo packs", Buffer, ArrayGetCell ( ExtraItemCost_01, Item ) );
	
	         Buffer [0] = Item;
	
	         Buffer [1] = 0;
	
	         menu_additem ( MenuID, Menu, Buffer );
        }

        if ( menu_items ( MenuID ) <= 0 )
        {
	         client_print_color ( id, print_team_default, "%s Extra Items are disabled.", CHAT_PREFIX );
	         
		menu_destroy ( MenuID );
	         
		return;
        }

        formatex ( Menu, charsmax ( Menu ), "Back" );
   
        menu_setprop ( MenuID, MPROP_BACKNAME, Menu );

        formatex ( Menu, charsmax ( Menu ), "More" );

        menu_setprop ( MenuID, MPROP_NEXTNAME, Menu );

        formatex ( Menu, charsmax ( Menu ), "Exit");
    
        menu_setprop ( MenuID, MPROP_EXITNAME, Menu );

        menu_display ( id, MenuID );
}

public ShowMenuZClass ( id )
{
         if ( !IsConnected [id] ) return;

	if ( IsBot [id] )
	{
		ZombieClassNext [id] = random_num ( 0, iZClass - 1 );
		
		return;
	}
	
	static MenuID, Menu [128], Class, Buffer_01 [32], Buffer_02 [32];
	
	formatex ( Menu, charsmax ( Menu ), "Zombie Class\y" );
	
	MenuID = menu_create ( Menu, "MenuZClass" );
	
	for ( Class = 0; Class < iZClass; Class ++ )
	{
		ArrayGetString ( ZClassName_01, Class, Buffer_01, charsmax ( Buffer_01 ) );
		
		ArrayGetString ( ZClassInfo_01, Class, Buffer_02, charsmax ( Buffer_02 ) );
		
		formatex ( Menu, charsmax ( Menu ), "%s\y [%s]", Buffer_01, Buffer_02 );
		
		Buffer_01 [0] = Class;
		
		Buffer_01 [1] = 0;
		
		menu_additem ( MenuID, Menu, Buffer_01 );
	}
	
	formatex ( Menu, charsmax ( Menu ), "Back" );
	
	menu_setprop ( MenuID, MPROP_BACKNAME, Menu );
	
	formatex ( Menu, charsmax ( Menu ), "More" );
	
	menu_setprop ( MenuID, MPROP_NEXTNAME, Menu );
	
	formatex ( Menu, charsmax ( Menu ), "Exit" );
	
	menu_setprop ( MenuID, MPROP_EXITNAME, Menu );
	
	menu_display ( id, MenuID );
}

public MenuGame ( id, key )
{
	switch ( key )
	{
		case 0: 
		{
			if ( CanBuy [id] ) ShowMenuBuy_01 ( id );
		}
		case 1: 
		{
			if ( IsAlive [id] )
					
				ShowMenuExtras ( id );
			else
				client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );
		}		
		case 2: 
		{
			ShowMenuZClass ( id );
		}
		case 3: 
		{
			if ( IsAlive [id] )
			{
				if ( is_player_stuck ( id ) )
				
					DoRandomSpawn ( id, 1 );
				else
					client_print_color ( id, print_team_default, "%s You are not stuck.", CHAT_PREFIX );
			}
			else
				client_print_color ( id, print_team_default, "%s Extra items are unavailable right now...", CHAT_PREFIX );
		}                
		case 4: 
		{
			if ( IsAlive [id] || fm_cs_get_user_team ( id ) == FM_CS_TEAM_SPECTATOR )
			{
				client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );
				
				return PLUGIN_HANDLED;
				
				/*CheckRound ( id );

				dllfunc ( DLLFunc_ClientKill, id );*/
			}

			SaveStats ( id );
			
			remove_task ( id + TASK_TEAM );
			remove_task ( id + TASK_MODEL );
			remove_task ( id + TASK_SPAWN );
			remove_task ( id + TASK_BLOOD );
			remove_task ( id + TASK_BURN );
			remove_task ( id + TASK_HEALTH );
			
			fm_cs_set_user_team ( id, FM_CS_TEAM_SPECTATOR );
			
			fm_user_team_update ( id );
		}
	}
	
	return PLUGIN_HANDLED;
}


public MenuBuy_01 ( id, key )
{
	if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] || IsTryder [id] ) return PLUGIN_HANDLED;
	
	if ( key >= MENU_KEY_BACK || WPN_SELECTION >= WPN_MAXIDS )
	{
		switch ( key )
		{
			case MENU_KEY_BACK: 
			{
				if ( WPN_STARTID + 7 >= WPN_MAXIDS ) 

				         WPN_STARTID = 0;
			}
			case MENU_KEY_NEXT: 
			{
				if ( WPN_STARTID + 7 < WPN_MAXIDS ) 
					
					WPN_STARTID += 7;
			}
			case MENU_KEY_EXIT: 
			{
				return PLUGIN_HANDLED;
			}
		}
		
		ShowMenuBuy_01 ( id );
		
		return PLUGIN_HANDLED;
	}
	
	BuyPrimaryWeapon ( id, WPN_SELECTION );

	ShowMenuBuy_02 ( id );
	
	return PLUGIN_HANDLED;
}

BuyPrimaryWeapon ( id, selection )
{
	drop_weapons ( id, 1 );
	drop_weapons ( id, 2 );

	fm_strip_user_weapons ( id );
	
	fm_give_item ( id, "weapon_knife" );

	static WeaponID, WName [32];
	
	ArrayGetString ( PrimaryItems, selection, WName, charsmax ( WName ) );
	
	WeaponID = get_weaponid ( WName );

	fm_give_item ( id, WName );
	
	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

	CanBuy [id] = false;

	static i
	
	for ( i = 0; i < ArraySize ( AdditionalItems ); i ++ )
	{
		ArrayGetString ( AdditionalItems, i, WName, charsmax ( WName ) );
		
		fm_give_item ( id, WName );
	}
}

public MenuBuy_02 ( id, key )
{	
         if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] ) return PLUGIN_HANDLED;
	
	if ( key >= ArraySize ( SecondaryItems ) )
	{
		if ( key != MENU_KEY_EXIT )
			
			ShowMenuBuy_02 ( id );
		
		return PLUGIN_HANDLED;
	}
	
	drop_weapons ( id, 2 );
	
	static WeaponID, WName [32];
	
	ArrayGetString ( SecondaryItems, key, WName, charsmax ( WName ) );
	
	WeaponID = get_weaponid ( WName );
	
	fm_give_item ( id, WName );
	
	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
	
	return PLUGIN_HANDLED;
}

public MenuExtras ( id, MenuID, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( MenuID );
		
		return PLUGIN_HANDLED;
	}
	
	if ( !IsAlive [id] )
	{
		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );
		
		menu_destroy ( MenuID );
		
		return PLUGIN_HANDLED;
	}

	static Buffer [2], Dummy, ItemID;
	
	menu_item_getinfo ( MenuID, item, Dummy, Buffer, charsmax ( Buffer ), _, _, Dummy );
	
	ItemID = Buffer [0];

	BuyExtraItem ( id, ItemID );
	
	menu_destroy ( MenuID );
	
	return PLUGIN_HANDLED;
}


BuyExtraItem ( id, itemid, IgnoreCost = 0 )
{
	static Team; Team = ArrayGetCell ( ExtraItemTeam_01, itemid );
	
	if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && !( Team & ZP_TEAM_ZOMBIE ) ) || ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && !( Team & ZP_TEAM_HUMAN ) ) || ( IsNemesis [id] && !( Team & ZP_TEAM_NEMESIS ) ) || ( IsAssassin [id] && !( Team & ZP_TEAM_ASSASSIN ) ) || ( IsSurvivor [id] && !( Team & ZP_TEAM_SURVIVOR ) ) || ( IsSniper [id] && !( Team & ZP_TEAM_SNIPER ) ) )
	{
		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );
		
		return;
	}
	
	if ( ( itemid == EXTRA_ANTIDOTE && ( EndRound || SwarmRound || NemesisRound || AssassinRound || SurvivorRound || SniperRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound || fnGetZombies (  ) <= 1 || fnGetHumans (  ) == 1 ) )  
	|| ( itemid == EXTRA_MADNESS && NoDamage [id] ) || ( itemid == EXTRA_INFECTIONBOMB && ( EndRound || SwarmRound || NemesisRound || AssassinRound || SurvivorRound || SniperRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound ) ) )
	{
		client_print_color ( id, print_team_default, "%s You can't use this right now.", CHAT_PREFIX );
		
		return;
	}
	
	if ( !IgnoreCost )
	{
		if (AmmoPacks [id] < ArrayGetCell ( ExtraItemCost_01, itemid ) )
		{
			client_print_color ( id, print_team_default, "%s You dont have enough ammo packs.", CHAT_PREFIX );
			
			return;
		}
		
		AmmoPacks [id] -= ArrayGetCell ( ExtraItemCost_01, itemid );
	}
	
	switch ( itemid )
	{
		case EXTRA_NVISION:
		{
			NVision [id] = true;
			
			if ( !IsBot [id] )
			{
				NVisionEnabled [id] = true;
				
				if ( get_pcvar_num ( Zp_CustomNvg ) )
				{
					remove_task ( id + TASK_NVISION );
					
					set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" ); 
					
					set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
					
					ShowSyncHudMsg ( id, MsgSync_01, "You bought NightVision!" );
				}
				else
					SetUserGNvision ( id, 1 );
			}
			else
				cs_set_user_nvg ( id, 1 );
		}
		case EXTRA_EXPLOSION_NADE: 
		{
			if ( user_has_weapon ( id, CSW_HEGRENADE ) )
			{
				cs_set_user_bpammo ( id, CSW_HEGRENADE, cs_get_user_bpammo ( id, CSW_HEGRENADE ) + 1 );

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );
				
				write_byte ( AMMOID [CSW_HEGRENADE] ); 
				
				write_byte ( 1 );
				
				message_end (  );
				
				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );
				
				return; 
			}
			
			fm_give_item ( id, "weapon_hegrenade" );
		}
		case EXTRA_NAPALM_NADE: 
		{
			if ( user_has_weapon ( id, CSW_FLASHBANG ) )
			{
				cs_set_user_bpammo ( id, CSW_FLASHBANG, cs_get_user_bpammo ( id, CSW_FLASHBANG ) + 1 );

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );
				
				write_byte ( AMMOID [CSW_FLASHBANG] ); 
				
				write_byte ( 1 );
				
				message_end (  );
				
				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );
				
				return; 
			}
			
			fm_give_item ( id, "weapon_flashbang" );
		}
		case EXTRA_FROST_NADE: 
		{
			if ( user_has_weapon ( id, CSW_SMOKEGRENADE ) )
			{
				cs_set_user_bpammo ( id, CSW_SMOKEGRENADE, cs_get_user_bpammo ( id, CSW_SMOKEGRENADE ) + 1 );

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );
				
				write_byte ( AMMOID [CSW_SMOKEGRENADE] ); 
				
				write_byte ( 1 );
				
				message_end (  );
				
				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );
				
				return; 
			}
			
			fm_give_item ( id, "weapon_smokegrenade" );
		}
		case EXTRA_AWP_MAGNUM_SNIPER:
		{
			new WeaponID = cs_weapon_name_to_id ( "weapon_awp" );
			
			if ( MAXBPAMMO [WeaponID] > 2 )
			{
				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )
		
					drop_weapons ( id, 1 );
				else
					drop_weapons ( id, 2 );

				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
			}

			fm_give_item ( id, "weapon_awp" );
		}
		case EXTRA_M249_PARA_MACHINEGUN:
		{
			new WeaponID = cs_weapon_name_to_id ( "weapon_m249" );
			
			if ( MAXBPAMMO [WeaponID] > 2 )
			{
				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )
		
					drop_weapons ( id, 1 );
				else
					drop_weapons ( id, 2 );

				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
			}

			fm_give_item ( id, "weapon_m249" );
		}
		case EXTRA_SG550_AUTO_SNIPER:
		{
			new WeaponID = cs_weapon_name_to_id ( "weapon_sg550" );
			
			if ( MAXBPAMMO [WeaponID] > 2 )
			{
				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )
		
					drop_weapons ( id, 1 );
				else
					drop_weapons ( id, 2 );

				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
			}

			fm_give_item ( id, "weapon_sg550" );
		}
		case EXTRA_G3SG1_AUTO_SNIPER:
		{
			new WeaponID = cs_weapon_name_to_id ( "weapon_g3sg1" );
			
			if ( MAXBPAMMO [WeaponID] > 2 )
			{
				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )
		
					drop_weapons ( id, 1 );
				else
					drop_weapons ( id, 2 );

				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );
			}

			fm_give_item ( id, "weapon_g3sg1" );
		}
		case EXTRA_JETPACK:
		{
		         new Clip, Ammo;
	                  
			new Weapon = get_user_weapon ( id, Clip, Ammo );
			
			set_hudmessage ( 255, 168, 25, -1.0, 0.80, 1, 0.0, 5.0, 1.0, 1.0, -1) 
		         
			ShowSyncHudMsg ( 0, MsgSync_01, "%s bought a Jetpack!!", PlayerName [id] );
			
			client_print_color ( id, print_team_grey, "%s Press^3 -CTRL+SPACE-^1 to fly!", CHAT_PREFIX );
		  
		         client_print_color ( id, print_team_grey, "%s Press^3 -RIGHT CLICK-^1 to shoot!", CHAT_PREFIX );
			
			HasJet [id] = 1;
			
			FlyEnergy [id] = get_pcvar_num ( Zp_FlyMaxEngery );
			
			Rocket [id] = true;
			
			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyJetpack, 1.0, ATTN_NORM, 0, PITCH_NORM ); 
			
			//client_cmd ( id,"spk items/gunpickup2.wav")
			
			if ( Weapon == CSW_KNIFE )
			{
				SwitchModel ( id );
			}
			else
			{
				engclient_cmd ( id, "weapon_knife" ), SwitchModel ( id );
			}    
		}
		case EXTRA_UNLIMITEDCLIP:
		{
			HasUnlimitedClip [id] = true;

			set_hudmessage ( 255, 215, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 )
			
			ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Unlimited Clip", PlayerName [id] );
			
			client_print_color ( id, print_team_grey, "%s^3 %s^1, you bought^4 Unlimited Clip", CHAT_PREFIX, PlayerName [id] );
	         }
		case EXTRA_ARMOR_100:
		{
			set_hudmessage ( 0, 0, 255, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( id, MsgSync_01, "%s, you have been equiped with Armor (100ap)", PlayerName [id] );
			
			client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Armor (100ap)", CHAT_PREFIX, PlayerName [id] );

			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + 100, 600 ) ) );
			
			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyArmor, 1.0, ATTN_NORM, 0, PITCH_NORM ); 
		}
		case EXTRA_ARMOR_200:
		{
			set_hudmessage ( 0, 0, 255, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( id, MsgSync_01, "%s, you have been equiped with Armor (200ap)", PlayerName [id] );
			
			client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Armor (200ap)", CHAT_PREFIX, PlayerName [id] );

			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + 200, 600 ) ) );
			
			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyArmor, 1.0, ATTN_NORM, 0, PITCH_NORM ); 
		}
		case EXTRA_MULTIJUMP:
		{
			MultiJumps [id] ++;

			set_hudmessage ( 235, 156, 9, -1.0, 0.6, 1, 0.0, 5.0, 1.0, 1.0, -1 )
			
			ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Multijump,^nMaxjumps: %d", PlayerName [id], MultiJumps [id] );
				
			client_print_color ( id, print_team_grey, "%s^3 %s^1, you bought^4 Multijump^1, maxjumps:^4 %d", CHAT_PREFIX, PlayerName [id], MultiJumps [id] );
		}
		case EXTRA_TRYDER:
		{
			fm_strip_user_weapons ( id );

			fm_set_rendering ( id, kRenderFxGlowShell, 150, 0, 255, kRenderNormal, 10 );
		
			fm_give_item ( id, "weapon_knife" ); 
		
			fm_give_item ( id, "weapon_ak47" );
		
			fm_give_item ( id, "weapon_g3sg1" );
		
			fm_give_item ( id, "weapon_m4a1" );
			
			fm_give_item ( id, "weapon_xm1014" );
			
			fm_give_item ( id, "weapon_sg550" );
			
			fm_give_item ( id, "weapon_deagle" );
			
			fm_give_item ( id, "weapon_hegrenade" );
			
			fm_give_item ( id, "weapon_flashbang" );
			
			fm_give_item ( id, "weapon_smokegrenade" );
		
			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AK47], AMMOTYPE [CSW_AK47], MAXBPAMMO [CSW_AK47] );
			
			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_G3SG1], AMMOTYPE [CSW_G3SG1], MAXBPAMMO [CSW_G3SG1] );
			
			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_M4A1], AMMOTYPE [CSW_M4A1], MAXBPAMMO [CSW_M4A1] );
			
			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_XM1014], AMMOTYPE [CSW_XM1014], MAXBPAMMO [CSW_XM1014] );
			
			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_DEAGLE], AMMOTYPE [CSW_DEAGLE], MAXBPAMMO [CSW_DEAGLE] );
		
			HasUnlimitedClip [id] = true;

			IsTryder [id] = true;
		
		         set_pev ( id, pev_gravity, 0.5 );	
		  
			fm_set_user_health ( id, get_pcvar_num ( Zp_TryderHealth ) );

			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + get_pcvar_num ( Zp_TryderArmor ), 600 ) ) );
		
			set_hudmessage ( 212, 0, 177, -1.0, 0.72, 1, 0.0, 5.0, 1.0, 1.0, -1)
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s is now a Tryder !!", PlayerName [id] );
		
			client_print_color ( 0, print_team_grey, "%s^3 %s^1 is now a^4 Tryder", CHAT_PREFIX, PlayerName [id] );
		}
		case EXTRA_SURVIVOR:
		{ 
			if ( native_has_round_started (  ) || EndRound )
	                  {
		                  client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );
		
		                  return;
	                  }
			  
			remove_task ( TASK_MAKEZOMBIE );
			  
			cmdMakeZombie ( MODE_SURVIVOR, id );
			
		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Survivor", CHAT_PREFIX, PlayerName [id] );
		
		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Survivor !", PlayerName [id] );
		
		         LogToFile ( "%s bought Survivor", PlayerName [id] );
		}
		case EXTRA_SNIPER:
		{
			if ( native_has_round_started (  ) || EndRound )
	                  {
		                  client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );
		
		                  return;
	                  }
			  
			remove_task ( TASK_MAKEZOMBIE );
			  
			cmdMakeZombie ( MODE_SNIPER, id );

		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Sniper", CHAT_PREFIX, PlayerName [id] );
		
		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Nemesis !", PlayerName [id] );
		
		         LogToFile ( "%s bought Survivor", PlayerName [id] );
		}
		case EXTRA_NEMESIS:
		{
			if ( native_has_round_started (  ) || EndRound )
	                  {
		                 client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );
		
		                  return;
	                  }
			  
			remove_task ( TASK_MAKEZOMBIE );
			  
			cmdMakeZombie ( MODE_NEMESIS, id );
			
		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Nemesis", CHAT_PREFIX, PlayerName [id] );
		
		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Nemesis !", PlayerName [id] );
		
		         LogToFile ( "%s bought Survivor", PlayerName [id] );
		}
		case EXTRA_ASSASSIN:
		{
			if ( native_has_round_started (  ) || EndRound )
	                  {
		                 client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );
		
		                  return;
	                  }
			
			remove_task ( TASK_MAKEZOMBIE );
			  
			cmdMakeZombie ( MODE_ASSASSIN, id );			

		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Assassin", CHAT_PREFIX, PlayerName [id] );
		
		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Assassin !", PlayerName [id] );
		
		         LogToFile ( "%s bought Survivor", PlayerName [id] );
		}
		case EXTRA_ANTIDOTE: 
		{
			UserHuman ( id, 0, 0, 0 );
		}
		case EXTRA_MADNESS: 
		{
			client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Zombie Madness", CHAT_PREFIX, PlayerName [id] );
			
			set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 )
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Zombie Madness!", PlayerName [id] );
			
			NoDamage [id] = true;
			
			fm_set_rendering ( id, kRenderFxGlowShell, 100, 0, 0, kRenderNormal, 200 );
			
			set_task ( get_pcvar_float ( Zp_MadnessDuration ), "MadnessOver", id + TASK_BLOOD );
			
			static Sound [64];
			
			ArrayGetString ( ZombieMadness, random_num ( 0, ArraySize ( ZombieMadness ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
		}
		case EXTRA_INFECTIONBOMB: 
		{
			set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( id, MsgSync_01, "You bought Infection Bomb!" );
			
			if ( user_has_weapon ( id, CSW_HEGRENADE ) )
			{
				cs_set_user_bpammo ( id, CSW_HEGRENADE, cs_get_user_bpammo ( id, CSW_HEGRENADE ) + 1 );

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );
				
				write_byte ( AMMOID [CSW_HEGRENADE] ); 
				
				write_byte ( 1 );
				
				message_end (  );
				
				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );
				
				return; 
			}
			
			fm_give_item ( id, "weapon_hegrenade" );
		}
		case EXTRA_KNIFEBLINK:
		{
		         iBlinks [id] += 5
			 
		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		         ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Knife Blinks ", PlayerName [id] );
		
		         client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Knife Blinks", CHAT_PREFIX, PlayerName [id] );
	         }
		default:
		{
			ExecuteForward ( fwExtraItemSelected, fwDummyResult, id, itemid );
		
			if ( fwDummyResult >= ZP_PLUGIN_HANDLED && !IgnoreCost )
		
				AmmoPacks [id] += ArrayGetCell ( ExtraItemCost_01, itemid );
		}
	}
}

public MenuZClass ( id, MenuID, Item )
{
	if ( Item == MENU_EXIT )
	{
		menu_destroy ( MenuID );
		
		return PLUGIN_HANDLED;
	}
	
	static Buffer [2], Dummy, ClassID;
	
	menu_item_getinfo ( MenuID,Item, Dummy, Buffer, charsmax ( Buffer ), _, _, Dummy );
	
	ClassID = Buffer [0];

	ZombieClassNext [id] = ClassID;
	
	static Name [32];
	
	ArrayGetString ( ZClassName_01, ZombieClassNext [id], Name, charsmax ( Name ) );
	
	static HealthString [16];
	
	AddCommas ( ArrayGetCell ( ZClassHealth_01, ZombieClassNext [id] ), HealthString, charsmax ( HealthString ) );
	
	client_print_color ( id, print_team_default, "%s Your zombie class after the next infection will be:^4 %s", CHAT_PREFIX, Name );
	
	client_print_color ( id, print_team_default, "%s Health:^4 %s^1 | Speed:^4 %d^1 | Gravity:^4 %d^1 | Knockback:^4 %d%%", CHAT_PREFIX, HealthString, ArrayGetCell ( ZClassSpeed_01, ZombieClassNext [id] ),
	
	floatround ( Float: ArrayGetCell ( ZClassGravity_01, ZombieClassNext [id] ) * 800.0 ), floatround ( Float: ArrayGetCell ( ZClassKnockback_01, ZombieClassNext [id] ) * 100.0 ) );
	
	menu_destroy ( MenuID );
	
	return PLUGIN_HANDLED;
}

public cmdMadeZombie ( id )
{
	if ( NewRound )
	{
		if ( !access ( id, AccessFlag [ACCESS_MODE_INFECTION] ) )
		
		return PLUGIN_HANDLED;
	}
	else
	{
                  if ( !access ( id, AccessFlag [ACCESS_MAKE_ZOMBIE] ) )
		  
	          return PLUGIN_HANDLED;
	}
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_zombie (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedZombie ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandZombie ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeTryder ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MAKE_HUMAN] ) ) return PLUGIN_HANDLED;
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_tryder (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( IsTryder [Player] || IsZombie [Player] || IsNemesis [Player] || IsAssassin [Player] || IsSurvivor [Player] || IsSniper [Player] )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandTryder ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeHuman ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MAKE_HUMAN] ) ) return PLUGIN_HANDLED;
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_human (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedHuman ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandHuman ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeNemesis ( id )
{
	if ( NewRound )
	{
		if ( !access ( id, AccessFlag [ACCESS_MODE_NEMESIS] ) ) return PLUGIN_HANDLED;
	}
	else
	{
                  if ( !access ( id, AccessFlag [ACCESS_MAKE_NEMESIS] ) ) return PLUGIN_HANDLED;
	}
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_nemesis (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedNemesis ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandNemesis ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeAssassin ( id )
{
	if ( NewRound )
	{
		if ( !access ( id, AccessFlag [ACCESS_MODE_ASSASSIN] ) ) return PLUGIN_HANDLED;
	}
	else
	{
                  if ( !access ( id, AccessFlag [ACCESS_MAKE_ASSASSIN] ) ) return PLUGIN_HANDLED;
	}
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_assassin (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedAssassin ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandAssassin ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeSurvivor ( id )
{
	if ( NewRound )
	{
		if ( !access ( id, AccessFlag [ACCESS_MODE_SURVIVOR] ) ) return PLUGIN_HANDLED;
	}
	else
	{
                  if ( !access ( id, AccessFlag [ACCESS_MAKE_SURVIVOR] ) ) return PLUGIN_HANDLED;
	}
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_survivor (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedSurvivor ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandSurvivor ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdMadeSniper ( id )
{
	if ( NewRound )
	{
		if ( !access ( id, AccessFlag [ACCESS_MODE_SNIPER] ) ) return PLUGIN_HANDLED;
	}
	else
	{
                  if ( !access ( id, AccessFlag [ACCESS_MAKE_SNIPER] ) ) return PLUGIN_HANDLED;
	}
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_sniper (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedSniper ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandSniper ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdRespawn ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_RESPAWN_PLAYERS] ) ) return PLUGIN_HANDLED;
	
	if ( read_argc (  ) < 2 )
	{
		console_print ( id, "* Usage: 'zp_respawn (Name)'" );
		
		return PLUGIN_HANDLED;
	}
	
	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
	
	new Player = cmd_target ( id, Arg, CMDTARGET_ALLOW_SELF );
	
	if ( !Player ) return PLUGIN_HANDLED;
	
	if ( IsAlive [Player] )
	{
		console_print ( id, "* Player ^"%s^" is alive !", PlayerName [Player] );
		
		return PLUGIN_HANDLED;
	}
	
	if ( !CheckAllowedRespawn ( Player ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandRespawn ( id, Player );
	
	return PLUGIN_HANDLED;
}

public cmdSwarm ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_SWARM] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedSwarm (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandSwarm ( id )
	
	return PLUGIN_HANDLED;
}

public cmdMulti ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_MULTI] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedMulti (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandMulti ( id )
	
	return PLUGIN_HANDLED;
}

public cmdPlague ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_PLAGUE] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedPlague (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandPlague ( id )
	
	return PLUGIN_HANDLED;
}

public cmdArmageddon ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_ARMAGEDDON] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedArmageddon (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandArmageddon ( id )
	
	return PLUGIN_HANDLED;
}

public cmdApocalypse ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_APOCALYPSE] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedApocalypse (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandApocalypse ( id )
	
	return PLUGIN_HANDLED;
}

public cmdNightmare ( id )
{
         if ( !access ( id, AccessFlag [ACCESS_MODE_NIGHTMARE] ) ) return PLUGIN_HANDLED;
	
	if ( !CheckAllowedNightmare (  ) )
	{
		console_print ( id, "* Unavailable command." );
		
		return PLUGIN_HANDLED;
	}
	
	CommandNightmare ( id )
	
	return PLUGIN_HANDLED;
}

public MessageCurWeapon ( MsgID, MsgDest, MsgEntity )
{
	if ( !IsAlive [MsgEntity] || IsZombie [MsgEntity] ) return;
	
	if ( get_msg_arg_int ( 1 ) != 1 ) return;
	
	if ( IsSurvivor [MsgEntity] ? !get_pcvar_num ( Zp_SurvivorInfiniteAmmo ) : IsSniper [MsgEntity] ? !get_pcvar_num ( Zp_SniperInfiniteAmmo ) : !HasUnlimitedClip [MsgEntity] ) return;	
	
	static Weapon, Clip;
	
	Weapon = get_msg_arg_int ( 2 );
	
	Clip = get_msg_arg_int ( 3 );

	if ( MAXCLIP [Weapon] > 2 )
	{
		set_msg_arg_int ( 3, get_msg_argtype ( 3 ), MAXCLIP [Weapon] );
		
		if ( Clip < 2 )
		{
			static WName [32], WeaponEnt;
			
			get_weaponname ( Weapon, WName, sizeof WName - 1 );
			
			WeaponEnt = fm_find_ent_by_owner ( -1, WName, MsgEntity );

			fm_set_weapon_ammo ( WeaponEnt, MAXCLIP [Weapon] );
		}		
	}	
}

public MessageMoney ( Msg_ID, MsgDest, MsgEntity )
{
	fm_cs_set_user_money ( MsgEntity, 0 );
	
	return PLUGIN_HANDLED;
}

public MessageHealth ( MsgID, MsgDest, MsgEntity )
{
	static Health; Health = get_msg_arg_int ( 1 );
	
	if ( Health < 256 ) return;
	
	if ( Health % 256 == 0 ) fm_set_user_health ( MsgEntity, pev ( MsgEntity, pev_health ) + 1 );
	
	set_msg_arg_int ( 1, get_msg_argtype ( 1 ), 255 );
}

public MessageScreenFade ( MsgID, MsgDest, MsgEntity )
{
	if ( get_msg_arg_int ( 4 ) != 255 || get_msg_arg_int ( 5 ) != 255 || get_msg_arg_int ( 6 ) != 255 || get_msg_arg_int ( 7 ) < 200 ) return PLUGIN_CONTINUE;
	
	if ( IsZombie [MsgEntity] && !IsNemesis [MsgEntity] && !IsAssassin [MsgEntity] )
	{
		set_msg_arg_int ( 4, get_msg_argtype ( 4 ), 0 );
		
		set_msg_arg_int ( 5, get_msg_argtype ( 5 ), 120 );
		
		set_msg_arg_int ( 6, get_msg_argtype ( 6 ), 240 );
		
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_HANDLED;
}

public MessageNvgToggle (  ) return PLUGIN_HANDLED;

public MessageWeaponPickup ( MsgID, MsgDest, MsgEntity )
{
	if ( IsZombie [MsgEntity] ) return PLUGIN_HANDLED;
	
	return PLUGIN_CONTINUE;
}

public MessageAmmoPickup ( MsgID, MsgDest, MsgEntity )
{
	if ( IsZombie [MsgEntity] ) return PLUGIN_HANDLED;
	
	return PLUGIN_CONTINUE;
}

public MessageScenario (  )
{
	if ( get_msg_args (  ) > 1 )
	{
		static Sprite [8]; get_msg_arg_string ( 2, Sprite, charsmax ( Sprite ) );
		
		if ( equal ( Sprite, "hostage" ) ) return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

public MessageHostagePos (  ) return PLUGIN_HANDLED;


public MessageTextMsg (  )
{
	static Msg [22]; get_msg_arg_string ( 2, Msg, charsmax ( Msg ) );
	
	if ( equal ( Msg, "#Game_will_restart_in" ) )
	{
		ScoreHumans = 0;
		
		ScoreZombies = 0;
		
		leRoundEnd (  );
	}
	else if ( equal ( Msg, "#Hostages_Not_Rescued" ) || equal ( Msg, "#Round_Draw" ) || equal ( Msg, "#Terrorists_Win" ) || equal ( Msg, "#CTs_Win" ) )
	
		return PLUGIN_HANDLED;
	
	if ( get_msg_args (  ) == 5 )
	{
		if ( get_msg_argtype ( 5 ) == ARG_STRING )
		{
			new Value_01 [64]; get_msg_arg_string ( 5, Value_01, charsmax ( Value_01 ) );
			
			if ( equal ( Value_01, "#Fire_in_the_hole" ) )

				return PLUGIN_HANDLED;
		}
	}
	else if ( get_msg_args (  ) == 6 )
	{
		if ( get_msg_argtype ( 6 ) == ARG_STRING )
		{
			new Value_02 [64]; get_msg_arg_string ( 6, Value_02, charsmax ( Value_02 ) );
			
			if ( equal ( Value_02, "#Fire_in_the_hole" ) )
				
				return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public MessageSendAudio (  )
{
	static Audio [17]; get_msg_arg_string ( 2, Audio, charsmax ( Audio ) );
	
	if ( equal ( Audio [7], "terwin") || equal ( Audio [7], "ctwin") || equal ( Audio [7], "rounddraw" ) ) 

	          return PLUGIN_HANDLED;
	
	if ( get_msg_args (  ) == 3 )
	{
		if ( get_msg_argtype ( 2 ) == ARG_STRING )
		{
			new Value [64]; get_msg_arg_string ( 2, Value, charsmax ( Value ) );
			
			if ( equal ( Value, "%!MRAD_FIREINHOLE" ) )

			         return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public MessageTeamScore (  )
{
	static Team [2]; get_msg_arg_string ( 1, Team, charsmax ( Team ) );
	
	switch ( Team [0] )
	{
		case 'C': set_msg_arg_int ( 2, get_msg_argtype ( 2 ), ScoreHumans );

		case 'T': set_msg_arg_int ( 2, get_msg_argtype ( 2 ), ScoreZombies );
	}
}

public MessageTeamInfo ( MsgID, MsgDest )
{
	if ( MsgDest != MSG_ALL && MsgDest != MSG_BROADCAST ) return;
	
	if ( SwitchingTeam ) return;

	static id; id = get_msg_arg_int ( 1 );
	
	set_task ( 0.2, "SpecNVision", id );
	
	if ( NewRound ) return;

	static Team [2]; get_msg_arg_string ( 2, Team, charsmax ( Team ) );
	
	switch ( Team [0] )
	{
		case 'C':
		{
			if ( ( SurvivorRound && fnGetHumans (  ) ) || ( SniperRound && fnGetHumans (  ) ) )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_T );
				
				set_msg_arg_string ( 2, "TERRORIST" );
			}
			else if ( !fnGetZombies (  ) )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_T );
				
				set_msg_arg_string ( 2, "TERRORIST" );
			}
		}
		case 'T':
		{
			if ( fnGetZombies (  ) )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
				
				set_msg_arg_string ( 2, "CT" );
			}
		}
	}
}

public MakeZombieTask (  ) cmdMakeZombie ( MODE_NONE, 0 );

cmdMakeZombie ( Mode, id )
{
	static iPlayersNum; iPlayersNum = fnGetAlive (  );

	if ( iPlayersNum < 1 )
	{
		set_task ( 2.0, "MakeZombieTask", TASK_MAKEZOMBIE );
		
		return;
	}
	
	NewRound = false;
	
	static ForwardID, Sound [64], iZombies, iMaxZombies;
	
	if ( ( Mode == MODE_NONE && ( LastMode != MODE_SURVIVOR ) && random_num ( 1, get_pcvar_num ( Zp_SurvivorChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_SurvivorMinPlayers ) ) || Mode == MODE_SURVIVOR )
	{
		SurvivorRound = true;
		
		LastMode = MODE_SURVIVOR;

		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );
		
		ForwardID = id;
		
		UserHuman ( id, 1, 0, 0 );

		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] ) continue;

			if ( IsSurvivor [id] || IsZombie [id] ) continue;
			
			UserZombie ( id, 0, 0, 0, 1, 0 );
		}
		
		ArrayGetString ( SoundSurvivor, random_num ( 0, ArraySize ( SoundSurvivor ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		set_hudmessage ( 20, 20, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 )
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%s is Survivor!", PlayerName [ForwardID] );
		
		ModeStarted = true;
		
		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SURVIVOR, ForwardID );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_SNIPER ) && random_num ( 1, get_pcvar_num ( Zp_SniperChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_SniperMinPlayers ) ) || Mode == MODE_SNIPER )
	{
		SniperRound = true;
		
		LastMode = MODE_SNIPER;
		
		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );
		
		ForwardID = id;

		UserHuman ( id, 0, 1, 0 );
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] ) continue;

			if ( IsSniper [id] || IsZombie [id] ) continue;
			
			UserZombie ( id, 0, 0, 0, 1, 0 );
		}

		ArrayGetString ( SoundSniper, random_num ( 0, ArraySize ( SoundSniper ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );

		set_hudmessage ( 20, 255, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "%s is Sniper!", PlayerName [ForwardID] );
		
		ModeStarted = true;
		
		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SNIPER, ForwardID );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_SWARM ) && random_num ( 1, get_pcvar_num ( Zp_SwarmChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_SwarmMinPlayers ) ) || Mode == MODE_SWARM )
	{		
		SwarmRound = true;
		
		LastMode = MODE_SWARM;
		
		iMaxZombies = floatround ( iPlayersNum * 0.5, floatround_ceil );
		
		iZombies = 0;
		
		while ( iZombies < iMaxZombies )
		{
			if ( ++ id > MaxPlayers ) id = 1;
			
			if ( !IsAlive [id] || IsZombie [id] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				UserZombie ( id, 0, 0, 0, 1, 0 );
				
				iZombies ++;
			}
		}
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsZombie [id] ) continue;
			
			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
				
				fm_user_team_update ( id );
			}
		}
		
		ArrayGetString ( SoundSwarm, random_num ( 0, ArraySize ( SoundSwarm ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		set_hudmessage ( 20, 255, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Swarm Round!" );
		
		ModeStarted = true;
		
		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SWARM, 0 );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_MULTI ) && random_num ( 1, get_pcvar_num ( Zp_MultiChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_MultiMinPlayers ) ) || Mode == MODE_MULTI )
	{
		LastMode = MODE_MULTI;
		
		iMaxZombies = floatround ( iPlayersNum * 0.5, floatround_ceil );
		
		iZombies = 0;

		while ( iZombies < iMaxZombies )
		{
			if ( ++ id > MaxPlayers ) id = 1;

			if ( !IsAlive [id] || IsZombie [id] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				UserZombie ( id, 0, 0, 0, 1, 0 );
				
				iZombies ++;
			}
		}
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsZombie [id] ) continue;

			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
				
				fm_user_team_update ( id );
			}
		}
		
		ArrayGetString ( SoundMulti, random_num ( 0, ArraySize ( SoundMulti ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		set_hudmessage ( 255, 50, 0, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Multiple Infection!" );

		ModeStarted = true;

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_MULTI, 0 );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_PLAGUE ) && random_num ( 1, get_pcvar_num ( Zp_PlagueChance ) ) == 1 && 
	floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) >= 1 && 
	iPlayersNum - ( get_pcvar_num ( Zp_PlagueSurvivorNum ) + get_pcvar_num ( Zp_PlagueNemesisNum ) + floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) ) >= 1 && 
	iPlayersNum >= get_pcvar_num ( Zp_PlagueMinPlayers ) ) || Mode == MODE_PLAGUE )
	{
		PlagueRound = true;
		
		LastMode = MODE_PLAGUE;
		
		static iSurvivors, iMaxSurvivors;
		
		iMaxSurvivors = get_pcvar_num ( Zp_PlagueSurvivorNum );
		
		iSurvivors = 0;
		
		while ( iSurvivors < iMaxSurvivors )
		{
			id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );
			
			if ( IsSurvivor [id] ) continue;
			
			UserHuman ( id, 1, 0, 0 );
			
			iSurvivors ++;

			fm_set_user_health ( id, get_pcvar_num ( Zp_PlagueSurvivorHealth ) )
		}
		
		static iNemesis, iMaxNemesis;
		
		iMaxNemesis = get_pcvar_num ( Zp_PlagueNemesisNum );
		
		iNemesis = 0;
		
		while ( iNemesis < iMaxNemesis )
		{
			id = fnGetRandomAlive ( random_num(1, iPlayersNum))
			
			if ( IsSurvivor [id] || IsNemesis [id] ) continue;
			
			UserZombie ( id, 0, 1, 0, 0, 0 );
			
			iNemesis ++;
			
			fm_set_user_health ( id, get_pcvar_num ( Zp_PlagueNemesisHealth ) );
		}
		
		iMaxZombies = floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil );
		
		iZombies = 0;
		
		while ( iZombies < iMaxZombies )
		{
			if ( ++ id > MaxPlayers ) id = 1;
			
			if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				UserZombie ( id, 0, 0, 0, 1, 0 );
				
				iZombies ++;
			}
		}
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] ) continue;
			
			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_CT);
				
				fm_user_team_update ( id );
			}
		}

		ArrayGetString ( SoundPlague, random_num ( 0, ArraySize ( SoundPlague ) - 1 ), Sound, charsmax ( Sound ) )
		
		PlaySound ( Sound );
		
		set_hudmessage ( 0, 50, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Plague Round!" );

		ModeStarted = true;

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_PLAGUE, 0 );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_ARMAGEDDON ) && random_num ( 1, get_pcvar_num ( Zp_ArmageddonChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_ArmageddonMinPlayers ) ) || Mode == MODE_ARMAGEDDON )
	{		
		ArmageddonRound = true;
		
		LastMode = MODE_ARMAGEDDON;
		
		static iSurvivors, iMaxSurvivors;
		
		iMaxSurvivors = floatround ( iPlayersNum * 0.5, floatround_ceil );
		
		iSurvivors = 0;
		
		while ( iSurvivors < iMaxSurvivors )
		{
			if ( ++ id > MaxPlayers ) id = 1;

			if ( !IsAlive [id] || IsSurvivor [id] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				UserHuman ( id, 1, 0, 0 );
				
				iSurvivors ++;		

				fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseSurvivorHealth ) );
			}
		}

		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsSurvivor [id] ) continue;

			UserZombie ( id, 0, 1, 0, 0, 0 );			
			
			fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseNemesisHealth ) );
		}
		
		ArrayGetString ( SoundArmageddon, random_num ( 0, ArraySize ( SoundArmageddon ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );

		set_hudmessage ( 155, 20, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Armageddon Round!" );		

		ModeStarted = true;

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_ARMAGEDDON, 0 );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_APOCALYPSE ) && random_num ( 1, get_pcvar_num ( Zp_ApocalypseChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_ApocalypseMinPlayers ) ) || Mode == MODE_APOCALYPSE )
	{		
		ApocalypseRound = true;
		
		LastMode = MODE_APOCALYPSE;
		
		static iSnipers, iMaxSnipers;
		
		iMaxSnipers = floatround ( iPlayersNum * 0.5, floatround_ceil )
		
		iSnipers = 0;
		
		while ( iSnipers < iMaxSnipers )
		{
			if ( ++ id > MaxPlayers ) id = 1;
			
			if ( !IsAlive [id] || IsSniper [id] ) continue;
			
			if ( random_num ( 0, 1 ) )
			{
				UserHuman ( id, 0, 1, 0 );
				
				iSnipers ++;		
				
				fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseSniperHealth ) );
			}
		}
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsSniper [id] ) continue;
			
			UserZombie ( id, 0, 0, 1, 0, 0 )	;		
			
			fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseAssassinHealth ) );
		}

		ArrayGetString ( SoundApocalypse, random_num ( 0, ArraySize ( SoundApocalypse ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		set_hudmessage ( 255, 20, 155, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Assassins vs. Snipers Round!" );
		
		ModeStarted = true;

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_APOCALYPSE, 0 );
	}
	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_NIGHTMARE ) && random_num ( 1, get_pcvar_num ( Zp_NightmareChance ) ) == 1 && floatround ( iPlayersNum * 0.2, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.2, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_NightmareMinPlayers ) ) || Mode == MODE_NIGHTMARE )
	{
		NightmareRound = true;
	
		LastMode = MODE_NIGHTMARE;
	
		iMaxZombies = floatround ( ( iPlayersNum * 0.2 ), floatround_ceil );
	
		iZombies = 0
	
		while ( iZombies < iMaxZombies )
		{
			if ( ( ++ id ) > MaxPlayers ) id = 1;
		
			if ( !IsAlive [id] ) continue;
		
			if ( random_num ( 0, 1 ) )
			{
				UserZombie ( id, 0, 1, 0, 0, 0 );
			
				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareAssassinHealth ) );
				//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightassahpmulti)))
			
				iZombies ++;
			}
		}
	
		iZombies = 0
	
		while ( iZombies < iMaxZombies )
		{
			if ( ( ++ id ) > MaxPlayers ) id = 1;
		
			if ( !IsAlive [id] || IsAssassin [id] ) continue;
		
			if ( random_num ( 0, 1 ) )
			{
				UserZombie ( id, 0, 0, 1, 0, 0 );
			
				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareNemesisHealth ) );
				//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightnemhpmulti)))
			
				iZombies ++;
			}
		}
	
		iZombies = 0
	
		while ( iZombies < iMaxZombies )
		{
			if ( ( ++ id ) > MaxPlayers ) id = 1;
		
			if ( !IsAlive [id] || IsAssassin [id] || IsNemesis [id] ) continue;
		
			if ( random_num ( 0,  1 ) )
			{
				UserHuman ( id, 1, 0, 0 );
			
				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareSurvivorHealth ) );
			//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightsurvhpmulti)))
			
				iZombies++
			}
		}
	
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] || IsAssassin [id] || IsNemesis [id] || IsSurvivor [id] ) continue;
		
			UserHuman ( id, 0, 1, 0 );
		
			fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareSniperHealth ) );		         
			//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightsniphpmulti)))
		}
	
		ArrayGetString ( SoundNightmare, random_num ( 0, ArraySize ( SoundNightmare ) - 1 ), Sound, charsmax ( Sound ) );
		
		PlaySound ( Sound );
		
		set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
		
		ShowSyncHudMsg ( 0, MsgSync_01, "Nightmare Round !" );		
		
		ModeStarted = true;
		
		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_NIGHTMARE, 0 );

	}
	else
	{
		LastMode = MODE_INFECTION;
		
		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );

		ForwardID = id;
		
		if ( ( Mode == MODE_NONE && ( LastMode != MODE_NEMESIS ) && random_num ( 1, get_pcvar_num ( Zp_NemesisChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_NemesisMinPlayers ) ) || Mode == MODE_NEMESIS )
		{
			NemesisRound = true;
			
			LastMode = MODE_NEMESIS;
			
			UserZombie ( id, 0, 1, 0, 0, 0 );
		}
		else if ( ( Mode == MODE_NONE && ( LastMode != MODE_ASSASSIN ) && random_num ( 1, get_pcvar_num ( Zp_AssassinChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_AssassinMinPlayers ) ) || Mode == MODE_ASSASSIN )
		{
			AssassinRound = true;
			
			LastMode = MODE_ASSASSIN;

			UserZombie ( id, 0, 0, 1, 0, 0 ); 
		}
		else
		{
			LastMode = MODE_INFECTION;

			UserZombie ( id, 0, 0, 0, 0, 0 );
		}
		
		for ( id = 1; id <= MaxPlayers; id ++ )
		{
			if ( !IsAlive [id] ) continue;
			
			if ( IsZombie [id] ) continue;
			
			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
			{
				remove_task ( id + TASK_TEAM );
				
				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
				
				fm_user_team_update ( id );
			}
		}		
		
		if ( NemesisRound )
		{
			ArrayGetString ( SoundNemesis, random_num ( 0, ArraySize ( SoundNemesis ) - 1 ), Sound, charsmax ( Sound ) );
			
			PlaySound ( Sound );
			
			set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s is Nemesis !", PlayerName [ForwardID] );

			ModeStarted = true;			

			ExecuteForward ( fwRoundStart,  fwDummyResult, MODE_NEMESIS, ForwardID );
		}
		else if ( AssassinRound )
		{
			ArrayGetString ( SoundAssassin, random_num ( 0, ArraySize ( SoundAssassin ) - 1 ), Sound, charsmax ( Sound ) );
			
			PlaySound ( Sound );

			set_hudmessage ( 255, 255, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s is Assassin !", PlayerName [ForwardID] );
			
			ModeStarted = true;

			ExecuteForward ( fwRoundStart, fwDummyResult, MODE_ASSASSIN, ForwardID );
		}
		else
		{
			set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s is First Zombie !", PlayerName [ForwardID] );
			
			ModeStarted = true;
			
			ExecuteForward ( fwRoundStart, fwDummyResult, MODE_INFECTION, ForwardID );
		} 
	}  

	if ( ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && NemesisRound ) || 
	( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && AssassinRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && SurvivorRound ) || 
	( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && SniperRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && SwarmRound ) || 
	( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && PlagueRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && ArmageddonRound ) || 
	( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && ApocalypseRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && NightmareRound ) || 
	( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && !NemesisRound && !AssassinRound && !SurvivorRound && !SniperRound && !SwarmRound && !PlagueRound && !ArmageddonRound && !ApocalypseRound && !NightmareRound ) )
	{
		remove_task ( TASK_AMBIENCESOUNDS );
		
		set_task ( 2.0, "AmbienceSoundEffects", TASK_AMBIENCESOUNDS );
	}	
}

UserZombie ( id, Infector, Nemesis, Assassin, SilentMode, Rewards )
{
	ExecuteForward ( fwUserInfectAttempt, fwDummyResult, id, Infector, Nemesis );
	
	if ( fwDummyResult >= ZP_PLUGIN_HANDLED && ModeStarted && fnGetZombies (  ) > LastPlayerLeaving ) return;
	
	ExecuteForward ( fwUserInfectedPre, fwDummyResult, id, Infector, Nemesis );
	
	if ( ZombieClassNext [id] == ZCLASS_NONE ) set_task ( 0.2, "ShowMenuZClass", id );

	ZombieClass [id] = ZombieClassNext [id];
	
	if ( ZombieClass [id] == ZCLASS_NONE ) ZombieClass [id] = 0;
	
	IsZombie [id] = true;
	
	IsNemesis [id] = false;
	
	IsAssassin [id] = false;
	
	IsSurvivor [id] = false;
	
	IsSniper [id] = false;
	
	FirstZombie [id] = false;
	
	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_BRIGHTLIGHT );
	
	NoDamage [id] = false;
	
	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_NODRAW );
	
	BurningDuration [id] = 0;

	if ( Rewards && Infector )
	{
		SendDeathMsg ( Infector, id );
		
		FixDeadAttrib ( id );
		
		UpdateFrags ( Infector, id, 1, 1, 1 );
		
		AmmoPacks [Infector] += get_pcvar_num ( Zp_AmmoInfect );
	}
	
	ZombieSpeed [id] = float ( ArrayGetCell ( ZClassSpeed_01, ZombieClass [id] ) );
	
	ZombieKnockback [id] = Float:ArrayGetCell ( ZClassKnockback_01, ZombieClass [id] );
	
	ArrayGetString ( ZClassName_01, ZombieClass [id], ZombieClassName [id], charsmax ( ZombieClassName [ ] ) );

	static Sound [64];
	
	if ( !SilentMode )
	{
		if ( Nemesis )
		{
			IsNemesis [id] = true;

			if ( get_pcvar_num ( Zp_NemesisHealth ) < 50000 )
			
				fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, 0 ) * fnGetAlive (  ) );
			else
				fm_set_user_health ( id, get_pcvar_num ( Zp_NemesisHealth ) );

			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_NemesisGravity ) );
		}
		else if ( Assassin )
		{
			IsAssassin [id] = true;

			if ( get_pcvar_num ( Zp_AssassinHealth ) < 15000 )
			
				fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, 0 ) * fnGetAlive (  ) );
			else
				fm_set_user_health ( id, get_pcvar_num ( Zp_AssassinHealth ) );
			
			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_AssassinGravity ) );
		}
		else if ( fnGetZombies (  ) == 1 )
		{
			FirstZombie [id] = true;

			fm_set_user_health ( id, floatround ( float ( ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) ) * 1.0 ) );
			
			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );

			ArrayGetString ( ZombieInfect, random_num ( 0, ArraySize ( ZombieInfect ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
		}
		else
		{
			fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) )
			
			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );
			
			ArrayGetString ( ZombieInfect, random_num ( 0, ArraySize ( ZombieInfect ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
			
			set_hudmessage ( 255, 20, 20, 0.05, 0.45, 0, 0.0, 5.0, 1.0, 1.0, -1 );
			
			if ( Infector )
			
				ShowSyncHudMsg ( 0, MsgSync_01, "%s's brains has been eaten by %s...", PlayerName [id], PlayerName [Infector] );
			else
				ShowSyncHudMsg ( 0, MsgSync_01, "%s's brains has been eaten...", PlayerName [id] );
		}
	}
	else
	{
		fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) )
		
		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );
	}

	remove_task ( id + TASK_MODEL );
	
	remove_task ( id + TASK_BLOOD );
	
	remove_task ( id + TASK_BURN );
	
	if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_T )
	{
		remove_task ( id + TASK_TEAM );
		
		fm_cs_set_user_team ( id, FM_CS_TEAM_T);
		
		fm_user_team_update ( id );
	}

	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;
	
	AlreadyHasModel = false;
	
	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );

	if ( IsNemesis [id] && GetModels [NEMESIS] )
	{
		size = ArraySize ( ModelNemesis );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelNemesis, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0, size - 1 );
			
			ArrayGetString ( ModelNemesis, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else if ( IsAssassin [id] && GetModels [ASSASSIN] )
	{
		size = ArraySize ( ModelAssassin );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelAssassin, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0, size - 1 );
				
			ArrayGetString ( ModelAssassin, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else
	{
		for ( i = ArrayGetCell ( ZClassModelsStart_01, ZombieClass [id] ); i < ArrayGetCell ( ZClassModelSend_01, ZombieClass [id] ); i ++ )
		{
			ArrayGetString ( ZClassPlayerModel_01, i, TempModel, charsmax ( TempModel ) );
					
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
				
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( ArrayGetCell ( ZClassModelsStart_01, ZombieClass [id] ), ArrayGetCell ( ZClassModelSend_01, ZombieClass [id] ) - 1 );
				
			ArrayGetString ( ZClassPlayerModel_01, iRandom, PlayerModel[ id], charsmax ( PlayerModel [ ] ) );
		}
	}
		
	if ( !AlreadyHasModel )
	{
		if ( NewRound )
			
			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );
		else
			fmUserModelUpdate ( id + TASK_MODEL );
	}
		
	if ( !IsFrozen [id] )
	{
		if ( IsNemesis [id] )

		         fm_set_rendering ( id, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 25  );
			//fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
			
		else if ( IsAssassin [id] )

			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
		else
			fm_set_rendering ( id );
	}

	cs_set_user_zoom ( id, CS_RESET_ZOOM, 1 );
	
	set_pev ( id, pev_armorvalue, 0.0 );
	
	drop_weapons ( id, 1 );
	
	drop_weapons ( id, 2 );
	
	fm_strip_user_weapons ( id );
	
	fm_give_item ( id, "weapon_knife" );
	
	InfectionEffects ( id );
	
	if ( get_pcvar_num ( Zp_NvgGive ) )
	{
		NVision [id] = true;
		
		if ( !IsBot [id] )
		{
			if ( get_pcvar_num ( Zp_NvgGive ) == 1 )
			{
				NVisionEnabled [id] = true;
				
				if ( get_pcvar_num ( Zp_CustomNvg ) )
				{
					remove_task ( id + TASK_NVISION );
					
					set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );
				}
				else
					SetUserGNvision ( id, 1 );
			}

			else if ( NVisionEnabled [id] )
			{
				if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );
				
				else SetUserGNvision ( id, 0 );
				
				NVisionEnabled [id] = false;
			}
		}
		else
			cs_set_user_nvg ( id, 1 );
	}
	else if ( NVision [id] )
	{
		if ( IsBot [id] ) cs_set_user_nvg ( id, 0 )
		
		if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );
		
		else if ( NVisionEnabled [id] ) SetUserGNvision ( id, 0 );
			
		NVision [id] = false;
		
		NVisionEnabled [id] = false;
	}
	
	if ( !IsNemesis [id] && !IsNemesis [id] && get_pcvar_num ( Zp_ZombieBleeding ) ) set_task ( 0.7, "MakeBlood", id + TASK_BLOOD, _, _, "b" );
	
	if ( !IsNemesis [id] && !IsAssassin [id] ) set_task ( random_float ( 50.0, 70.0 ), "ZombiePlayIdle", id + TASK_BLOOD, _, _, "b" );
	
	ExecuteForward ( fwUserInfectedPost, fwDummyResult, id, Infector, Nemesis );
	
	fnCheckLastZombie (  );
}

UserHuman ( id, Survivor, Sniper, SilentMode )
{

	ExecuteForward ( fwUserHumanizeAttempt, fwDummyResult, id, Survivor )
	
	if ( fwDummyResult >= ZP_PLUGIN_HANDLED && ModeStarted && fnGetHumans (  ) > LastPlayerLeaving ) return;
	
	ExecuteForward ( fwUserHumanizedPre, fwDummyResult, id, Survivor );

	remove_task ( id + TASK_MODEL );
	
	remove_task ( id + TASK_BLOOD );
	
	remove_task ( id + TASK_BURN );
	
	remove_task ( id + TASK_NVISION );

	IsZombie [id] = false;
	
	IsNemesis [id] = false;
	
	IsAssassin [id] = false;
	
	IsSurvivor [id] = false;
	
	IsSniper [id] = false;
	
	FirstZombie [id] = false;
	
	CanBuy [id] = true;
	
	NVision [id] = false;
	
	NVisionEnabled [id] = false;
	
	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_BRIGHTLIGHT );
	
	NoDamage [id] = false;
	
	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_NODRAW );
	
	BurningDuration [id] = 0;
	
	drop_weapons ( id, 1 );
	
	drop_weapons ( id, 2 );

	fm_strip_user_weapons ( id );
	
	fm_give_item ( id, "weapon_knife" );

	if ( Survivor )
	{
		IsSurvivor [id] = true;
		
		if ( get_pcvar_num ( Zp_SurvivorHealth ) < 3500 )

			fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) * fnGetAlive (  ) );
		else
			fm_set_user_health ( id, get_pcvar_num ( Zp_SurvivorHealth ) );
		
		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SurvivorGravity ) );
		                  
		fm_give_item ( id, "weapon_xm1014" );
		fm_give_item ( id, "weapon_ak47" );
		fm_give_item ( id, "weapon_m4a1" );
		
		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_XM1014], AMMOTYPE [CSW_XM1014], MAXBPAMMO [CSW_XM1014] );               
		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AK47], AMMOTYPE [CSW_AK47], MAXBPAMMO [CSW_AK47] );                
		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_M4A1], AMMOTYPE [CSW_M4A1], MAXBPAMMO [CSW_M4A1] );                       		
	}
	else if ( Sniper )
	{
		IsSniper [id] = true
		
		if ( get_pcvar_num ( Zp_SniperHealth ) < 2000 )

			fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) * fnGetAlive (  ) );
		else
			fm_set_user_health ( id, get_pcvar_num ( Zp_SniperHealth ) );
		
		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SniperGravity ) );
			
		fm_give_item ( id, "weapon_awp" ) ;               
		
		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AWP], AMMOTYPE [CSW_AWP], MAXBPAMMO [CSW_AWP] );               	
	}
	else
	{
		fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) );		
		
		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );		
		
		set_task ( 0.2, "ShowMenuBuy_01", id + TASK_SPAWN );

		if ( !SilentMode )
		{
			static Sound [64];
			
			ArrayGetString ( SoundAntidote, random_num ( 0, ArraySize ( SoundAntidote ) - 1 ), Sound, charsmax ( Sound ) );
			
			emit_sound ( id, CHAN_ITEM, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
			
			set_hudmessage ( 20, 155, 255, 0.05, 0.45, 0, 0.0, 5.0, 1.0, 1.0, -1 );
			
			ShowSyncHudMsg ( 0, MsgSync_01, "%s has used an antidote...", PlayerName [id] )
		}
	}

	if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )
	{
		remove_task ( id + TASK_TEAM );
		
		fm_cs_set_user_team ( id, FM_CS_TEAM_CT);
		
		fm_user_team_update ( id );
	}

	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;
	
	AlreadyHasModel = false;
	
	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );
		
	if ( IsSurvivor [id] && GetModels [SURVIVOR] )
	{
		size = ArraySize ( ModelSurvivor );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelSurvivor, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0, size - 1 );
				
			ArrayGetString ( ModelSurvivor, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else if ( IsSniper [id] && GetModels [SNIPER] )
	{
		size = ArraySize ( ModelSniper );
			
		for ( i = 0; i < size; i ++ )
		{
			ArrayGetString ( ModelSniper, i, TempModel, charsmax ( TempModel ) );
				
			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
		}
			
		if ( !AlreadyHasModel )
		{
			iRandom = random_num ( 0, size - 1 );
				
			ArrayGetString ( ModelSniper, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
		}
	}
	else
	{
		if ( GetModels [OWNER] && ( get_user_flags ( id ) & AccessFlag [ACCESS_OWNER_MODELS] ) )
		{
			size = ArraySize ( ModelOwnerHuman );
				
			for ( i = 0; i < size; i ++ )
			{
				ArrayGetString ( ModelOwnerHuman, i, TempModel, charsmax ( TempModel ) )
					
				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
			}
				
			if ( !AlreadyHasModel )
			{
				iRandom = random_num ( 0, size - 1 );
					
				ArrayGetString ( ModelOwnerHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
			}				
		}
		else if ( GetModels [ADMIN] && ( get_user_flags ( id ) & AccessFlag [ACCESS_ADMIN_MODELS] ) )
		{
			size = ArraySize ( ModelAdminHuman );
				
			for ( i = 0; i < size; i ++ )
			{
				ArrayGetString ( ModelAdminHuman, i, TempModel, charsmax ( TempModel ) )
				
				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
			}
				
			if ( !AlreadyHasModel )
			{
				iRandom = random_num ( 0, size - 1 );
					
				ArrayGetString ( ModelAdminHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
			}				
		}
		else 
		{
			size = ArraySize ( ModelHuman );
				
			for ( i = 0; i < size; i ++ )
			{
				ArrayGetString ( ModelHuman, i, TempModel, charsmax ( TempModel ) )
					
				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;
			}
				
			if ( !AlreadyHasModel )
			{
				iRandom = random_num ( 0, size - 1 );
					
				ArrayGetString ( ModelHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );
			}
		}
	}
		
	if ( !AlreadyHasModel )
	{
		if ( NewRound )
			
			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );
		else
			fmUserModelUpdate ( id + TASK_MODEL );
	}
		
	if ( !IsFrozen [id] )
	{
		if ( IsSurvivor [id] || IsSniper [id] )

			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
		else
			fm_set_rendering ( id );
	}

	if ( IsBot [id] ) cs_set_user_nvg ( id, 0 );
	
	else if ( !get_pcvar_num ( Zp_CustomNvg ) && NVisionEnabled [id] ) SetUserGNvision ( id, 0 );
		
	ExecuteForward ( fwUserHumanizedPost, fwDummyResult, id, Survivor );

	fnCheckLastZombie (  );
}

public CacheCvars (  )
{      	
	CachedHumanSpeed = get_pcvar_float ( Zp_HumanSpeed );
	
	CachedNemesisSpeed = get_pcvar_float ( Zp_NemesisSpeed );
	
	CachedAssassinSpeed = get_pcvar_float ( Zp_AssassinSpeed );
	
	CachedSurvivorSpeed = get_pcvar_float ( Zp_SurvivorSpeed );
	
	CachedSniperSpeed = get_pcvar_float ( Zp_SniperSpeed );

	CachedLeapNemesis = get_pcvar_num ( Zp_LeapNemesis );
	
	CachedLeapNemesisCooldown = get_pcvar_float ( Zp_LeapNemesisCooldown );
}

LoadCustomizationFromFiles (  )
{
	new Path [64]; get_configsdir ( Path, charsmax ( Path ) );

	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_CUSTOMIZATION_FILE );

	if ( !file_exists ( Path ) )
	{
		new Error [100]; formatex ( Error, charsmax ( Error ), "Cannot load customization file %s!", Path );
	
		set_fail_state ( Error );
	
		return;
	}

	new LineData [1024], Key [64], Value [960], Section, Teams, i, Buffer [100];

	new File = fopen ( Path, "rt" );

	while ( File && !feof ( File ) )
	{
		fgets ( File, LineData, charsmax ( LineData ) );
	
		replace ( LineData, charsmax ( LineData ), "^n", "" );
	
		if ( !LineData [0] || LineData [0] == ';' ) continue;
	
		if ( LineData [0] == '[' )
		{
			Section ++;
		
			continue;
		}
	
		strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );
	
		trim ( Key );
		trim ( Value );
	
		switch ( Section )
		{
			case SECTION_ACCESS_FLAGS:
			{
				if ( equal ( Key, "START MODE INFECTION"))
					
					AccessFlag [ACCESS_MODE_INFECTION] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE NEMESIS"))
					
					AccessFlag [ACCESS_MODE_NEMESIS] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE ASSASSIN"))
					
					AccessFlag [ACCESS_MODE_ASSASSIN] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE SURVIVOR"))
					
					AccessFlag [ACCESS_MODE_SURVIVOR] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE SNIPER"))
					
					AccessFlag [ACCESS_MODE_SNIPER] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE SWARM"))
							
					AccessFlag [ACCESS_MODE_SWARM] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE MULTI"))
					
					AccessFlag [ACCESS_MODE_MULTI] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE PLAGUE"))
					
					AccessFlag [ACCESS_MODE_PLAGUE] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE ARMAGEDDON"))
					
					AccessFlag [ACCESS_MODE_ARMAGEDDON] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE APOCALYPSE"))
					
					AccessFlag [ACCESS_MODE_APOCALYPSE] = read_flags ( Value );
				
				else if ( equal ( Key, "START MODE NIGHTMARE"))
					
					AccessFlag [ACCESS_MODE_NIGHTMARE] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE ZOMBIE"))
					
					AccessFlag [ACCESS_MAKE_ZOMBIE] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE HUMAN"))
					
					AccessFlag [ACCESS_MAKE_HUMAN] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE NEMESIS"))
					
					AccessFlag [ACCESS_MAKE_NEMESIS] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE ASSASSIN"))
					
					AccessFlag [ACCESS_MAKE_ASSASSIN] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE SURVIVOR"))
					
					AccessFlag [ACCESS_MAKE_SURVIVOR] = read_flags ( Value );
				
				else if ( equal ( Key, "MAKE SNIPER"))
					
					AccessFlag [ACCESS_MAKE_SNIPER] = read_flags ( Value );
				
				else if ( equal ( Key, "RESPAWN PLAYERS"))
					
					AccessFlag [ACCESS_RESPAWN_PLAYERS] = read_flags ( Value );
				
				else if ( equal ( Key, "OWNER MODELS"))
					
					AccessFlag [ACCESS_OWNER_MODELS] = read_flags ( Value );
				
				else if ( equal ( Key, "ADMIN MODELS" ) )
				
					AccessFlag [ACCESS_ADMIN_MODELS] = read_flags ( Value );
			}
			case SECTION_PLAYER_MODELS:
			{
				if ( equal ( Key, "HUMAN" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ModelHuman, Key );
					}
				}
				else if ( equal ( Key, "NEMESIS" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [NEMESIS] = false;
					}
					else
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [NEMESIS] = true;
							
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelNemesis, Key );
							
							for ( i = 0; i < ArraySize ( ModelNemesis ); i ++ )
							{
								ArrayGetString( ModelNemesis, i, Buffer, charsmax ( Buffer ) );
		
								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

								engfunc ( EngFunc_PrecacheModel, Buffer );
								
								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "ASSASSIN" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [ASSASSIN] = false;
					}
					else
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [ASSASSIN] = true;
							
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelAssassin, Key );
							
							for ( i = 0; i < ArraySize ( ModelAssassin ); i ++ )
							{
								ArrayGetString ( ModelAssassin, i, Buffer, charsmax ( Buffer ) );
		
								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

								engfunc ( EngFunc_PrecacheModel, Buffer );
								
								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "SURVIVOR" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [SURVIVOR] = false;
					}
					else
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [SURVIVOR] = true;
							
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelSurvivor, Key );
						
							for ( i = 0; i < ArraySize ( ModelSurvivor); i ++ )
							{
								ArrayGetString( ModelSurvivor, i, Buffer, charsmax ( Buffer ) );
		
								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );
		
		                                                       engfunc ( EngFunc_PrecacheModel, Buffer );
		
								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "SNIPER" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [SNIPER] = false;
					}
					else
					{	
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [SNIPER] = true;
							
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelSniper, Key );
	
                                                                for ( i = 0; i < ArraySize ( ModelSniper ); i ++ )
	                                                       {
                                                                      	 ArrayGetString( ModelSniper, i, Buffer, charsmax ( Buffer ) );
		
                                                                      	 format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

								 engfunc ( EngFunc_PrecacheModel, Buffer );	 
									 
                                                                      	 if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
                                                                      	 if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "OWNER HUMAN" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [OWNER] = false;
					}
					else
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [OWNER] = true;
							
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelOwnerHuman, Key );
							
							for ( i = 0; i < ArraySize ( ModelOwnerHuman ); i ++ )
							{
								ArrayGetString ( ModelOwnerHuman, i, Buffer, charsmax ( Buffer ) );
		
								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

								engfunc ( EngFunc_PrecacheModel, Buffer );
								
								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "ADMIN HUMAN" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						GetModels [ADMIN] = false;
					}
					else
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
						{
							GetModels [ADMIN] = true;
						
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( ModelAdminHuman, Key );

							for ( i = 0; i < ArraySize ( ModelAdminHuman ); i ++ )
							{
								ArrayGetString ( ModelAdminHuman, i, Buffer, charsmax ( Buffer ) );
		
								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

								engfunc ( EngFunc_PrecacheModel, Buffer );
								
								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 
		
								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );
							}
						}
					}
				}
				else if ( equal ( Key, "FORCE CONSISTENCY" ) )
					
					ForceConsistency = str_to_num ( Value );
			}
			case SECTION_WEAPON_MODELS:
			{				
				if ( equal ( Key, "V_KNIFE HUMAN" ) )
					
					copy ( ModelVKnifeHuman, charsmax ( ModelVKnifeHuman ), Value );
				
				else if ( equal ( Key, "V_KNIFE NEMESIS" ) )
					
					copy ( ModelVKnifeNemesis, charsmax ( ModelVKnifeNemesis ), Value );
				
				else if ( equal ( Key, "V_KNIFE ASSASSIN"))
					
					copy ( ModelVKnifeAssassin, charsmax ( ModelVKnifeAssassin ), Value );
				
				else if ( equal ( Key, "V_XM1014 SURVIVOR"))
					
					copy ( ModelVxm1014Survivor, charsmax ( ModelVxm1014Survivor ), Value );
				
				else if ( equal ( Key, "P_XM1014 SURVIVOR"))
					
					copy ( ModelPxm1014Survivor, charsmax ( ModelPxm1014Survivor ), Value );
				
				else if ( equal ( Key, "V_AK47 SURVIVOR"))
					
					copy ( ModelVak47Survivor, charsmax ( ModelVak47Survivor ), Value );
				
				else if ( equal ( Key, "P_AK47 SURVIVOR"))
					
					copy ( ModelPak47Survivor, charsmax ( ModelPak47Survivor ), Value );
				
				else if ( equal ( Key, "V_M4A1 SURVIVOR"))
					
					copy ( ModelVm4a1Survivor, charsmax ( ModelVm4a1Survivor ), Value );
				
				else if ( equal ( Key, "P_M4A1 SURVIVOR"))
					
					copy ( ModelPm4a1Survivor, charsmax ( ModelPm4a1Survivor ), Value );
				
				else if ( equal ( Key, "V_AWP SNIPER"))
					
					copy ( ModelVawpSniper, charsmax ( ModelVawpSniper ), Value );
				
				else if ( equal ( Key, "P_AWP SNIPER"))
					
					copy ( ModelPawpSniper , charsmax ( ModelPawpSniper ), Value );
				
				else if ( equal ( Key, "GRENADE INFECT"))
					
					copy ( ModelGrenadeInfect, charsmax ( ModelGrenadeInfect ), Value );
				
				else if ( equal ( Key, "GRENADE EXPLODE"))
					
					copy ( ModelGrenadeExplode, charsmax ( ModelGrenadeExplode ), Value );
				
				else if ( equal ( Key, "GRENADE FIRE"))
					
					copy( ModelGrenadeFire, charsmax ( ModelGrenadeFire ), Value );
				
				else if ( equal ( Key, "GRENADE FROST"))
					
					copy ( ModelGrenadeFrost, charsmax ( ModelGrenadeFrost ), Value );
				
				else if ( equal ( Key, "ROCKET MODEL" ) )
					
					copy ( RocketModel, charsmax ( RocketModel ), Value );
				
				else if ( equal ( Key, "TRIP MINE VIEW"))
					
					copy ( ModelTripMine, charsmax ( ModelTripMine ), Value );
			}
			case SECTION_SOUNDS:
			{
				if ( equal ( Key, "WIN ZOMBIES" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundWinZombies, Key );
					}
				}
				else if ( equal ( Key, "WIN HUMANS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundWinHumans, Key );
					}
				}
				else if ( equal ( Key, "WIN NO ONE" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundWinNoOne, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE INFECT" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ZombieInfect, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE PAIN" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ZombiePain, Key );
					}
				}
				else if ( equal ( Key, "NEMESIS PAIN" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( NemesisPain, Key );
					}
				}
				else if ( equal ( Key, "ASSASSIN PAIN" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( AssassinPain, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE DIE" ) )
				{
					while ( Value[0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ZombieDie, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE FALL" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ZombieFall, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE MISS SLASH" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieMissSlash, Key );
					}
				}
				else if (equal( Key, "ZOMBIE MISS WALL"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieMissWall, Key );
					}
				}
				else if (equal(Key, "ZOMBIE HIT NORMAL"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieHitNormal, Key );
					}
				}
				else if (equal(Key, "ZOMBIE HIT STAB"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieHitStab, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE IDLE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieIdle, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE IDLE LAST"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieIdleLast, Key );
					}
				}
				else if ( equal ( Key, "ZOMBIE MADNESS"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( ZombieMadness, Key );
					}
				}
				else if ( equal ( Key, "ROUND NEMESIS"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundNemesis, Key );
					}
				}
				else if ( equal ( Key, "ROUND ASSASSIN"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundAssassin, Key );
					}
				}
				else if ( equal ( Key, "ROUND SURVIVOR"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundSurvivor, Key );
					}
				}
				else if ( equal ( Key, "ROUND SNIPER"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundSniper, Key );
					}
				}
				else if (equal( Key, "ROUND SWARM"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundSwarm, Key );
					}
				}
				else if ( equal( Key, "ROUND MULTI"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundMulti,Key );
					}
				}
				else if ( equal ( Key, "ROUND PLAGUE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundPlague, Key );
					}
				}
				else if ( equal ( Key, "ROUND ARMAGEDDON"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundArmageddon, Key );
					}
				}
				else if (equal( Key, "ROUND APOCALYPSE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundApocalypse, Key );
					}
				}
				else if ( equal ( Key, "ROUND NIGHTMARE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundNightmare, Key );
					}
				}
				else if (equal(Key, "GRENADE INFECT EXPLODE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeInfect, Key );
					}
				}
				else if (equal(Key, "GRENADE INFECT PLAYER"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeInfectPlayer, Key );
					}
				}
				else if (equal( Key, "GRENADE EXPLODE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeExplode, Key );
					}
				}
				else if (equal(Key, "GRENADE FIRE EXPLODE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeFire, Key );
					}
				}
				else if ( equal ( Key, "GRENADE FIRE PLAYER"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeFirePlayer, Key );
					}
				}
				else if (equal(Key, "GRENADE FROST EXPLODE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeFrost, Key );
					}
				}
				else if (equal(Key, "GRENADE FROST PLAYER"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeFrostPlayer, Key );
					}
				}
				else if (equal(Key, "GRENADE FROST BREAK"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( GrenadeFrostBreak, Key );
					}
				}				
				else if (equal(Key, "ANTIDOTE"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundAntidote, Key );
					}
				}
			}
			case SECTION_AMBIENCE_SOUNDS:
			{
				if ( equal ( Key, "INFECTION ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && equal ( Key, "INFECTION SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_01, Key );
						
						ArrayPushCell ( SoundAmbienceMp3_01, equal ( Key [strlen ( Key ) -4], ".mp3") ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && equal ( Key, "INFECTION DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key ); 
						
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_01, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "NEMESIS ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && equal ( Key, "NEMESIS SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_02, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_02, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && equal(Key, "NEMESIS DURATIONS"))
				{
					while ( Value[0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_02, str_to_num ( Key ) )
					}
				}
				else if ( equal ( Key, "ASSASSIN ENABLE"))
					
					AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && equal ( Key, "ASSASSIN SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax (Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_03, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_03, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && equal ( Key, "ASSASSIN DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ','))
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_03, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "SURVIVOR ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && equal ( Key, "SURVIVOR SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_04, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_04, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds[AMBIENCE_SOUNDS_SURVIVOR] && equal( Key, "SURVIVOR DURATIONS"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_04, str_to_num ( Key ) )
					}
				}
				else if ( equal ( Key, "SNIPER ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && equal ( Key, "SNIPER SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_05, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_05, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds[AMBIENCE_SOUNDS_SNIPER] && equal ( Key, "SNIPER DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_05, str_to_num ( Key ) )
					}
				}
				else if ( equal ( Key, "SWARM ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_SWARM] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && equal ( Key, "SWARM SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_06, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_06, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && equal ( Key, "SWARM DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_06, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "PLAGUE ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && equal ( Key, "PLAGUE SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_07, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_07, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && equal ( Key, "PLAGUE DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_07, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "ARMAGEDDON ENABLE" ) )
					
					AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && equal ( Key, "ARMAGEDDON SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_08, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_08, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && equal ( Key, "ARMAGEDDON DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_08, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "APOCALYPSE ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && equal ( Key, "APOCALYPSE SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_09, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_09, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && equal ( Key, "APOCALYPSE DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_09, str_to_num ( Key ) );
					}
				}
				else if ( equal ( Key, "NIGHTMARE ENABLE" ) )
					
				AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] = str_to_num ( Value )
				
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && equal ( Key, "NIGHTMARE SOUNDS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( SoundAmbience_10, Key )
						
						ArrayPushCell ( SoundAmbienceMp3_10, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );
					}
				}
				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && equal ( Key, "NIGHTMARE DURATIONS" ) )
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushCell ( SoundAmbienceDuration_10, str_to_num ( Key ) );
					}
				}
			}
			case SECTION_HARD_CODED_ITEMS_COSTS:
			{
				if ( equal ( Key, "NIGHT VISION" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_NVISION] = false;
					}
					else
					{
						ExtraItems [EXTRA_NVISION] = true;
						
						ExtraCosts [EXTRA_NVISION] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "EXPLOSION NADE" ) )
				{
				         if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_EXPLOSION_NADE] = false;
					}
					else
					{
						ExtraItems [EXTRA_EXPLOSION_NADE] = true;
						
						ExtraCosts [EXTRA_EXPLOSION_NADE] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "NAPALM NADE" ) )
				{
				         if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_NAPALM_NADE] = false;
					}
					else
					{
						ExtraItems [EXTRA_NAPALM_NADE] = true;
					         
						ExtraCosts [EXTRA_NAPALM_NADE] = str_to_num ( Value );
					}
				}	
				else if ( equal ( Key, "FROST NADE" ) )
				{	
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_FROST_NADE] = false;
					}
					else
					{
						ExtraItems [EXTRA_FROST_NADE] = true;
					         
						ExtraCosts [EXTRA_FROST_NADE] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "AWP MAGNUM SNIPER" ) )
				{	
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] = false;
					}
					else
					{
						ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] = true;
					    
						ExtraCosts [EXTRA_AWP_MAGNUM_SNIPER] = str_to_num ( Value );
					}
				}
		
				else if ( equal ( Key, "M249 PARA MACHINEGUN" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_M249_PARA_MACHINEGUN] = false;
					}
					else
					{
						ExtraItems [EXTRA_M249_PARA_MACHINEGUN] = true;
					    
						ExtraCosts [EXTRA_M249_PARA_MACHINEGUN] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "SG550 AUTO SNIPER" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_SG550_AUTO_SNIPER] = false;
					}
					else
					{
						ExtraItems [EXTRA_SG550_AUTO_SNIPER] = true;
					    
						ExtraCosts [EXTRA_SG550_AUTO_SNIPER] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "G3SG1 AUTO SNIPER" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] = false;
					}
					else
					{
						ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] = true;
					    
						ExtraCosts [EXTRA_G3SG1_AUTO_SNIPER] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "JETPACK + BAZOOKA" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_JETPACK] = false;
					}
					else
					{
						ExtraItems [EXTRA_JETPACK] = true;
					    
						ExtraCosts [EXTRA_JETPACK] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "UNLIMITED CLIP" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_UNLIMITEDCLIP] = false;
					}
					else
					{
						ExtraItems [EXTRA_UNLIMITEDCLIP] = true;
					    
						ExtraCosts [EXTRA_UNLIMITEDCLIP] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "ARMOR (100)" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_ARMOR_100] = false;
					}
					else
					{
						ExtraItems [EXTRA_ARMOR_100] = true;
					    
						ExtraCosts [EXTRA_ARMOR_100] = str_to_num ( Value );
					}
				}	
				else if ( equal ( Key, "ARMOR (200)" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_ARMOR_200] = false;
					}
					else
					{
						ExtraItems [EXTRA_ARMOR_200] = true;
					    
						ExtraCosts [EXTRA_ARMOR_200] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "MULTIJUMP" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_MULTIJUMP] = false;
					}
					else
					{
						ExtraItems [EXTRA_MULTIJUMP] = true;
					    
						ExtraCosts [EXTRA_MULTIJUMP] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "BUY TRYDER" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_TRYDER] = false;
					}
					else
					{
						ExtraItems [EXTRA_TRYDER] = true;
					    
						ExtraCosts [EXTRA_TRYDER] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "BUY SURVIVOR" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_SURVIVOR] = false;
					}
					else
					{
						ExtraItems [EXTRA_SURVIVOR] = true;
					    	
						ExtraCosts [EXTRA_SURVIVOR] = str_to_num ( Value );
					}
				}	
				else if ( equal ( Key, "BUY SNIPER" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_SNIPER] = false;
					}
					else
					{
						ExtraItems [EXTRA_SNIPER] = true;
					    	
						ExtraCosts [EXTRA_SNIPER] = str_to_num ( Value );
					}
				}	
				else if ( equal ( Key, "BUY NEMESIS" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_NEMESIS] = false;
					}
					else
					{
						ExtraItems [EXTRA_NEMESIS] = true;
					    		
						ExtraCosts [EXTRA_NEMESIS] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "BUY ASSASSIN" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_ASSASSIN] = false;
					}
					else
					{
						ExtraItems [EXTRA_ASSASSIN] = true;
					    	
						ExtraCosts [EXTRA_ASSASSIN] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "ANTIDOTE" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_ANTIDOTE] = false;
					}
					else
					{
						ExtraItems [EXTRA_ANTIDOTE] = true;
					    	
						ExtraCosts [EXTRA_ANTIDOTE] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "ZOMBIE MADNESS" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_MADNESS] = false;
					}
					else
					{
						ExtraItems [EXTRA_MADNESS] = true;
					    	
						ExtraCosts [EXTRA_MADNESS] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "INFECTION BOMB" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_INFECTIONBOMB] = false;
					}
					else
					{
						ExtraItems [EXTRA_INFECTIONBOMB] = true;
					    	
						ExtraCosts [EXTRA_INFECTIONBOMB] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "KNIFE BLINK" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_KNIFEBLINK] = false;
					}
					else
					{
						ExtraItems [EXTRA_KNIFEBLINK] = true;
					    	
						ExtraCosts [EXTRA_KNIFEBLINK] = str_to_num ( Value );
					}
				}
				else if ( equal ( Key, "TRIP MINE" ) )
				{
					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )
					{
						ExtraItems [EXTRA_TRIPMINE] = false;
					}
					else
					{
						ExtraItems [EXTRA_TRIPMINE] = true;
					    	
						ExtraCosts [EXTRA_TRIPMINE] = str_to_num ( Value );
					}
				}
			}
			case SECTION_WEATHER_EFFECTS:
			{
				if ( equal ( Key, "FOG" ) )
				{
					if ( equal ( Value, "OFF" ))

						AmbienceFog = false;
						
					else //if ( !equal ( Value, "OFF" ) )
					
						AmbienceFog = true;
				}
				else if ( equal ( Key, "FOG DENSITY" ) )
					
					copy ( FogDensity, charsmax ( FogDensity ), Value );
				
				else if ( equal ( Key, "FOG COLOR" ) )
					
					copy ( FogColor, charsmax ( FogColor ), Value );
			}
			case SECTION_SKY:
			{
				if ( equal ( Key, "SKY NAMES" ) )
				{
					if ( equal ( Value, "OFF" ) )
					{
						SkyEnable = false;
					}
					else 
					{
						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) ) 
						{
							SkyEnable = true;
						
							trim ( Key );
							trim ( Value );
						
							ArrayPushString ( SkyNames, Key );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%sbk.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%sdn.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%sft.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%slf.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%srt.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						
							formatex ( LineData, charsmax( LineData ), "gfx/env/%sup.tga", Key )
							engfunc ( EngFunc_PrecacheGeneric, LineData );
						}
					}
				}
			}
			case SECTION_ZOMBIE_DECALS:
			{
				if ( equal ( Key, "DECALS"))
				{
					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
					{
						trim ( Key );
						trim ( Value );
						
						ArrayPushString ( ZombieDecals, Key );
					}
				}
			}
			case SECTION_KNOCKBACK:
			{
				strtolower ( Key );
				
				format ( Key, charsmax ( Key ), "weapon_%s", Key );
				
				KnockbackWeaponPower [cs_weapon_name_to_id ( Key ) ] = str_to_float ( Value );
			}
		}
	}
	
	if ( File ) fclose ( File );
	
	get_configsdir ( Path, charsmax ( Path ) );
	
	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_ZOMBIECLASSES_FILE );
	
	if ( file_exists ( Path ) )
	{
		File = fopen ( Path, "rt" )
		
		while ( File && !feof ( File ) )
		{
			fgets ( File, LineData, charsmax ( LineData ) );
			
			replace ( LineData, charsmax ( LineData ), "^n", "" );
			
			if ( !LineData [0] || LineData [0] == ';' ) continue;
			
			if ( LineData [0] == '[' )
			{
				LineData [strlen ( LineData ) - 1] = 0;
				
				copy ( LineData, charsmax ( LineData ), LineData [1] );
				
				ArrayPushString ( ZClassRealName, LineData );
				
				continue;
			}
			
			strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );
			
			trim ( Key );
			trim ( Value );
			
			if ( equal ( Key, "NAME" ) )
				
			ArrayPushString ( ZClassName_02, Value );
			
			else if ( equal ( Key, "INFO" ) )
				
			ArrayPushString( ZClassInfo_02, Value );
			
			else if ( equal ( Key, "MODELS" ) )
			{
				ArrayPushCell ( ZClassModelsStart_02, ArraySize ( ZClassPlayerModel_02 ) );
				
				while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
				{
					trim ( Key );
					trim ( Value );
					
					ArrayPushString ( ZClassPlayerModel_02, Key );
					
					ArrayPushCell ( ZClassModelIndex_02, -1 );
				}
				
				ArrayPushCell ( ZClassModelSend_02, ArraySize ( ZClassPlayerModel_02 ) );
			}
			else if ( equal ( Key, "CLAWMODEL" ) )
				
			ArrayPushString ( ZClassClawModel_02, Value );
			
			else if ( equal ( Key, "HEALTH" ) )
				
			ArrayPushCell ( ZClassHealth_02, str_to_num ( Value ) );
			
			else if ( equal ( Key, "SPEED" ) )
				
			ArrayPushCell ( ZClassSpeed_02, str_to_num ( Value ) );
			
			else if ( equal ( Key, "GRAVITY" ) )
				
			ArrayPushCell ( ZClassGravity_02, str_to_float ( Value ) );
			
			else if ( equal ( Key, "KNOCKBACK" ) ) 
				
			ArrayPushCell ( ZClassKnockback_02, str_to_float ( Value ) );
		}
		
		if ( File ) fclose ( File );
	}
	
	get_configsdir ( Path, charsmax ( Path ) );
	
	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_EXTRAITEMS_FILE );
	
	if ( file_exists ( Path ) )
	{
		File = fopen ( Path, "rt" );
		
		while ( File && !feof ( File ) )
		{
			fgets ( File, LineData, charsmax ( LineData ) );
			
			replace ( LineData, charsmax ( LineData ), "^n", "" );
			
			if ( !LineData [0] || LineData [0] == ';' ) continue;
			
			if ( LineData [0] == '[' )
			{
				LineData [strlen ( LineData) - 1] = 0;
				
				copy ( LineData, charsmax ( LineData ), LineData [1] );
				
				ArrayPushString ( ExtraItemRealName, LineData );
				
				continue;
			}
			
			strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );
			
			trim ( Key );
			
			trim ( Value );
			
			if ( equal ( Key, "NAME" ) )
				
				ArrayPushString ( ExtraItemName_02, Value );
			
			else if ( equal ( Key, "COST" ) )
				
				ArrayPushCell ( ExtraItemCost_02, str_to_num ( Value ) );
			
			else if ( equal ( Key, "TEAMS" ) )
			{
				Teams = 0;
				
				while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )
				{
					trim ( Key );
					trim ( Value );
					
					if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_ZOMBIE] ) )
						
						Teams |= ZP_TEAM_ZOMBIE;
					
					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_HUMAN] ) )
						
						Teams |= ZP_TEAM_HUMAN;
					
					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_NEMESIS] ) )
						
						Teams |= ZP_TEAM_NEMESIS;
					
					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_ASSASSIN] ) )
						
						Teams |= ZP_TEAM_ASSASSIN;
					
					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_SURVIVOR] ) )
						
						Teams |= ZP_TEAM_SURVIVOR;
					
					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_SNIPER] ) )
						
						Teams |= ZP_TEAM_SNIPER;
				}
				
				ArrayPushCell ( ExtraItemTeam_02, Teams );
			}
		}
		
		if ( File ) fclose ( File );
	}		
}



SaveCustomization (  )
{
	new i, k, Buffer [512];

	new Path [64]; get_configsdir ( Path, charsmax ( Path ) );
	
	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_ZOMBIECLASSES_FILE );

	new File = fopen ( Path, "at" ), size = ArraySize ( ZClassName_01 );
	
	for ( i = 0; i < size; i ++ )
	{
		if ( ArrayGetCell ( ZClassNew, i ) )
		{
			ArrayGetString ( ZClassName_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^n[%s]", Buffer );
			
			fputs ( File, Buffer );
			
			
			ArrayGetString ( ZClassName_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^nNAME = %s", Buffer );
			
			fputs ( File, Buffer );
			
			
			ArrayGetString ( ZClassInfo_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^nINFO = %s", Buffer );
			
			fputs ( File, Buffer );
			
			for ( k = ArrayGetCell ( ZClassModelsStart_01, i ); k < ArrayGetCell ( ZClassModelSend_01, i ); k ++ )
			{
				if ( k == ArrayGetCell ( ZClassModelsStart_01, i ) )
				{
					ArrayGetString ( ZClassPlayerModel_01, k, Buffer, charsmax ( Buffer ) );
				}
				else
				{
					ArrayGetString ( ZClassPlayerModel_01, k, Path, charsmax ( Path ) );
					
					format ( Buffer, charsmax ( Buffer ), "%s , %s", Buffer, Path );
				}
			}
			format ( Buffer, charsmax ( Buffer ), "^nMODELS = %s", Buffer );
			
			fputs ( File, Buffer );
			
			ArrayGetString ( ZClassClawModel_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^nCLAWMODEL = %s", Buffer );
			
			fputs ( File, Buffer );
			
			formatex ( Buffer, charsmax ( Buffer ), "^nHEALTH = %d", ArrayGetCell ( ZClassHealth_01, i ) );
			
			fputs ( File, Buffer );
			
			formatex ( Buffer, charsmax ( Buffer ), "^nSPEED = %d", ArrayGetCell ( ZClassSpeed_01, i ) );
			
			fputs ( File, Buffer );

			formatex ( Buffer, charsmax ( Buffer ), "^nGRAVITY = %.2f", Float:ArrayGetCell ( ZClassGravity_01, i ) );
			
			fputs ( File, Buffer );
			
			formatex ( Buffer, charsmax ( Buffer ), "^nKNOCKBACK = %.2f^n", Float:ArrayGetCell ( ZClassKnockback_01, i ) );
			
			fputs ( File, Buffer );
		}
	}
	
	fclose ( File );

	get_configsdir ( Path, charsmax ( Path ) );
	
	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_EXTRAITEMS_FILE );
	
	File = fopen ( Path, "at" ); size = ArraySize ( ExtraItemName_01 );

	for ( i = EXTRA_WEAPONS_STARTID; i < size; i ++ )
	{
		if ( ArrayGetCell ( ExtraItemNew, i ) )
		{
			ArrayGetString ( ExtraItemName_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^n[%s]", Buffer );
			
			fputs ( File, Buffer );

			ArrayGetString ( ExtraItemName_01, i, Buffer, charsmax ( Buffer ) );
			
			format ( Buffer, charsmax ( Buffer ), "^nNAME = %s", Buffer );
			
			fputs(  File, Buffer );
			
			formatex ( Buffer, charsmax ( Buffer ), "^nCOST = %d", ArrayGetCell ( ExtraItemCost_01, i ) );
			
			fputs ( File, Buffer );

			formatex ( Buffer, charsmax ( Buffer ), "^nTEAMS = %s^n", ZP_TEAM_NAMES [ArrayGetCell ( ExtraItemTeam_01, i) ] );
			
			fputs ( File, Buffer );
		}
	}
	
	fclose ( File );

         ArrayDestroy ( ZClassRealName );
	ArrayDestroy ( ZClassName_02 );
	ArrayDestroy ( ZClassInfo_02 );
	ArrayDestroy ( ZClassModelsStart_02 );
	ArrayDestroy ( ZClassModelSend_02 );
	ArrayDestroy ( ZClassPlayerModel_02 );
	ArrayDestroy ( ZClassModelIndex_02 );
	ArrayDestroy ( ZClassClawModel_02 );
	ArrayDestroy ( ZClassHealth_02 );
	ArrayDestroy ( ZClassSpeed_02 );
	ArrayDestroy ( ZClassGravity_02 );
	ArrayDestroy ( ZClassKnockback_02 );
	ArrayDestroy ( ZClassNew );
	ArrayDestroy ( ExtraItemRealName );
	ArrayDestroy ( ExtraItemName_02 );
	ArrayDestroy ( ExtraItemCost_02 );
	ArrayDestroy ( ExtraItemTeam_02 );
	ArrayDestroy ( ExtraItemNew );
}

public RegisterHamCzBots ( id )
{
         if ( HamCzBots || !IsConnected [id] ) return;
	
	RegisterHamFromEntity ( Ham_Spawn, id, "fwPlayerSpawnPost", 1 );
	RegisterHamFromEntity ( Ham_Killed, id, "fwPlayerKilled" );
	RegisterHamFromEntity ( Ham_Killed, id, "fwPlayerKilledPost", 1 );
	RegisterHamFromEntity ( Ham_TakeDamage, id, "fwTakeDamage" );
	RegisterHamFromEntity ( Ham_TakeDamage, id, "fwTakeDamagePost", 1 );
	RegisterHamFromEntity ( Ham_TraceAttack, id, "fwTraceAttack" );

	HamCzBots = true;
	
	if ( is_user_alive ( id ) ) fwPlayerSpawnPost ( id );
}

public BotBuyExtras ( taskid )
{
	if ( !IsAlive [ID_SPAWN] || IsNemesis [ID_SPAWN] || IsAssassin [ID_SPAWN] || IsSurvivor [ID_SPAWN] || IsSniper [ID_SPAWN] ) return;
	
	if ( !IsZombie [ID_SPAWN] ) 
	{
		BuyExtraItem ( ID_SPAWN, EXTRA_NVISION );
		
		BuyExtraItem ( ID_SPAWN, random ( EXTRA_WEAPONS_STARTID -1  ) );
	}
	else 
	{
		BuyExtraItem ( ID_SPAWN, EXTRA_ANTIDOTE );
	}
}

public RefillBpAmmo ( const Args [], id )
{
	if ( !IsAlive [id] || IsZombie [id] ) return;
	
	set_msg_block ( get_user_msgid ( "AmmoPickup" ), BLOCK_ONCE );

	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [REFILL_WEAPONID], AMMOTYPE [REFILL_WEAPONID], MAXBPAMMO [REFILL_WEAPONID] );
}

BalanceTeams (  )
{
	static iPlayersNum;
	
	iPlayersNum = fnGetPlaying (  );
	
	if ( iPlayersNum < 1 ) return;

	static iTerrors, iMaxTerrors, id, Team [33];
	
	iMaxTerrors = iPlayersNum / 2;
	
	iTerrors = 0;

	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( !IsConnected [id] ) continue;
		
		Team [id] = fm_cs_get_user_team ( id );
		
		if ( Team [id] == FM_CS_TEAM_SPECTATOR || Team [id] == FM_CS_TEAM_UNASSIGNED ) continue;

		remove_task ( id + TASK_TEAM );
		
		fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
		
		Team [id] = FM_CS_TEAM_CT;
	}

	while ( iTerrors < iMaxTerrors )
	{
		if ( ++ id > MaxPlayers ) id = 1;
		
		if ( !IsConnected [id] ) continue;

		if ( Team [id] != FM_CS_TEAM_CT ) continue;
		
		if ( random_num ( 0, 1 ) )
		{
			fm_cs_set_user_team ( id, FM_CS_TEAM_T );
			
			Team [id] = FM_CS_TEAM_T;
			
			iTerrors ++;
		}
	}
}

public SendWelcomeMessage (  )
{    
	client_print_color ( 0, print_team_grey, "^1****^4 Zombie Plague 6.2^3 (^4The Return^3)^1 ||^4 ...:::^1[^3 Fight for your life !^1 ]^4:::...^1 ****" );
	
	client_print_color ( 0, print_team_default, "%s Press^4 M^1 to open the game menu!", CHAT_PREFIX );
	
	set_hudmessage ( 20, 155, 255, -1.0, 0.17, 1, 0.0, 3.0, 2.0, 1.0, -1 );
	
	ShowSyncHudMsg ( 0, MsgSync_01, "The T-Virus has been set loose..." );
}

CheckRound ( leaving_player )
{
         if ( EndRound || task_exists ( TASK_MAKEZOMBIE ) ) return;
	
	static iPlayersNum, id; iPlayersNum = fnGetAlive (  );
	
	if ( iPlayersNum < 2 ) return;

	if ( IsZombie [leaving_player] && fnGetZombies (  ) == 1 )
	{
		if ( fnGetHumans (  ) == 1 && fnGetCTs (  ) == 1 ) return;
		
		while ( ( id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) ) ) == leaving_player ) {  }

		client_print_color ( 0, print_team_default, "%s Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie.", CHAT_PREFIX, PlayerName [leaving_player], PlayerName [id] )
		
		LastPlayerLeaving = true;
		
		if ( IsNemesis [leaving_player] )
		{
			UserZombie ( id, 0, 1, 0, 0, 0 );
			
			if ( ModeNemesis ) zp_round_started ( MODE_NEMESIS, id );
		}
		
		else if ( IsAssassin [leaving_player] )
		{	
			UserZombie ( id, 0, 0, 1, 0, 0 );
			
			if ( ModeAssassin ) zp_round_started ( MODE_ASSASSIN, id );
		}
		else
		         UserZombie ( id, 0, 0, 0, 0, 0 );
		
		LastPlayerLeaving = false;
		
		if ( IsNemesis [leaving_player] )

		         fm_set_user_health ( id, pev ( leaving_player, pev_health ) );
		
		if ( IsAssassin [leaving_player] )
			
			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );
	}
	else if ( !IsZombie [leaving_player] && fnGetHumans (  ) == 1 )
	{
		if ( fnGetZombies (  ) == 1 && fnGetTs (  ) == 1 ) return;

		while ( ( id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) ) ) == leaving_player ) {  }
		
		client_print_color ( 0, print_team_default, "%s Last human,^3 %s^1 disconnected,^4 %s^1 is the last human.", CHAT_PREFIX, PlayerName [leaving_player], PlayerName [id] )
		
		LastPlayerLeaving = true;
		
		if ( IsSurvivor [leaving_player] )
		{	
			UserHuman ( id, 1, 0, 0 );
			
			if ( ModeSurvivor ) zp_round_started ( MODE_SURVIVOR, id );
		}
		else if ( IsSniper [leaving_player] )
		{
		         UserHuman ( id, 0, 1, 0 );
			 
			if ( ModeSniper ) zp_round_started ( MODE_SNIPER, id );
		}
		else
			UserHuman ( id, 0, 0, 0 );
		
		LastPlayerLeaving = false;
		
		if ( IsSurvivor [leaving_player] )
			
			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );
		
		if ( IsSniper [leaving_player] )
			
			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );
	}
}

public AmbienceSoundEffects ( taskid )
{
	static Sound [64], iRandom, Duration, IsMp3;
	
	if ( NemesisRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_02 ) - 1 )
		
		ArrayGetString ( SoundAmbience_02, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_02, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_02, iRandom );
	}
	else if ( AssassinRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_03 ) - 1 )
		
		ArrayGetString ( SoundAmbience_03, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_03, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_03, iRandom );
	}
	else if ( SurvivorRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_04 ) - 1 )
		
		ArrayGetString ( SoundAmbience_04, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_04, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_04, iRandom );
	}
	else if ( SniperRound ) 
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_05 ) - 1 )
		
		ArrayGetString ( SoundAmbience_05, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_05, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_05, iRandom );
	}
	else if ( SwarmRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_06 ) - 1 )
		
		ArrayGetString ( SoundAmbience_06, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_06, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_06, iRandom );
	}
	else if ( PlagueRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_07 ) - 1 )
		
		ArrayGetString ( SoundAmbience_07, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_07, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_07, iRandom );
	}
	else if ( ArmageddonRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_08 ) - 1 )
		
		ArrayGetString ( SoundAmbience_08, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_08, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_08, iRandom );
	}
	else if ( ApocalypseRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_09 ) - 1 )
		
		ArrayGetString ( SoundAmbience_09, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_09, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_09, iRandom );
	}
	else if ( NightmareRound )
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_10 ) - 1 )
		
		ArrayGetString ( SoundAmbience_10, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_10, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_10, iRandom );
	}
	else 
	{
		iRandom = random_num ( 0, ArraySize( SoundAmbience_01 ) - 1 )
		
		ArrayGetString ( SoundAmbience_01, iRandom, Sound, charsmax ( Sound ) );
		
		Duration = ArrayGetCell ( SoundAmbienceDuration_01, iRandom );
		
		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_01, iRandom );
	}
	
	if ( IsMp3 )
		client_cmd ( 0, "mp3 play ^"sound/%s^"", Sound );
	else
		PlaySound ( Sound );
		
	set_task ( float ( Duration ), "AmbienceSoundEffects", TASK_AMBIENCESOUNDS );
}

AmbienceSoundStop (  ) client_cmd ( 0, "mp3 stop; stopsound" );


public TaskHideMoney ( taskid )
{
         if ( !IsAlive [ID_SPAWN] ) return;
	
	message_begin ( MSG_ONE, get_user_msgid ( "HideWeapon" ), _, ID_SPAWN );
	write_byte ( HIDE_MONEY );
	message_end (  )

	message_begin ( MSG_ONE, get_user_msgid ( "Crosshair" ), _, ID_SPAWN );
	write_byte ( 0 );
	message_end (  );
}

InfectionExplode ( Entity )
{
	if ( EndRound ) return;
	
	static Float: Origin [3];
	
	pev ( Entity, pev_origin, Origin );
	
	CreateBlastInfection ( Origin );
	
	static Sound [64];
	
	ArrayGetString ( GrenadeInfect, random_num ( 0, ArraySize ( GrenadeInfect ) - 1 ), Sound, charsmax ( Sound ) )
	
	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	
	static Attacker;
	
	Attacker = pev ( Entity, pev_owner );
	
	static Victim;
	
	Victim = -1
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || IsZombie [Victim] || NoDamage [Victim] ) continue;
		
		if ( fnGetHumans (  ) == 1 )
		{
			ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
			
			continue;
		}
		
		ArrayGetString ( GrenadeInfectPlayer, random_num ( 0, ArraySize ( GrenadeInfectPlayer ) - 1 ), Sound, charsmax ( Sound ) );
		
		emit_sound ( Victim, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
		
		UserZombie ( Victim, Attacker, 0, 1, 1, 0 );
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public HeExplode ( Entity )
{
	static Float: Origin [3];
	
	pev ( Entity, pev_origin, Origin );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_EXPLOSION );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	write_short ( HExplode );
	write_byte ( 30 ); 
	write_byte ( 15 ); 
	write_byte ( 0 );
	message_end (  );
	
	static Attacker;
	
	Attacker = pev ( Entity, pev_owner );
	
	for ( new Victim = 1; Victim < MaxPlayers + 1; Victim ++ )
	{
		if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
		
		if ( IsZombie [Victim] )
		{
			static Float: fDistance, Float: fDamage;
			
			fDistance = EntityRange ( Victim, Entity );
			
			if ( fDistance < 300.0 )
			{
				fDamage = 667.0 - fDistance;
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );
				write_short ( 2048 );
				write_short ( 1024 );
				write_short ( FFADE_IN );
				write_byte ( 250 );
				write_byte ( 0 );
				write_byte ( 0 );
				write_byte ( fDistance < 220 ? 220 : 205 );
				message_end (   );
				
				//emit_sound ( Victim, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, IsZombie [Victim], PITCH_NORM );
				client_cmd ( Victim, "spk ^"%s^"", SOUND_EXPLODE );
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );
				write_short ( UNIT_SECOND * 4 );
				write_short ( UNIT_SECOND * 2 ); 
				write_short ( UNIT_SECOND * 10 );
				message_end (  );
				
				if ( float ( get_user_health ( Victim ) ) - fDamage > 0.0 )
					
					ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
				else
					ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
				
				if ( !IsNemesis [Victim] && !IsAssassin [Victim] ) fDamage *= 0.75;
				
				client_print_color ( Attacker, print_team_default, "%s Damage to^4 %s^1 ::^4 %0.0f^1 damage", CHAT_PREFIX, PlayerName [Victim], fDamage );
				
				if ( fDamage >= get_pcvar_num ( Zp_AmmoDamage ) )
					
					AmmoPacks [Attacker] += 2;
				else
					AmmoPacks [Attacker] += 1;
			}
		}
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

FireExplode ( Entity )
{
	static Float: Origin [3]
	
	pev ( Entity, pev_origin, Origin );
	
	CreateBlastFire ( Origin );
	
	static Sound [64];
	
	ArrayGetString ( GrenadeFire, random_num ( 0, ArraySize ( GrenadeFire ) - 1 ), Sound, charsmax ( Sound ) )
	
	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	
	static Victim; Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !IsZombie [Victim] || NoDamage [Victim] ) continue;
		
		if ( IsNemesis [Victim] || IsAssassin [Victim] )
			
			BurningDuration [Victim] += get_pcvar_num ( Zp_FireDuration );
		else
			BurningDuration [Victim] += get_pcvar_num ( Zp_FireDuration ) * 5;

		if ( !task_exists ( Victim + TASK_BURN ) ) set_task ( 0.2, "BurningFlame", Victim + TASK_BURN, _, _, "b" );
	}
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

FrostExplode ( Entity )
{
	static Float: Origin [3];
	
	pev ( Entity, pev_origin, Origin )
	
	CreateBlastFrost ( Origin )
	
	static Sound [64];
	
	ArrayGetString ( GrenadeFrost, random_num ( 0, ArraySize ( GrenadeFrost ) - 1 ), Sound, charsmax ( Sound ) ) 
	
	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	
	static Victim; Victim = -1;
	
	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )
	{
		if ( !is_user_valid_alive ( Victim ) || !IsZombie [Victim] || IsFrozen [Victim] || NoDamage [Victim] ) continue;

		if ( IsNemesis [Victim] || IsAssassin [Victim] )
		{
			static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );

			ArrayGetString ( GrenadeFrostBreak, random_num ( 0, ArraySize ( GrenadeFrostBreak ) - 1 ), Sound, charsmax ( Sound ) )
			
			emit_sound ( Victim, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin_2 );
			write_byte ( TE_BREAKMODEL ); 
			write_coord ( Origin_2 [0] ); 
			write_coord ( Origin_2 [1] ); 
			write_coord ( Origin_2 [2] + 24 ); 
			write_coord ( 16 ); 
			write_coord ( 16 ); 
			write_coord ( 16 );
			write_coord ( random_num (-50, 50) );
			write_coord ( random_num (-50, 50) );
			write_coord ( 25 ); 
			write_byte ( 10 ); 
			write_short ( GlassSpr ); 
			write_byte ( 10 ); 
			write_byte ( 25 );
			write_byte ( BREAK_GLASS ); 
			message_end (  );
			
			continue;
		}
		
		fm_set_rendering ( Victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25 );
		
		ArrayGetString ( GrenadeFrostPlayer, random_num ( 0, ArraySize ( GrenadeFrostPlayer ) - 1 ), Sound, charsmax ( Sound ) );
		
		emit_sound ( Victim, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
		
		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );
		write_short ( 0 );
		write_short ( 0 );
		write_short ( FFADE_STAYOUT );
		write_byte ( 0 );
		write_byte ( 100 );
		write_byte ( 200 );
		write_byte ( 100 );
		message_end (  );
		
		if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
		
			set_pev ( Victim, pev_gravity, 999999.9 );
		else
			set_pev ( Victim, pev_gravity, 0.000001 );

		IsFrozen [Victim] = true;
		
		set_task ( get_pcvar_float ( Zp_FreezeDuration ), "RemoveFreeze", Victim );
	}
	engfunc ( EngFunc_RemoveEntity, Entity );
}

public RemoveFreeze ( id )
{
	if ( !IsAlive [id] || !IsFrozen [id] ) return;

	IsFrozen [id] = false;
	
	if ( IsZombie [id] )
	{
		if ( IsNemesis [id] )

		         set_pev ( id, pev_gravity, get_pcvar_float ( Zp_NemesisGravity ) );
		
		else if ( IsAssassin [id] )
			
			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_AssassinGravity ) );
		
		else
			set_pev ( id, pev_gravity, Float:ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );
	}
	else
	{
		if ( IsSurvivor [id] )
			
			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SurvivorGravity ) );
		
		else if ( IsSniper [id] )
			
			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SniperGravity ) );
		else	    
			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );	
	}

	if ( IsZombie [id] )
	{
		if ( IsNemesis [id] )
			
			fm_set_rendering ( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25 );
			//fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

		else if ( IsAssassin [id] )

			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
		else
			fm_set_rendering ( id );
	}
	else
	{
		if ( IsSurvivor [id] || IsSniper [id] )

			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
		else
			fm_set_rendering ( id );
	}	
	
	message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, id );
	write_short ( UNIT_SECOND );
	write_short ( 0 );
	write_short ( FFADE_IN );
	write_byte ( 0 );
	write_byte ( 50 );
	write_byte ( 200 );
	write_byte ( 100 );
	message_end (  );
	
	static Sound [64];
	
	ArrayGetString ( GrenadeFrostBreak, random_num ( 0, ArraySize ( GrenadeFrostBreak ) - 1 ), Sound, charsmax ( Sound ) );
	
	emit_sound ( id, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	
	static Origin [3]; get_user_origin ( id, Origin )

	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_BREAKMODEL ); 
	write_coord ( Origin [0] ); 
	write_coord ( Origin [1] );
	write_coord ( Origin [2]+24 ); 
	write_coord ( 16 );
	write_coord ( 16 ); 
	write_coord ( 16 ); 
	write_coord ( random_num (-50, 50) ); 
	write_coord ( random_num (-50, 50) ); 
	write_coord ( 25 ); 
	write_byte ( 10 ); 
	write_short ( GlassSpr ); 
	write_byte ( 10 ); 
	write_byte ( 25 );
	write_byte ( BREAK_GLASS ); 
	message_end (  );
	
	ExecuteForward ( fwUserUnfrozen, fwDummyResult, id );
}

public RemoveStuff (  )
{
	static Ent
	
	if ( get_pcvar_num ( Zp_RemoveDoors ) > 0 )
	{
		Ent = -1;
		
		while ( ( Ent = engfunc ( EngFunc_FindEntityByString, Ent, "classname", "func_door_rotating" ) ) != 0 )
		
			engfunc ( EngFunc_SetOrigin, Ent, Float: {8192.0 ,8192.0 ,8192.0} );
	}
	
	if ( get_pcvar_num ( Zp_RemoveDoors ) > 1 )
	{
		Ent = -1;
		while ( ( Ent = engfunc ( EngFunc_FindEntityByString, Ent, "classname", "func_door" ) ) != 0 )
			
			engfunc ( EngFunc_SetOrigin, Ent, Float: {8192.0 ,8192.0 ,8192.0} );
	}
}

ReplaceWeaponModels ( id, weaponid )
{
	switch ( weaponid )
	{
		case CSW_KNIFE: 
		{
			if ( IsZombie [id] )
			{
				if ( IsNemesis [id] )
				{
					set_pev ( id, pev_viewmodel2, ModelVKnifeNemesis );
					
					set_pev ( id, pev_weaponmodel2, "" );
				}
				else if ( IsAssassin [id] ) 
				{
					set_pev(id, pev_viewmodel2, ModelVKnifeAssassin );
					
					set_pev(id, pev_weaponmodel2, "" );
				}
				else 
				{
					static ClawModel [100];
						
					ArrayGetString ( ZClassClawModel_01, ZombieClass [id], ClawModel, charsmax ( ClawModel ) ); 
						
					format ( ClawModel, charsmax ( ClawModel ), "models/zombie_plague/%s", ClawModel );
						
					set_pev ( id, pev_viewmodel2, ClawModel );
						
					set_pev ( id, pev_weaponmodel2, "" );
				}
			}
			else 
			{
					set_pev ( id, pev_viewmodel2, ModelVKnifeHuman );
					
					set_pev ( id, pev_weaponmodel2, "models/p_knife.mdl" );
			}
		}
		case CSW_XM1014: 
		{
			if ( IsSurvivor [id] )
			{
				set_pev ( id, pev_viewmodel2, ModelVxm1014Survivor );
				
				set_pev ( id, pev_weaponmodel2, ModelPxm1014Survivor );                                
			}
		}
		case CSW_AK47: 
		{
			if ( IsSurvivor [id] )
			{
				set_pev(id, pev_viewmodel2, ModelVak47Survivor );
				
				set_pev(id, pev_weaponmodel2, ModelPak47Survivor );
			}
		}
		case CSW_M4A1:
		{
			if ( IsSurvivor [id] )
			{
				set_pev ( id, pev_viewmodel2, ModelVm4a1Survivor );
				
				set_pev ( id, pev_weaponmodel2, ModelPm4a1Survivor );
			}
		}
		case CSW_AWP: 
		{
			if ( IsSniper [id] )
			{
				set_pev ( id, pev_viewmodel2, ModelVawpSniper );
				
				set_pev ( id, pev_weaponmodel2, ModelPawpSniper );
			}
		}
		case CSW_HEGRENADE: 
		{
			if ( IsZombie [id] )
			
				set_pev ( id, pev_viewmodel2, ModelGrenadeInfect );
			else
				set_pev ( id, pev_viewmodel2, ModelGrenadeExplode );
		}
		case CSW_FLASHBANG: 
		{
			set_pev ( id, pev_viewmodel2, ModelGrenadeFire );
		}
		case CSW_SMOKEGRENADE: 
		{
			set_pev ( id, pev_viewmodel2, ModelGrenadeFrost );
		}
	}
}

ResetVars ( id, resetall )
{
	IsZombie [id] = false;
	
	IsNemesis [id] = false;
	
	IsAssassin [id] = false;
	
	IsSurvivor [id] = false;
	
	IsSniper [id] = false;
	 
	FirstZombie [id] = false;
	
	LastZombie [id] = false;
	
	LastHuman [id] = false;
	
	IsFrozen [id] = false;
	
	NoDamage [id] = false;
	
	NVision [id] = false;
	
	NVisionEnabled [id] = false;
	
	CanBuy [id] = true;
	
	BurningDuration [id] = 0;
	
	if ( resetall )
	{
		AmmoPacks [id] = get_pcvar_num ( Zp_StartPacks );		
		
		ZombieClass [id] = ZCLASS_NONE; 
		
		ZombieClassNext [id] = ZCLASS_NONE;
		
		DamageDealt [id] = 0;			
	}
}

public SpecNVision ( id )
{
	if ( !IsConnected [id] || IsAlive [id] || IsBot [id] ) return;

	if ( get_pcvar_num ( Zp_NvgGive ) )
	{
		NVision [id] = true;

		if ( get_pcvar_num ( Zp_NvgGive ) == 1 )
		{
			NVisionEnabled [id] = true;

			if ( get_pcvar_num ( Zp_CustomNvg ) )
			{
				remove_task ( id + TASK_NVISION );
				
				set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );
			}
			else
				SetUserGNvision ( id, 1 );
		}
	}
}

public SpectatorHudMessage ( taskid )
{
	static id; id = ID_SHOWHUD;
	
	if ( !IsAlive [id] )
	{
		id = pev ( id, PEV_SPEC_TARGET );   
		
		if ( !IsAlive [id] ) return;
	}
	
	static Class [32], Red, Green, Blue;
	
	
	if ( IsZombie [id] )
	{
		Red = 220;
		
		Green = 80;
		
		Blue = 0;
		
		if ( IsNemesis [id] )
			
		         formatex ( Class, charsmax ( Class ), "Nemesis" );
		
		else if ( IsAssassin [id] )
			
		         formatex ( Class, charsmax ( Class ), "Assassin" );
		else
			copy ( Class, charsmax ( Class ), ZombieClassName [id] );
	}
	else 
	{
		Red = 0;
		
		Green = 175;
		
		Blue = 255;
		
		if ( IsSurvivor [id] )
			
		         formatex ( Class, charsmax ( Class ), "Survivor" );
		
		else if ( IsSniper [id] )
			
		         formatex ( Class, charsmax ( Class ), "Sniper" );
		else
			formatex ( Class, charsmax ( Class ), "Human" );
	}
	
	if ( id != ID_SHOWHUD )
	{
		
		static HealthString [16], PacksString [16], UserIp [16], Country [44], City[44];

		AddCommas ( pev ( id, pev_health ), HealthString, charsmax ( HealthString ) );
		
		AddCommas ( AmmoPacks [id], PacksString, charsmax ( PacksString ) );
		
	         get_user_ip ( id, UserIp, charsmax ( UserIp ) );
	
	         geoip_country_ex ( UserIp, Country, charsmax ( City ) );
	
	         geoip_city ( UserIp, City, charsmax ( City ) );

		set_hudmessage ( 0, 80, 255, -1.0, 0.80, 0, 6.0, 1.1, 0.0, 0.0, -1 );
		
		if ( equal ( Country, "" ) && !equal ( City, "" ) )
		
			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: N/A, %s", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), City )
		
		else if ( !equal ( Country, "" ) && equal ( City, "" ) )
		
			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: %s, N/A", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), Country )
			
		else if ( equal ( Country, "" ) && equal ( City, "" ) )
	
			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: N/A, N/A", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ) )
			
		else if ( !equal ( Country, "" ) && !equal ( City, "" ) ) 
		
			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: %s, %s", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), Country, City )
	}
	else	
	{
		
		static HealthString [16], PacksString [16];
		
		AddCommas ( pev ( ID_SHOWHUD, pev_health ), HealthString, charsmax ( HealthString ) );
		
		AddCommas ( AmmoPacks [ID_SHOWHUD], PacksString, charsmax ( PacksString ) );

		set_hudmessage ( Red, Green, Blue, 0.03, 0.90, 0, 6.0, 1.1, 0.0, 0.0, -1)
		
		ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Health: %s - Class: %s - Ammo: %s - Armor: %d", HealthString, Class, PacksString, pev ( ID_SHOWHUD, pev_armorvalue ) );
	}
}

public ZombiePlayIdle ( taskid )
{

         if ( EndRound || NewRound ) return;
	
	static Sound [64]
	
	if ( LastZombie [ID_BLOOD] )
	{
		ArrayGetString ( ZombieIdleLast, random_num ( 0, ArraySize ( ZombieIdleLast ) - 1 ), Sound, charsmax ( Sound ) );
		
		emit_sound ( ID_BLOOD, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	}
	else
	{
		ArrayGetString ( ZombieIdle, random_num ( 0, ArraySize ( ZombieIdle ) - 1 ), Sound, charsmax ( Sound ) );
		
		emit_sound ( ID_BLOOD, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	}
}

public MadnessOver ( taskid )
{
	NoDamage [ID_BLOOD] = false;
	
	fm_set_rendering ( ID_BLOOD );
}

DoRandomSpawn ( id, regularspawns = 0 )
{
	static Hull, SpIndex, i;
	
	Hull = ( pev ( id, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN

	if ( !regularspawns )
	{
		if ( !SpawnCount_01 ) return;
		
		SpIndex = random_num ( 0, SpawnCount_01 - 1 );
		
		for ( i = SpIndex + 1; /*no condition*/ ; i ++ )
		{
			if ( i >= SpawnCount_01 ) i = 0;
			
			if ( is_hull_vacant ( Spawns_01 , Hull ) )
			{
				engfunc ( EngFunc_SetOrigin, id, Spawns_01  );
				
				break;
			}
			
			if ( i == SpIndex ) break;
		}
	}
	else
	{
		if ( !SpawnCount_02 ) return;
		
		SpIndex = random_num ( 0, SpawnCount_02 - 1 );
		
		for ( i = SpIndex + 1; /*no condition*/ ; i ++ )
		{
			if ( i >= SpawnCount_02 ) i = 0;
			
			if ( is_hull_vacant ( Spawns_02 [i], Hull ) )
			{
				engfunc ( EngFunc_SetOrigin, id, Spawns_02 [i] );
				
				break;
			}

			if ( i == SpIndex ) break;
		}
	}
}

fnGetZombies (  )
{
	static iZombies, id;
	
	iZombies = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsZombie [id] )
			
			iZombies ++;
	}
	
	return iZombies;
}

fnGetHumans (  )
{
	static iHumans, id;
	
	iHumans = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && !IsZombie [id] )
			
			iHumans ++;
	}
	
	return iHumans;
}

fnGetNemesis (  )
{
	static iNemesis, id;
	
	iNemesis = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsNemesis [id] )
		
			iNemesis ++;
	}
	
	return iNemesis;
}

fnGetAssassins (  )
{
	static iAssassins, id;
	
	iAssassins = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsAssassin [id] )
		
			iAssassins ++;
	}
	
	return iAssassins;
}

fnGetSurvivors (  )
{
	static iSurvivors, id;
	
	iSurvivors = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsSurvivor [id] )
		
			iSurvivors ++;
	}
	
	return iSurvivors;
}

fnGetSnipers (  )
{
	static iSnipers, id;
	
	iSnipers = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsSniper [id] )
		
			iSnipers ++;
	}
	
	return iSnipers;
}

fnGetAlive (  )
{
	static iAlive, id;
	
	iAlive = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] )
			
			iAlive ++;
	}
	
	return iAlive;
}

fnGetRandomAlive ( n )
{
	static iAlive, id;
	
	iAlive = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] )
			
			iAlive ++; 
		
		if ( iAlive == n )
			
			return id;
	}
	
	return -1;
}

fnGetPlaying (  )
{
	static iPlaying, id, Team
	
	iPlaying = 0
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsConnected [id] )
		{
			Team = fm_cs_get_user_team ( id );
			
			if ( Team != FM_CS_TEAM_SPECTATOR && Team != FM_CS_TEAM_UNASSIGNED )
				
				iPlaying ++;
		}
	}
	return iPlaying;
}

fnGetCTs (  )
{
	static iCTs, id;
	
	iCTs = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsConnected [id] )
		{			
			if ( fm_cs_get_user_team ( id ) == FM_CS_TEAM_CT )
				
				iCTs ++;
		}
	}
	return iCTs;
}

fnGetTs (  )
{
	static iTs, id;
	
	iTs = 0;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsConnected [id] )
		{			
			if ( fm_cs_get_user_team ( id ) == FM_CS_TEAM_T )
				
				iTs ++;
		}
	}
	return iTs;
}

fnCheckLastZombie (  )
{
	static id;
	
	for ( id = 1; id <= MaxPlayers; id ++ )
	{
		if ( IsAlive [id] && IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && fnGetZombies (  ) == 1 )
		{
			if ( !LastZombie [id] )
			{
				ExecuteForward ( fwUserLastZombie, fwDummyResult, id );
			}
			
			LastZombie [id] = true;
		}
		else
			LastZombie [id] = false;

		if ( IsAlive [id] && !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && fnGetHumans (  ) == 1 ) 
		{
			if ( !LastHuman [id] )
			{
				ExecuteForward ( fwUserLastHuman, fwDummyResult, id );
			}
			
			LastHuman [id] = true;
		}
		else
			LastHuman [id] = false;
	}
}

SaveStats ( id )
{
	if ( DBName [id] [0] && !equal ( PlayerName [id], DBName [id] ) )
	{
		if ( DBSlot >= sizeof DBName ) DBSlot = MaxPlayers + 1;
		
		copy ( DBName [DBSlot], charsmax ( DBName [ ] ), DBName [id] );
		
		DBPacks [DBSlot] = DBPacks [id];
		
		DBZombieClass [DBSlot] = DBZombieClass [id];
		
		DBSlot ++;
	}
	
	copy ( DBName [id], charsmax ( DBName [ ] ), PlayerName [id] );
	
	DBPacks [id] = AmmoPacks [id];
	
	DBZombieClass [id] = ZombieClassNext [id];
}

LoadStats ( id )
{
	static i;
	
	for ( i = 0; i < sizeof DBName; i ++ )
	{
		if ( equal ( PlayerName [id], DBName [i] ) )
		{
			AmmoPacks [id] = DBPacks [i];			
			
			ZombieClass [id] = DBZombieClass [i];
			
			ZombieClassNext[id] = DBZombieClass [i];
			
			return;
		}
	}
}

CheckAllowedZombie ( id )
{
	if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] ) || EndRound || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedHuman ( id )
{
	if ( ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] ) || EndRound || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedNemesis ( id )
{
	if ( EndRound || IsNemesis [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedAssassin ( id )
{
	if ( EndRound || IsAssassin [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedSurvivor ( id )
{
	if ( EndRound || IsSurvivor [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedSniper ( id )
{
	if ( EndRound || IsSniper [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )
		
		return false;
	
	return true;
}

CheckAllowedRespawn ( id ) 
{
	static Team;
	
	Team = fm_cs_get_user_team ( id );
	
	if ( EndRound || Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED || IsAlive [id] )
		
		return false;
	
	return true;
}

CheckAllowedSwarm (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )
		
		return false;
	
	return true;
}

CheckAllowedMulti (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )
		
		return false;
	
	return true;
}

CheckAllowedPlague (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( ( fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) < 1 ||
	
	fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueSurvivorNum ) + get_pcvar_num ( Zp_PlagueNemesisNum ) + floatround ( (fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) ) < 1 )

	          return false;
	
	return true;
}

CheckAllowedArmageddon (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )
		
		return false;
	
	return true;
}

CheckAllowedApocalypse (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )
		
		return false;
	
	return true;
}

CheckAllowedNightmare (  )
{
	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.2, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.2, floatround_ceil ) >= fnGetAlive (  ) )
		
		return false;
	
	return true;
}

CommandZombie ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Zombie", PlayerName [id], PlayerName [player] );
	
	LogToFile ( "ADMIN %s: made %s Zombie", PlayerName [id], PlayerName [player] );

	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		remove_task ( TASK_ID );
		
		cmdMakeZombie ( MODE_INFECTION, player );
	}
	else
		UserZombie ( player, 0, 0, 0, 0, 0 );
}

CommandTryder ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Tryder", PlayerName [id], PlayerName [player] );
	
	LogToFile ( "ADMIN %s: made %s Tryder", PlayerName [id], PlayerName [player] );

	BuyExtraItem ( player, EXTRA_TRYDER, true )
}

CommandHuman ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Human", PlayerName [id], PlayerName [player] );
	
	LogToFile ( "ADMIN %s: made %s Human", PlayerName [id], PlayerName [player] );

	UserHuman ( player, 0, 0, 0 );
}

CommandNemesis ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Nemesis", PlayerName [id], PlayerName [player] )
	
	LogToFile ( "ADMIN %s: made %s Nemesis", PlayerName [id], PlayerName [player] );
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		remove_task ( TASK_ID );
		
		cmdMakeZombie ( MODE_NEMESIS, player );
	}
	else
		UserZombie ( player, 0, 1, 0, 0, 0 );
}

CommandAssassin ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Assassin", PlayerName [id], PlayerName [player] );
	
	LogToFile ( "ADMIN %s: made %s Assassin", PlayerName [id], PlayerName [player] );

	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		remove_task ( TASK_ID );
		
		cmdMakeZombie ( MODE_ASSASSIN, player );
	}
	else
		UserZombie ( player, 0, 0, 1, 0, 0 );
}

CommandSurvivor ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Survivor", PlayerName [id], PlayerName [player] )
	
	LogToFile ( "ADMIN %s: made %s Survivor", PlayerName [id], PlayerName [player] );
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		remove_task ( TASK_ID );
		
		cmdMakeZombie ( MODE_SURVIVOR, player );
	}
	else
		UserHuman ( player, 1, 0, 0 );
}

CommandSniper ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Sniper", PlayerName [id], PlayerName [player] )
	
	LogToFile ( "ADMIN %s: made %s Sniper", PlayerName [id], PlayerName [player] );
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		remove_task ( TASK_ID );
		
		cmdMakeZombie ( MODE_SNIPER, player );
	}
	else
		UserHuman ( player, 0, 1, 0 );
}

CommandRespawn ( id, player )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : respawn^4 %s", PlayerName [id], PlayerName [player] );
	
	LogToFile ( "ADMIN %s: respawn %s", PlayerName [id], PlayerName [player] );
	
	ExecuteHamB ( Ham_CS_RoundRespawn, player );
}

CommandSwarm ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Swarm mode", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Swarm mode", PlayerName [id] );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_SWARM, 0 );
}

CommandMulti ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Multiple infection", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Multiple infection", PlayerName [id] );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_MULTI, 0 );
}

CommandPlague ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Plague mode", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Plague mode", PlayerName [id] );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_PLAGUE, 0 );
}

CommandArmageddon ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Armageddon mode", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Armageddon mode", PlayerName [id] );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_ARMAGEDDON, 0 );
}

CommandApocalypse ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Apocalypse mode", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Apocalypse mode", PlayerName [id] );
	
	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_APOCALYPSE, 0 );
}

CommandNightmare ( id )
{
	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Nightmare mode", PlayerName [id] );
	
	LogToFile ( "ADMIN %s: started Nightmare mode", PlayerName [id] );

	remove_task ( TASK_MAKEZOMBIE );
	
	remove_task ( TASK_ID );
	
	cmdMakeZombie ( MODE_NIGHTMARE, 0 );
} 

public native_get_user_human ( id ) return IsHuman [id];

public native_get_user_zombie ( id ) return IsZombie [id];

public native_get_user_nemesis ( id ) return IsNemesis [id];

public native_get_user_assassin ( id ) return IsAssassin [id];

public native_get_user_survivor ( id ) return IsSurvivor [id];

public native_get_user_sniper ( id ) return IsSniper [id];

public native_get_user_first_zombie ( id ) return FirstZombie [id];

public native_get_user_last_zombie ( id ) return LastZombie [id];

public native_get_user_last_human ( id ) return LastHuman [id];

public native_get_user_zombie_class ( id ) return ZombieClass [id];

public native_get_user_next_class ( id ) return ZombieClassNext [id];

public native_set_user_zombie_class ( id, classid )
{
	if ( classid < 0 || classid >= iZClass ) return 0;
	
	ZombieClassNext [id] = classid;
	
	return 1;
}

public native_get_user_ammo_packs ( id ) return AmmoPacks [id];

public native_set_user_ammo_packs ( id, amount ) AmmoPacks [id] = amount;

public native_get_zombie_maxhealth ( id )
{
	if ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] )
	{
		if ( FirstZombie [id] )
		
			return floatround ( float ( ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) ) * 1.0 ) ;
		else
			return ArrayGetCell ( ZClassHealth_01, ZombieClass [id] );
	}
	return -1;
}

public native_get_user_nightvision ( id ) return NVision [id];

public native_set_user_nightvision ( id, set )
{
	if ( set )
	{
		NVision [id] = true;
		
		if ( !IsBot [id] )
		{
			NVisionEnabled [id] = true;
			
			if ( get_pcvar_num ( Zp_CustomNvg ) )
			{
				remove_task ( id + TASK_NVISION );
				
				set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );
			}
			else
				SetUserGNvision ( id, 1 );
		}
		else
			cs_set_user_nvg ( id, 1 );
	}
	else
	{
		if ( IsBot [id] ) cs_set_user_nvg ( id, 0 );
		
		if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );
		
		else if ( NVisionEnabled [id] ) SetUserGNvision ( id, 0 );
			
			NVision [id] = false;
		
		NVisionEnabled [id] = false;
	}
}

public native_infect_user ( id, infector, silent, rewards )
{
	if ( !CheckAllowedZombie ( id ) ) return 0;

	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		cmdMakeZombie ( MODE_INFECTION, id );
	}
	else
		UserZombie ( id, is_user_valid_alive ( infector ) ? infector : 0, 0, 0, ( silent == 1 ) ? 1 : 0, ( rewards == 1 ) ? 1 : 0 );
	
	return 1;
}

public native_disinfect_user ( id, silent )
{
         if ( !CheckAllowedHuman ( id ) ) return 0;

	UserHuman ( id, 0, 0, ( silent == 1 ) ? 1 : 0 );
	
	return 1;
}

public native_make_user_nemesis ( id )
{
         if ( !CheckAllowedNemesis ( id ) ) return 0;

	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		cmdMakeZombie ( MODE_NEMESIS, id );
	}
	else
		UserZombie ( id, 0, 1, 0, 0, 0 );
	
	return 1;
}

public native_make_user_assassin ( id )
{
	if ( !CheckAllowedAssassin ( id ) ) return 0;
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		cmdMakeZombie ( MODE_ASSASSIN, id );
	}
	else
		UserZombie ( id, 0, 0, 1, 0, 0 );
	
	return 1;
}

public native_make_user_survivor ( id )
{
         if ( !CheckAllowedSurvivor ( id ) ) return 0;
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		cmdMakeZombie ( MODE_SURVIVOR, id );
	}
	else
		UserHuman ( id, 1, 0, 0 );

	return 1;
}

public native_make_user_sniper ( id )
{
         if ( !CheckAllowedSniper ( id ) ) return 0;
	
	if ( NewRound )
	{
		remove_task ( TASK_MAKEZOMBIE );
		
		cmdMakeZombie ( MODE_SNIPER, id );
	}
	else
		UserHuman ( id, 0, 1, 0 );
	
	return 1;
}

public native_force_buy_extra_item ( id, ItemID, IgnoreCost )
{

         if ( ItemID < 0 || ItemID >= iExtraItem ) return 0;
	
	BuyExtraItem ( id, ItemID, IgnoreCost )
	
	return 1;
}

public native_override_user_model ( id, const newmodel[], modelindex )
{
	if ( !is_user_valid_connected ( id ) ) return 0;
	
	param_convert ( 2 );

	remove_task ( id + TASK_MODEL );
	
	static CurrentModel [32];

	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) )

	if ( !equal ( CurrentModel, newmodel ) )
	{
		copy ( PlayerModel [id], charsmax ( PlayerModel [ ] ), newmodel );

		if ( NewRound )
				
			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );
		else
			fmUserModelUpdate ( id + TASK_MODEL );
	}

	return true;
}

public native_has_round_started (  )
{
	if ( NewRound ) return 0; 
	
	if ( ModeStarted ) return 1;
	
	return 2; 
}

public native_is_nemesis_round (  ) return NemesisRound;

public native_is_assassin_round (  ) return AssassinRound;

public native_is_survivor_round (  ) return SurvivorRound;

public native_is_sniper_round (  ) return SniperRound;

public native_is_swarm_round (  ) return SwarmRound;

public native_is_plague_round (  ) return PlagueRound;

public native_is_armageddon_round (  ) return ArmageddonRound;

public native_is_apocalypse_round (  ) return ApocalypseRound;

public native_is_nightmare_round ( ) return NightmareRound;

public native_get_zombie_count (  ) return fnGetZombies (  );

public native_get_human_count (  ) return fnGetHumans (  );

public native_get_nemesis_count (  ) return fnGetNemesis (  );

public native_get_assassin_count (  ) return fnGetAssassins (  );

public native_get_survivor_count (  ) return fnGetSurvivors (  );

public native_get_sniper_count (  ) return fnGetSnipers (  );

public native_register_extra_item ( const Name [ ], Cost, Team )
{
	if ( !ArraysCreated ) return -1;
	
	if ( Team == ZP_TEAM_ANY ) Team = ZP_TEAM_ZOMBIE | ZP_TEAM_HUMAN;
	
	param_convert ( 1 );
	
	ArrayPushString ( ExtraItemName_01, Name );
	
	ArrayPushCell ( ExtraItemCost_01, Cost );
	
	ArrayPushCell ( ExtraItemTeam_01, Team );
	
	ArrayPushCell ( ExtraItemNew, 1 );
	
	
	new i, Buffer [32], size = ArraySize ( ExtraItemRealName );
	
	for ( i = 0; i < size; i ++ )
	{
		ArrayGetString ( ExtraItemRealName, i, Buffer, charsmax ( Buffer ) );
		
		if ( !equal ( Name, Buffer ) ) continue;
		
		ArraySetCell ( ExtraItemNew, iExtraItem, 0 );
		
		ArrayGetString ( ExtraItemName_02, i, Buffer, charsmax ( Buffer ) );
		
		ArraySetString ( ExtraItemName_01, iExtraItem, Buffer );
		
		Buffer [0] = ArrayGetCell ( ExtraItemCost_02, i );
		
		ArraySetCell ( ExtraItemCost_01, iExtraItem, Buffer [0] );
		
		Buffer [0] = ArrayGetCell ( ExtraItemTeam_02, i );
		
		ArraySetCell ( ExtraItemTeam_01, iExtraItem, Buffer [0] );
	}
	
	iExtraItem ++;
	
	return iExtraItem -1;
}

native_register_item ( const Name [ ], Cost, Team )
{
	ArrayPushString ( ExtraItemName_01, Name );
	
	ArrayPushCell ( ExtraItemCost_01, Cost );
	
	ArrayPushCell ( ExtraItemTeam_01, Team );
	
	ArrayPushCell ( ExtraItemNew, 1 );
	
	iExtraItem ++;
}

public native_register_zombie_class ( const Name [ ], const Info [ ], const model [ ], const clawmodel[], hp, speed, Float:gravity, Float:knockback )
{
	if ( !ArraysCreated ) return -1;
	
	param_convert ( 1 );
	param_convert ( 2 );
	param_convert ( 3 );
	param_convert ( 4 );

	ArrayPushString ( ZClassName_01, Name )
	
	ArrayPushString ( ZClassInfo_01, Info )

	ArrayPushCell ( ZClassModelsStart_01, ArraySize ( ZClassPlayerModel_01 ) );
	
	ArrayPushString ( ZClassPlayerModel_01, model );
		
	ArrayPushCell ( ZClassModelSend_01, ArraySize ( ZClassPlayerModel_01 ) );
		
	ArrayPushCell ( ZClassModelIndex_01, -1 );

	ArrayPushString ( ZClassClawModel_01, clawmodel );
	
	ArrayPushCell ( ZClassHealth_01, hp );
	
	ArrayPushCell ( ZClassSpeed_01, speed );
	
	ArrayPushCell ( ZClassGravity_01, gravity );
	
	ArrayPushCell ( ZClassKnockback_01, knockback );
	
	ArrayPushCell ( ZClassNew, 1 );

	new i, k, Buffer [32], Float: Buffer_2, NumModelsCustom, NumModelsDefault, prec_mdl [100], size = ArraySize ( ZClassRealName );
	
	for ( i = 0; i < size; i ++ )
	{
		ArrayGetString ( ZClassRealName, i, Buffer, charsmax ( Buffer ) );
		
		if ( !equal ( Name, Buffer ) ) continue;
		
		ArraySetCell ( ZClassNew, iZClass, 0 );
		
		ArrayGetString ( ZClassName_02, i, Buffer, charsmax ( Buffer ) );
		
		ArraySetString ( ZClassName_01, iZClass, Buffer );
		
		ArrayGetString ( ZClassInfo_02, i, Buffer, charsmax ( Buffer ) );
		
		ArraySetString ( ZClassInfo_01, iZClass, Buffer );

		NumModelsCustom = ArrayGetCell ( ZClassModelSend_02, i ) - ArrayGetCell ( ZClassModelsStart_02, i );
			
		NumModelsDefault = ArrayGetCell ( ZClassModelSend_01, iZClass ) - ArrayGetCell ( ZClassModelsStart_01, iZClass );

		for ( k = 0; k < min ( NumModelsCustom, NumModelsDefault ); k ++ )
		{
			ArrayGetString ( ZClassPlayerModel_02, ArrayGetCell ( ZClassModelsStart_02, i ) + k, Buffer, charsmax ( Buffer ) );
				
			ArraySetString ( ZClassPlayerModel_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k, Buffer );
				
			formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", Buffer, Buffer );
				
			ArraySetCell ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k, engfunc ( EngFunc_PrecacheModel, prec_mdl ) );
				
			if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );
				
			if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );
		}
			
		if ( NumModelsCustom > NumModelsDefault )
		{
			for ( k = NumModelsDefault; k < NumModelsCustom; k ++ )
			{
				ArrayGetString ( ZClassPlayerModel_02, ArrayGetCell ( ZClassModelsStart_02, i ) + k, Buffer, charsmax ( Buffer ) );
					
				ArrayInsertStringAfter ( ZClassPlayerModel_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k - 1, Buffer );
					
				formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", Buffer, Buffer );

				ArrayInsertCellAfter ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k - 1, engfunc ( EngFunc_PrecacheModel, prec_mdl ) ); 
					
				if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );
					
				if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );
			}

			ArraySetCell ( ZClassModelSend_01, iZClass, ArrayGetCell ( ZClassModelSend_01, iZClass ) + ( NumModelsCustom - NumModelsDefault ) );
		}
		
		ArrayGetString ( ZClassClawModel_02, i, Buffer, charsmax ( Buffer ) );
		
		ArraySetString ( ZClassClawModel_01, iZClass, Buffer );
		
		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/zombie_plague/%s", Buffer );
		
		engfunc ( EngFunc_PrecacheModel, prec_mdl );

		Buffer [0] = ArrayGetCell ( ZClassHealth_02, i );
		
		ArraySetCell ( ZClassHealth_01, iZClass, Buffer [0] );
		
		Buffer [0] = ArrayGetCell ( ZClassSpeed_02, i );
		
		ArraySetCell ( ZClassSpeed_01, iZClass, Buffer [0] );
		
		Buffer_2 = Float: ArrayGetCell ( ZClassGravity_02, i );
		
		ArraySetCell ( ZClassGravity_01, iZClass, Buffer_2 );
		
		Buffer_2 = Float: ArrayGetCell ( ZClassKnockback_02, i );
		
		ArraySetCell ( ZClassKnockback_01, iZClass, Buffer_2 );
	}

	if ( ArrayGetCell ( ZClassNew, iZClass ) )
	{
		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", model, model );
			
		ArraySetCell ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ), engfunc ( EngFunc_PrecacheModel, prec_mdl ) );
			
		if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );
			
		if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );

		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/zombie_plague/%s", clawmodel );
		
		engfunc ( EngFunc_PrecacheModel, prec_mdl );
	}
	
	iZClass ++;
	
	return iZClass -1;
}


public native_get_extra_item_id ( const Name [ ] )
{
	param_convert ( 1 );
	
	static i, ItemName [32];
	
	for ( i = 0; i < iExtraItem; i ++ )
	{
		ArrayGetString ( ExtraItemName_01, i, ItemName, charsmax ( ItemName ) );
		
		if ( equali ( Name, ItemName ) ) return i;
	}
	
	return -1;
}

public native_get_zombie_class_id ( const Name [ ] )
{
	param_convert ( 1 );
	
	static i, ClassName [32];
	
	for ( i = 0; i < iZClass; i ++ )
	{
		ArrayGetString ( ZClassName_01, i, ClassName, charsmax ( ClassName ) );
		
		if ( equali ( Name, ClassName ) ) return i;
	}
	
	return -1;
}

public UserNVision ( taskid )
{
	static origin [3]; get_user_origin ( ID_NVISION, origin );
	
	message_begin ( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, ID_NVISION );
	write_byte ( TE_DLIGHT );
	write_coord ( origin [0] );
	write_coord ( origin [1] );
	write_coord ( origin [2] );
	write_byte ( 100 );
	
	if ( NoDamage [ID_NVISION] )
	{
		write_byte ( 255 );
		write_byte ( 0 );
		write_byte ( 0 );
	}
	else
	{
		write_byte ( 0 );
		write_byte ( 120 );
		write_byte ( 240 );
	}
	
	write_byte ( 2 );
	write_byte ( 0 ); 
	message_end (  );
}

InfectionEffects ( id )
{
	if ( !IsFrozen [id] )
	{
		message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, id );
		write_short ( UNIT_SECOND );
		write_short ( 0 );
		write_short ( FFADE_IN );	
		write_byte ( 255 );
		write_byte ( 0 );
		write_byte ( 0 );	
		write_byte ( 255 );
		message_end (  )
	}
	
	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, id );
	write_short ( UNIT_SECOND * 4 );
	write_short ( UNIT_SECOND * 2 );
	write_short ( UNIT_SECOND * 10 );
	message_end (  )
	
	static Origin [3]; get_user_origin ( id, Origin );
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_IMPLOSION );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin[2] );
	write_byte ( 128 );
	write_byte ( 20 );
	write_byte ( 3 );
	message_end (  );
	 
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_PARTICLEBURST );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_short ( 50 );
	write_byte ( 70 );
	write_byte ( 3 );
	message_end (  );
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
	write_byte ( TE_DLIGHT );
	write_coord ( Origin [0] );
	write_coord ( Origin [1] );
	write_coord ( Origin [2] );
	write_byte ( 20 );
	write_byte ( 250 );
	write_byte ( 0 );
	write_byte ( 40 );
	write_byte ( 2 );
	write_byte ( 0 );
	message_end (  );
}

public MakeBlood ( taskid )
{
         if ( !( pev ( ID_BLOOD, pev_flags ) & FL_ONGROUND ) || fm_get_speed ( ID_BLOOD ) < 80 ) return;

	static Float: origin [3]; pev ( ID_BLOOD, pev_origin, origin );

	if ( pev ( ID_BLOOD, pev_bInDuck ) )
		
		origin [2] -= 18.0;
	else
		origin [2] -= 36.0;
	
	engfunc ( EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, origin, 0 ); 
	
	write_byte ( TE_WORLDDECAL );
	
	engfunc ( EngFunc_WriteCoord, origin [0] );
	
	engfunc ( EngFunc_WriteCoord, origin [1] ); 
	
	engfunc ( EngFunc_WriteCoord, origin [2] );
	
	write_byte ( ArrayGetCell ( ZombieDecals, random_num ( 0, ArraySize ( ZombieDecals ) - 1 ) )  + ( CZero * 12 ) );
	
	message_end (  );
}

public BurningFlame ( taskid )
{
	static origin [3], flags;
	
	get_user_origin ( ID_BURN, origin );
	
	flags = pev ( ID_BURN, pev_flags );
	
	if ( NoDamage [ID_BURN] || ( flags & FL_INWATER ) || BurningDuration [ID_BURN] < 1 )
	{
		message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
		write_byte ( TE_SMOKE ); 
		write_coord ( origin [0] ); 
		write_coord ( origin [1] ); 
		write_coord ( origin [2] - 50 );
		write_short ( SmokeSpr ); 
		write_byte ( random_num (15, 20) ); 
		write_byte ( random_num (10, 20) );
		message_end (  );

		remove_task ( taskid );
		
		return;
	}

	if ( !IsNemesis [ID_BURN] && !IsAssassin [ID_BURN] && !random_num ( 0, 20 ) )
	{
		static Sound [64];
		
		ArrayGetString ( GrenadeFirePlayer, random_num ( 0, ArraySize ( GrenadeFirePlayer ) - 1 ), Sound, charsmax ( Sound ) )
		
		emit_sound ( ID_BURN, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
	}

	if ( !IsNemesis [ID_BURN] && !IsAssassin [ID_BURN] && ( flags & FL_ONGROUND ) && get_pcvar_float ( Zp_FireSlowdown ) > 0.0 )
	{
		static Float: velocity [3];
		
		pev ( ID_BURN, pev_velocity, velocity );
		
		xs_vec_mul_scalar ( velocity, get_pcvar_float ( Zp_FireSlowdown ), velocity );
		
		set_pev ( ID_BURN, pev_velocity, velocity );
	}
	
	static health;
	
	health = pev ( ID_BURN, pev_health ); 
	
	if ( health - floatround ( get_pcvar_float ( Zp_FireDamage ), floatround_ceil ) > 0 )
		
		fm_set_user_health ( ID_BURN, health - floatround ( get_pcvar_float ( Zp_FireDamage ), floatround_ceil ) );
	
	message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
	
	write_byte ( TE_SPRITE );
	
	write_coord ( origin [0] + random_num (-5, 5) );
	
	write_coord ( origin [1] + random_num (-5, 5) ); 
	
	write_coord ( origin [2] + random_num (-10, 10) ); 
	
	write_short ( FlameSpr );
	
	write_byte ( random_num (5, 10) );
	
	write_byte ( 200 );
	
	message_end (  );

	BurningDuration [ID_BURN]--
}

CreateBlastInfection ( const Float: Origin [3] )
{
	engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
	write_byte ( TE_BEAMCYLINDER );
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] ); 
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] ); 
	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 
	//engfunc ( EngFunc_WriteCoord, originF[2]+385.0 );    // SMALL
	//engfunc ( EngFunc_WriteCoord, originF[2]+555.0 ); // LARGEST
	write_short ( ExploSpr ); 
	write_byte ( 0 ); 
	write_byte ( 0 ); 
	write_byte ( 4 ); 
	write_byte ( 60 ); 
	write_byte ( 0 ); 
	write_byte ( 0 ); 
	write_byte ( 250 ); 
	write_byte ( 0 ); 
	write_byte ( 200 ); 
	write_byte ( 0 ); 
	message_end (  );
}

CreateBlastFire ( const Float: Origin [3] )
{
         engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
         write_byte ( TE_BEAMCYLINDER );
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] ); 
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] ); 
	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 
         write_short ( ExploSpr ); 
         write_byte ( 0 ); 
         write_byte ( 0 ); 
         write_byte ( 4 ); 
         write_byte ( 60 ); 
         write_byte ( 0 ); 
         write_byte ( 250 );
         write_byte ( 40 );
         write_byte ( 0 );
         write_byte ( 200 );
         write_byte ( 0 );
         message_end (  )
}

CreateBlastFrost ( const Float: Origin [3] )
{
         engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
         write_byte ( TE_BEAMCYLINDER );
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] ); 
	engfunc ( EngFunc_WriteCoord, Origin [0] ); 
	engfunc ( EngFunc_WriteCoord, Origin [1] ); 
	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 
         write_short ( ExploSpr ); 
         write_byte ( 0 ); 
         write_byte ( 0 ); 
         write_byte ( 4 ); 
         write_byte ( 60 ); 
         write_byte ( 0 );
         write_byte ( 0 );
         write_byte ( 100 );
         write_byte ( 200 );
         write_byte ( 200 );
         write_byte ( 0 );
         message_end (  );
}

FixDeadAttrib ( id )
{
         message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreAttrib" ) );
         write_byte ( id ); 
         write_byte ( 0 );
         message_end (  );
}

SendDeathMsg ( Attacker, Victim )
{
         message_begin ( MSG_BROADCAST, get_user_msgid ( "DeathMsg" ) );
         write_byte ( Attacker );
         write_byte ( Victim ); 
         write_byte ( 1 );
         write_string ( "infection" )
         message_end (  )
}

UpdateFrags ( Attacker, Victim, frags, deaths, scoreboard )
{
	set_pev ( Attacker, pev_frags, float ( pev ( Attacker, pev_frags ) + frags ) );
	
	fm_cs_set_user_deaths ( Victim, cs_get_user_deaths ( Victim ) + deaths );
	
	if ( scoreboard )
	{
		message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreInfo" ) );
		write_byte ( Attacker );
		write_short ( pev ( Attacker, pev_frags ) );
		write_short ( cs_get_user_deaths ( Attacker ) );
		write_short ( 0 );
		write_short ( fm_cs_get_user_team ( Attacker ) );
		message_end (  );
		
		message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreInfo" ) );
		write_byte ( Victim );
		write_short ( pev ( Victim, pev_frags ) );
		write_short ( cs_get_user_deaths ( Victim ) );
		write_short ( 0 );
		write_short ( fm_cs_get_user_team ( Victim ) );
		message_end (  );
	}
}

PlaySound ( const Sound [ ] ) client_cmd ( 0, "spk ^"%s^"", Sound );

SetUserGNvision ( id, toggle )
{
         message_begin ( MSG_ONE, get_user_msgid ( "NVGToggle" ), _, id );
         write_byte ( toggle );
         message_end (  );
}

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

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

public LogToFile ( const msg [ ], any:...)
{
	new Message [256];
	
	vformat ( Message, sizeof ( Message ) -1, msg , 2 );
	
	new Director [64], File [128], Log [256], LogTime [32];
	
	get_time ( "%d.%m.%Y - %H:%M:%S", LogTime, sizeof ( LogTime ) -1 );
	
	if( !Director [0] )
	{	
		get_basedir ( Director, sizeof ( Director ) -1 );
		
		formatex ( File, sizeof ( File ) -1, "%s/logs/ZombiePlague-UltimateX.log", Director );
	}
	
	formatex ( Log, sizeof ( Log ) -1, "|%s| %s ", LogTime, Message );
	
	write_file ( File, Log, -1 );
}

/* --------------- | Extra Items | -------------- */

public BuyTripMine ( id )
{
	if ( !IsAlive [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );
		
		return PLUGIN_CONTINUE;
	}
	
	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );
		
		return PLUGIN_CONTINUE;
	}
	
	if ( AmmoPacks [id] < ExtraCosts [EXTRA_TRIPMINE] )
	{
		client_print_color ( id, print_team_grey, "%s You need^4 %d ammo packs^1.", CHAT_PREFIX, ExtraCosts [EXTRA_TRIPMINE] );
		
		return PLUGIN_CONTINUE;
	}
	
	
	AmmoPacks [id] -= ExtraCosts [EXTRA_TRIPMINE];
	
	HasTripMines [id] ++;
	
	client_print_color ( id, print_team_grey, "%s You bought a trip mine. Press^3 V^1 to plant it or^3 C^1 to take it.", CHAT_PREFIX );
	
	client_cmd ( id, "bind ^"v^" ^"createlaser^"" );
	
	client_cmd ( id, "bind ^"c^" ^"removelaser^"" );
	
	return PLUGIN_CONTINUE;
}

public PlantTripMine ( id )
{
	if( !IsAlive [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
		
	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
	
	if ( !HasTripMines [id] )
	{
		client_print_color ( id, print_team_default, "%s You don't have a trip mine to plant.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
	
	if ( PlantedMines [id] > 1 )
	{
		client_print_color ( id, print_team_grey, "%s You can plant only^3 2^1 mines.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}

	
	if ( HasPlanting [id] || HasRemoving [id] ) return PLUGIN_HANDLED;
	
	if ( CanPlant ( id ) ) 
	{
		HasPlanting [id] = true;
		
		message_begin ( MSG_ONE_UNRELIABLE, 108, _, id );
		write_byte ( 1 );
		write_byte ( 0 );
		message_end ( );
		
		set_task ( 1.2, "fwPlantMines", id + TASK_CREATE );
	}
	
	return PLUGIN_HANDLED;
}

public TakeTripMine ( id )
{
	if ( !IsAlive [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
	
	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )
	{
		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
	
	if ( !PlantedMines [id] )
	{
		client_print_color ( id, print_team_default, "%s You don't have a planted mine.", CHAT_PREFIX );
		
		return PLUGIN_HANDLED;
	}
	
	if ( HasPlanting [id] || HasRemoving [id] ) return PLUGIN_HANDLED;
	
	if ( CanTake ( id ) ) 
	{
		HasRemoving [id] = true;
		
		message_begin ( MSG_ONE_UNRELIABLE, 108, _, id );
		write_byte ( 1 );
		write_byte ( 0 );
		message_end (  );
		
		set_task ( 1.2, "fwTakeMines", id + TASK_REMOVE );
	}
	
	return PLUGIN_HANDLED;
}

public fwPlantMines ( id ) 
{
	id -= TASK_CREATE;
	
	HasPlanting [id] = false;
	
	static Float: Origin [3]; entity_get_vector ( id, EV_VEC_origin, Origin );
	
	static Float: TraceDirection [3], Float: TraceEnd [3], Float: iTraceResult [3], Float: Normal [3];
	
	velocity_by_aim ( id, 128, TraceDirection );
	
	TraceEnd [0] = TraceDirection [0] + Origin [0];
	
	TraceEnd [1] = TraceDirection [1] + Origin [1];
	
	TraceEnd [2] = TraceDirection [2] + Origin [2];
	
	static Float: Fraction, iTr; iTr = 0;
	
	engfunc ( EngFunc_TraceLine, Origin, TraceEnd, 0, id, iTr );
	
	get_tr2 ( iTr, TR_vecEndPos, iTraceResult );
	
	get_tr2 ( iTr, TR_vecPlaneNormal, Normal );
	
	get_tr2 ( iTr, TR_flFraction, Fraction );
	
	static Entity; Entity = create_entity ( "info_target" );
	
	if ( !Entity ) return;
	
	entity_set_string ( Entity, EV_SZ_classname, MINE_CLASSNAME );
	
	entity_set_model ( Entity, ModelTripMine );
	
	entity_set_size ( Entity, Float: { -4.0, -4.0, -4.0 }, Float: { 4.0, 4.0, 4.0 } );
	
	if ( get_pcvar_num ( TripMineGlow ) )
	
		fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 120, 240, kRenderNormal, 13 );
	
	entity_set_int ( Entity, EV_INT_iuser2, id );
	
	PlantedMines [id] ++;

	set_pev ( Entity, pev_iuser3, PlantedMines [id] );
	
	entity_set_float ( Entity, EV_FL_frame, 0.0 );
	
	entity_set_float ( Entity, EV_FL_framerate, 0.0 );
	
	entity_set_int ( Entity, EV_INT_movetype, MOVETYPE_FLY );
	
	entity_set_int ( Entity, EV_INT_solid, SOLID_NOT );
	
	entity_set_int ( Entity, EV_INT_body, 3 );
	
	entity_set_int ( Entity, EV_INT_sequence, 7 );
	
	entity_set_float ( Entity, EV_FL_takedamage, DAMAGE_NO );
	
	entity_set_int ( Entity, EV_INT_iuser1, 0 );
	
	static Float: NewOrigin [3], Float: EntAngles [3];
	
	NewOrigin [0] = iTraceResult [0] + ( Normal [0] * 8.0 );
	
	NewOrigin [1] = iTraceResult [1] + ( Normal [1] * 8.0 );
	
	NewOrigin [2] = iTraceResult [2] + ( Normal [2] * 8.0 );
	
	entity_set_origin ( Entity, NewOrigin );
	
	vector_to_angle ( Normal, EntAngles );
	
	entity_set_vector ( Entity, EV_VEC_angles, EntAngles );
	
	EntAngles [0] *= -1.0;
	
	EntAngles [1] *= -1.0;
	
	EntAngles [2] *= -1.0;
	
	entity_set_vector ( Entity, EV_VEC_v_angle, EntAngles );
	
	HasTripMines [id] --;
	
	emit_sound ( Entity, CHAN_WEAPON, MINE_SOUND_DEPLOY, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
	
	emit_sound ( Entity, CHAN_VOICE, MINE_SOUND_CHARGE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
	
	entity_set_float ( Entity, EV_FL_nextthink, get_gametime (  ) + 0.6 );
}

public fwTakeMines ( id ) 
{
	id -= TASK_REMOVE;
	
	HasRemoving [id] = false;
	
	static Entity, ClassName [32], Float: OwnerOrigin [3], Float: EntityOrigin [3];
	
	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 
	{
		if ( !is_valid_ent ( Entity ) ) continue;
		
		ClassName [0] = '^0';
		
		entity_get_classname ( Entity, ClassName );
		
		if ( equal ( ClassName, MINE_CLASSNAME ) ) 
		{
			if ( entity_get_owner ( Entity ) == id ) 
			{
				entity_get_vector ( id, EV_VEC_origin, OwnerOrigin );
				
				entity_get_vector ( Entity, EV_VEC_origin, EntityOrigin );
				
				if ( get_distance_f ( OwnerOrigin, EntityOrigin ) < 55.0 ) 
				{
					PlantedMines [id] --;
					
					HasTripMines [id] ++;
					
					remove_entity ( Entity );
					
					break;
				}
			}
		}
	}
}

public bool: CanPlant ( id ) 
{
	static Float: Origin [3];
	
	entity_get_vector ( id, EV_VEC_origin, Origin );
	
	static Float: TraceDirection [3], Float: TraceEnd [3], Float: iTraceResult [3], Float: Normal [3];
	
	velocity_by_aim ( id, 64, TraceDirection );
	
	TraceEnd [0] = TraceDirection [0] + Origin [0];
	
	TraceEnd [1] = TraceDirection [1] + Origin [1];
	
	TraceEnd [2] = TraceDirection [2] + Origin [2];
	
	static Float: Fraction, iTr; iTr = 0;
	
	engfunc ( EngFunc_TraceLine, Origin, TraceEnd, 0, id, iTr );
	
	get_tr2 ( iTr, TR_vecEndPos, iTraceResult );
	
	get_tr2 ( iTr, TR_vecPlaneNormal, Normal );
	
	get_tr2 ( iTr, TR_flFraction, Fraction );
	
	if ( Fraction >= 1.0 ) 
	{
		client_print_color ( id, print_team_default, "%s You must plant the tripmine on a wall.", CHAT_PREFIX );
			
		return false;
	}
	
	return true;
}

public bool: CanTake ( id ) 
{
	static Entity, ClassName [32], Float: OwnerOrigin [3], Float: EntityOrigin [3];
	
	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 
	{
		if ( !is_valid_ent ( Entity ) ) continue;
		
		ClassName [0] = '^0';
		
		entity_get_classname ( Entity, ClassName );
		
		if ( equal ( ClassName, MINE_CLASSNAME ) ) 
		{
			if ( entity_get_owner ( Entity ) == id ) 
			{
				entity_get_vector ( id, EV_VEC_origin, OwnerOrigin );
				
				entity_get_vector ( Entity, EV_VEC_origin, EntityOrigin );
				
				if ( get_distance_f ( OwnerOrigin, EntityOrigin ) < 55.0 )
					
					return true;
			}
		}
	}
	
	return false;
}

public fwRemoveMinesByOwner ( id ) 
{
	static Entity, ClassName [32];
	
	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 
	{
		if ( !is_valid_ent ( Entity ) ) continue;
		
		ClassName [0] = '^0';
		
		entity_get_classname ( Entity, ClassName );
		
		if ( equal ( ClassName, MINE_CLASSNAME ) )
		
			if ( entity_get_int ( Entity, EV_INT_iuser2 ) == id )
				
				remove_entity ( Entity );
	}
}

fwExplodeMine ( Entity ) 
{
	PlantedMines [entity_get_owner ( Entity )] --;
	
	static Float: Origin [3], Float: ZombieOrigin [3], Float: Velocity [3];
	
	entity_get_vector ( Entity, EV_VEC_origin, Origin );

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_EXPLOSION );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	write_short ( HExplode )
	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
	write_byte ( 55 );
	write_byte ( 15 );
	write_byte ( 0 );
	message_end (  );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_EXPLOSION );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	write_short( HExplode );
	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
	write_byte ( 65 );
	write_byte ( 15 );
	write_byte ( 0 );
	message_end (  );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_EXPLOSION );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	write_short ( HExplode );
	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
	write_byte ( 85 );
	write_byte ( 15 );
	write_byte ( 0 );
	message_end (  );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_BEAMCYLINDER );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] + 400.0 ); 
	write_short ( ExploSpr );
	write_byte ( 0 ); 
	write_byte ( 0 ); 
	write_byte ( 4 ); 
	write_byte ( 60 ); 
	write_byte ( 0 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 200 ); 
	write_byte ( 0 );
	message_end (  );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_BEAMCYLINDER );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] + 700.0 ); 
	write_short ( ExploSpr ); 
	write_byte ( 0 ); 
	write_byte ( 0 ); 
	write_byte ( 4 ); 
	write_byte ( 110 ); 
	write_byte ( 0 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 200 );
	write_byte ( 0 );
	message_end (  );
	
	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte ( TE_BEAMCYLINDER ); 
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] );
	engfunc ( EngFunc_WriteCoord, Origin [0] );
	engfunc ( EngFunc_WriteCoord, Origin [1] );
	engfunc ( EngFunc_WriteCoord, Origin [2] + 900.0 ); 
	write_short ( ExploSpr ); 
	write_byte ( 0 );
	write_byte ( 0 ); 
	write_byte ( 4 ); 
	write_byte ( 160 ); 
	write_byte ( 0 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 121 ); 
	write_byte ( 200 ); 
	write_byte ( 0 ); 
	message_end (  );
	
	static iZombie;
	
	for ( iZombie = 1; iZombie < MaxPlayers + 1; iZombie ++ ) 
	{
		if ( is_user_connected ( iZombie ) ) 
		{
			if ( is_user_alive ( iZombie ) ) 
			{
				entity_get_vector ( iZombie, EV_VEC_origin, ZombieOrigin );
				
				if ( get_distance_f ( Origin, ZombieOrigin ) < 340.0 ) 
				{
					entity_get_vector ( iZombie, EV_VEC_velocity, Velocity );
					
					Velocity [2] += 240.0;
					
					Velocity [1] += 200.0;
					
					Velocity [0] += 160.0;
					
					entity_set_vector ( iZombie, EV_VEC_velocity, Velocity );
				}
			}
		}
	}
	
	for ( new i = 1; i < MaxPlayers + 1; i ++ )
	{
		if ( !is_user_connected ( i ) || !is_user_alive ( i ) ) continue;
		
		if ( IsZombie [i] )
		{
			static Float: fDistance, Float: fDamage;

			fDistance = EntityRange ( i, Entity );

			if ( fDistance < 340 )
			{
				fDamage = 2850.0 - fDistance;

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

				xs_vec_mul_scalar ( fVelocity, 1.75, fVelocity );

				set_pev ( i, pev_velocity, fVelocity );

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, i );
				write_short ( UNIT_SECOND );
				write_short ( UNIT_SECOND );
				write_short ( FFADE_IN );
				write_byte ( 250 );
				write_byte ( 0 );
				write_byte ( 0 );
				write_byte ( fDistance < 220 ? 230 : 210 );
				message_end (   );
				
				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, i );
			        write_short ( UNIT_SECOND * 3 );
			        write_short ( UNIT_SECOND * 2 );
			        write_short ( UNIT_SECOND * 4 );
				message_end (  );

				if ( float ( get_user_health ( i ) ) - fDamage > 0 )
		
					ExecuteHamB ( Ham_TakeDamage, i, Entity, entity_get_owner ( Entity ), fDamage, DMG_BLAST );
				else 
					ExecuteHamB ( Ham_Killed, i, entity_get_owner ( Entity ), 2 );
			
				
				if ( !IsNemesis [i] && !IsAssassin [i] ) fDamage *= 0.75;

				client_print_color ( entity_get_owner ( Entity ), print_team_default, "%s Damage to^4 %s^1 ::^4 %0.0f^1 damage", CHAT_PREFIX, PlayerName [i], fDamage );
			}
		}
	}

	for ( new i = 1; i < MaxPlayers + 1; i ++ )
	{
		if ( !is_user_connected ( i ) || !is_user_alive ( i ) ) continue;
		
		if ( !IsZombie [i] )
		{
			message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, i );
			write_short ( UNIT_SECOND * 3 );
			write_short ( UNIT_SECOND * 2 );
			write_short ( UNIT_SECOND * 4 );
			message_end (  );
			
			if ( EntityRange ( i, Entity ) < 340 )
			{
				static Float: fVelocity [3];
				
				pev ( i, pev_velocity, fVelocity );

				xs_vec_mul_scalar ( fVelocity, 1.5, fVelocity );

				set_pev ( i, pev_velocity, fVelocity );
			}
		}
	}

	remove_entity ( Entity );
}

public fwThinkMine ( Entity ) 
{
	static Float: GameTime, iStatus;
	
	GameTime = get_gametime (  );
	
	iStatus = entity_get_status ( Entity );
	
	switch ( iStatus ) 
	{
		case 0: 
		{
			entity_set_int ( Entity, EV_INT_iuser1, 1 );
			
			entity_set_float ( Entity, EV_FL_takedamage, DAMAGE_YES );
			
			entity_set_int ( Entity, EV_INT_solid, SOLID_BBOX );
			
			entity_set_float ( Entity, EV_FL_health, float ( get_pcvar_num ( TripMineHealth ) ) + 1000.0 );
			
			emit_sound ( Entity, CHAN_VOICE, MINE_SOUND_ACTIVATE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		}
		case 1: 
		{
			static Float: Health;
			
			Health = entity_get_float ( Entity, EV_FL_health );

			if ( is_user_alive ( entity_get_owner ( Entity ) ) )
			{
				if ( entity_get_owner ( Entity ) )
				{
					if ( pev ( Entity, pev_iuser3 ) == 1 )
					{
						set_hudmessage ( 0, 120, 240, 0.08, 0.3, 0, 0.0, 0.12, 2.0, 1.0, -1 ),
						
						ShowSyncHudMsg ( entity_get_owner ( Entity ), MsgSync_01, "First mine's health: %0.0f", Health - 1000.0 );
					}
					else
					{
						set_hudmessage ( 0, 120, 240, 0.08, 0.33, 0, 0.0, 0.12, 2.0, 1.0, -1 ),
						
						ShowSyncHudMsg ( entity_get_owner ( Entity ), MsgSync_02, "Second mine's health: %0.0f", Health - 1000.0 );
					}
				}
				
				if ( Health <= 1000.0 ) 
				{
					fwExplodeMine ( Entity );
				
					return FMRES_IGNORED;
				}
			}
		}
	}
	
	if ( is_valid_ent ( Entity ) )
		
		entity_set_float ( Entity, EV_FL_nextthink, GameTime + 0.1 );
	
	return FMRES_IGNORED;
}

public fwStartFrame (  )
{ 
	iTime = get_gametime (  );
	
	static id; 
	
	for ( id = 1; id <= MaxPlayers; id ++ ) 
		
		Frame [id] ++;
}

public fwPlayerPreThink_02 ( id )
{
	engfunc ( EngFunc_LightStyle, 0, AssassinRound ? "a" : "d" );
	
	if ( is_user_alive ( id ) ) 
		
		JPForward ( id );
}
	
public JPForward ( id ) 
{	
	if ( !is_user_alive ( id ) && ( IsZombie [id] || IsNemesis [id] || IsSurvivor [id] ) )
		
		return FMRES_IGNORED;		
		
	if ( !HasJet [id] ) return FMRES_IGNORED;
	
	if ( JPCal [id] < iTime ){
		
		JPEnergy ( id );  JPCal [id] = iTime + get_pcvar_float ( Zp_CalTime );
	}
	
	CheckRocket ( id );
	
	new Clip, Ammo;
	
	new WeaponID = get_user_weapon ( id, Clip, Ammo );
	
	if ( WeaponID == CSW_KNIFE || WeaponID != CSW_KNIFE )
	{
		if ( ( pev ( id, pev_button ) & IN_ATTACK2 ) )
		{
			Attack_02 ( id );	
		}	
	}
	if( ( !( pev ( id, pev_flags ) & FL_ONGROUND ) ) && ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) )
	{			
		if ( ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.3 ) && ( FlyEnergy [id] <= get_pcvar_num ( Zp_FlyMaxEngery ) ) ) 
		{
			if ( JPSound [id] < iTime )
			{
				emit_sound ( id, CHAN_ITEM, SoundJetpack, 1.0, ATTN_NORM, 1, PITCH_HIGH );
				
				JPSound [id] = iTime + 1.0;
			}
		}					
		else if ( ( FlyEnergy [id] > 0 ) && ( FlyEnergy [id] < get_pcvar_num ( Zp_FlyMaxEngery ) * 0.3 ) )
		{
			if ( JPSound [id] < iTime )
			{
				emit_sound ( id, CHAN_ITEM, SoundJetpackBlow, 1.0, ATTN_NORM, 1, PITCH_HIGH );
				
				JPSound [id] = iTime + 1.0;
			}
		}
		
		HumanFly ( id );
		
		Attack_01 ( id );
	}	
	
	return FMRES_IGNORED
}
public JPEnergy ( id ) 
{
	if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) && pev ( id, pev_button ) & IN_ATTACK )	
	{	
		new Clip, Ammo;
			
		new WeaponID = get_user_weapon ( id, Clip, Ammo )
			
		if ( WeaponID == CSW_KNIFE ) 
		{
			if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.09 )
				
				FlyEnergy [id] = FlyEnergy [id] - get_pcvar_num ( Zp_FlyEngery );	 
		}
	}
	else if ( ( !( pev ( id, pev_flags ) & FL_ONGROUND ) ) && ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) )
	{
		if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.09 )
			
			FlyEnergy [id] = FlyEnergy [id] - get_pcvar_num ( Zp_FlyEngery );
	}
		
	if ( pev ( id, pev_flags ) & FL_ONGROUND )	
			
		FlyEnergy [id] = FlyEnergy [id] + get_pcvar_num ( Zp_RegainEnergy );
}

public Attack_01 ( id ) 
{
	if ( Fly [id] )
	{	
		static Float: JetpackData_01 [3];
		
		pev ( id, pev_velocity, JetpackData_01 );
		
		new Origin [3], Float: Aim [3];
		
		VelocityByAim ( id, 10, Aim );
		
		get_user_origin ( id, Origin );
		
		Origin [0] -= floatround ( Aim [0] );
		
		Origin [1] -= floatround ( Aim [1] );
		
		Origin [2] -= floatround ( Aim [2] );
		
		
		if( ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) && !( pev ( id, pev_flags ) & FL_ONGROUND ) )
		{
			
			message_begin ( MSG_ALL,SVC_TEMPENTITY );
			write_byte ( 17 );
			write_coord ( Origin [0] );
			write_coord ( Origin [1] );
			write_coord ( Origin [2] );
			write_short ( xFireBallSpr );
			write_byte ( 9 );
			write_byte ( 180 );
			message_end (  );	
			
			static Float: Speed;
			
			Speed = floatsqroot ( JetpackData_01 [0] * JetpackData_01 [0] + JetpackData_01 [1] * JetpackData_01 [1] )
			
			if ( Speed !=0.0 )
		         {
			         set_pev ( id, EV_INT_movetype,6 );
			        
				set_pev ( id, pev_frame, 0.9 );
		         }
		
		         if ( Speed < get_pcvar_float ( Zp_JetpackSpeed ) )

			         Speed += get_pcvar_float ( Zp_JetpackAccelerate );
			
			static Float: JetpackData_02 [3];
			
			pev ( id, pev_angles, JetpackData_02 );
			
			JetpackData_02 [2] = 0.0;
			
			angle_vector ( JetpackData_02, ANGLEVECTOR_FORWARD, JetpackData_02 );
			
			JetpackData_02 [0] *= Speed;
			
			JetpackData_02 [1] *= Speed;
			
			JetpackData_01 [0] = JetpackData_02 [0];
			
			JetpackData_01 [1] = JetpackData_02 [1];
		}
		
		if ( JetpackData_01 [2] < get_pcvar_float ( Zp_JetpackSpeed ) && JetpackData_01 [2] > 0.0 )

		         JetpackData_01 [2] += get_pcvar_float ( Zp_JetpackUpSpeed );
		
		else if ( JetpackData_01 [2] < 0.0 )
			
			JetpackData_01 [2] += ( get_pcvar_float ( Zp_JetpackUpSpeed ) * 1.15 );
		
		set_pev ( id, pev_velocity, JetpackData_01 );
	}
}

public Attack_02 ( id ) 
{	
	if ( Rocket [id] )
	{
		new RocketEntity = create_entity ( "info_target" );
		
		if ( RocketEntity == 0 ) return PLUGIN_CONTINUE;
		
		entity_set_string ( RocketEntity, EV_SZ_classname, "zp_jp_rocket" );
		
		entity_set_model ( RocketEntity, RocketModel );
		
		entity_set_size ( RocketEntity, Float:{0.0, 0.0, 0.0}, Float: {0.0, 0.0, 0.0} );
		
		entity_set_int ( RocketEntity, EV_INT_movetype, MOVETYPE_FLY );
		
		entity_set_int ( RocketEntity, EV_INT_solid, SOLID_BBOX );
		
		new Float: vSrc [3];
		
		entity_get_vector ( id, EV_VEC_origin, vSrc );
		
		new Float: Aim [3], Float: Origin [3];
		
		VelocityByAim ( id, 64, Aim );
		
		entity_get_vector ( id, EV_VEC_origin, Origin );
		
		vSrc [0] += Aim [0];
		vSrc [1] += Aim [1];
		
		entity_set_origin ( RocketEntity, vSrc );
		
		new Float: Velocity [3], Float: Angles [3], iOrigin [3]
		
		VelocityByAim ( id, get_pcvar_num ( Zp_RocketSpeed ), Velocity );
		
		entity_set_vector ( RocketEntity, EV_VEC_velocity, Velocity );
		
		vector_to_angle ( Velocity, Angles );
		
		entity_set_vector ( RocketEntity, EV_VEC_angles, Angles );
		
		entity_set_edict ( RocketEntity,EV_ENT_owner, id );
		
		entity_set_float ( RocketEntity, EV_FL_takedamage, 1.0 );
		 
		set_pev ( RocketEntity, pev_effects, EF_LIGHT );
		
		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
		
		write_byte ( TE_BEAMFOLLOW );
		
		write_short ( RocketEntity );
		
		write_short ( JPSmokeSpr );
		
		write_byte ( 25 );
		
		write_byte ( 8 );
		
		write_byte ( 255 );
		
		write_byte ( 255 );
		
		write_byte ( 255 );
		
		write_byte ( 200 );
		
		message_end (  );
		
		
		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
		write_byte ( TE_BEAMTORUS );
		write_coord ( iOrigin [0] ); 
		write_coord ( iOrigin [1] ); 
		write_coord ( iOrigin [2] ); 
		write_coord ( iOrigin [0] ); 
		write_coord ( iOrigin [1] );
		write_coord ( iOrigin [2] + 10 );
		write_short ( xFireBallSpr ); 
		write_byte ( 0 );
		write_byte ( 0  ); 
		write_byte ( 8 ); 
		write_byte ( 50 ); 
		write_byte ( 0 ); 
		write_byte ( 0 ); 
		write_byte ( 255 ); 
		write_byte ( 0 ); 
		write_byte ( 255 ); 
		write_byte ( 0 ); 
		message_end (  );
		
		emit_sound ( RocketEntity, CHAN_WEAPON, SoundRocket, 1.0, ATTN_NORM, 0, PITCH_NORM );
		
		Shot [id] = true;
		
		LastRocket [id] = iTime + get_pcvar_num ( Zp_RocketDelay );
	}
	return PLUGIN_CONTINUE
}

public CheckModels ( id ) 
{	
	if ( IsZombie [id] || IsNemesis [id] || IsSurvivor [id] ) return FMRES_IGNORED
	
	if ( HasJet [id] ) 
	{
		new Clip, Ammo;
		
		new WeaponID = get_user_weapon ( id, Clip, Ammo );
		
		if ( WeaponID == CSW_KNIFE ) 
		
			SwitchModel ( id );
			
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public SwitchModel ( id ) 
{
	entity_set_string ( id,EV_SZ_viewmodel, "models/v_egon.mdl" );
	
	entity_set_string ( id,EV_SZ_weaponmodel, "models/p_egon.mdl" );
}

public RemoveJetpacks (  ) 
{
	new NextItem  = find_ent_by_class ( -1, "zp_jp_jetpack" );
	
        while ( NextItem ) 
        {
		remove_entity ( NextItem );
		
                NextItem = find_ent_by_class ( -1, "zp_jp_jetpack" );
	}

	return PLUGIN_CONTINUE;
}

public HumanFly ( id ) 
{	
	if ( FlyEnergy [id] <= get_pcvar_num ( Zp_FlyMaxEngery ) * 0.1 )
	{
		JPOff ( id );	
	}
	if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.1 )
	{
		JPOn ( id );
	}
}

public JPOn ( id ) 
{
	Fly [id] = true;
	
}
public JPOff ( id ) 
{
	Fly [id] = false;
	
}

public CheckRocket ( id ) 
{	
	if ( LastRocket [id] > iTime )
	{	
		RK_Forbidden ( id );
		
		RSound [id] = true;
	}
	else
	{	
		if ( Shot [id] )
		{
			RSound [id] = false;
			
			Shot [id] = false;
		}
		
		RK_Sound ( id );
		
		RK_Allow ( id);
	}
}

public RK_Allow ( id ) Rocket [id] = true;


public RK_Forbidden ( id ) Rocket [id] = false;
	

public RK_Sound ( id ) 
{
	if ( !RSound [id] )
	{
		engfunc ( EngFunc_EmitSound, id, CHAN_WEAPON, SoundGetRocket, 1.0, ATTN_NORM, 0, PITCH_NORM );
		
		//client_print(player, print_center, "")
		
		RSound [id] = true;
	}
	/*else if ( RSound [id] )
	{
		
	}*/
	
}

public DropJetpack ( id ) 
{
	if ( HasJet [id] ) 
	{
		new Float: Aim [3], Float: Origin [3];
		
		VelocityByAim ( id, 64, Aim );
		
		entity_get_vector ( id, EV_VEC_origin, Origin );
		
		Origin [0] += Aim [0];
		
		Origin [1] += Aim [1];
		
		new Jetpack = create_entity ( "info_target" );
		
		entity_set_string ( Jetpack, EV_SZ_classname, "zp_jp_jetpack" );
		
		entity_set_model ( Jetpack, "models/p_egon.mdl" );	 
		
		entity_set_size ( Jetpack, Float: {-16.0,-16.0,-16.0}, Float: {16.0,16.0,16.0} );
		
		entity_set_int ( Jetpack, EV_INT_solid, 1 );
		
		entity_set_int ( Jetpack, EV_INT_movetype, 6 );
		
		entity_set_vector ( Jetpack, EV_VEC_origin, Origin )	;	
		
		HasJet [id] = 0;
		
		Rocket [id] = false;
	}	
}

public pfn_touch ( pentru, ptd ) 
{ 
	if( is_valid_ent ( pentru ) ) 
	{ 
		new ClassName [32];
		
		entity_get_string ( pentru, EV_SZ_classname, ClassName, charsmax ( ClassName ) ); 
		
		if ( equal ( ClassName, "zp_jp_jetpack" ) ) 
		{ 
			if ( is_valid_ent ( ptd ) ) 
			{ 
				new id = ptd;
				
				if ( id > 0 && id < MaxPlayers + 2 ) 
				{ 
					if ( !HasJet [id] && !IsZombie [id] && is_user_alive ( id ) ) 
					{ 	
						HasJet [id] = 1 ;
						
						FlyEnergy [id] = get_pcvar_num ( Zp_FlyEngery );
						
						Rocket [id] = true ;
						
						emit_sound ( id, CHAN_ITEM, SoundBuyJetpack, 1.0, ATTN_NORM, 0, PITCH_NORM );
						//client_cmd(id,"spk items/gunpickup2.wav") 
						
						engclient_cmd ( id, "weapon_knife" ) 
						
						SwitchModel ( id ) 
						
						remove_entity ( pentru )
					}
				}
			}
		}
		else if( equal ( ClassName, "zp_jp_rocket" ) ) 
		{
			new Float: Origin [3], iOrigin [3];
			
			entity_get_vector ( pentru, EV_VEC_origin, Origin );
			
			FVecIVec ( Origin, iOrigin );
			
			JPRadiusDamage ( pentru );
			
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_EXPLOSION)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_short(HExplode)
			write_byte(55)
			write_byte(15)
			write_byte(0)
			message_end()
			
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_EXPLOSION)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_short(HExplode)
			write_byte(65)
			write_byte(15)
			write_byte(0)
			message_end()
			
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_EXPLOSION)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_short(HExplode)
			write_byte(85)
			write_byte(15)
			write_byte(0)
			message_end()
			
			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_BEAMCYLINDER)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2]+650)
			write_short(WhiteSpr)
			write_byte(0)
			write_byte(1)
			write_byte(6)
			write_byte(100)
			write_byte(1)
			write_byte(255)
			write_byte(255)
			write_byte(255)
			write_byte(200)
			write_byte(0)
			message_end()
			
			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_BEAMCYLINDER)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2]+650)
			write_short(WhiteSpr)
			write_byte(0)
			write_byte(1)
			write_byte(6)
			write_byte(100)
			write_byte(1)
			write_byte(255)
			write_byte(255)
			write_byte(255)
			write_byte(200)
			write_byte(0)
			message_end()
			
			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)
			write_byte(TE_BEAMCYLINDER)
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2])
			write_coord(iOrigin[0])
			write_coord(iOrigin[1])
			write_coord(iOrigin[2]+650)
			write_short(WhiteSpr)
			write_byte(0)
			write_byte(1)
			write_byte(6)
			write_byte(100)
			write_byte(1)
			write_byte(255)
			write_byte(255)
			write_byte(255)
			write_byte(200)
			write_byte(0)
			message_end()
			
			if ( is_valid_ent ( ptd ) ) 
			{
				new ClassName_02 [32];
				
				entity_get_string ( ptd, EV_SZ_classname, ClassName_02, charsmax ( ClassName_02 ) );
				
				if ( equal ( ClassName_02, "func_breakable" ) )
					
					force_use ( pentru, ptd );
			}
			
			remove_entity ( pentru );
		}
	}
	return PLUGIN_CONTINUE
}

public zp_user_infected_pre ( id, infector )
{
	cmdDrop ( id );
	
	HasJet [id] = 0;
	
	FlyEnergy [id] = 0;
	
	Rocket [id] = false;
	
	IsTryder [id] = false;
	
	HasUnlimitedClip [id] = false;
	
	MultiJumps [id] = false;
}

stock JPRadiusDamage ( Entity ) 
{
	new id = entity_get_edict ( Entity, EV_ENT_owner );
	
	new Packs;
	
	for ( new i = 1; i < MaxPlayers + 1; i ++ ) 
	{
		if ( is_user_alive ( i ) ) 
		{
			new Distance = floatround ( entity_range ( Entity, i ) );
			
			if ( Distance <= get_pcvar_num ( Zp_DamageRange ) ) 
			{
				new HP = get_user_health ( i );
				
				new Float: Damage = get_pcvar_float ( Zp_RocketDamage ) - ( get_pcvar_float ( Zp_RocketDamage ) / get_pcvar_float ( Zp_DamageRange ) ) * float ( Distance );
				
				new Origin [3]; get_user_origin ( i, Origin );
				
				new iPos = ++ iPosition [id];
				
				if ( iPos == sizeof ( iCoords ) )

					iPos = iPosition [id] = 0;

				
				if ( IsZombie [id] != IsZombie [i] ) 
				{
					if ( Damage >= 800 )
					         
					         Packs = 2;
					else
						Packs = 1;
					
					if ( HP > Damage )
					{
						AmmoPacks [id] += Packs;
						
						JPTakeDamage ( i, floatround ( Damage ), Origin, DMG_BLAST );
						
						set_hudmessage ( 0, 40, 80, Float: iCoords [iPos] [0], Float: iCoords [iPos] [1], 0, 0.1, 2.5, 0.02, 0.02, -1 );
						
						ShowSyncHudMsg ( id, MsgSync_04, "%i", floatround ( Damage ) );
						
						client_print_color ( id, print_team_default, "%s Damage to^4 %s^1 ::^4 %i^1 damage", CHAT_PREFIX, PlayerName [i], floatround ( Damage ) ); 	
					}
					else
					{
						LogKill ( id, i, "Jetpack Rocket", 0 );
						
						AmmoPacks [id] += 4;
					}
				}
			}
		}
	}
}

stock LogKill ( Killer, Victim, Weapon [ ], Headshot )
{
	set_msg_block ( get_user_msgid ( "DeathMsg" ), BLOCK_SET );
	
	ExecuteHamB ( Ham_Killed, Victim, Killer, 2 );
	
	set_msg_block ( get_user_msgid ( "DeathMsg" ), BLOCK_NOT );
	
	
	message_begin ( MSG_BROADCAST, get_user_msgid ( "DeathMsg" ) );
	write_byte ( Killer );
	write_byte ( Victim );
	write_byte ( Headshot );
	write_string ( Weapon );
	message_end (  );

	if ( get_user_team ( Killer ) != get_user_team ( Victim ) )
	
	         set_pev ( Killer, pev_frags, float ( pev ( Killer, pev_frags ) + 1 ) );
	
	if ( get_user_team ( Killer ) == get_user_team ( Victim ) )
		
		set_pev ( Killer, pev_frags, float ( pev ( Killer, pev_frags ) - 1 ) );
	
	new KillerAuthid [32], VictimAuthid [32], KillerTeam [10], VictimTeam [10];

	get_user_team ( Killer, KillerTeam, charsmax ( KillerTeam ) );
	
	get_user_authid ( Killer, KillerAuthid, charsmax ( KillerAuthid ) );

	get_user_team ( Victim, VictimTeam, charsmax ( VictimTeam ) );
	
	get_user_authid ( Victim, VictimAuthid, charsmax ( VictimAuthid ) );
	
	log_message ( "^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", PlayerName [Killer], get_user_userid ( Killer ), 
	
	KillerAuthid, KillerTeam, PlayerName [Victim], get_user_userid ( Victim ), VictimAuthid, VictimTeam, Weapon );
	
	return PLUGIN_CONTINUE;
}

stock JPTakeDamage ( Victim, Damage, Origin [3], Bit ) 
{
	message_begin ( MSG_ONE, get_user_msgid ( "Damage" ), {0,0,0}, Victim );
	
	write_byte ( 21 )
	
	write_byte ( 20 )
	
	write_long ( Bit )
	
	write_coord ( Origin [0] )
	
	write_coord ( Origin [1] )
	
	write_coord ( Origin [2] )
	
	message_end (  )
	
	fm_set_user_health ( Victim, get_user_health ( Victim ) - Damage );
	
	//emit_sound ( Victim, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, Victim, PITCH_NORM );
	client_cmd ( Victim, "spk ^"%s^"", SOUND_EXPLODE );
	
	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );
	write_short ( 2048 );
	write_short ( 1024 );
	write_short ( FFADE_IN );
	write_byte ( 250 );
	write_byte ( 0 );
	write_byte ( 0 );
	write_byte ( 230 );
	message_end (   );
	
	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );
	write_short ( UNIT_SECOND * 4 );
	write_short ( UNIT_SECOND * 2 ); 
	write_short ( UNIT_SECOND * 10 );
	message_end (  );
}


public fwTraceLinePost ( Float:start[3], Float:end[3], conditions, id, trace )
{
	if ( !CheckValidPlayer ( id ) ) return FMRES_IGNORED;
	
	new iWeaponID = get_user_weapon ( id );
	
	if ( iWeaponID != CSW_KNIFE )
	{
		OPCancel ( id );
		
		return FMRES_IGNORED;
	}
	
	new Enemy = iEnemy [id];
	
	if ( !Enemy )
	{
		Enemy = get_tr2 ( trace, TR_pHit );
		
		if ( !CheckValidPlayer (Enemy) || IsZombie [Enemy] )
		{
			OPCancel ( id );
			
			return FMRES_IGNORED;
		}
		
		iEnemy [id] = Enemy;
	}
	
	return FMRES_IGNORED;
}

public OPNearEnemy ( id )
{	
	new Enemy = iEnemy [id];
	
	new Float: Time = get_gametime (  );
	
	if ( !Enemy || iLastSlash [id] + iDelay > Time )
	{	
		InBlink [id] = 0;
		
		return;
	}
	
	new Origin [3], OriginEnemy [3];
	
	get_user_origin ( id, Origin, 0 );
	
	get_user_origin ( Enemy, OriginEnemy, 0 );
	
	new Distance = get_distance ( Origin, OriginEnemy );
	
	if ( 50 <= Distance <= 300 )
	{	
		InBlink [id] = 1;
		
		return;	
	}
	else if ( 50 > Distance && InBlink [id] )
	{
		OPSlash ( id );
	}
	
	OPCancel ( id );
}

public OPBlink ( id )
{	
	new Float: NewVelocity [3];
	
	new Enemy = iEnemy [id];
	
	new Float: OriginEnemy [3];
	
	pev ( Enemy, pev_origin, OriginEnemy );
	
	entity_set_aim ( id, OriginEnemy );
	
	get_speed_vector2 ( id, Enemy, iSpeed, NewVelocity );
	
	set_pev ( id, pev_velocity, NewVelocity );
}

public OPCancel ( id )
{	
	InBlink [id] = 0;
	
	iEnemy [id] = 0;
	
	if ( !iCanceled [id] )
	{	
		OPSetBlink ( id );
		
		iCanceled [id] = 1;
	}
}

public OPSlash ( id ) 
{	
	set_pev ( id, pev_velocity, {0.0,0.0,0.0} );	
	
	new WeaponID = get_user_weapon ( id, _, _ );
	
	if ( WeaponID == CSW_KNIFE )
	{
		new Weapon [32];
		
		get_weaponname ( WeaponID, Weapon, charsmax ( Weapon ) );
		
		new Entity = fm_find_ent_by_owner ( -1, Weapon, id );
		
		if ( Entity )
		{	
			set_pdata_float ( Entity, 46, 0.0 );
			
			set_pdata_float ( Entity, 47, 0.0 );
			
			iSlash [id] = 1;
			
			iLastSlash [id] = get_gametime (  );
			
			iBlinks [id] -= 1;
			
			client_print_color ( 0, print_team_grey, "%s^3 %s^1 just used a Knife Blink! (Blinks remaining:^4 %d blinks^1)", CHAT_PREFIX, PlayerName [id], iBlinks [id] );
		}
	}  
}

public OPSetBlink ( id )
{	
	new Blink = InBlink [id];
	
	if ( Blink > 1 ) return;
	
	if ( Blink ) InBlink [id] += 1;
}

public CheckValidPlayer ( id )
{	
	if ( 1 <= id <= MaxPlayers && is_user_alive ( id ) )
		
		return 1;
	
	return 0;
}

public fwPlayerPostThink ( id )
{
	if ( !is_user_alive ( id ) || IsZombie [id] || !MultiJumps [id] ) return PLUGIN_CONTINUE;
	
	if ( DoJump [id] == true )
	{
		new Float: Velocity [3];
			
		pev ( id, pev_velocity, Velocity );
			
		Velocity [2] = random_float ( 265.0,285.0 );
			
		set_pev ( id, pev_velocity, Velocity );
			
		DoJump [id] = false;
			
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_CONTINUE
}

stock drop_weapons ( id, dropwhat )
{
	static Weapons [32], Num, i, WeaponID;
	
	Num = 0;
	
	get_user_weapons ( id, Weapons, Num );
	
	for ( i = 0; i < Num; i ++ )
	{
		WeaponID = Weapons [i];
		
		if ( ( dropwhat == 1 && ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM ) ) || ( dropwhat == 2 && ( ( 1 << WeaponID ) & SECONDARY_WEAPONS_BIT_SUM ) ) )
		{
			static DropName [32], WeaponEntity;
			
			get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );
			
			WeaponEntity = fm_find_ent_by_owner ( -1, DropName, id );
			
			set_pev ( WeaponEntity, PEV_ADDITIONAL_AMMO, cs_get_user_bpammo ( id, WeaponID ) );
			
			engclient_cmd ( id, "drop", DropName );
			
			cs_set_user_bpammo ( id, WeaponID, 0 );
		}
	}
}
 
stock fm_set_kvd ( entity, const key[], const value[], const classname[] )
{
	set_kvd ( 0, KV_ClassName, classname );
	set_kvd ( 0, KV_KeyName, key );
	set_kvd ( 0, KV_Value, value );
	set_kvd ( 0, KV_fHandled, 0 );
	
	dllfunc ( DLLFunc_KeyValue, entity, 0 );
}

stock fm_set_rendering ( entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 )
{
	static Float:color[3];
	
	color [0] = float (r);
	color [1] = float (g);
	color [2] = float (b);
	
	set_pev ( entity, pev_renderfx, fx );
	set_pev ( entity, pev_rendercolor, color );
	set_pev ( entity, pev_rendermode, render );
	set_pev ( entity, pev_renderamt, float ( amount ) );
}

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

stock fm_get_aim_origin ( id, Float: origin [3] )
{
	static Float:origin1F[3], Float:origin2F[3]
	
	pev ( id, pev_origin, origin1F );
	
	pev ( id, pev_view_ofs, origin2F );
	
	xs_vec_add ( origin1F, origin2F, origin1F );
	
	pev ( id, pev_v_angle, origin2F );
	
	engfunc ( EngFunc_MakeVectors, origin2F );
	
	global_get ( glb_v_forward, origin2F );
	
	xs_vec_mul_scalar ( origin2F, 9999.0, origin2F );
	
	xs_vec_add ( origin1F, origin2F, origin2F );
	
	engfunc ( EngFunc_TraceLine, origin1F, origin2F, 0, id, 0 );
	
	get_tr2 ( 0, TR_vecEndPos, origin );
}

stock fm_find_ent_by_owner ( entity, const classname[], owner )
{
	while ( ( entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname ) ) && pev ( entity, pev_owner ) != owner ) {  }
	
	return entity;
}

stock fm_set_user_health ( id, health )
{
	( health > 0) ? set_pev ( id, pev_health, float ( health ) ) : dllfunc ( DLLFunc_ClientKill, id );
}

stock fm_give_item ( id, const item [] )
{
	static Entity;
	
	Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, item ) );
	
	if ( !pev_valid ( Entity ) ) return;
	
	static Float: origin [3];
	
	pev ( id, pev_origin, origin );
	
	set_pev ( Entity, pev_origin, origin );
	
	set_pev ( Entity, pev_spawnflags, pev ( Entity, pev_spawnflags ) | SF_NORESPAWN );
	
	dllfunc ( DLLFunc_Spawn, Entity );
	
	static Save; Save = pev ( Entity, pev_solid );
	
	dllfunc ( DLLFunc_Touch, Entity, id );
	
	if ( pev ( Entity, pev_solid ) != Save ) return;
	
	engfunc ( EngFunc_RemoveEntity, Entity );
}

stock fm_strip_user_weapons ( id )
{
	static ent;
	
	ent = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "player_weaponstrip" ) );
	
	if ( !pev_valid ( ent)) return;
	
	dllfunc ( DLLFunc_Spawn, ent );
	
	dllfunc ( DLLFunc_Use, ent, id );
	
	engfunc ( EngFunc_RemoveEntity, ent );
}

stock is_hull_vacant ( Float:origin [3], Hull )
{
	engfunc ( EngFunc_TraceHull, origin, origin, 0, Hull, 0, 0 )
	
	if ( !get_tr2 ( 0, TR_StartSolid ) && !get_tr2(0, TR_AllSolid ) && get_tr2 ( 0, TR_InOpen ) )
		
		return true;
	
	return false;
}

stock is_player_stuck ( id )
{
	static Float:origin [3];
	
	pev ( id, pev_origin, origin );
	
	engfunc ( EngFunc_TraceHull, origin, origin, 0, ( pev ( id, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN, id, 0 );
	
	if ( get_tr2 ( 0, TR_StartSolid ) || get_tr2 ( 0, TR_AllSolid ) || !get_tr2 ( 0, TR_InOpen ) )
		
		return true;
	
	return false;
}

stock cs_weapon_name_to_id ( const weapon [ ] )
{
	static i;
	
	for ( i = 0; i < sizeof WEAPONENTNAMES; i ++ )
	{
		if ( equal ( weapon, WEAPONENTNAMES [i] ) )
			return i;
	}
	
	return 0;
}

stock fmCsGetCurrentWeaponEnt ( id )
{
	return get_pdata_cbase ( id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX );
}

stock fm_cs_get_weapon_ent_owner ( ent )
{
	return get_pdata_cbase ( ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS );
}

stock fm_set_weapon_ammo ( entity, amount )
{
	set_pdata_int ( entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS );
}

stock fm_cs_set_user_deaths ( id, value )
{
	set_pdata_int ( id, OFFSET_CSDEATHS, value, OFFSET_LINUX );
}

stock fm_cs_get_user_team ( id )
{
	return get_pdata_int ( id, OFFSET_CSTEAMS, OFFSET_LINUX );
}

stock fm_cs_set_user_team ( id, team )
{
	set_pdata_int ( id, OFFSET_CSTEAMS, team, OFFSET_LINUX );
}

stock fm_cs_set_user_money ( id, value )
{
	set_pdata_int ( id, OFFSET_CSMONEY, value, OFFSET_LINUX );
}

stock fm_user_team_update ( id )
{
	static Float: CurrentTime;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - TeamsTargetTime >= 0.1 )
	{
		set_task ( 0.1, "fm_cs_set_user_team_msg", id + TASK_TEAM );
		
		TeamsTargetTime = CurrentTime + 0.1
	}
	else
	{
		set_task ( ( TeamsTargetTime + 0.1 ) - CurrentTime, "fm_cs_set_user_team_msg", id + TASK_TEAM );
		
		TeamsTargetTime = CurrentTime + 0.1
	}
}

public fm_cs_set_user_team_msg ( taskid )
{
	SwitchingTeam = true;

	emessage_begin ( MSG_ALL, get_user_msgid ( "TeamInfo" ) );
	
	ewrite_byte ( ID_TEAM );
	
	ewrite_string ( CS_TEAM_NAMES [fm_cs_get_user_team (ID_TEAM)] );
	
	emessage_end (  );
	
	SwitchingTeam = false
}

stock fmSetPlayerModelEnt ( id )
{
	fm_set_rendering ( id, kRenderFxNone, 255, 255, 255, kRenderTransTexture, 1 );
	
	static model [100];
	
	formatex ( model, charsmax ( model ), "models/player/%s/%s.mdl", PlayerModel [id], PlayerModel [id] );
	
	if ( !pev_valid ( EntPlayerModel [id] ) )
	{
		EntPlayerModel [id] = engfunc ( EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
		
		if ( !pev_valid ( EntPlayerModel [id] ) ) return;
		
		set_pev ( EntPlayerModel [id], pev_classname, MODEL_ENT_CLASSNAME );
		
		set_pev ( EntPlayerModel [id], pev_movetype, MOVETYPE_FOLLOW );
		
		set_pev ( EntPlayerModel [id], pev_aiment, id );
		
		set_pev ( EntPlayerModel [id], pev_owner, id );
	}
	
	engfunc ( EngFunc_SetModel, EntPlayerModel [id], model );
}

stock fm_set_weaponmodel_ent ( id )
{
	static model [100];
	
	pev ( id, pev_weaponmodel2, model, charsmax ( model ) );
	
	if ( !pev_valid ( EntWeaponModel [id] ) )
	{
		EntWeaponModel [id] = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "info_target" ) );
		
		if ( !pev_valid ( EntWeaponModel [id] ) ) return;
		
		set_pev ( EntWeaponModel [id], pev_classname, WEAPON_ENT_CLASSNAME );
		
		set_pev ( EntWeaponModel [id], pev_movetype, MOVETYPE_FOLLOW );
		
		set_pev ( EntWeaponModel [id], pev_aiment, id );
		
		set_pev ( EntWeaponModel [id], pev_owner, id );
	}
	
	engfunc ( EngFunc_SetModel, EntWeaponModel [id], model );
}

stock fm_remove_model_ents ( id )
{
	if ( pev_valid ( EntPlayerModel [id] ) )
	{
		engfunc ( EngFunc_RemoveEntity, EntPlayerModel [id] );
		
		EntPlayerModel [id] = 0;
	}

	if ( pev_valid ( EntWeaponModel [id] ) )
	{
		engfunc ( EngFunc_RemoveEntity, EntWeaponModel [id] );
		
		EntWeaponModel [id] = 0;
	}
}

public fm_cs_set_user_model ( taskid )
{
	set_user_info ( ID_MODEL, "model", PlayerModel [ID_MODEL] );
}

stock fm_cs_get_user_model ( player, model [ ], len )
{
	get_user_info ( player, "model", model, len );
}

public fmUserModelUpdate ( taskid )
{
	static Float: CurrentTime;
	
	CurrentTime = get_gametime (  );
	
	if ( CurrentTime - ModelTargetTime >= 0.2 )
	{
		fm_cs_set_user_model ( taskid );
		
		ModelTargetTime = CurrentTime;
	}
	else
	{
		set_task ( ( ModelTargetTime + 0.2 ) - CurrentTime, "fm_cs_set_user_model", taskid );
		
		ModelTargetTime = ModelTargetTime + 0.2;
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/



eroarea

| Afiseaza codul
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Modified for http://www.freakz.ro

ZombiePlague_6.2.sma(49) : fatal error 110: assertion failed: AMX Mod X v1.8.3 or later library required!


Compilation aborted.
1 Error.
Done.


Folosesc si compiler 1.8.1 & 1.8.3

va rog frumos ziceti-mi o solutie. :(
RoyalServer
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 0
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 3 times
Been thanked: 46 times

08 Oct 2017, 01:36

DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Oct 2017, 01:59

mi-sa compliat tot inafara de ZombiePlague_6.2.sma

poftim sma dela ZombiePlague_6.2.sma

mi-l poti complia tu te rog frumos?
| Afiseaza codul
/* 

                        - | AMXMODX 1.8.3 | -

			

         _____________________________________________________

        |                                                     |

	| Zombie Plague 6.2 - Base Plugin                     |

        |                                                     |

	|       (c) AUG 2016 - Final version                  |

	|			                              |

	|         This product is a free version.             |

	|			                              |

	| By using our product you accept the Terms of Use.   |

	|			                              |

	|                                                     |

	|           - Project started by EnTeR_ -             |

	|_____________________________________________________|

	

	 _____________________________________________________

	|                                                     |

	|                    Credits:                         |

	|                                                     |

	|       * MeRcyLeZZ for original zp version           |

	|                                                     |

	|     * Hattrick for extra items and improvements       |

	|_____________________________________________________|



        

*/





#include             <     amxmodx     >

#include             <     amxmisc     >

#include             <     cstrike     >

#include             <   hamsandwich   >

#include             <     fakemeta    >

#include             <     engine      >

#include             <   chr_engine    >

#include             <       xs        >

#include             <      geoip      >

#include             <     csstats     >





#pragma tabsize    0





#if AMXX_VERSION_NUM < 183



         #assert AMX Mod X v1.8.3 or later library required!



#endif



 

#define PLUGIN    "Zombie Plague (UltimateX)"



#define VERSION              "6.2"





#define CHAT_PREFIX       "^4[ZP]^1"



#define REMINDER_DELAY        25.0



enum ClassModels

{

	OWNER,

	ADMIN,

	SNIPER,

	SURVIVOR,

	NEMESIS,

	ASSASSIN

}



new const ZP_CUSTOMIZATION_FILE [  ] = "ZombiePlague_Customization.ini";



new const ZP_EXTRAITEMS_FILE [  ] = "ZombiePlague_ExtraItems.ini";



new const ZP_ZOMBIECLASSES_FILE [  ] = "ZombiePlague_ZClasses.ini";



new const ZP_CONFIGURATION_FILE [  ] = "ZombiePlague_Configuration.cfg";



const MAX_CSDM_SPAWNS = 128;



const MAX_STATS_SAVED = 64;



const TASK_ID = 1603;



const TASK_LEADER = 37032;



const TASK_HEALTH = 1994;



new const Float: iCoords [ ] [ ] = 

{

	{ 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 }

};



enum

{

	SECTION_NONE = 0,

	SECTION_ACCESS_FLAGS,

	SECTION_PLAYER_MODELS,

	SECTION_WEAPON_MODELS,

	SECTION_SOUNDS,

	SECTION_AMBIENCE_SOUNDS,

	SECTION_HARD_CODED_ITEMS_COSTS,

	SECTION_WEATHER_EFFECTS,

	SECTION_SKY,

	SECTION_ZOMBIE_DECALS,

	SECTION_KNOCKBACK

};



enum

{

         ACCESS_MODE_INFECTION = 0,

         ACCESS_MODE_NEMESIS,

         ACCESS_MODE_ASSASSIN,

         ACCESS_MODE_SURVIVOR,

         ACCESS_MODE_SNIPER,

         ACCESS_MODE_SWARM,

         ACCESS_MODE_MULTI,

         ACCESS_MODE_PLAGUE,

         ACCESS_MODE_ARMAGEDDON,

         ACCESS_MODE_APOCALYPSE,

         ACCESS_MODE_NIGHTMARE,

         ACCESS_MAKE_ZOMBIE,

         ACCESS_MAKE_HUMAN,

         ACCESS_MAKE_NEMESIS,

         ACCESS_MAKE_ASSASSIN,

         ACCESS_MAKE_SURVIVOR,

         ACCESS_MAKE_SNIPER,

         ACCESS_RESPAWN_PLAYERS,

         ACCESS_OWNER_MODELS,

	ACCESS_ADMIN_MODELS,

         MAX_ACCESS_FLAGS

};



enum (+= 100)

{

	TASK_MODEL = 2000,

	TASK_TEAM,

	TASK_SPAWN,

	TASK_BLOOD,

	TASK_BURN,

	TASK_NVISION,

	TASK_SHOWHUD,

	TASK_MAKEZOMBIE,

	TASK_WELCOMEMSG,

	TASK_AMBIENCESOUNDS

};



/* --------------- | For TripMine | -------------- */



#define MAX_ENTITIES		        600



#define TASK_CREATE		        84765

#define TASK_REMOVE		        86766



#define MINE_CLASSNAME		        "zp_trip_mine"

#define MINE_SOUND_ACTIVATE	        "zombie_plague/mine_activate.wav"

#define MINE_SOUND_CHARGE	        "zombie_plague/mine_charge.wav"

#define MINE_SOUND_DEPLOY	        "zombie_plague/mine_deploy.wav"

#define entity_get_owner(%0)		 entity_get_int( %0, EV_INT_iuser2 )

#define entity_get_status(%0)		 entity_get_int( %0, EV_INT_iuser1 )

#define entity_get_classname(%0,%1)	 entity_get_string( %0, EV_SZ_classname, %1, charsmax( %1 ) )



/* ------------------------------------------------- */



#define ID_MODEL            (taskid - TASK_MODEL)

#define ID_TEAM             (taskid - TASK_TEAM)

#define ID_SPAWN            (taskid - TASK_SPAWN)

#define ID_BLOOD            (taskid - TASK_BLOOD)

#define ID_BURN             (taskid - TASK_BURN)

#define ID_NVISION          (taskid - TASK_NVISION)

#define ID_SHOWHUD          (taskid - TASK_SHOWHUD)



#define REFILL_WEAPONID     Args[0]



#define WPN_STARTID         MenuData [id][1]

#define WPN_MAXIDS          ArraySize(PrimaryItems)

#define WPN_SELECTION       (MenuData[id][1]+key)



#define EntityRange(%1,%2)   entity_range(%1,%2)



#define MODEL_EXPLODE	    "sprites/zerogxplode.spr"

#define SOUND_EXPLODE	    "fvox/flatline.wav"

#define JP_SMOKE_SPRITE     "sprites/smoke.spr"

#define XFIREBALL_SPRITE    "sprites/xfireball3.spr"

#define WHITE_SPRITE        "sprites/white.spr"

#define TRAIL_SPRITE        "sprites/laserbeam.spr"

#define RING_SPRITE         "sprites/shockwave.spr"

#define FIRE_SPRITE         "sprites/flame.spr"

#define SMOKE_SPRITE        "sprites/black_smoke3.spr"

#define GLASS_MODEL         "models/glassgibs.mdl"



#define TE_EXPLOSION	 3

#define TE_BEAMFOLLOW	 22

#define TE_BEAMCYLINDER	 21



const MENU_KEY_BACK = 7;

const MENU_KEY_NEXT = 8;

const MENU_KEY_EXIT = 9;



enum

{

	EXTRA_NVISION = 0,

	EXTRA_EXPLOSION_NADE,

	EXTRA_NAPALM_NADE,

	EXTRA_FROST_NADE,

	EXTRA_AWP_MAGNUM_SNIPER,

	EXTRA_M249_PARA_MACHINEGUN,

	EXTRA_SG550_AUTO_SNIPER,

	EXTRA_G3SG1_AUTO_SNIPER,

	EXTRA_JETPACK,

	EXTRA_UNLIMITEDCLIP,

	EXTRA_ARMOR_100,

	EXTRA_ARMOR_200,

	EXTRA_MULTIJUMP,

	EXTRA_TRYDER,

	EXTRA_SURVIVOR,

	EXTRA_SNIPER,

	EXTRA_NEMESIS,

	EXTRA_ASSASSIN,

	EXTRA_ANTIDOTE,

	EXTRA_MADNESS,

	EXTRA_INFECTIONBOMB,

	EXTRA_KNIFEBLINK,

	EXTRA_TRIPMINE,

	EXTRA_WEAPONS_STARTID

};



enum

{

         MODE_NONE = 0,	

         MODE_INFECTION,

         MODE_NEMESIS,

         MODE_ASSASSIN,

         MODE_SURVIVOR,

         MODE_SNIPER,

         MODE_SWARM,

         MODE_MULTI,

         MODE_PLAGUE,

         MODE_ARMAGEDDON, 

         MODE_APOCALYPSE,

         MODE_NIGHTMARE

};



const ZP_TEAM_NO_ONE = 0;

const ZP_TEAM_ANY = 0;

const ZP_TEAM_ZOMBIE = (1<<0);

const ZP_TEAM_HUMAN = (1<<1) ;	

const ZP_TEAM_NEMESIS = (1<<2);

const ZP_TEAM_SURVIVOR = (1<<3); 

const ZP_TEAM_SNIPER = (1<<4);

const ZP_TEAM_ASSASSIN = (1<<5);



new const ZP_TEAM_NAMES [ ] [ ] = 

{ 	

	"ZOMBIE , HUMAN", 

	"ZOMBIE", 

	"HUMAN", 

	"ZOMBIE , HUMAN", 

	"NEMESIS",

	"ZOMBIE , NEMESIS", 

	"HUMAN , NEMESIS", 

	"ZOMBIE , HUMAN , NEMESIS",

	"ASSASSIN", 

	"ZOMBIE , ASSASSIN", 

	"HUMAN , ASSASSIN", 

	"ZOMBIE, HUMAN, ASSASSIN",

	"NEMESIS , ASSASSIN",

	"ZOMBIE , NEMESIS , ASSASSIN",

	"HUMAN, NEMESIS, ASSASSIN",

	"ZOMBIE , HUMAN , NEMESIS , ASSASSIN",

	"SURVIVOR",

	"ZOMBIE, SURVIVOR",

	"HUMAN, SURVIVOR",

	"ZOMBIE, HUMAN, SURVIVOR",

	"NEMESIS , SURVIVOR",

	"ZOMBIE , NEMESIS , SURVIVOR",

	"HUMAN , NEMESIS , SURVIVOR",

	"ZOMBIE , HUMAN , NEMESIS , SURVIVOR",

	"ASSASSIN, SURVIVOR",

	"ZOMBIE, ASSASSIN, SURVIVOR",

	"HUMAN, ASSASSIN, SURVIVOR",

	"ZOMBIE, HUMAN, ASSASSIN, SURVIVOR",

	"NEMESIS, ASSASSIN, SURVIVOR",

	"ZOMBIE, NEMESIS, ASSASSIN, SURVIVOR",

	"HUMAN, NEMESIS, ASSASSIN, SURVIVOR",

	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SURVIVOR",

	"SNIPER",

	"ZOMBIE, SNIPER",

	"HUMAN, SNIPER",

	"ZOMBIE, HUMAN, SNIPER",

	"NEMESIS, SNIPER",

	"ZOMBIE, NEMESIS, SNIPER",

	"HUMAN, NEMESIS, SNIPER",

	"ZOMBIE, HUMAN, NEMESIS, SNIPER",

	"ASSASSIN, SNIPER",

	"ZOMBIE, ASSASSIN, SNIPER",

	"HUMAN, ASSASSIN, SNIPER",

	"ZOMBIE, HUMAN, ASSASSIN, SNIPER",

	"NEMESIS, ASSASSIN, SNIPER",

	"ZOMBIE, NEMESIS, ASSASSIN, SNIPER",

	"HUMAN, NEMESIS, ASSASSIN, SNIPER",

	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SNIPER",

	"SURVIVOR, SNIPER",

	"ZOMBIE, SURVIVOR, SNIPER",

	"HUMAN, SURVIVOR, SNIPER",

	"ZOMBIE, HUMAN, SURVIVOR, SNIPER",

	"NEMESIS, SURVIVOR, SNIPER",

	"ZOMBIE, NEMESIS, SURVIVOR, SNIPER",

	"HUMAN, NEMESIS, SURVIVOR, SNIPER",

	"ZOMBIE, HUMAN, NEMESIS, SURVIVOR, SNIPER",

	"ASSASSIN, SURVIVOR, SNIPER",

	"ZOMBIE, ASSASSIN, SURVIVOR, SNIPER",

	"HUMAN, ASSASSIN, SURVIVOR, SNIPER",

	"ZOMBIE, HUMAN, ASSASSIN, SURVIVOR, SNIPER",

	"NEMESIS, ASSASSIN, SURVIVOR, SNIPER",

	"ZOMBIE, NEMESIS, ASSASSIN, SURVIVOR, SNIPER",

	"HUMAN, NEMESIS, ASSASSIN, SURVIVOR, SNIPER",

	"ZOMBIE, HUMAN, NEMESIS, ASSASSIN, SURVIVOR, SNIPER"

};



const ZCLASS_NONE = -1;



#if cellbits == 32

         const OFFSET_CLIPAMMO = 51;

#else

         const OFFSET_CLIPAMMO = 65;

#endif



const OFFSET_PAINSHOCK = 108;

const OFFSET_CSTEAMS = 114;

const OFFSET_CSMONEY = 115;

const OFFSET_CSDEATHS = 444;

const OFFSET_MODELINDEX = 491; 

const OFFSET_ACTIVE_ITEM = 373;

const OFFSET_WEAPONOWNER = 41;

const OFFSET_LINUX = 5;

const OFFSET_LINUX_WEAPONS = 4;



const HIDE_MONEY = (1<<5);

const UNIT_SECOND = (1<<12);

const DMG_HEGRENADE = (1<<24);

const USE_USING = 2;

const USE_STOPPED = 0;

const STEPTIME_SILENT = 999;

const BREAK_GLASS = 0x01;

const FFADE_IN = 0x0000;

const FFADE_STAYOUT = 0x0004;

const PEV_SPEC_TARGET = pev_iuser2;



enum

{

	FM_CS_TEAM_UNASSIGNED = 0,

	FM_CS_TEAM_T,

	FM_CS_TEAM_CT,

	FM_CS_TEAM_SPECTATOR

};



new const CS_TEAM_NAMES [ ] [ ] = 

{

         "UNASSIGNED", 

	"TERRORIST", 

	"CT", 

	"SPECTATOR" 

};



new const GetPrimaryItems [ ] [ ] = 

{ 

	"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 const GetSecondaryItems [ ] [ ] = 

{ 

	"weapon_glock18",

	"weapon_usp",

	"weapon_p228",

	"weapon_deagle",

	"weapon_fiveseven",

	"weapon_elite" 

};



new const GetAdditionalItems [ ] [ ] = 

{

	"weapon_hegrenade",

	"weapon_flashbang",

	"weapon_smokegrenade"

};



new const GetObjectiveEnts [ ] [ ] =

{

	"func_bomb_target", 

	"info_bomb_target",

	"info_vip_start",

	"func_vip_safetyzone",

	"func_escapezone",

	"hostage_entity",

	"monster_scientist",

	"func_hostage_rescue",

	"info_hostage_rescue",

	"env_fog",

	"env_rain",

	"env_snow",

	"item_longjump",

	"func_vehicle"

}



new const MAXBPAMMO [ ] = 

{

         -1, 254, -1, 

         254, 1, 254, 1, 

	254, 254, 1, 254,

	254, 254, 254, 254, 

	254, 254, 254, 254, 

	254, 254, 254, 254, 

	254, 254, 2, 254, 254, 

	254, -1, 254 

};





new const MAXCLIP [ ] = 

{

         -1, 13, -1, 

	 10, -1, 7, -1, 

	 30, 30, -1, 30, 

	 20, 25, 30, 35, 

	 25, 12, 20, 10, 

	 30, 100, 8, 30, 

	 30, 20, -1, 7, 30, 

	 30, -1, 50 

};



new const AMMOID [ ] = 

{

         -1, 9, -1, 

	 2, 12, 5, 

	 14, 6, 4, 

	 13, 10, 7, 

	 6, 4, 4, 4, 

	 6, 10, 1, 10, 

	 3, 5, 4, 10, 2, 

	 11, 8, 4, 2, -1, 7 

};



new const AMMOTYPE [ ] [ ] = 

{

         "", "357sig", "", "762nato",

	"", "buckshot", "", "45acp", 

	"556nato", "", "9mm", "57mm", 

	"45acp", "556nato", "556nato", 

	"556nato", "45acp", "9mm", "338magnum", 

	"9mm", "556natobox", "buckshot", "556nato", 

	"9mm", "762nato", "", "50ae", "556nato", 

	"762nato", "", "57mm" 

};



new const AMMOWEAPON [ ] = 

{

         0, 

	CSW_AWP,

	CSW_SCOUT, 

	CSW_M249,

	CSW_AUG,

	CSW_XM1014, 

	CSW_MAC10,

	CSW_FIVESEVEN,

	CSW_DEAGLE,

	CSW_P228,

	CSW_ELITE,

	CSW_FLASHBANG, 

	CSW_HEGRENADE,

	CSW_SMOKEGRENADE,

	CSW_C4 

};



new const WEAPONNAMES [ ] [ ] = 

{

         "",

	"P228 Compact",

	"",

	"Schmidt Scout",

	"",

	"XM1014 M4",

	"",

	"Ingram MAC-10",

	"Steyr AUG A1",

         "",

	"Dual Elite Berettas",

	"FiveseveN",

	"UMP 45",

	"SG-550 Auto-Sniper",

	"IMI Galil",

	"Famas",

         "USP .45 ACP Tactical",

	"Glock 18C",

	"AWP Magnum Sniper",

	"MP5 Navy",

	"M249 Para Machinegun",

         "M3 Super 90",

	"M4A1 Carbine",

	"Schmidt TMP",

	"G3SG1 Auto-Sniper",

	"",

	"Desert Eagle .50 AE",

         "SG-552 Commando",

	"AK-47 Kalashnikov",

	"", 

	"ES P90" 

};



new const WEAPONENTNAMES [ ] [ ] = 

{

         "", 

	"weapon_p228",

	"", 

	"weapon_scout",

	"weapon_hegrenade", 

	"weapon_xm1014",

	"weapon_c4",

	"weapon_mac10",

	"weapon_aug",

	"weapon_smokegrenade",

	"weapon_elite",

	"weapon_fiveseven",

	"weapon_ump45", 

	"weapon_sg550",

	"weapon_galil",

	"weapon_famas",

	"weapon_usp",

	"weapon_glock18", 

	"weapon_awp",

	"weapon_mp5navy",

	"weapon_m249",

	"weapon_m3",

	"weapon_m4a1",

	"weapon_tmp",

	"weapon_g3sg1", 

	"weapon_flashbang",

	"weapon_deagle",

	"weapon_sg552",

	"weapon_ak47",

	"weapon_knife",

	"weapon_p90" 

};



new const SoundBuyAmmo [ ] = "items/9mmclip1.wav";

new const SoundArmorHit [ ] = "player/bhit_helmet-1.wav";

new const SoundBuyArmor [ ] = "items/tr_kevlar.wav";

new const SoundRocket [ ] = "zombie_plague/rocket_fire.wav";

new const SoundBuyJetpack [ ] = "items/gunpickup2.wav";

new const SoundGetRocket [ ] = "items/9mmclip2.wav";

new const SoundJetpack [ ] = "zombie_plague/jetpack.wav";

new const SoundJetpackBlow [ ] = "zombie_plague/jp_blow.wav";



const Float:NADE_EXPLOSION_RADIUS = 240.0;



const PEV_ADDITIONAL_AMMO = pev_iuser1;



const PEV_NADE_TYPE = pev_flTimeStepSound;



const NADE_TYPE_INFECTION = 1111;

const NADE_TYPE_EXPLODE = 2222;

const NADE_TYPE_FROST = 3333;

const NADE_TYPE_FIRE = 4444;



const PEV_FLARE_COLOR = pev_punchangle;

const PEV_FLARE_DURATION = pev_flSwimTime;



const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);

const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

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



new const MODEL_ENT_CLASSNAME [ ] = "player_model";

new const WEAPON_ENT_CLASSNAME [ ] = "weapon_model";



const KEYS_GAMEMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;



const KEYS_BUYMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;



enum

{

	AMBIENCE_SOUNDS_INFECTION = 0,

	AMBIENCE_SOUNDS_NEMESIS,

	AMBIENCE_SOUNDS_ASSASSIN,

	AMBIENCE_SOUNDS_SURVIVOR,

	AMBIENCE_SOUNDS_SNIPER,

	AMBIENCE_SOUNDS_SWARM,

	AMBIENCE_SOUNDS_PLAGUE,

	AMBIENCE_SOUNDS_ARMAGEDDON,

	AMBIENCE_SOUNDS_APOCALYPSE,

	AMBIENCE_SOUNDS_NIGHTMARE,

	MAX_AMBIENCE_SOUNDS

};



const ZP_PLUGIN_HANDLED = 97;





new HasTripMines [33], PlantedMines [33], HasPlanting [33], HasRemoving [33], TripMineGlow, TripMineHealth, ModelTripMine [64],



Float: iSpeed = 1000.0, Float: iDelay = 1.0, iEnemy [33], InBlink [33], Float: iLastSlash [33], iCanceled [33], iSlash [33], iBlinks [33],



RocketModel [64], bool: Fly [33] = false, bool: Rocket [33] = false, bool: RSound [33] = false, bool: Shot [33] = false, Frame [33],



Float: iTime = 0.0, Float: LastRocket [33] = 0.0, 



Float: JPCal [33] = 0.0, Float: JPSound [33] = 0.0, FlyEnergy [33], HasJet [33], 



Zp_JetpackSpeed, Zp_RocketDamage, Zp_DamageRange,



Zp_JetpackUpSpeed, Zp_JetpackAccelerate, Zp_RocketDelay, Zp_RocketSpeed, Zp_FlyMaxEngery, Zp_FlyEngery, Zp_RegainEnergy, Zp_CalTime, JPSmokeSpr, xFireBallSpr, WhiteSpr,



HasUnlimitedClip [33], JumpNum [33] = 0, bool: DoJump [33] = false, MultiJumps [33] = 0,



IsTryder [33], Zp_TryderHealth, Zp_TryderArmor, UserTotalAmmo [33];



/* ---------------------- | For GamePlay | --------------------- */



new MaxPlayers, ModeAssassin, ModeSurvivor, ModeNemesis, ModeSniper,



CountDown, IsHuman [33], IsZombie [33], IsNemesis [33],



IsAssassin [33], IsSurvivor [33], IsSniper [33], FirstZombie [33], LastZombie [33], LastHuman [33],



IsFrozen [33], NoDamage [33], NVision [33], NVisionEnabled [33], ZombieClass [33],



ZombieClassNext [33], CanBuy [33], AmmoPacks [33], DamageDealt [33],



Float: LastLeapTime [33], PlayerModel [33] [32], MenuData [33] [5],  EntPlayerModel [33], EntWeaponModel [33], BurningDuration [33],



iPosition [33], NewRound, EndRound, NemesisRound, AssassinRound, SurvivorRound, SniperRound, SwarmRound, ArmageddonRound,



ApocalypseRound, NightmareRound, PlagueRound, ModeStarted, LastMode, ScoreZombies, ScoreHumans, SpawnCount_01, SpawnCount_02,



Float: Spawns_01 [MAX_CSDM_SPAWNS] [3], Float: Spawns_02 [MAX_CSDM_SPAWNS] [3], Float: ModelTargetTime,



Float: TeamsTargetTime, TrailSpr, ExploSpr, FlameSpr, SmokeSpr, GlassSpr, HExplode, FreezeTime, CZero, HamCzBots, fwSpawn, fwPrecacheSound,



ArraysCreated, LastPlayerLeaving, SwitchingTeam, iSize, 



fwRoundStart, fwRoundEnd, fwUserInfectedPre, fwUserInfectedPost, fwUserHumanizedPre, fwUserHumanizedPost, fwUserInfectAttempt, fwUserHumanizeAttempt, fwExtraItemSelected,



fwUserUnfrozen, fwUserLastZombie, fwUserLastHuman, fwDummyResult,



DBName [MAX_STATS_SAVED] [32], DBPacks [MAX_STATS_SAVED], DBZombieClass [MAX_STATS_SAVED], DBSlot,



Array: ExtraItemName_01, Array: ExtraItemCost_01, Array: ExtraItemTeam_01, iExtraItem, Array: ExtraItemRealName, Array: ExtraItemName_02, Array: ExtraItemCost_02,



Array: ExtraItemTeam_02, Array: ExtraItemNew, Array: ZClassName_01, Array: ZClassInfo_01, Array: ZClassModelsStart_01, Array: ZClassModelSend_01, Array: ZClassPlayerModel_01, Array: ZClassModelIndex_01,



Array: ZClassClawModel_01, Array: ZClassHealth_01, Array: ZClassSpeed_01, Array: ZClassGravity_01, Array: ZClassKnockback_01, iZClass, Array: ZClassRealName, Array: ZClassName_02, Array: ZClassInfo_02,



Array: ZClassHealth_02, Array: ZClassSpeed_02, Array: ZClassGravity_02, Array: ZClassKnockback_02, Array: ZClassNew, Array: ZClassModelIndex_02, Array: ZClassModelsStart_02,



Array: ZClassClawModel_02, Array: ZClassModelSend_02, Array: ZClassPlayerModel_02, AccessFlag [MAX_ACCESS_FLAGS],



Array: ModelNemesis, Array: ModelAssassin, Array: ModelSurvivor, Array: ModelSniper, Array: ModelHuman, Array: ModelOwnerHuman, Array: ModelAdminHuman,



ModelVKnifeHuman [64], ModelVKnifeNemesis [64],



ModelVKnifeAssassin [64], ModelVxm1014Survivor [64], ModelPxm1014Survivor [64], ModelVak47Survivor [64], ModelPak47Survivor [64], ModelVm4a1Survivor [64], ModelPm4a1Survivor [64], ModelVawpSniper [64], 



ModelPawpSniper [64], ModelGrenadeInfect [64], ModelGrenadeExplode [64], ModelGrenadeFire [64], ModelGrenadeFrost [64],



Array: SoundWinZombies, Array: SoundWinHumans, Array: SoundWinNoOne, Array: ZombieInfect, Array: ZombieIdle, Array: ZombiePain, Array: NemesisPain, Array: AssassinPain, Array: ZombieDie, Array: ZombieFall,



Array: ZombieMissWall, Array: ZombieHitNormal, Array: ZombieHitStab,



Array: ZombieIdleLast, Array: ZombieMadness, Array: SoundNemesis, Array: SoundAssassin, Array: SoundSurvivor, Array: SoundSniper, Array: SoundSwarm, Array: SoundMulti, Array: SoundPlague, Array: SoundArmageddon, Array: SoundApocalypse, 



Array: SoundNightmare, Array: GrenadeInfect, Array: GrenadeInfectPlayer, Array: GrenadeExplode, Array: GrenadeFrost, Array: GrenadeFrostPlayer, Array: GrenadeFrostBreak, Array: GrenadeFire, Array: GrenadeFirePlayer,



Array: SoundAntidote, AmbienceSounds [MAX_AMBIENCE_SOUNDS], Array: SoundAmbience_01, Array: SoundAmbience_02, Array: SoundAmbience_03, Array: SoundAmbience_04, Array: SoundAmbience_05, Array: SoundAmbience_06, 



Array: SoundAmbience_07, Array: SoundAmbience_08, Array: SoundAmbience_09, Array: SoundAmbience_10, Array: SoundAmbienceDuration_01, Array: SoundAmbienceDuration_02, Array: SoundAmbienceDuration_03, Array: SoundAmbienceDuration_04, 



Array: SoundAmbienceDuration_05, Array: SoundAmbienceDuration_06, Array: SoundAmbienceDuration_07, Array:SoundAmbienceDuration_08, Array: SoundAmbienceDuration_09, Array: SoundAmbienceDuration_10, Array: SoundAmbienceMp3_01,



Array: SoundAmbienceMp3_02, Array: SoundAmbienceMp3_03, Array:SoundAmbienceMp3_04, Array: SoundAmbienceMp3_05, Array: SoundAmbienceMp3_06, Array: SoundAmbienceMp3_07, Array: SoundAmbienceMp3_08, Array: SoundAmbienceMp3_09, Array: SoundAmbienceMp3_10,



Array: PrimaryItems, Array: SecondaryItems, Array: AdditionalItems, ExtraCosts [EXTRA_WEAPONS_STARTID],



AmbienceFog, FogDensity [10], FogColor [12], SkyEnable, Array:SkyNames, Array: ZombieDecals, Array: ObjectiveEnts, Float: KnockbackWeaponPower[31] = { -1.0, ... }, 



Array: ZombieMissSlash, ForceConsistency, IsConnected [33], IsAlive [33], IsBot [33], CurrentWeapon [33], PlayerName [33] [32], Float: ZombieSpeed [33], Float: ZombieKnockback [33], ZombieClassName [33] [32], Float: CachedHumanSpeed, 



Float: CachedNemesisSpeed, Float: CachedAssassinSpeed, Float: CachedSurvivorSpeed, Float: CachedSniperSpeed, CachedLeapNemesis, Float: CachedLeapNemesisCooldown,



Zp_PlagueChance, 



Zp_NemesisHealth, Zp_AssassinHealth,



Zp_NemesisChance, Zp_AssassinChance, Zp_CustomNvg, Zp_HumanHealth, 



Zp_NemesisGravity, Zp_AssassinGravity, Zp_AmmoDamage, Zp_ZombieArmor, Zp_SurvivorPainFree, Zp_SniperPainFree,



Zp_NemesisPainFree, Zp_NemesisSpeed, Zp_AssassinPainFree, Zp_AssassinSpeed, Zp_SurvivorChance, Zp_SurvivorHealth, Zp_SurvivorSpeed, Zp_SniperChance, Zp_SniperHealth, Zp_SniperSpeed, Zp_HumanSpeed, 



Zp_SwarmChance, Zp_ArmageddonChance, Zp_ApocalypseChance, Zp_NightmareChance, Zp_ZombieBleeding, Zp_RemoveDoors, 



Zp_MultiChance, Zp_AmmoInfect,



Zp_KnockbackPower, Zp_FreezeDuration,



Zp_SurvivorGravity, Zp_SniperGravity,



Zp_HumanGravity, Zp_NightmareNemesisHealth, Zp_NightmareAssassinHealth,



Zp_FireDuration, Zp_FireDamage, Zp_ApocalypseNemesisHealth, Zp_ApocalypseSurvivorHealth, Zp_ApocalypseAssassinHealth, Zp_ApocalypseSniperHealth,



Zp_KnockbackDucking, Zp_KnockbackDamage, Zp_KnockbackZvel,



Zp_NvgGive, 



Zp_ZombiePainFree, Zp_FireSlowdown,



Zp_Knockback, Zp_HumanArmor,



Zp_KnockbackDistance, Zp_NemesisDamage, Zp_AssassinDamage,



Zp_LeapNemesis, Zp_LeapNemesisForce, Zp_LeapNemesisHeight, Zp_LeapNemesisCooldown,



Zp_NightmareSurvivorHealth, Zp_NightmareSniperHealth,



Zp_NemesisMinPlayers, Zp_AssassinMinPlayers, Zp_SurvivorMinPlayers, Zp_SniperMinPlayers,



Zp_SwarmMinPlayers, Zp_MultiMinPlayers, Zp_PlagueMinPlayers, Zp_ArmageddonMinPlayers, Zp_ApocalypseMinPlayers,



Zp_NightmareMinPlayers,



Zp_MadnessDuration, Zp_PlagueNemesisNum, Zp_PlagueNemesisHealth, Zp_PlagueSurvivorHealth,



Zp_SniperDamage, Zp_PlagueSurvivorNum,



Zp_SurvivorInfiniteAmmo, Zp_SniperInfiniteAmmo, Zp_NemesisKnockback, Zp_AssassinKnockback,



Zp_StartPacks, GetModels [ClassModels], ExtraItems [EXTRA_WEAPONS_STARTID],  



MsgSync_01, MsgSync_02, MsgSync_03, MsgSync_04;



#define is_user_valid_connected(%1) (1 <= %1 <= MaxPlayers && IsConnected[%1])



#define is_user_valid_alive(%1) (1 <= %1 <= MaxPlayers && IsAlive[%1])



public plugin_natives (  )

{

	register_native ( "zp_get_user_zombie", "native_get_user_zombie", 1 );

	register_native ( "zp_get_user_nemesis", "native_get_user_nemesis", 1 );

	register_native ( "zp_get_user_assassin", "native_get_user_assassin", 1 );

	register_native ( "zp_get_user_survivor", "native_get_user_survivor", 1 );

	register_native ( "zp_get_user_sniper", "native_get_user_sniper", 1 );

	register_native ( "zp_get_user_first_zombie", "native_get_user_first_zombie", 1 );

	register_native ( "zp_get_user_last_zombie", "native_get_user_last_zombie", 1 );

	register_native ( "zp_get_user_last_human", "native_get_user_last_human", 1 );

	register_native ( "zp_get_user_zombie_class", "native_get_user_zombie_class", 1 );

	register_native ( "zp_get_user_next_class", "native_get_user_next_class", 1 );

	register_native ( "zp_set_user_zombie_class", "native_set_user_zombie_class", 1 );

	register_native ( "zp_get_user_ammo_packs", "native_get_user_ammo_packs", 1 );

	register_native ( "zp_set_user_ammo_packs", "native_set_user_ammo_packs", 1 );

	register_native ( "zp_get_zombie_maxhealth", "native_get_zombie_maxhealth", 1 );

	register_native ( "zp_get_user_nightvision", "native_get_user_nightvision", 1 );

	register_native ( "zp_set_user_nightvision", "native_set_user_nightvision", 1 );

	register_native ( "zp_infect_user", "native_infect_user", 1 );

	register_native ( "zp_disinfect_user", "native_disinfect_user", 1 );

	register_native ( "zp_make_user_nemesis", "native_make_user_nemesis", 1 );

	register_native ( "zp_make_user_assassin", "native_make_user_assassin", 1 );

	register_native ( "zp_make_user_survivor", "native_make_user_survivor", 1 );

	register_native ( "zp_make_user_sniper", "native_make_user_sniper", 1 );

	register_native ( "zp_force_buy_extra_item", "native_force_buy_extra_item", 1 );

	register_native ( "zp_override_user_model", "native_override_user_model", 1 );

	

	register_native ( "zp_has_round_started", "native_has_round_started", 1 );

	register_native ( "zp_is_nemesis_round", "native_is_nemesis_round", 1 );

	register_native ( "zp_is_assassin_round", "native_is_assassin_round", 1 );

	register_native ( "zp_is_survivor_round", "native_is_survivor_round", 1 );

	register_native ( "zp_is_sniper_round", "native_is_sniper_round", 1 );

	register_native ( "zp_is_swarm_round", "native_is_swarm_round", 1 );

	register_native ( "zp_is_plague_round", "native_is_plague_round", 1 );

	register_native ( "zp_is_armageddon_round", "native_is_armageddon_round", 1 );

	register_native ( "zp_is_apocalypse_round", "native_is_apocalypse_round", 1 );

	register_native ( "zp_is_nightmare_round", "native_is_nightmare_round", 1 );

	register_native ( "zp_get_zombie_count", "native_get_zombie_count", 1 );

	register_native ( "zp_get_human_count", "native_get_human_count", 1 );

	register_native ( "zp_get_nemesis_count", "native_get_nemesis_count", 1 );

	register_native ( "zp_get_assassin_count", "native_get_assassin_count", 1 );

	register_native ( "zp_get_survivor_count", "native_get_survivor_count", 1 ); 

	register_native ( "zp_get_sniper_count", "native_get_sniper_count", 1 );

	

	register_native ( "zp_register_extra_item", "native_register_extra_item", 1 );

	register_native ( "zp_register_zombie_class", "native_register_zombie_class", 1 );

	register_native ( "zp_get_extra_item_id", "native_get_extra_item_id", 1 );

	register_native ( "zp_get_zombie_class_id", "native_get_zombie_class_id", 1 );

}



public plugin_precache (  )

{

	precache_sound ( "fvox/flatline.wav" );

	

	precache_sound ( "fvox/one.wav" );

	

	precache_sound ( "fvox/two.wav" );

	

	precache_sound ( "fvox/three.wav" );

	

	precache_sound ( "fvox/four.wav" );

	

	precache_sound ( "fvox/five.wav" );

	

	precache_sound ( "fvox/six.wav" );

	

	precache_sound ( "fvox/seven.wav" );

	

	precache_sound ( "fvox/eight.wav" );

	

	precache_sound ( "fvox/nine.wav" );

	

	precache_sound ( "fvox/ten.wav" );

	

	ModelHuman = ArrayCreate(32, 1);

	

	ModelNemesis = ArrayCreate(32, 1);

	

	ModelAssassin = ArrayCreate(32, 1);

	

	ModelSurvivor = ArrayCreate(32, 1);

	

	ModelSniper = ArrayCreate(32, 1);

	

	ModelOwnerHuman = ArrayCreate(32, 1);

	

	ModelAdminHuman = ArrayCreate ( 32, 1 );

	

	SoundWinZombies = ArrayCreate(64, 1);

	

	SoundWinHumans = ArrayCreate(64, 1);

	

	SoundWinNoOne = ArrayCreate(64, 1);

	

	ZombieInfect = ArrayCreate(64, 1);

	

	ZombiePain = ArrayCreate(64, 1);

	

	NemesisPain = ArrayCreate(64, 1);

	

	AssassinPain = ArrayCreate(64, 1);

	

	ZombieDie = ArrayCreate(64, 1);

	

	ZombieFall = ArrayCreate(64, 1);

	

	ZombieMissSlash = ArrayCreate(64, 1);

	

	ZombieMissWall = ArrayCreate(64, 1);

	

	ZombieHitNormal = ArrayCreate(64, 1);

	

	ZombieHitStab = ArrayCreate(64, 1);

	

	ZombieIdle = ArrayCreate(64, 1);

	

	ZombieIdleLast = ArrayCreate(64, 1);

	

	ZombieMadness = ArrayCreate(64, 1);

	

	SoundNemesis = ArrayCreate(64, 1);

	

	SoundAssassin = ArrayCreate(64, 1);

	

	SoundSurvivor = ArrayCreate(64, 1);

	

	SoundSniper = ArrayCreate(64, 1);

	

	SoundSwarm = ArrayCreate(64, 1);

	

	SoundMulti = ArrayCreate(64, 1);

	

	SoundPlague = ArrayCreate(64, 1);

	

	SoundArmageddon = ArrayCreate(64, 1);

	

	SoundApocalypse = ArrayCreate(64, 1);

	

	SoundNightmare = ArrayCreate(64, 1);

	

	GrenadeInfect = ArrayCreate(64, 1);

	

	GrenadeInfectPlayer = ArrayCreate(64, 1);

	

	GrenadeFire = ArrayCreate(64, 1);

	

	GrenadeFirePlayer = ArrayCreate(64, 1);

	

	GrenadeFrost = ArrayCreate(64, 1);

	

	GrenadeFrostPlayer = ArrayCreate(64, 1);

	

	GrenadeFrostBreak = ArrayCreate(64, 1);

	

	GrenadeExplode = ArrayCreate(64, 1);

	

	SoundAntidote = ArrayCreate(64, 1);

	

	SoundAmbience_01 = ArrayCreate(64, 1);

	

	SoundAmbience_02 = ArrayCreate(64, 1);

	

	SoundAmbience_03 = ArrayCreate(64, 1);

	

	SoundAmbience_04 = ArrayCreate(64, 1);

	

	SoundAmbience_05 = ArrayCreate(64, 1);

	

	SoundAmbience_06 = ArrayCreate(64, 1);

	

	SoundAmbience_07 = ArrayCreate(64, 1);

	

	SoundAmbience_08 = ArrayCreate(64, 1);

	

	SoundAmbience_09 = ArrayCreate(64, 1);

	

	SoundAmbience_10 = ArrayCreate(64, 1);

	

	SoundAmbienceDuration_01 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_02 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_03 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_04 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_05 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_06 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_07 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_08 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_09 = ArrayCreate(1, 1);

	

	SoundAmbienceDuration_10 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_01 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_02 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_03 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_04 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_05 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_06 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_07 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_08 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_09 = ArrayCreate(1, 1);

	

	SoundAmbienceMp3_10 = ArrayCreate(1, 1);

	

	PrimaryItems = ArrayCreate ( 32, 1 );

	

	SecondaryItems = ArrayCreate ( 32, 1 );

	

	AdditionalItems = ArrayCreate(32, 1);

	

	SkyNames = ArrayCreate(32, 1);



	ZombieDecals = ArrayCreate(1, 1);

	

	ObjectiveEnts = ArrayCreate(32, 1);

	

	ExtraItemName_01 = ArrayCreate(32, 1);

	

	ExtraItemCost_01 = ArrayCreate(1, 1);

	

	ExtraItemTeam_01 = ArrayCreate(1, 1);

	

	ExtraItemRealName = ArrayCreate(32, 1);

	

	ExtraItemName_02 = ArrayCreate(32, 1);

	

	ExtraItemCost_02 = ArrayCreate(1, 1);

	

	ExtraItemTeam_02 = ArrayCreate(1, 1);

	

	ExtraItemNew = ArrayCreate(1, 1);

	

	ZClassName_01 = ArrayCreate(32, 1);

	

	ZClassInfo_01 = ArrayCreate(32, 1);

	

	ZClassModelsStart_01 = ArrayCreate(1, 1);

	

	ZClassModelSend_01 = ArrayCreate(1, 1);

	

	ZClassPlayerModel_01 = ArrayCreate(32, 1);

	

	ZClassModelIndex_01 = ArrayCreate(1, 1);

	

	ZClassClawModel_01 = ArrayCreate(32, 1);

	

	ZClassHealth_01 = ArrayCreate(1, 1);

	

	ZClassSpeed_01 = ArrayCreate(1, 1);

	

	ZClassGravity_01 = ArrayCreate(1, 1);

	

	ZClassKnockback_01 = ArrayCreate(1, 1);

	

	ZClassRealName = ArrayCreate(32, 1);

	

	ZClassName_02 = ArrayCreate(32, 1);

	

	ZClassInfo_02 = ArrayCreate(32, 1);

	

	ZClassModelsStart_02 = ArrayCreate(1, 1);

	

	ZClassModelSend_02 = ArrayCreate(1, 1);

	

	ZClassPlayerModel_02 = ArrayCreate(32, 1);

	

	ZClassModelIndex_02 = ArrayCreate(1, 1);

	

	ZClassClawModel_02 = ArrayCreate(32, 1);

	

	ZClassHealth_02 = ArrayCreate(1, 1);

	

	ZClassSpeed_02 = ArrayCreate(1, 1);

	

	ZClassGravity_02 = ArrayCreate(1, 1);

	

	ZClassKnockback_02 = ArrayCreate(1, 1);

	

	ZClassNew = ArrayCreate(1, 1);

	

	ArraysCreated = true;



	LoadCustomizationFromFiles (  );

	

	new i, Buffer [100];

	

	native_register_item ( "NightVision (single round)", ExtraCosts [EXTRA_NVISION], ZP_TEAM_HUMAN );

	

	native_register_item ( "Explosion Nade", ExtraCosts [EXTRA_EXPLOSION_NADE], ZP_TEAM_HUMAN );

	

	native_register_item ( "Napalm Nade", ExtraCosts [EXTRA_NAPALM_NADE], ZP_TEAM_HUMAN );

	

	native_register_item ( "Frost Nade", ExtraCosts [EXTRA_FROST_NADE], ZP_TEAM_HUMAN );

	

	native_register_item ( "AWP Magnum Sniper", ExtraCosts [EXTRA_AWP_MAGNUM_SNIPER], ZP_TEAM_HUMAN );

	

	native_register_item ( "M249 Para Machinegun", ExtraCosts [EXTRA_M249_PARA_MACHINEGUN], ZP_TEAM_HUMAN );

	

	native_register_item ( "SG550 Auto-Sniper", ExtraCosts [EXTRA_SG550_AUTO_SNIPER], ZP_TEAM_HUMAN );

	

	native_register_item ( "G3SG1 Auto-Sniper", ExtraCosts [EXTRA_G3SG1_AUTO_SNIPER], ZP_TEAM_HUMAN );

	

	native_register_item ( "Jetpack+Bazooka", ExtraCosts [EXTRA_JETPACK], ZP_TEAM_HUMAN );

	

	native_register_item ( "Unlimited Clip", ExtraCosts [EXTRA_UNLIMITEDCLIP], ZP_TEAM_HUMAN );

	

	native_register_item ( "Armura (100)", ExtraCosts [EXTRA_ARMOR_100], ZP_TEAM_HUMAN );

	

	native_register_item ( "Armura (200)", ExtraCosts [EXTRA_ARMOR_200], ZP_TEAM_HUMAN );

	

	native_register_item ( "Multijump +1", ExtraCosts [EXTRA_MULTIJUMP], ZP_TEAM_HUMAN );

	

	native_register_item ( "Cumpara Tryder", ExtraCosts [EXTRA_TRYDER], ZP_TEAM_HUMAN );

	

	native_register_item ( "Cumpara Survivor", ExtraCosts [EXTRA_SURVIVOR], ZP_TEAM_HUMAN );

	

	native_register_item ( "Cumpara Sniper", ExtraCosts [EXTRA_SNIPER], ZP_TEAM_HUMAN );

	

	native_register_item ( "Cumpara Nemesis", ExtraCosts [EXTRA_NEMESIS], ZP_TEAM_HUMAN );

	

	native_register_item ( "Cumpara Assassin", ExtraCosts [EXTRA_ASSASSIN], ZP_TEAM_HUMAN );

	

	native_register_item ( "T-Virus Antidote", ExtraCosts [EXTRA_ANTIDOTE], ZP_TEAM_ZOMBIE );

	

	native_register_item ( "Zombie Madness", ExtraCosts [EXTRA_MADNESS], ZP_TEAM_ZOMBIE );

	

	native_register_item ( "Infection Bomb", ExtraCosts [EXTRA_INFECTIONBOMB], ZP_TEAM_ZOMBIE );

	

	native_register_item ( "Knife Blink", ExtraCosts [EXTRA_KNIFEBLINK], ZP_TEAM_ZOMBIE );

	

	if ( ArraySize ( PrimaryItems ) == 0 )

	{

		for ( i = 0; i < sizeof GetPrimaryItems; i ++ )

			

			ArrayPushString ( PrimaryItems, GetPrimaryItems )

	}

	

	if ( ArraySize ( SecondaryItems ) == 0 )

	{

		for ( i = 0; i < sizeof GetSecondaryItems; i ++ )

			

			ArrayPushString ( SecondaryItems, GetSecondaryItems )

	}

	

	if ( ArraySize ( AdditionalItems ) == 0 )

	{

		for ( i = 0; i < sizeof GetAdditionalItems; i ++ )

			

			ArrayPushString ( AdditionalItems, GetAdditionalItems )

	}

	

	if ( ArraySize ( ObjectiveEnts ) == 0 )

	{

		for ( i = 0; i < sizeof GetObjectiveEnts; i ++ )

			

			ArrayPushString ( ObjectiveEnts, GetObjectiveEnts )

	}

	

	for ( i = 0; i < ArraySize ( ModelHuman ); i ++ )

	{

		ArrayGetString( ModelHuman, i, Buffer, charsmax ( Buffer ) );

		

		format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



		engfunc ( EngFunc_PrecacheModel, Buffer );

		

		if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

		if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

	}

	

	engfunc ( EngFunc_PrecacheModel, ModelVKnifeHuman );

	

	engfunc ( EngFunc_PrecacheModel, ModelVKnifeNemesis );

	

	engfunc ( EngFunc_PrecacheModel, ModelVKnifeAssassin );

	

	engfunc ( EngFunc_PrecacheModel, ModelVxm1014Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelPxm1014Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelVak47Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelPak47Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelVm4a1Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelPm4a1Survivor );

	

	engfunc ( EngFunc_PrecacheModel, ModelVawpSniper );

	

	engfunc ( EngFunc_PrecacheModel, ModelPawpSniper );       

	

	engfunc ( EngFunc_PrecacheModel, ModelGrenadeInfect );

	

	engfunc ( EngFunc_PrecacheModel, ModelGrenadeExplode );

	

	engfunc ( EngFunc_PrecacheModel, ModelGrenadeFire );

	

	engfunc ( EngFunc_PrecacheModel, ModelGrenadeFrost );

	

	engfunc ( EngFunc_PrecacheModel, ModelTripMine );

	

	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_ACTIVATE );

	

	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_CHARGE );

	

	engfunc ( EngFunc_PrecacheSound, MINE_SOUND_DEPLOY );



	TrailSpr = engfunc ( EngFunc_PrecacheModel, TRAIL_SPRITE );

	

	ExploSpr = engfunc ( EngFunc_PrecacheModel, RING_SPRITE );

	

	FlameSpr = engfunc ( EngFunc_PrecacheModel, FIRE_SPRITE );

	

	SmokeSpr = engfunc ( EngFunc_PrecacheModel, SMOKE_SPRITE );

	

	GlassSpr = engfunc ( EngFunc_PrecacheModel, GLASS_MODEL );

	

	HExplode = engfunc ( EngFunc_PrecacheModel, MODEL_EXPLODE );

	

	JPSmokeSpr = engfunc ( EngFunc_PrecacheModel, JP_SMOKE_SPRITE );

	

	xFireBallSpr = engfunc ( EngFunc_PrecacheModel, XFIREBALL_SPRITE );

	

	WhiteSpr = engfunc ( EngFunc_PrecacheModel, WHITE_SPRITE );



	engfunc ( EngFunc_PrecacheSound, SOUND_EXPLODE );    	   

	

	engfunc ( EngFunc_PrecacheModel, RocketModel );

	

	precache_model ( "models/p_egon.mdl" );



	precache_model ( "models/v_egon.mdl" );



	precache_model ( "models/w_egon.mdl" );

	

	for ( i = 0; i < ArraySize ( SoundWinZombies ); i ++ )

	{

		ArrayGetString ( SoundWinZombies, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( SoundWinHumans ); i ++ )

	{

		ArrayGetString ( SoundWinHumans, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( SoundWinNoOne ); i ++ )

	{

		ArrayGetString ( SoundWinNoOne, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieInfect ); i ++ )

	{

		ArrayGetString ( ZombieInfect, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	



	for ( i = 0; i < ArraySize ( ZombiePain ); i ++ )

	{

		ArrayGetString ( ZombiePain, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( NemesisPain ); i ++ )

	{

		ArrayGetString ( NemesisPain, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( AssassinPain ); i ++ )

	{

		ArrayGetString ( AssassinPain, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( ZombieDie ); i ++ )

	{

		ArrayGetString ( ZombieDie, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieFall ); i ++ )

	{

		ArrayGetString ( ZombieFall, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieMissSlash ); i ++ )

	{

		ArrayGetString ( ZombieMissSlash, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieMissWall ); i ++ )

	{

		ArrayGetString ( ZombieMissWall, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieHitNormal ); i ++ )

	{

		ArrayGetString ( ZombieHitNormal, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieHitStab ); i ++ )

	{

		ArrayGetString ( ZombieHitStab, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( ZombieIdle ); i ++ )

	{

		ArrayGetString ( ZombieIdle, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( ZombieIdleLast ); i ++ )

	{

		ArrayGetString ( ZombieIdleLast, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( ZombieMadness ); i ++ )

	{

		ArrayGetString ( ZombieMadness, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundNemesis ); i ++ )

	{

		ArrayGetString ( SoundNemesis, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundAssassin ); i ++ )

	{

		ArrayGetString ( SoundAssassin, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( SoundSurvivor ); i ++ )

	{

		ArrayGetString ( SoundSurvivor, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundSniper ); i ++ )

	{

		ArrayGetString ( SoundSniper, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundSwarm ); i ++ )

	{

		ArrayGetString ( SoundSwarm, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundMulti ); i ++ )

	{

		ArrayGetString ( SoundMulti, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundPlague ); i ++ )

	{

		ArrayGetString ( SoundPlague, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundArmageddon ); i ++ )

	{

		ArrayGetString ( SoundArmageddon, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundApocalypse ); i ++ )

	{

		ArrayGetString ( SoundApocalypse, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( SoundNightmare ); i ++ )

	{

		ArrayGetString ( SoundNightmare, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( GrenadeInfect ); i ++ )

	{

		ArrayGetString ( GrenadeInfect, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( GrenadeInfectPlayer ); i ++ )

	{

		ArrayGetString ( GrenadeInfectPlayer, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( GrenadeFire ); i ++ )

	{

		ArrayGetString ( GrenadeFire, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( GrenadeFirePlayer ); i ++ )

	{

		ArrayGetString ( GrenadeFirePlayer, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( GrenadeFrost ); i ++ )

	{

		ArrayGetString ( GrenadeFrost, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( GrenadeFrostPlayer ); i ++ )

	{

		ArrayGetString ( GrenadeFrostPlayer, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	for ( i = 0; i < ArraySize ( GrenadeFrostBreak ); i ++ )

	{

		ArrayGetString ( GrenadeFrostBreak, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( GrenadeExplode ); i ++ )

	{

		ArrayGetString ( GrenadeExplode, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}

	

	for ( i = 0; i < ArraySize ( SoundAntidote ); i ++ )

	{

		ArrayGetString ( SoundAntidote, i, Buffer, charsmax ( Buffer ) );

		

		engfunc ( EngFunc_PrecacheSound, Buffer );

	}



	if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_01 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_01, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_01, i ) )

			{

				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	

	if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_02 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_02, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_02, i ) )

			{

				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_03 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_03, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_03, i ) )

			{

				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_04 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_04, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_04, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_05 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_05, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_05, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_06 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_06, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_06, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_07 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_07, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_07, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_08 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_08, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_08, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds[AMBIENCE_SOUNDS_APOCALYPSE] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_09 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_09, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_09, i ) )

			{

				format ( Buffer, charsmax ( Buffer ), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] )

	{

		for ( i = 0; i < ArraySize ( SoundAmbience_10 ); i ++ ) 

		{

			ArrayGetString ( SoundAmbience_10, i, Buffer, charsmax ( Buffer ) );

			

			if ( ArrayGetCell ( SoundAmbienceMp3_10, i ) )

			{

				format ( Buffer, charsmax ( Buffer), "sound/%s", Buffer );

				

				engfunc ( EngFunc_PrecacheGeneric, Buffer );

			}

			else

			{

				engfunc ( EngFunc_PrecacheSound, Buffer );	

			}

		}

	}

	

	engfunc ( EngFunc_PrecacheSound, SoundBuyAmmo );

	

	engfunc ( EngFunc_PrecacheSound, SoundArmorHit );

	

	engfunc ( EngFunc_PrecacheSound, SoundRocket );

	

	engfunc ( EngFunc_PrecacheSound, SoundBuyJetpack );

	

	engfunc ( EngFunc_PrecacheSound, SoundGetRocket );

	

	engfunc ( EngFunc_PrecacheSound, SoundJetpack );

	

	engfunc ( EngFunc_PrecacheSound, SoundJetpackBlow );

	

	new Entity; 

	

	Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "hostage_entity" ) );

	

	if ( pev_valid ( Entity ) )

	{

		engfunc ( EngFunc_SetOrigin, Entity, Float: {8192.0,8192.0,8192.0} );

		

		dllfunc ( DLLFunc_Spawn, Entity );

	}

	

	if ( AmbienceFog )

	{

		Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "env_fog" ) );

		

		if ( pev_valid ( Entity ) )

		{

			fm_set_kvd ( Entity, "density", FogDensity, "env_fog" );

			

			fm_set_kvd ( Entity, "rendercolor", FogColor, "env_fog" );

		}

	}

	

	fwSpawn = register_forward ( FM_Spawn, "fmSpawn" );

	

	fwPrecacheSound = register_forward ( FM_PrecacheSound, "fmPrecacheSound" );

}



public plugin_init (  ) 

{

	register_plugin ( PLUGIN, VERSION, "ZP Dev Team" );

	

	if ( !iZClass ) set_fail_state ( "No zombie classes loaded!" );

	

	register_cvar ( "zp_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY );



	set_cvar_string ( "zp_version", VERSION );

	

	/* -------------- |   Game Menu   | ------------ */ 

	

	register_menu ( "Game Menu", KEYS_GAMEMENU, "MenuGame" );

	

	register_menu ( "Buy Menu 1", KEYS_BUYMENU, "MenuBuy_01" );

	

	register_menu ( "Buy Menu 2", KEYS_BUYMENU, "MenuBuy_02" );

	

	/* ------------- | Change Commands | ----------- */

	

	register_clcmd ( "nightvision", "cmdNightVision" );

	

	register_clcmd ( "drop", "cmdDrop" );

	

	register_clcmd ( "chooseteam", "cmdChangeTeam" );

	

	register_clcmd ( "jointeam", "cmdChangeTeam" );

	

	/* ------------- |  Buy TripMine  | -------------- */

	

	register_clcmd ( "say", "SayCommands" );

	

	register_clcmd ( "createlaser", "PlantTripMine" );

	

	register_clcmd ( "removelaser", "TakeTripMine" );

	

	register_think ( MINE_CLASSNAME, "fwThinkMine" );

	

	TripMineGlow = register_cvar ( "zp_tripmine_glow", "1" );

	

	TripMineHealth = register_cvar ( "zp_tripmine_health", "800" )

	

	/* ------------- | Block Commands | -------------- */



        register_clcmd ( "radio1", "cmdNotAllowed" );	



        register_clcmd ( "radio2", "cmdNotAllowed" );



        register_clcmd ( "radio3", "cmdNotAllowed" );



	register_clcmd ( "fullupdate","cmdNotAllowed" );

	

	register_clcmd ( "cl_setautobuy", "cmdNotAllowed" );

	

	register_clcmd ( "cl_autobuy", "cmdNotAllowed" );

	

	register_clcmd ( "cl_setrebuy", "cmdNotAllowed" );

	

	register_clcmd ( "cl_rebuy", "cmdNotAllowed" ) ;

	

	register_clcmd ( "autobuy", "cmdNotAllowed" );

	

	/* ------------- | Admin Commands | -------------- */

	

	register_clcmd ( "zp_tryder", "cmdMadeTryder" );

	

	register_clcmd ( "zp_human", "cmdMadeHuman" );

	

	register_clcmd ( "zp_survivor", "cmdMadeSurvivor" );

	

	register_clcmd ( "zp_sniper", "cmdMadeSniper" );

	

	register_clcmd ( "zp_zombie", "cmdMadeZombie" );

	

	register_clcmd ( "zp_nemesis", "cmdMadeNemesis" );

	

	register_clcmd ( "zp_assassin", "cmdMadeAssassin" );

	

	register_clcmd ( "zp_respawn", "cmdRespawn" );

	

	register_clcmd ( "mode_multi", "cmdMulti" );

	

	register_clcmd ( "mode_plague", "cmdPlague" );

	

	register_clcmd ( "mode_swarm", "cmdSwarm" );

	

	register_clcmd ( "mode_armageddon", "cmdArmageddon" );

	

	register_clcmd ( "mode_nightmare", "cmdNightmare" );

	

	register_clcmd ( "mode_apocalypse", "cmdApocalypse" );

	

	/* --------------- | Events & LogEvents | -------------- */

	

	register_event ( "DeathMsg", "evDeathMsg", "a" );	

	

	register_event ( "StatusValue", "evShowStatus", "be", "1=2", "2!0" );

	

	register_event ( "StatusValue", "evHideStatus", "be", "1=1", "2=0" );

	

	register_event ( "StatusValue", "ShowStatus", "be", "1=2", "2!0" );

	

	register_event ( "StatusValue", "HideStatus", "be", "1=1", "2=0" );



         register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );	



	register_logevent ( "leRoundStart", 2, "1=Round_Start" );



	register_logevent ( "leRoundEnd", 2, "1=Round_End" );

	

	register_event ( "AmmoX", "evAmmoX", "be" );

	

	if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] || AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] || AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] || AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] || AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] || 

	

	AmbienceSounds [AMBIENCE_SOUNDS_SWARM] || AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] || AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] || AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] || AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] )

	

	register_event ( "30", "evIntermission", "a" );

	

	register_event ( "CurWeapon", "CheckModels", "be" );

	

	/* --------------- | Ham Forwards | --------------- */

	

	RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );



	RegisterHam ( Ham_Killed, "player", "fwPlayerKilled" );



	RegisterHam ( Ham_Killed, "player", "fwPlayerKilledPost", 1 );



	RegisterHam ( Ham_TakeDamage, "player", "fwTakeDamage" );



	RegisterHam ( Ham_TakeDamage, "player", "fwTakeDamagePost", 1 );



	RegisterHam ( Ham_TraceAttack, "player", "fwTraceAttack" );



	RegisterHam ( Ham_Use, "func_tank", "fwUseStationary" );



	RegisterHam ( Ham_Use, "func_tankmortar", "fwUseStationary" );



	RegisterHam ( Ham_Use, "func_tankrocket", "fwUseStationary" );



	RegisterHam ( Ham_Use, "func_tanklaser", "fwUseStationary" );



	RegisterHam ( Ham_Use, "func_tank", "fwUseStationaryPost", 1 );



	RegisterHam ( Ham_Use, "func_tankmortar", "fwUseStationaryPost", 1 );



	RegisterHam ( Ham_Use, "func_tankrocket", "fwUseStationaryPost", 1 );



	RegisterHam ( Ham_Use, "func_tanklaser", "fwUseStationaryPost", 1 );



	RegisterHam ( Ham_Use, "func_pushable", "fwUsePushable" );



	RegisterHam ( Ham_Touch, "weaponbox", "fwTouchWeapon" );



	RegisterHam ( Ham_Touch, "armoury_entity", "fwTouchWeapon" );



	RegisterHam ( Ham_Touch, "weapon_shield", "fwTouchWeapon" );



	RegisterHam ( Ham_AddPlayerItem, "player", "fwAddPlayerItem" );

	

	RegisterHam ( Ham_Think, "grenade", "fwThinkGrenade" );

	

	for ( new i = 1; i < sizeof WEAPONENTNAMES; i++ ) if ( WEAPONENTNAMES  [0] ) RegisterHam ( Ham_Item_Deploy, WEAPONENTNAMES , "fwItemDeployPost", 1 );

	

	register_forward ( FM_SetClientKeyValue, "fwSetClientKeyValue" );

	

	register_forward ( FM_ClientDisconnect, "fwClientDisconnect" );



	register_forward ( FM_ClientDisconnect, "fwClientDisconnectPost", 1 );



	register_forward ( FM_ClientKill, "fwClientKill" );



	register_forward ( FM_EmitSound, "fwEmitSound" );

	

	register_forward ( FM_ClientUserInfoChanged, "fwClientUserInfoChanged" );



	register_forward ( FM_GetGameDescription, "fwGetGameDescription" );



	register_forward ( FM_SetModel, "fwSetModel" );

	

	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink" );

	

	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink_01" );

	

	register_forward ( FM_PlayerPreThink, "fwPlayerPreThink_02" );

	

	register_forward ( FM_PlayerPreThink, "fmPlayerPreThink" );

	

	register_forward ( FM_TraceLine, "fwTraceLinePost", 1 );

	

	register_forward ( FM_StartFrame, "fwStartFrame" );

	

	register_forward ( FM_PlayerPostThink, "fwPlayerPostThink" );

	

	unregister_forward ( FM_Spawn, fwSpawn );



	unregister_forward ( FM_PrecacheSound, fwPrecacheSound );

	

		/* --------------- | Message Hook | --------------- */

	

	register_message ( get_user_msgid ( "CurWeapon" ), "MessageCurWeapon" );



	register_message ( get_user_msgid ( "Money" ), "MessageMoney" );



	register_message ( get_user_msgid ( "Health" ), "MessageHealth" );



	register_message ( get_user_msgid ( "ScreenFade" ), "MessageScreenFade" );



	register_message ( get_user_msgid ( "NVGToggle" ), "MessageNvgToggle" );



	register_message ( get_user_msgid ( "WeapPickup" ), "MessageWeaponPickup" );



	register_message ( get_user_msgid ( "AmmoPickup" ), "MessageAmmoPickup" );



	register_message ( get_user_msgid ( "Scenario" ), "MessageScenario" );



	register_message ( get_user_msgid ( "HostagePos" ), "MessageHostagePos" );



	register_message ( get_user_msgid ( "TextMsg" ), "MessageTextMsg" );



	register_message ( get_user_msgid ( "SendAudio" ), "MessageSendAudio" );



	register_message ( get_user_msgid ( "TeamScore" ), "MessageTeamScore" );



	register_message ( get_user_msgid ( "TeamInfo" ), "MessageTeamInfo" );

	

	/* ------------- | Global Cvar's | -------------- */

	

	Zp_JetpackSpeed = register_cvar ( "zp_jp_forward_speed", "350.0" );

	

	Zp_JetpackUpSpeed = register_cvar ( "zp_jp_up_speed", "35.0" );

	

	Zp_JetpackAccelerate = register_cvar ( "zp_jp_accelerate", "100.0" );



	Zp_RocketDelay = register_cvar ( "zp_jp_rocket_delay","12.0" );

	

	Zp_RocketSpeed = register_cvar ( "zp_jp_rocket_speed","1700" );



	Zp_RocketDamage = register_cvar ( "zp_jp_rocket_damage","950" );



	Zp_DamageRange = register_cvar ( "zp_jp_damage_radius","600" );	



	Zp_FlyMaxEngery = register_cvar ( "zp_jp_max_engery", "100" );



	Zp_FlyEngery = register_cvar ( "zp_jp_engery", "10" );



	Zp_RegainEnergy = register_cvar ( "zp_jp_regain_energy", "3" );



	Zp_CalTime = register_cvar ( "zp_jp_energy_cal", "1.0" );



	Zp_TryderHealth = register_cvar ( "zp_tryder_health", "666" );

	

	Zp_TryderArmor = register_cvar ( "zp_tryder_armor", "666" );



	Zp_PlagueChance = register_cvar ( "zp_plague_change", "180" );

	

	Zp_NemesisHealth = register_cvar ( "zp_nemesis_health", "150000" );

	

	Zp_AssassinHealth = register_cvar ( "zp_assassin_health", "35000" ); 

	

	Zp_NemesisChance = register_cvar ( "zp_nemesis_change", "40" );

	

	Zp_AssassinChance = register_cvar ( "zp_assassin_change", "50" );

	

	Zp_CustomNvg = register_cvar ( "zp_custom_nvg", "1" );

	

	Zp_HumanHealth = register_cvar ( "zp_human_health", "150" );

	

	Zp_NemesisGravity = register_cvar ( "zp_nemesis_gravity", "0.5" );

	

	Zp_AssassinGravity = register_cvar ( "zp_assassin_gravity", "0.4" );

	

	Zp_AmmoDamage = register_cvar ( "zp_ammo_damage", "500" );

	

	Zp_ZombieArmor = register_cvar ( "zp_zombie_armor", "0.75" );

	

	Zp_SurvivorPainFree = register_cvar ( "zp_survivor_pain", "1" );

	

	Zp_SniperPainFree = register_cvar ( "zp_sniper_pain", "1" );

	

	Zp_NemesisPainFree = register_cvar ( "zp_nemesis_pain", "1" );

	

	Zp_NemesisSpeed = register_cvar ( "zp_nemesis_speed", "250" );

	

	Zp_AssassinPainFree = register_cvar ( "zp_assassin_pain", "1" );

	

	Zp_AssassinSpeed = register_cvar ( "zp_assassin_speed", "600" );

	

	Zp_SurvivorChance = register_cvar ( "zp_survivor_change", "200" );

	

	Zp_SurvivorHealth = register_cvar ( "zp_survivor_health", "5000" );

	

	Zp_SurvivorSpeed = register_cvar ( "zp_survivor_speed", "230" );

	

	Zp_SniperChance = register_cvar ( "zp_sniper_change", "200" );

	

	Zp_SniperHealth = register_cvar ( "zp_sniper_health", "3000" );

	

	Zp_SniperSpeed = register_cvar ( "zp_sniper_speed", "235" );

	

	Zp_HumanSpeed = register_cvar ( "zp_human_speed", "240" ); 

	

	Zp_SwarmChance = register_cvar ( "zp_swarm_change", "150" );

	

	Zp_ArmageddonChance = register_cvar ( "zp_armageddon_change", "300" );

	

	Zp_ApocalypseChance = register_cvar ( "zp_apocalypse_change", "470" );

	

	Zp_NightmareChance = register_cvar ( "zp_nightmare_change", "190" );

	

	Zp_ZombieBleeding = register_cvar ( "zp_zombie_bleeding", "0" );

	

	Zp_RemoveDoors = register_cvar ( "zp_remove_doors", "1" );

	

	Zp_MultiChance = register_cvar ( "zp_multiple_change", "150" );

	

	Zp_AmmoInfect = register_cvar ( "zp_ammo_infect", "1" );

	

	Zp_KnockbackPower = register_cvar ( "zp_knockback_power", "1" );

	

	Zp_FreezeDuration = register_cvar ( "zp_freeze_duration", "3" );

	

	Zp_SurvivorGravity = register_cvar ( "zp_survivor_gravity", "1.0" );

	

	Zp_SniperGravity = register_cvar ( "zp_sniper_gravity", "1.0" );

	

	Zp_HumanGravity = register_cvar ( "zp_human_gravity", "1.0" );

	

	Zp_FireDuration = register_cvar ( "zp_fire_duration", "4" );

	

	Zp_FireDamage = register_cvar ( "zp_fire_damage", "20" );

	

	Zp_ApocalypseNemesisHealth = register_cvar ( "zp_apocalypse_nemesis_health", "40000" );

	

	Zp_ApocalypseSurvivorHealth = register_cvar ( "zp_apocalypse_surivor_health", "10000" );

	

	Zp_ApocalypseAssassinHealth = register_cvar ( "zp_apocalypse_assassin_health", "35000" );

	

	Zp_ApocalypseSniperHealth = register_cvar ( "zp_apocalypse_sniper_health", "8000" );

	

	Zp_KnockbackDucking = register_cvar ( "zp_knockback_ducking", "0.25" );

	

	Zp_KnockbackDamage = register_cvar ( "zp_knockback_damage", "1" );

	

	Zp_KnockbackZvel = register_cvar ( "zp_knockback_zvel", "0" );



	Zp_NvgGive = register_cvar ( "zp_nvg_give", "1" );



	Zp_ZombiePainFree = register_cvar ( "zp_zombie_pain", "1" );

	

	Zp_FireSlowdown = register_cvar ( "zp_fire_slowdown", "1" );

	

	Zp_Knockback  = register_cvar ( "zp_knockback", "1" ); 

	

	Zp_HumanArmor = register_cvar ( "zp_human_armor", "1" );

	

	Zp_KnockbackDistance = register_cvar ( "zp_knockback_distange", "500" );

	

	Zp_NemesisDamage = register_cvar ( "zp_nemesis_damage", "250" );

	

	Zp_AssassinDamage = register_cvar ( "zp_assassin_damage", "250" );

	

	Zp_LeapNemesis = register_cvar ( "zp_leap_nemesis", "1" );

	

	Zp_LeapNemesisForce = register_cvar ( "zp_leap_nemesis_force", "500" );

	

	Zp_LeapNemesisHeight = register_cvar ( "zp_leap_nemesis_height", "300" );

	

	Zp_LeapNemesisCooldown = register_cvar ( "zp_leap_nemesis_cooldown", "1.0" );

	

	Zp_NightmareNemesisHealth = register_cvar ( "zp_nightmare_nemesis_health", "40000" );

	

	Zp_NightmareAssassinHealth = register_cvar ( "zp_nightmare_assassin_health", "35000" );

	

	Zp_NightmareSurvivorHealth = register_cvar ( "zp_nightmare_survivor_health", "10000" );

	

	Zp_NightmareSniperHealth = register_cvar ( "zp_nightmare_sniper_health", "8000" );



	Zp_NemesisMinPlayers = register_cvar ( "zp_nemesis_minplayers", "1" );

	

	Zp_AssassinMinPlayers = register_cvar ( "zp_assassin_minplayers", "1" );

	

	Zp_SurvivorMinPlayers = register_cvar ( "zp_survivor_minplayers", "1" );

	

	Zp_SniperMinPlayers = register_cvar ( "zp_sniper_minplayers", "1" );



	Zp_SwarmMinPlayers = register_cvar ( "zp_swarm_minplayers", "4" );

	

	Zp_MultiMinPlayers = register_cvar ( "zp_multiple_minplayers", "6" );

	

	Zp_PlagueMinPlayers = register_cvar ( "zp_plague_minplayers", "8" );

	

	Zp_ArmageddonMinPlayers = register_cvar ( "zp_armageddon_minplayers", "6" );

	

	Zp_ApocalypseMinPlayers = register_cvar ( "zp_apocalypse_minplayers", "6" );



	Zp_NightmareMinPlayers = register_cvar ( "zp_nightmare_minplayers", "6" );

	

	Zp_MadnessDuration = register_cvar ( "zp_madness_duration", "5.0" );

	

	Zp_PlagueNemesisNum = register_cvar ( "zp_plague_nemesis_num", "2" );

	

	Zp_PlagueNemesisHealth = register_cvar ( "zp_plague_nemesis_health", "50000" );

	

	Zp_PlagueSurvivorHealth = register_cvar ( "zp_plague_surivor_health", "8000" );

	

	Zp_SniperDamage = register_cvar ( "zp_sniper_damage", "4600" );

	

	Zp_PlagueSurvivorNum = register_cvar ( "zp_plague_survivor_num", "3" );

	

	Zp_SurvivorInfiniteAmmo = register_cvar ( "zp_survivor_infinite_ammo", "1" );

	

	Zp_SniperInfiniteAmmo = register_cvar ( "zp_sniper_infinite_ammo", "1" );

	

	Zp_NemesisKnockback = register_cvar ( "zp_nemesis_knockback", "0.07" );

	

	Zp_AssassinKnockback = register_cvar ( "zp_assassin_knockback", "0.07" );

	

	Zp_StartPacks = register_cvar ( "zp_start_packs", "30" );

	

	/* --------------- | Custom Forwards | --------------- */

	

	fwRoundStart = CreateMultiForward ( "zp_round_started", ET_IGNORE, FP_CELL, FP_CELL );



	fwRoundEnd = CreateMultiForward ( "zp_round_ended", ET_IGNORE, FP_CELL );



	fwUserInfectedPre = CreateMultiForward ( "zp_user_infected_pre", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL );



	fwUserInfectedPost = CreateMultiForward ( "zp_user_infected_post", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL );



	fwUserHumanizedPre = CreateMultiForward ( "zp_user_humanized_pre", ET_IGNORE, FP_CELL, FP_CELL );



	fwUserHumanizedPost = CreateMultiForward ( "zp_user_humanized_post", ET_IGNORE, FP_CELL, FP_CELL );



	fwUserInfectAttempt = CreateMultiForward ( "zp_user_infect_attempt", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL );



	fwUserHumanizeAttempt = CreateMultiForward ( "zp_user_humanize_attempt", ET_CONTINUE, FP_CELL, FP_CELL );



	fwExtraItemSelected = CreateMultiForward ( "zp_extra_item_selected", ET_CONTINUE, FP_CELL, FP_CELL );



	fwUserUnfrozen = CreateMultiForward ( "zp_user_unfrozen", ET_IGNORE, FP_CELL );



	fwUserLastZombie = CreateMultiForward ( "zp_user_last_zombie", ET_IGNORE, FP_CELL );



	fwUserLastHuman = CreateMultiForward ( "zp_user_last_human", ET_IGNORE, FP_CELL );

	

	/* --------------- | For Game Mode | --------------- */

	

	if ( SkyEnable )

	{

		new Sky [32]; ArrayGetString ( SkyNames, random_num ( 0, ArraySize ( SkyNames ) - 1 ), Sky, charsmax ( Sky ) );



		set_cvar_string ( "sv_skyname", Sky );

	}

	

	set_cvar_num ( "sv_skycolor_r", 0 );



	set_cvar_num ( "sv_skycolor_g", 0 );



	set_cvar_num ( "sv_skycolor_b", 0 );

	

	new MyMod [6]; get_modname ( MyMod, charsmax ( MyMod ) );



	if ( equal ( MyMod, "czero") ) CZero = 1;

	

	iSize = sizeof ( iCoords );	

	

	MsgSync_01 = CreateHudSyncObj (  );	

	

         MsgSync_02 = CreateHudSyncObj (  );

	 

	MsgSync_03 = CreateHudSyncObj (  );



         MsgSync_04 = CreateHudSyncObj (  );

	 

	MaxPlayers = get_maxplayers (  );

	

	DBSlot = MaxPlayers + 1;

}



public SayCommands ( id )

{

	new Args [64]; read_args ( Args, charsmax ( Args ) )

	

	remove_quotes ( Args );

	

	new Arg_01 [16], Arg_02 [32];

	

	argbreak ( Args, Arg_01, charsmax ( Arg_01 ), Arg_02, charsmax ( Arg_02 ) );

	

	if ( equal ( Arg_01, "/donate", 7 ) )

	

		cmdDonatePacks ( id, Arg_02 );

	

	else if ( equal ( Arg_01, "/lm" ) || equal ( Arg_01, "lm" ) )

	 

	         BuyTripMine ( id );

	

}



public cmdDonatePacks ( id, Arg [ ] )

{

	new To [32], Count [10];

	

	argbreak ( Arg, To, charsmax ( To ), Count, charsmax ( Count ) );

	

	if ( !To [0] || !Count [0] )

	{

		client_print_color ( id, print_team_grey, "%s Usage^4 :^3 '/donate (Name) (Packs)'", CHAT_PREFIX );

		

		return;

	}

	

	new Reciever = cmd_target ( id, To, ( CMDTARGET_ALLOW_SELF ) );

	

	if ( !Reciever || Reciever == id )

	{

		client_print_color ( id, print_team_grey, "%s Player^3 %s^1 has not been found on the server!", CHAT_PREFIX, To );

		

		return;

	}

	

	new PacksSender = AmmoPacks [id];

	

	new Packs;

	

	if ( equal ( Count, "all" ) )

	

		Packs = PacksSender;

	else

		Packs = str_to_num ( Count );

		

	if ( Packs <= 0 )

	{

		client_print_color ( id, print_team_default, "%s Wrong ammo quantity!", CHAT_PREFIX );

		

		return;

	}

	

	if ( PacksSender <= 0 && Packs > 0 )

	{

		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );

		

		return;

	}

	

	PacksSender -= Packs;

	

	if ( PacksSender < 0 )

	{

		Packs += PacksSender;

		

		PacksSender = 0;

		

	}

	

	AmmoPacks [Reciever] += Packs;

	

	UserTotalAmmo [Reciever] += Packs

	

	AmmoPacks [id] = PacksSender;

	

	client_print_color ( 0, print_team_grey, "%s^3 %s^1 gave^4 %d packs^1 to^3 %s", CHAT_PREFIX, PlayerName [id], Packs, PlayerName [Reciever] );

}



public client_PreThink ( id )

{

	if ( !IsAlive [id] || IsAssassin [id] ) return



	new Float: FallSpeed = 50.0 * -1.0;



	new Button = get_user_button ( id );

	

	if ( Button & IN_USE ) 

	{

		new Float: Velocity [3];

		

		entity_get_vector ( id, EV_VEC_velocity, Velocity );

		

		if ( Velocity [2] < 0.0 ) 

		{

			entity_set_int ( id, EV_INT_sequence, 3 );

			

			entity_set_int ( id, EV_INT_gaitsequence, 1 );

			

			entity_set_float ( id, EV_FL_frame, 1.0 );

			

			entity_set_float ( id, EV_FL_framerate, 1.0 );



			Velocity [2] = ( Velocity [2] + 40.0 < FallSpeed ) ? Velocity [2] + 40.0 : FallSpeed;

			

			entity_set_vector ( id, EV_VEC_velocity, Velocity );

		}

	}

}



public plugin_cfg (  )

{

	new Director [32]; get_configsdir ( Director, charsmax ( Director ) );

	

	server_cmd ( "exec %s/%s", Director, ZP_CONFIGURATION_FILE );

	

	ArraysCreated = false;

	

	SaveCustomization (  );



	set_task ( 0.5, "CacheCvars" );

	

	set_task ( 0.5, "evNewRound" );

	

	set_task ( 0.5, "leRoundStart" );

}



public client_damage ( iAttacker, iVictim, iDamage )

{

	if ( IsZombie [iAttacker] || IsNemesis [iAttacker] || IsAssassin [iAttacker] ) return;

	

	if ( ++ iPosition [iAttacker] == iSize ) iPosition [iAttacker] = 0;

	

	set_hudmessage ( 0, 40, 80, Float: iCoords [iPosition [iAttacker]] [0], Float: iCoords [iPosition [iAttacker]] [1], 0, 0.1, 2.5, 0.02, 0.02, -1 );

	

	ShowSyncHudMsg ( iAttacker, MsgSync_04, "%i", iDamage );

}



public cmdNotAllowed ( id ) return PLUGIN_HANDLED;



public zp_round_started ( Mode, id )

{

	remove_task ( id + TASK_HEALTH );



         if ( Mode == MODE_NEMESIS )

	{

	       if ( !ModeNemesis ) ModeNemesis = true;

		

                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );

	}

	else if ( Mode == MODE_ASSASSIN )

	{

	       if ( !ModeAssassin ) ModeAssassin = true;

		

                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );

	}

	else if ( Mode == MODE_SURVIVOR )

	{

	       if ( !ModeSurvivor ) ModeSurvivor = true;

		

                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );

	}

	else if ( Mode == MODE_SNIPER )

	{

	       if ( !ModeSniper ) ModeSniper = true;

		

                set_task ( REMINDER_DELAY, "ModeInformer", id + TASK_HEALTH, _, _, "b" );

	}

}

	

public ModeInformer ( id )

{

	id -= TASK_HEALTH;

	

	if ( is_user_alive ( id ) )

	{

		static HealthString [16]; AddCommas ( get_user_health ( id ), HealthString, charsmax ( HealthString ) );

		

		if ( IsNemesis [id] )

		{

			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Nemesis^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );

		}

		else if ( IsAssassin [id] )

		{

		        client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Assassin^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );

		}

		else if ( IsSurvivor [id] )

		{

			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Survivor^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );

		}

		else if ( IsSniper [id] )

		{

			client_print_color ( 0, print_team_grey, "%s A^3 Rapture^1 Reminder^3 @^4 Sniper^1 still has %s^4 health points!", CHAT_PREFIX, HealthString );

		}

	}

}	



public evDeathMsg (  )

{	

	new iPlayers [32], iHuman, iZombie;

	

	if ( ModeNemesis )

	{

		get_players ( iPlayers, iHuman, "ah" );

		

		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%d Human%s Remaining...", iHuman - 1, iHuman == 2 ? "" : "s" );

	}

	

	if ( ModeAssassin )

	{

		get_players ( iPlayers, iHuman, "ah" );

		

		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%d Human%s Remaining...", iHuman - 1, iHuman == 2 ? "" : "s" );

	}

	

	if ( ModeSurvivor )

	{

		get_players ( iPlayers, iZombie, "ah" );

		

		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%d Zombie%s Remaining...", iZombie - 1, iZombie == 2 ? "" : "s" );

	}

	

	if ( ModeSniper )

	{

		get_players ( iPlayers, iZombie, "ah" );

		

		set_hudmessage ( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%d Zombie%s Remaining...", iZombie - 1, iZombie == 2 ? "" : "s" );

	}

}



public zp_round_ended (  )

{

	for ( new id = 1; id <= MaxPlayers; id ++ )



		if ( task_exists ( id ) ) remove_task ( id );

	

	if ( ModeNemesis ) ModeNemesis = false;

	

	if ( ModeAssassin ) ModeAssassin = false;

	

	if ( ModeSurvivor ) ModeSurvivor = false;

	

	if ( ModeSniper ) ModeSniper = false;

}



public evNewRound (  )

{

	/* ---------- | Remove Extra-Items | ---------- */

	

	for ( new id = 1; id <= MaxPlayers; id ++ ) 

	{

	         iBlinks [id] = 0;

		 

		Shot [id] = true

	

	         LastRocket [id] = iTime + 14.0; 

		 

		HasUnlimitedClip [id] = false; 

		

		MultiJumps [id] = false;

		

		IsTryder [id] = false;

	}



         RemoveJetpacks (  )

	

	remove_task ( TASK_ID );

	

	CountDown = 10 - 1;

	

	set_task ( 4.0, "CheckCountDown", TASK_ID );

	

	set_task ( 0.1, "RemoveStuff" );

	

	NewRound = true;

	

	EndRound = false;

	

	NemesisRound = false;

	

	AssassinRound = false;

	

	SurvivorRound = false;

	

	SniperRound = false;

	

	SwarmRound = false;

	

	ArmageddonRound = false;

	

	ApocalypseRound = false;

	

	NightmareRound = false;

	

	PlagueRound = false;

	

	ModeStarted = false;



	FreezeTime = true;	        

	

	remove_task ( TASK_WELCOMEMSG );

	

	set_task ( 1.0, "SendWelcomeMessage", TASK_WELCOMEMSG );



	

	remove_task ( TASK_MAKEZOMBIE );

	

	set_task ( 13.0, "MakeZombieTask", TASK_MAKEZOMBIE );

}

	



public CheckCountDown (  )

{	

	new DownSpeak [11] [] = 

	{ 

		"",

		"fvox/one.wav", 

		"fvox/two.wav", 

		"fvox/three.wav", 

		"fvox/four.wav", 

		"fvox/five.wav", 

		"fvox/six.wav", 

		"fvox/seven.wav", 

		"fvox/eight.wav", 

		"fvox/nine.wav",

		"fvox/ten.wav"

	};

	

	if ( CountDown > 1 )

	{ 

		//emit_sound ( 0, CHAN_VOICE, DownSpeak [CountDown - 1], 1.0, ATTN_NORM, 0, PITCH_NORM);

		

		client_cmd ( 0, "spk %s", DownSpeak [CountDown - 1] );

		

		set_hudmessage ( 179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);	

		

		if ( CountDown != 1 ) ShowSyncHudMsg ( 0, MsgSync_01, "Infection in %i", CountDown - 1 );

		

	}

	

	-- CountDown;

	

	if ( CountDown >= 1 )

	

	         set_task ( 1.0, "CheckCountDown", TASK_ID );

	else

		remove_task ( TASK_ID );

}



public evShowStatus ( id )

{

	if ( !IsBot [id] && IsConnected [id] ) 

	{

		static AimID; AimID = read_data ( 2 );

		

		if ( IsZombie [id] == IsZombie [AimID] )

		{

			static Class [ 32], Red, Green, Blue;

			

			if ( IsZombie [id] )

			{

				Red = 255;

				

				Green = 140;

				

				Blue = 40;

				

				if ( IsNemesis [AimID] )

					

					formatex ( Class, charsmax ( Class ), "Nemesis" );

				

				else if ( IsAssassin [AimID] )

					

					formatex ( Class, charsmax ( Class ), "Assassin" );

				else

					copy ( Class, charsmax ( Class ), ZombieClassName [id] );

			}

			else

			{

				Red = 20;

				

				Green = 135;

				

				Blue = 255;

				

				if ( IsSurvivor [AimID] )

				

					formatex ( Class, charsmax ( Class ), "Survivor");

				

				else if ( IsSniper [AimID] )

					formatex ( Class, charsmax ( Class ), "Sniper ");

				else

					formatex ( Class, charsmax ( Class ), "Human" );

			}

			

			

			static HealthString [16], ArmorString [16], PacksString [16];

			

			AddCommas ( pev ( AimID, pev_health ), HealthString, charsmax ( HealthString ) );

			

			AddCommas ( pev ( AimID, pev_armorvalue ), ArmorString, charsmax ( ArmorString ) );

			

			AddCommas ( AmmoPacks [AimID], PacksString, charsmax ( PacksString ) );

			                     

			set_hudmessage ( Red, Green, Blue, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );

			

			ShowSyncHudMsg ( id, MsgSync_03, "%s^n[ %s | Health: %s | Armor: %s | Ammo: %s ]", \

			PlayerName [AimID], Class, HealthString, ArmorString, PacksString );

		}

	}

}





public evHideStatus ( id ) ClearSyncHud( id, MsgSync_03 );

	



public ShowStatus ( id )

{

	if ( is_user_connected ( id ) && !IsZombie [id] )

	{

		static iTarget; iTarget = read_data ( 2 );

		

		if ( IsZombie [iTarget] )

		{	

			static HealthString [16]; AddCommas ( get_user_health ( iTarget ), HealthString, charsmax ( HealthString ) );	

			

			set_hudmessage ( 250, 4, 24, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1 );

			

			ShowSyncHudMsg ( id, MsgSync_03, "%s^n[Health: %s]", PlayerName [iTarget], HealthString );

		}

	}

}



public HideStatus ( id ) ClearSyncHud ( id, MsgSync_03 );





public leRoundStart (  ) 

{

         FreezeTime = false;



	static Entity, ClassName [32], id;

	

	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 

	{

		if ( !is_valid_ent ( Entity ) ) continue;

		

		ClassName [0] = '^0';

		

		entity_get_classname ( Entity, ClassName );

		

		if ( equal ( ClassName, MINE_CLASSNAME ) )

			

			remove_entity ( Entity );

	}

	

	for ( id = 1; id < MaxPlayers + 1; id ++ ) 

	{

		HasTripMines [id] = 0;

		

		PlantedMines [id] = 0;

	}

}



public leRoundEnd (  )

{

	remove_task ( TASK_LEADER );

	

	set_task ( 0.1, "LeaderFrags", TASK_LEADER );

	

	static Float: LastEndTime, Float: CurrentTime;

	

	CurrentTime = get_gametime (  );

	

	if ( CurrentTime - LastEndTime < 0.5 ) return;

	

	LastEndTime = CurrentTime;

	

	static id, Team;

		

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( !IsConnected [id] ) continue;

			

		Team = fm_cs_get_user_team ( id );

			

		if ( Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED ) continue;

			

		SaveStats ( id );

	}

	

	EndRound = true;

	

	remove_task ( TASK_WELCOMEMSG );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	if ( ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && NemesisRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && AssassinRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && SurvivorRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && SniperRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && SwarmRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && PlagueRound ) || 

	

	( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && ArmageddonRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && ApocalypseRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && NightmareRound) || ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && !NemesisRound && !AssassinRound && !SurvivorRound && !SniperRound && !SwarmRound && !PlagueRound && !ArmageddonRound && !ApocalypseRound && !NightmareRound ) )

	{

	         remove_task ( TASK_AMBIENCESOUNDS );

	         

		AmbienceSoundStop (  );

	}

	

	static Sound [64];

	

	if ( !fnGetZombies (  ) )

	{

		set_hudmessage ( 20, 20, 255, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Humans defeated the plague!" );

		

		ArrayGetString ( SoundWinHumans, random_num ( 0, ArraySize ( SoundWinHumans ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		ScoreHumans ++;



		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_HUMAN );

	}

	else if ( !fnGetHumans (  ) )

	{

		set_hudmessage ( 255, 20, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Zombies have taken over the world!" );

		

		ArrayGetString ( SoundWinZombies, random_num ( 0, ArraySize ( SoundWinZombies ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		ScoreZombies ++;



		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_ZOMBIE );

	}

	else

	{

		set_hudmessage ( 20, 255, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "No one won..." );

		

		ArrayGetString ( SoundWinNoOne, random_num ( 0, ArraySize ( SoundWinNoOne ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );



		ExecuteForward ( fwRoundEnd, fwDummyResult, ZP_TEAM_NO_ONE );

	}

	

	BalanceTeams (  );

}



public LeaderFrags (  )

{ 

	new iFrags;

	

	new iLeader = GetLeader_Frags ( iFrags );

	

	new Players = fnGetPlaying (  );

	

	if ( Players == 0 ) return;



	else if ( iFrags == 0 )

		

		client_print_color ( 0, print_team_default, "%s The frags leader is not found.", CHAT_PREFIX );

	else

		client_print_color ( 0, print_team_grey, "%s The frags leader is^3 %s^1 @^4 %d Frags", CHAT_PREFIX, PlayerName [iLeader], iFrags );

		

	LeaderPacks (  );

}





public LeaderPacks (  )

{

	new iAmmoPacks;

	

	new iLeader = GetLeader_Ammo ( iAmmoPacks );

	

	new Players = fnGetPlaying (  );

	

	if ( Players == 0 ) return;



	else if ( iAmmoPacks == 0 )

		

		client_print_color ( 0, print_team_default, "%s The packs leader is not found.", CHAT_PREFIX );

	else

		client_print_color ( 0, print_team_grey, "%s The packs leader is^3 %s^1 @^4 %d Packs", CHAT_PREFIX, PlayerName [iLeader], iAmmoPacks );

}



GetLeader_Ammo ( &iAmmoPacks )

{

	new iPlayers [32], iNum, id, i, iLeader, iPacks;

	

	get_players ( iPlayers, iNum, "ch" );

	

	for ( i = 0; i < iNum; i ++ )

	{

		id = iPlayers ;

		

		iPacks = AmmoPacks [id];

		

		if ( iPacks > iAmmoPacks )

		{

			iAmmoPacks = iPacks;

			

			iLeader = id;

		}

	}

	

	return iLeader;

}



GetLeader_Frags ( &iFrags )

{

	new iPlayers [32], iNum, id, i, iLeader, iFrag;

	

	get_players ( iPlayers, iNum, "ch" );

	

	for ( i = 0; i < iNum; i ++ )

	{

		id = iPlayers ;

		

		iFrag = get_user_frags ( id );

		

		if ( iFrag > iFrags )

		{

			iFrags = iFrag;

			

			iLeader = id;

		}

	}

	

	return iLeader;

}



public evIntermission (  ) remove_task ( TASK_AMBIENCESOUNDS );



public evAmmoX ( id )

{

	if ( IsZombie [id] ) return;

	

	static Type; Type = read_data ( 1 );

	

	if ( Type >= sizeof AMMOWEAPON ) return;

	

	static Weapon; Weapon = AMMOWEAPON [Type];

	

	if ( MAXBPAMMO [Weapon] <= 2 ) return;



	static Amount; Amount = read_data ( 2 );



	if ( Amount < MAXBPAMMO [Weapon] )

	{

		static Args [1]; Args [0] = Weapon;

			

		set_task ( 0.1, "RefillBpAmmo", id, Args, sizeof Args ); 		

	}

}



public fmSpawn ( Entity )

{

	if ( !pev_valid ( Entity ) ) return FMRES_IGNORED;

	

	new ClassName [32], Objective [32], size = ArraySize ( ObjectiveEnts );

	

	pev ( Entity, pev_classname, ClassName, charsmax ( ClassName ) );

	

	for ( new i = 0; i < size; i ++ )

	{

		ArrayGetString ( ObjectiveEnts, i, Objective, charsmax ( Objective ) );

		

		if ( equal ( ClassName, Objective ) )

		{

			engfunc ( EngFunc_RemoveEntity, Entity );

			

			return FMRES_SUPERCEDE;

		}

	}

	return FMRES_IGNORED;

}



public fmPrecacheSound ( const Sound[] )

{

	if ( equal ( Sound, "hostage", 7 ) ) return FMRES_SUPERCEDE;

	

	return FMRES_IGNORED;

}



public fwPlayerSpawnPost ( id )

{

	if ( !is_user_alive ( id ) || !fm_cs_get_user_team ( id ) ) return;

	

	IsAlive [id] = true;



	remove_task ( id + TASK_SPAWN );

	remove_task ( id + TASK_MODEL );

	remove_task ( id + TASK_BLOOD );

	remove_task ( id + TASK_BURN );

	remove_task ( id + TASK_NVISION );

	

	set_task ( 0.4, "TaskHideMoney", id + TASK_SPAWN );

	

	ResetVars ( id, 0 );

	

	set_task ( 0.2, "ShowMenuBuy_01", id + TASK_SPAWN );



	fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) );

	

	set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );	

	

	if ( !NewRound && fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

	{

		remove_task ( id + TASK_TEAM );

		

		fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

		

		fm_user_team_update ( id );

	}

	

	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;

	

	AlreadyHasModel = false;



	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );

		

	if ( GetModels [OWNER] && ( get_user_flags ( id ) & AccessFlag [ACCESS_OWNER_MODELS] ) )

	{

		size = ArraySize ( ModelOwnerHuman );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelOwnerHuman, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0 , size - 1 );

				

			ArrayGetString ( ModelOwnerHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else if ( GetModels [ADMIN] && ( get_user_flags ( id ) & AccessFlag [ACCESS_ADMIN_MODELS] ) )

	{

		size = ArraySize ( ModelAdminHuman );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelAdminHuman, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0 , size - 1 );

				

			ArrayGetString ( ModelAdminHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else

	{			

		size = ArraySize ( ModelHuman );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelHuman, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0, size - 1 );

				

			ArrayGetString ( ModelHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

		

	if ( !AlreadyHasModel)

	{

		if ( NewRound )

				

			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );

		else

			fmUserModelUpdate ( id + TASK_MODEL );

	}

		

	fm_set_rendering ( id );

	

	if ( IsBot [id] )

	{

		cs_set_user_nvg ( id, 0 );

		

		if ( NewRound )

		

		         set_task ( 20.0, "BotBuyExtras", id + TASK_SPAWN );

		else 

		         set_task ( 10.0, "BotBuyExtras", id + TASK_SPAWN );		

	}

	

	static WeaponEntity;

	

	WeaponEntity = fmCsGetCurrentWeaponEnt ( id );

	

	if ( pev_valid ( WeaponEntity ) ) ReplaceWeaponModels ( id, cs_get_weapon_id ( WeaponEntity ) );



	fnCheckLastZombie (  );

}



public fwPlayerKilled ( Victim, Attacker, shouldgib )

{

	IsAlive [Victim] = false;



	remove_task ( Victim + TASK_HEALTH );

	

	if ( HasJet [Victim] ) 

	{

		DropJetpack ( Victim  );

		

		HasJet [Victim ] = 0;

		

		Rocket [Victim ] = false;

		

		FlyEnergy [Victim ] = 0;

	}

	

		

	iBlinks [Victim] = 0;

		 

	Shot [Victim] = true



	HasUnlimitedClip [Victim] = false; 

		

	MultiJumps [Victim] = false;

		

	IsTryder [Victim] = false;

	

	set_task ( 0.1, "SpecNVision", Victim );

	

	if ( get_pcvar_num ( Zp_NvgGive ) == 0 && NVision [Victim] )

	{

		if ( get_pcvar_num ( Zp_CustomNvg ) ) 



		         remove_task ( Victim + TASK_NVISION );

	         

		else if ( NVisionEnabled [Victim] )



		         SetUserGNvision ( Victim, 0 );

			

		NVision [Victim] = false;

	       

		NVisionEnabled [Victim] = false;

	}

	

	if ( get_pcvar_num ( Zp_NvgGive ) == 2 && NVision [Victim] && NVisionEnabled [Victim] )

	{

		if ( get_pcvar_num ( Zp_CustomNvg ) ) 

		

		        remove_task ( Victim + TASK_NVISION );

		

		else 

		         SetUserGNvision ( Victim, 0 );

		         

		NVisionEnabled [Victim] = false;

	}

	

	if ( IsZombie [Victim] || !IsZombie [Victim] )

	{

		remove_task ( Victim + TASK_BLOOD );

		

		remove_task ( Victim + TASK_BURN );

	}

	

	if ( is_user_connected ( Victim ) && is_user_connected ( Attacker ) )

	{

		if ( ( IsNemesis [Attacker] || IsNemesis [Victim] ) || ( IsAssassin [Attacker] || IsAssassin [Victim] ) )              	

			

			SetHamParamInteger ( 3, 2 );



		if ( IsSniper [Attacker] && CurrentWeapon [Attacker] == CSW_AWP )

		{	

			SetHamParamInteger ( 3, 2 );			

			

			static Origin [3]; get_user_origin ( Victim, Origin );			

			

			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );

			

			write_byte ( TE_LAVASPLASH ) ;

			

			write_coord ( Origin [0] );

			

			write_coord ( Origin [1] );

			

			write_coord ( Origin [2] - 26 ); 

			

			message_end (  );

		}

	}

	

	static SelfKill; SelfKill = ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) ? true : false;



	if ( SelfKill ) return;

	

	if ( IsZombie [Attacker] || IsNemesis [Attacker] || IsAssassin [Attacker] ) AmmoPacks [Attacker] += get_pcvar_num ( Zp_AmmoInfect );	

}





public fwPlayerKilledPost (  ) fnCheckLastZombie (  );





public fwTakeDamage ( Victim, Inflictor, Attacker, Float:Damage, DamageType )

{

	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;

	

	if ( NewRound || EndRound ) return HAM_SUPERCEDE;

	

	if ( NoDamage [Victim] ) return HAM_SUPERCEDE;



	if ( IsZombie [Attacker] == IsZombie [Victim] ) return HAM_SUPERCEDE;

	

	if ( !IsZombie [Attacker] )

	{

		if ( !IsNemesis [Victim] && !IsAssassin [Victim] && !IsSniper [Attacker] )

		{

			Damage *= get_pcvar_float ( Zp_ZombieArmor );

			

			SetHamParamFloat ( 4, Damage );

		}



		if ( !IsSurvivor [Attacker] || !IsSniper [Attacker] )

		{

			DamageDealt [Attacker] += floatround ( Damage );

			

			while ( DamageDealt [Attacker] > get_pcvar_num ( Zp_AmmoDamage ) )

			{

				AmmoPacks [Attacker] ++;

				

				DamageDealt [Attacker] -= get_pcvar_num ( Zp_AmmoDamage );

			}

		}

		

		if ( IsSniper [Attacker] && CurrentWeapon [Attacker] == CSW_AWP )

			

			SetHamParamFloat ( 4, get_pcvar_float ( Zp_SniperDamage ) );

		

		return HAM_IGNORED;

	}

	

	if ( DamageType & DMG_HEGRENADE ) return HAM_SUPERCEDE;

	

	if ( IsNemesis [Attacker] )

	{

		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, get_pcvar_float ( Zp_NemesisDamage ) );

		

		return HAM_IGNORED;

	}

	else if ( IsAssassin [Attacker] )

	{

		if ( Inflictor == Attacker ) SetHamParamFloat ( 4, get_pcvar_float ( Zp_AssassinDamage ) );

		

		return HAM_IGNORED;

	}

	

	if ( NemesisRound || AssassinRound || SurvivorRound || SniperRound || SwarmRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound || fnGetHumans (  ) == 1 ) return HAM_IGNORED;	



	if ( get_pcvar_num ( Zp_HumanArmor ) )

	{

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



		if ( Armor > 0.0 )

		{

			emit_sound ( Victim, CHAN_BODY, SoundArmorHit, 1.0, ATTN_NORM, 0, PITCH_NORM );

			

			set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );

			

			return HAM_SUPERCEDE;

		}

	}



	UserZombie ( Victim, Attacker, 0, 0, 0, 1 );

	

	return HAM_SUPERCEDE;

}



public fwTakeDamagePost ( Victim )

{

	if ( IsZombie [Victim] )

	{

		if ( IsNemesis [Victim] )

		{

			if ( !get_pcvar_num ( Zp_NemesisPainFree ) ) return;

		}

		else if ( IsAssassin [Victim] )

		{

			if ( !get_pcvar_num ( Zp_AssassinPainFree ) ) return;

		}

		else

		{

			switch ( get_pcvar_num ( Zp_ZombiePainFree ) )

			{

				case 0: return;

				

				case 2: if ( !LastZombie [Victim] ) return;

			}

		}

	}

	else

	{

		if ( IsSurvivor [Victim] )

		{

			if ( !get_pcvar_num ( Zp_SurvivorPainFree ) ) return;

		}		

		else if ( IsSniper [Victim] )

		{

			if ( !get_pcvar_num ( Zp_SniperPainFree ) ) return;

		}

		

		else return;

	}

	

	set_pdata_float ( Victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX );

}





public fwTraceAttack ( Victim, Attacker, Float: Damage, Float: Direction [3], DamageType )

{

	if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;



	if ( NewRound || EndRound ) return HAM_SUPERCEDE;



	if ( NoDamage [Victim] ) return HAM_SUPERCEDE;

	

	if ( IsZombie [Attacker] == IsZombie [Victim] ) return HAM_SUPERCEDE;

	

	if ( !IsZombie [Victim] || !( DamageType & DMG_BULLET ) ) return HAM_IGNORED;

	

	if ( !get_pcvar_num ( Zp_Knockback ) ) return HAM_IGNORED;

	

	if ( IsNemesis [Victim] && get_pcvar_float ( Zp_NemesisKnockback ) == 0.0 ) return HAM_IGNORED;

	

	if ( IsAssassin [Victim] && get_pcvar_float ( Zp_AssassinKnockback ) == 0.0 ) return HAM_IGNORED;



	static Ducking;

	

	Ducking = pev ( Victim, pev_flags ) & ( FL_DUCKING | FL_ONGROUND ) == ( FL_DUCKING | FL_ONGROUND )



	if ( Ducking && get_pcvar_float ( Zp_KnockbackDucking ) == 0.0 ) return HAM_IGNORED;

	

	static Origin_01 [3], Origin_02 [3];

	

	get_user_origin ( Victim, Origin_01 );

	

	get_user_origin ( Attacker, Origin_02 );



	if ( get_distance ( Origin_01, Origin_02 ) > get_pcvar_num ( Zp_KnockbackDistance ) ) return HAM_IGNORED;

	

	static Float: Velocity [3]; pev ( Victim, pev_velocity, Velocity );

	

	if ( get_pcvar_num ( Zp_KnockbackDamage ) ) xs_vec_mul_scalar ( Direction, Damage, Direction );



	if ( get_pcvar_num ( Zp_KnockbackPower ) && KnockbackWeaponPower [CurrentWeapon [Attacker] ] > 0.0 )

		

		xs_vec_mul_scalar ( Direction, KnockbackWeaponPower [CurrentWeapon [Attacker] ], Direction );

	

	if ( Ducking ) xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_KnockbackDucking ), Direction );

	

	if ( IsNemesis [Victim] )

	

		xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_NemesisKnockback ), Direction );

	

	else if ( IsAssassin [Victim] )

	

		xs_vec_mul_scalar ( Direction, get_pcvar_float ( Zp_AssassinKnockback ), Direction );

	

	else

		xs_vec_mul_scalar ( Direction, ZombieKnockback [Victim], Direction );



	xs_vec_add ( Velocity, Direction, Direction );

	

	if ( !get_pcvar_num ( Zp_KnockbackZvel ) ) Direction [2] = Velocity [2];

	

	set_pev ( Victim, pev_velocity, Direction );

	

	return HAM_IGNORED;

}





public fwUseStationary ( Entity, Caller, Activator, UseType )

{

	if ( UseType == USE_USING && is_user_valid_connected ( Caller ) && IsZombie [Caller] ) return HAM_SUPERCEDE;

	

	return HAM_IGNORED;

}



public fwUseStationaryPost ( Entity, Caller, Activator, UseType )

{

	if ( UseType == USE_STOPPED && is_user_valid_connected ( Caller ) )

		

		ReplaceWeaponModels ( Caller, CurrentWeapon [Caller] )

}



public fwUsePushable (  ) return HAM_SUPERCEDE;



public fwTouchWeapon ( Weapon, id )

{

	if ( !is_user_valid_connected ( id ) ) return HAM_IGNORED;

	

	if ( IsZombie [id] || ( ( IsSurvivor [id] || IsSniper [id]) && !IsBot [id] ) ) return HAM_SUPERCEDE;

	

	return HAM_IGNORED;

}



public fwAddPlayerItem ( id, WeaponEnt )

{

	static ExtraAmmo; ExtraAmmo = pev ( WeaponEnt, PEV_ADDITIONAL_AMMO );

	

	if ( ExtraAmmo )

	{

		static WeaponID; WeaponID = cs_get_weapon_id ( WeaponEnt );



		ExecuteHamB ( Ham_GiveAmmo, id, ExtraAmmo, AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

		

		set_pev ( WeaponEnt, PEV_ADDITIONAL_AMMO, 0 );

	}

}



public fwItemDeployPost ( WeaponEnt )

{

	static Owner; Owner = fm_cs_get_weapon_ent_owner ( WeaponEnt );

	

	static WeaponID; WeaponID = cs_get_weapon_id ( WeaponEnt );

	

	CurrentWeapon [Owner] = WeaponID;

	

	ReplaceWeaponModels ( Owner, WeaponID );



	if ( IsZombie [Owner] && !( ( 1 << WeaponID ) & ZOMBIE_ALLOWED_WEAPONS_BITSUM ) )

	{

		CurrentWeapon [Owner] = CSW_KNIFE;

		

		engclient_cmd ( Owner, "weapon_knife" );

	}

}





public wpn_gi_reset_weapon ( id ) ReplaceWeaponModels ( id, CSW_KNIFE );



public client_putinserver ( id )

{

	IsConnected [id] = true;

	

	Fly [id] = false;



	Rocket [id] = false;



	HasJet [id] = 0;



	FlyEnergy [id] = 0;

	

	get_user_name ( id, PlayerName [id], charsmax ( PlayerName [ ] ) );

	

	ResetVars ( id, 1 );

	

	LoadStats ( id );

	

	if ( !is_user_bot ( id ) )

	{

                  new UserIp [32], Country [44];

	

	         get_user_ip ( id, UserIp, charsmax ( UserIp ) );

	

	         geoip_country_ex ( UserIp, Country, charsmax ( Country ) );

		

		if ( equal ( Country, "" ) )



                  	 client_print_color ( 0, print_team_grey, "^1Player^4 %s^1 from^3 N/A^1 has joined the game!", PlayerName [id] );

		else

		          client_print_color ( 0, print_team_grey, "^1Player^4 %s^1 from^3 %s^1 has joined the game!", PlayerName [id], Country );

		

		set_task ( 1.0, "SpectatorHudMessage", id + TASK_SHOWHUD, _, _, "b" );

		

		set_task ( 5.0, "SendInfoMessage", id );

	}

	else 

	{

		IsBot [id] = true;

		

		if ( !HamCzBots ) set_task ( 0.1, "RegisterHamCzBots", id );

	}

}



public SendInfoMessage ( id )

{

	if ( is_user_connected ( id ) )

	{

		new Stats [8], Body [8];

	

		new RankPos = get_user_stats ( id, Stats, Body );

	

		new RankMax = get_statsnum (  );

	

		new HostName [64]; get_cvar_string ( "hostname", HostName, charsmax ( HostName ) );

	

		set_dhudmessage ( 0, 255, 0, 0.05, 0.22, 2, 0.02, 1.0, 0.05, 6.0 )

	

		show_dhudmessage ( id, "Welcome, %s^nWe hope you enjoy you stay here!^n^n%s^n^nYou rank is %d from %d", PlayerName [id], HostName, RankPos, RankMax );

	}

}



public fwClientDisconnect(id)

{

	if ( IsAlive [id] ) CheckRound ( id );

	

	Fly [id] = false;



	Rocket [id] = false;



	HasJet [id] = 0;



	FlyEnergy [id] = 0;

	

	SaveStats ( id );

	

	HasTripMines [id] = 0;

	

	HasPlanting [id] = false;

	

	HasRemoving [id] = false;

	

	if ( PlantedMines [id] )

	{

		fwRemoveMinesByOwner ( id );

		

		PlantedMines [id] = 0;

	}

	

	remove_task ( id + TASK_TEAM );

	remove_task ( id + TASK_MODEL );

	remove_task ( id + TASK_SPAWN );

	remove_task ( id + TASK_BLOOD );

	remove_task ( id + TASK_BURN );

	remove_task ( id + TASK_NVISION );

	remove_task ( id + TASK_SHOWHUD );

	remove_task ( id + TASK_HEALTH );

	remove_task ( id + TASK_REMOVE );

	remove_task ( id + TASK_CREATE );

	

	IsConnected [id] = false;

	

	IsBot [id] = false;

	

	IsAlive [id] = false;

}





public fwClientDisconnectPost (  ) fnCheckLastZombie (  );



public fwClientKill (  ) return FMRES_SUPERCEDE;





public fwEmitSound ( id, Channel, const Sample [], Float: Volume, Float: Attn, Flags, Pitch )

{

	if ( is_user_alive ( id ) ) 

	{

		new Clip, Ammo;

		

		new Weapon = get_user_weapon ( id, Clip, Ammo )

		

		if ( HasJet [id] && Weapon == CSW_KNIFE ) 

		{

			if ( equal ( Sample, "weapons/knife_slash1.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_slash2.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_deploy1.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_hitwall1.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_hit1.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_hit2.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_hit3.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_hit4.wav" ) ) return FMRES_SUPERCEDE;

			

			if ( equal ( Sample, "weapons/knife_stab.wav" ) ) return FMRES_SUPERCEDE;

		}

	}

	if ( Sample [0] == 'h' && Sample [1] == 'o' && Sample [2] == 's' && Sample [3] == 't' && Sample [4] == 'a' && Sample [5] == 'g' && Sample [6] == 'e' )

		

		return FMRES_SUPERCEDE;

	

	if ( !is_user_valid_connected ( id ) || !IsZombie [id] )

		

		return FMRES_IGNORED;

	

	static Sound [64];



	if ( Sample [7] == 'b' && Sample [8] == 'h' && Sample [9] == 'i' && Sample [10] == 't' )

	{

		if ( IsNemesis [id] )

		{

			ArrayGetString ( NemesisPain, random_num ( 0, ArraySize ( NemesisPain ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

		}

		else if ( IsAssassin [id] )

		{

			ArrayGetString ( AssassinPain, random_num ( 0, ArraySize ( AssassinPain ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

		}

		else

		{

			ArrayGetString ( ZombiePain, random_num ( 0, ArraySize ( ZombiePain ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

		}

		

		return FMRES_SUPERCEDE;

	}



	if ( Sample [8] == 'k' && Sample [9] == 'n' && Sample [10] == 'i' )

	{

		if ( Sample [14] == 's' && Sample [15] == 'l' && Sample [16] == 'a' )

		{

			ArrayGetString ( ZombieMissSlash, random_num ( 0, ArraySize ( ZombieMissSlash ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

			

			return FMRES_SUPERCEDE;

		}

		if ( Sample [14] == 'h' && Sample [15] == 'i' && Sample [16] == 't') 

		{

			if ( Sample [17] == 'w' ) 

			{

			         ArrayGetString ( ZombieMissWall, random_num ( 0, ArraySize ( ZombieMissWall ) - 1 ), Sound, charsmax ( Sound ) );

			

			         emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

			

				return FMRES_SUPERCEDE;

			}

			else

			{

			         ArrayGetString ( ZombieHitNormal, random_num ( 0, ArraySize ( ZombieHitNormal ) - 1 ), Sound, charsmax ( Sound ) );

			

			         emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

			

				return FMRES_SUPERCEDE;

			}

		}

		if ( Sample [14] == 's' && Sample [15] == 't' && Sample [16] == 'a')

		{

			ArrayGetString ( ZombieHitStab, random_num ( 0, ArraySize ( ZombieHitStab ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

			

			return FMRES_SUPERCEDE;

		}

	}



	if ( Sample [7] == 'd' && ( ( Sample [8] == 'i' && Sample [9] == 'e' ) || ( Sample [8] == 'e' && Sample [9] == 'a' ) ) )

	{

		ArrayGetString ( ZombieDie, random_num ( 0, ArraySize ( ZombieDie ) - 1 ), Sound, charsmax ( Sound ) );

			

		emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

		

		return FMRES_SUPERCEDE;

	}



	if ( Sample [10] == 'f' && Sample [11] == 'a' && Sample [12] == 'l' && Sample [13] == 'l' )

	{

		ArrayGetString ( ZombieFall, random_num ( 0, ArraySize ( ZombieFall ) - 1 ), Sound, charsmax ( Sound ) );

			

		emit_sound ( id, Channel, Sound, Volume, Attn, Flags, Pitch );

		

		return FMRES_SUPERCEDE;

	}

	

	return FMRES_IGNORED;

}



public fwSetClientKeyValue ( id, const infobuffer[], const key [] )

{

	if ( key [0] == 'm' && key [1] == 'o' && key [2] == 'd' && key [3] == 'e' && key [4] == 'l' )

		return FMRES_SUPERCEDE;

	

	return FMRES_IGNORED;

}



public fwClientUserInfoChanged ( id, Buffer )

{ 

        if ( !is_user_connected ( id ) ) return FMRES_IGNORED;



	static CurrentModel [32];

		

	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) )



	if ( !equal ( CurrentModel, PlayerModel [id] ) && !task_exists ( id + TASK_MODEL ) )

		

		fm_cs_set_user_model ( id + TASK_MODEL );



	static NewName [32]; engfunc( EngFunc_InfoKeyValue, Buffer, "name", NewName, charsmax ( NewName ) );

	

	if ( equal ( NewName, PlayerName [id] ) ) return FMRES_IGNORED;

	

	copy ( PlayerName [id], charsmax ( PlayerName [] ), NewName );



	PlayerName [id] = NewName;



	return FMRES_IGNORED;

}



public fwGetGameDescription (  )

{

	forward_return ( FMV_STRING, "Counter-Strike" );

	

	return FMRES_SUPERCEDE;

}



public fwSetModel ( 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 ( IsZombie [pev ( Entity, pev_owner )] )

	{

		if ( Model [9] == 'h' && Model [10] == 'e' )

		{

			fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 250, 0, kRenderNormal, 16 );

			

			message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

			write_byte ( TE_BEAMFOLLOW) ;

			write_short ( Entity );

			write_short ( TrailSpr );

			write_byte ( 10 );

			write_byte ( 10 );

			write_byte ( 0 );

			write_byte ( 250 );

			write_byte ( 0 );

			write_byte ( 200 );

			message_end (  );

			

			set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION );

		}

	}

	else if ( Model [9] == 'h' && Model [10] == 'e' ) 

	{

		fm_set_rendering ( Entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16 );

		

		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

		write_byte ( TE_BEAMFOLLOW );

		write_short ( Entity );

		write_short ( TrailSpr );

		write_byte ( 10 );

		write_byte ( 10 );

		write_byte ( 200 );

		write_byte ( 0 );

		write_byte ( 0 );

		write_byte ( 200 );

		message_end (  );

		

		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_EXPLODE );

	}

	else if ( Model [9] == 'f' && Model [10] == 'l' )

	{

		fm_set_rendering ( Entity, kRenderFxGlowShell, 250, 100, 0, kRenderNormal, 16 );

		

		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

		write_byte ( TE_BEAMFOLLOW );

		write_short ( Entity );

		write_short ( TrailSpr );

		write_byte ( 10 );

		write_byte ( 10 );

		write_byte ( 250 );

		write_byte ( 40 );

		write_byte ( 0 );

		write_byte ( 200 );

		message_end (  );



		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_FIRE );

	}

	else if ( Model[9] == 's' && Model[10] == 'm' ) 

	{

		fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16 );



		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

		write_byte ( TE_BEAMFOLLOW );

		write_short ( Entity );

		write_short ( TrailSpr);

		write_byte ( 10 );

		write_byte ( 10 );

		write_byte ( 0 );

		write_byte ( 100 );

		write_byte ( 200 );

		write_byte ( 200 );

		message_end (  );

		

		set_pev ( Entity, PEV_NADE_TYPE, NADE_TYPE_FROST );

	}

}



public fwThinkGrenade ( Entity )

{

	if ( !pev_valid ( Entity ) ) return HAM_IGNORED;



	static Float: DmgTime, Float: CurrentTime;

	

	pev ( Entity, pev_dmgtime, DmgTime );

	

	CurrentTime = get_gametime (  );

	

	if ( DmgTime > CurrentTime ) return HAM_IGNORED;

	

	switch ( pev ( Entity, PEV_NADE_TYPE ) )

	{

		case NADE_TYPE_INFECTION:

		{

			InfectionExplode ( Entity )

			

			return HAM_SUPERCEDE;

		}

		case NADE_TYPE_EXPLODE: 

		{

			HeExplode ( Entity );

			

			return HAM_SUPERCEDE;

		}

		case NADE_TYPE_FIRE:

		{

			FireExplode ( Entity );

			

			return HAM_SUPERCEDE;

		}

		case NADE_TYPE_FROST: 

		{

			FrostExplode ( Entity );

			

			return HAM_SUPERCEDE;

		}

	}

	

	return HAM_IGNORED;

}



public fwPlayerPreThink ( id )

{

	if ( !IsAlive [id] ) return;

	

	if ( IsZombie [id] && !IsNemesis [id] && IsAssassin [id] )

		

		set_pev ( id, pev_flTimeStepSound, STEPTIME_SILENT );

	

	if ( IsFrozen [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 ( IsZombie [id] )

		{

			if ( IsNemesis [id] )

			

				set_pev ( id, pev_maxspeed, CachedNemesisSpeed );

			

			else if ( IsAssassin [id] )

			

				set_pev ( id, pev_maxspeed, CachedAssassinSpeed );

			

			else

			

				set_pev ( id, pev_maxspeed, ZombieSpeed [id] )

		}

		else

		{

			if ( IsSurvivor [id] )

			

				set_pev ( id, pev_maxspeed, CachedSurvivorSpeed );

			

			else if ( IsSniper [id] )

			

			         set_pev(id, pev_maxspeed, CachedSniperSpeed );

			

			else						    

				

				set_pev(id, pev_maxspeed, CachedHumanSpeed );			

		}

	}	

	

	static Float: CoolDown, Float: CurrentTime;

	

	if ( IsZombie [id] && IsNemesis [id] )

	{

		if ( !CachedLeapNemesis ) return;

			

		CoolDown = CachedLeapNemesisCooldown;

	}

	else return;

	

	CurrentTime = get_gametime (  );

	

	if ( CurrentTime - LastLeapTime [id] < CoolDown ) return;

	

	if ( !IsBot [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;



	if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) || fm_get_speed ( id ) < 80 ) return;

	

	static Float: Velocity [3];



	velocity_by_aim ( id, get_pcvar_num ( Zp_LeapNemesisForce ), Velocity ) 

	

	Velocity [2] = get_pcvar_float ( Zp_LeapNemesisHeight );

	

	set_pev ( id, pev_velocity, Velocity );

	

	LastLeapTime [id] = CurrentTime;

}



public fwPlayerPreThink_01 ( id )

{

	if ( !is_user_alive ( id ) || IsZombie [id] || !MultiJumps [id] ) return PLUGIN_CONTINUE;

	

	new nBut = pev ( id, pev_button );

		

	new oBut = pev ( id, pev_oldbuttons );

		

	if ( ( nBut & IN_JUMP ) && !( pev ( id, pev_flags ) & FL_ONGROUND ) && !( oBut & IN_JUMP ) )

	{

		 if ( JumpNum [id] < MultiJumps [id] )

		 {

			 DoJump [id] = true;

				

			 JumpNum [id] ++;

				

			 return PLUGIN_CONTINUE;

		 }

	 }

	 if ( ( nBut & IN_JUMP ) && ( pev ( id, pev_flags ) & FL_ONGROUND ) )

	 {

		 JumpNum [id] = 0;

			

		 return PLUGIN_CONTINUE;

	 }

	 

	 return PLUGIN_CONTINUE;

}



public fmPlayerPreThink ( id )

{

	if ( CheckValidPlayer ( id ) ) 

	{

		new iWeaponID = get_user_weapon(id);

	

		if ( iWeaponID != CSW_KNIFE || !IsZombie [id] )

		{

			OPCancel ( id );

			

			return FMRES_IGNORED;

		}

		

		if ( iBlinks [id] == 0 ) return FMRES_IGNORED;

	

		new Button = pev ( id, pev_button );

	

		if ( !( Button & IN_ATTACK ) && !( Button & IN_ATTACK2 ) )

		{

			OPCancel ( id );

			

			return FMRES_IGNORED;

		}

	

		if ( iSlash [id] ) iSlash [id] = 0;

	

		OPNearEnemy ( id );

	

		if ( InBlink [id] )

		{

			OPSetBlink ( id );

			

			OPBlink ( id );

			

			iCanceled [id] = 0;

		}

	}	

	

	return FMRES_IGNORED;

}



public cmdNightVision ( id )

{

	if ( NVision [id] )

	{

		NVisionEnabled [id] = !( NVisionEnabled [id] )

		

		if ( get_pcvar_num ( Zp_CustomNvg ) )

		{

			remove_task ( id + TASK_NVISION );

			

			if ( NVisionEnabled [id] ) set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );

		}

		else

			SetUserGNvision ( id, NVisionEnabled [id] );

	}

	

	return PLUGIN_HANDLED;

}



public cmdDrop ( id )

{

	if ( IsSurvivor [id] || IsSniper [id] || IsTryder [id] ) return PLUGIN_HANDLED;

	

	if ( HasJet [id] ) 

	{

		new Clip, Ammo;

		

		new Weapon = get_user_weapon ( id, Clip, Ammo );

		

		if ( Weapon == CSW_KNIFE ) 

		{

			DropJetpack ( id )

			

			if ( !IsZombie [id] )

			{

				entity_set_string ( id, EV_SZ_viewmodel, "models/v_knife.mdl" );

				

				entity_set_string ( id, EV_SZ_weaponmodel, "models/p_knife.mdl" );

			}

			return PLUGIN_HANDLED

		}

	}

	

	return PLUGIN_CONTINUE;

}



public cmdChangeTeam ( id )

{

	static Team; Team = fm_cs_get_user_team ( id );

	

	if ( Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED ) return PLUGIN_CONTINUE;

	

	ShowMenuGame ( id );

	

	return PLUGIN_HANDLED;

}



ShowMenuGame ( id )

{

	static Menu [250], Len;

	

	Len = 0;

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\yGame Menu^n^n" );

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r1. \wBuy Weapons^n" );



	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r2. \wBuy Extra Items^n" );



	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r3. \wChoose Zombie Class^n" );



	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r4. \wUnstuck^n" );



	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r5. \wJoin Spectators^n^n" );

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n^n\r0. \wExit" );

	

	show_menu ( id, KEYS_GAMEMENU, Menu, -1, "Game Menu" );

}



public ShowMenuBuy_01 ( taskid )

{

	static id;

	

	( taskid > MaxPlayers ) ? ( id = ID_SPAWN ) : ( id = taskid );

	

	if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] ) return;

	

	if ( IsBot [id] )

	{

		BuyPrimaryWeapon ( id, random_num ( 0, ArraySize ( PrimaryItems ) - 1 ) );

		

		MenuBuy_02 ( id, random_num ( 0, ArraySize ( SecondaryItems ) - 1 ) );

		

		return;

	}

	

	static Menu [300], WeaponName [32], Len, Weapons, MaxLoops;

	

	Len = 0;

	

	MaxLoops = min ( WPN_STARTID + 7, WPN_MAXIDS );

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\yPrimary Menu %s/2^n^n", WPN_STARTID + 7 < WPN_MAXIDS ? "1" : "2" );

	

	for ( Weapons = WPN_STARTID; Weapons < MaxLoops; Weapons ++ )

	{

		ArrayGetString ( PrimaryItems, Weapons, WeaponName, charsmax ( WeaponName ) );

		

		Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r%d. \w%s^n", Weapons - WPN_STARTID + 1,WEAPONNAMES [ get_weaponid ( WeaponName ) ])

	}



	if ( WPN_STARTID + 7 >= WPN_MAXIDS )



	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r8. \wBack" );

	else

	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\d8. Back" );

	

	if ( WPN_STARTID + 7 < WPN_MAXIDS )



	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r9. \wMore" );

	else

	         Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\d9. More" );

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "^n\r0. \wExit" );

	

	show_menu ( id, KEYS_BUYMENU, Menu, -1, "Buy Menu 1" )

}





ShowMenuBuy_02 ( id )

{

	static Menu [250], WeaponName [32], Len, Weapons, MaxLoops;

	

	Len = 0;

	

	MaxLoops = ArraySize ( SecondaryItems );



	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\ySecondary Menu^n^n" );

	
	for ( Weapons = 0; Weapons < MaxLoops; Weapons ++ ) 

	{

		ArrayGetString ( SecondaryItems, Weapons, WeaponName, charsmax ( WeaponName ) )

		

		Len += formatex ( Menu [Len], charsmax ( Menu ) - Len, "\r%d. \w%s^n", Weapons + 1, WEAPONNAMES [ get_weaponid ( WeaponName ) ] )

	}

	

	Len += formatex ( Menu [Len], charsmax ( Menu ) - Len,  "^n^n\r0. \wExit" );

	

	show_menu ( id, KEYS_BUYMENU, Menu, -1, "Buy Menu 2" );

}



ShowMenuExtras ( id )

{

	static MenuID, Menu [128], Item, Team, Buffer [32];

	

	formatex ( Menu, charsmax ( Menu ), "\yExtra Items" );

	

	MenuID = menu_create ( Menu, "MenuExtras" );

	

	for ( Item = 0; Item < iExtraItem; Item ++ )

	{        

		Team = ArrayGetCell ( ExtraItemTeam_01, Item );



		if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && !( Team & ZP_TEAM_ZOMBIE ) ) || ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && !( Team & ZP_TEAM_HUMAN ) ) || ( IsNemesis [id] && !( Team & ZP_TEAM_NEMESIS ) ) || ( IsAssassin [id] && !( Team & ZP_TEAM_ASSASSIN ) ) || ( IsSurvivor [id] && !( Team & ZP_TEAM_SURVIVOR ) ) || ( IsSniper [id] && !( Team & ZP_TEAM_SNIPER ) ) ) continue;

		

		switch ( Item )

		{        

			case EXTRA_NVISION:

			{

				if ( !ExtraItems [EXTRA_NVISION] ) continue;



				formatex ( Buffer, charsmax ( Buffer ), "NightVision (single round)" );

			}

			case EXTRA_EXPLOSION_NADE:

			{

				if ( !ExtraItems [EXTRA_EXPLOSION_NADE] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Explosion Nade" );

			}

			case EXTRA_NAPALM_NADE:

			{

				if ( !ExtraItems [EXTRA_NAPALM_NADE] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Napalm Nade" );

			}

			case EXTRA_FROST_NADE:

			{

				if ( !ExtraItems [EXTRA_FROST_NADE] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Frost Nade" );

			}

			case EXTRA_AWP_MAGNUM_SNIPER:

			{

				if ( !ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "AWP Magnum Sniper" );

			}

			case EXTRA_M249_PARA_MACHINEGUN:

			{

				if ( !ExtraItems [EXTRA_M249_PARA_MACHINEGUN] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "M249 Para Machinegun" );

			}

			case EXTRA_SG550_AUTO_SNIPER:

			{

				if ( !ExtraItems [EXTRA_SG550_AUTO_SNIPER] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "SG550 Auto-Sniper" );

			}

			case EXTRA_G3SG1_AUTO_SNIPER:

			{

				if ( !ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "G3SG1 Auto-Sniper" );

			}

			case EXTRA_JETPACK:

			{

				if ( !ExtraItems [EXTRA_JETPACK] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Jetpack+Bazooka" );

			}

			case EXTRA_UNLIMITEDCLIP:

			{

				if ( !ExtraItems [EXTRA_UNLIMITEDCLIP] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Unlimited Clip" );

			}

			case EXTRA_ARMOR_100:

			{

				if ( !ExtraItems [EXTRA_ARMOR_100] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Armura (100)" );

			}

			case EXTRA_ARMOR_200:

			{

				if ( !ExtraItems [EXTRA_ARMOR_200] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Armura (200)" );

			}

			case EXTRA_MULTIJUMP:

			{

				if ( !ExtraItems [EXTRA_MULTIJUMP] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Multijump +1" );

			}

			case EXTRA_TRYDER:

			{

				if ( !ExtraItems [EXTRA_TRYDER] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Tryder" );

			}

			case EXTRA_SURVIVOR:

			{

				if ( !ExtraItems [EXTRA_SURVIVOR] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Survivor" );

			}

			case EXTRA_SNIPER:

			{

				if ( !ExtraItems [EXTRA_SNIPER] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Sniper" );

			}

			case EXTRA_NEMESIS:

			{

				if ( !ExtraItems [EXTRA_NEMESIS] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Nemesis" );

			}

			case EXTRA_ASSASSIN:

			{

				if ( !ExtraItems [EXTRA_ASSASSIN] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Cumpara Assassin" );

			}

			case EXTRA_ANTIDOTE:

			{

				if ( !ExtraItems [EXTRA_ANTIDOTE] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "T-Virus Antidote" );

			}

			case EXTRA_MADNESS:

			{

				if ( !ExtraItems [EXTRA_MADNESS] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Zombie Madness" );

			}

			case EXTRA_INFECTIONBOMB:

			{

				if ( !ExtraItems [EXTRA_INFECTIONBOMB] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Infection Bomb" );

			}

			case EXTRA_KNIFEBLINK:

			{

				if ( !ExtraItems [EXTRA_KNIFEBLINK] ) continue;

				

				formatex ( Buffer, charsmax ( Buffer ), "Knife Blink" );

			}

			default:

		         {

				ArrayGetString ( ExtraItemName_01, Item, Buffer, charsmax ( Buffer ) );

		         }

	         }                                                                                  

	

	         formatex ( Menu, charsmax ( Menu ), "%s \y%d ammo packs", Buffer, ArrayGetCell ( ExtraItemCost_01, Item ) );

	

	         Buffer [0] = Item;

	

	         Buffer [1] = 0;

	

	         menu_additem ( MenuID, Menu, Buffer );

        }



        if ( menu_items ( MenuID ) <= 0 )

        {

	         client_print_color ( id, print_team_default, "%s Extra Items are disabled.", CHAT_PREFIX );

	         

		menu_destroy ( MenuID );

	         

		return;

        }



        formatex ( Menu, charsmax ( Menu ), "Back" );

   

        menu_setprop ( MenuID, MPROP_BACKNAME, Menu );



        formatex ( Menu, charsmax ( Menu ), "More" );



        menu_setprop ( MenuID, MPROP_NEXTNAME, Menu );



        formatex ( Menu, charsmax ( Menu ), "Exit");

    

        menu_setprop ( MenuID, MPROP_EXITNAME, Menu );



        menu_display ( id, MenuID );

}



public ShowMenuZClass ( id )

{

         if ( !IsConnected [id] ) return;



	if ( IsBot [id] )

	{

		ZombieClassNext [id] = random_num ( 0, iZClass - 1 );

		

		return;

	}

	

	static MenuID, Menu [128], Class, Buffer_01 [32], Buffer_02 [32];

	

	formatex ( Menu, charsmax ( Menu ), "Zombie Class\y" );

	

	MenuID = menu_create ( Menu, "MenuZClass" );

	

	for ( Class = 0; Class < iZClass; Class ++ )

	{

		ArrayGetString ( ZClassName_01, Class, Buffer_01, charsmax ( Buffer_01 ) );

		

		ArrayGetString ( ZClassInfo_01, Class, Buffer_02, charsmax ( Buffer_02 ) );

		

		formatex ( Menu, charsmax ( Menu ), "%s\y [%s]", Buffer_01, Buffer_02 );

		

		Buffer_01 [0] = Class;

		

		Buffer_01 [1] = 0;

		

		menu_additem ( MenuID, Menu, Buffer_01 );

	}

	

	formatex ( Menu, charsmax ( Menu ), "Back" );

	

	menu_setprop ( MenuID, MPROP_BACKNAME, Menu );

	

	formatex ( Menu, charsmax ( Menu ), "More" );

	

	menu_setprop ( MenuID, MPROP_NEXTNAME, Menu );

	

	formatex ( Menu, charsmax ( Menu ), "Exit" );

	

	menu_setprop ( MenuID, MPROP_EXITNAME, Menu );

	

	menu_display ( id, MenuID );

}



public MenuGame ( id, key )

{

	switch ( key )

	{

		case 0: 

		{

			if ( CanBuy [id] ) ShowMenuBuy_01 ( id );

		}

		case 1: 

		{

			if ( IsAlive [id] )

					

				ShowMenuExtras ( id );

			else

				client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );

		}		

		case 2: 

		{

			ShowMenuZClass ( id );

		}

		case 3: 

		{

			if ( IsAlive [id] )

			{

				if ( is_player_stuck ( id ) )

				

					DoRandomSpawn ( id, 1 );

				else

					client_print_color ( id, print_team_default, "%s You are not stuck.", CHAT_PREFIX );

			}

			else

				client_print_color ( id, print_team_default, "%s Extra items are unavailable right now...", CHAT_PREFIX );

		}                

		case 4: 

		{

			if ( IsAlive [id] || fm_cs_get_user_team ( id ) == FM_CS_TEAM_SPECTATOR )

			{

				client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );

				

				return PLUGIN_HANDLED;

				

				/*CheckRound ( id );



				dllfunc ( DLLFunc_ClientKill, id );*/

			}



			SaveStats ( id );

			

			remove_task ( id + TASK_TEAM );

			remove_task ( id + TASK_MODEL );

			remove_task ( id + TASK_SPAWN );

			remove_task ( id + TASK_BLOOD );

			remove_task ( id + TASK_BURN );

			remove_task ( id + TASK_HEALTH );

			

			fm_cs_set_user_team ( id, FM_CS_TEAM_SPECTATOR );

			

			fm_user_team_update ( id );

		}

	}

	

	return PLUGIN_HANDLED;

}





public MenuBuy_01 ( id, key )

{

	if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] || IsTryder [id] ) return PLUGIN_HANDLED;

	

	if ( key >= MENU_KEY_BACK || WPN_SELECTION >= WPN_MAXIDS )

	{

		switch ( key )

		{

			case MENU_KEY_BACK: 

			{

				if ( WPN_STARTID + 7 >= WPN_MAXIDS ) 



				         WPN_STARTID = 0;

			}

			case MENU_KEY_NEXT: 

			{

				if ( WPN_STARTID + 7 < WPN_MAXIDS ) 

					

					WPN_STARTID += 7;

			}

			case MENU_KEY_EXIT: 

			{

				return PLUGIN_HANDLED;

			}

		}

		

		ShowMenuBuy_01 ( id );

		

		return PLUGIN_HANDLED;

	}

	

	BuyPrimaryWeapon ( id, WPN_SELECTION );



	ShowMenuBuy_02 ( id );

	

	return PLUGIN_HANDLED;

}



BuyPrimaryWeapon ( id, selection )

{

	drop_weapons ( id, 1 );

	drop_weapons ( id, 2 );



	fm_strip_user_weapons ( id );

	

	fm_give_item ( id, "weapon_knife" );



	static WeaponID, WName [32];

	

	ArrayGetString ( PrimaryItems, selection, WName, charsmax ( WName ) );

	

	WeaponID = get_weaponid ( WName );



	fm_give_item ( id, WName );

	

	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );



	CanBuy [id] = false;



	static i

	

	for ( i = 0; i < ArraySize ( AdditionalItems ); i ++ )

	{

		ArrayGetString ( AdditionalItems, i, WName, charsmax ( WName ) );

		

		fm_give_item ( id, WName );

	}

}



public MenuBuy_02 ( id, key )

{	

         if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] || IsSniper [id] ) return PLUGIN_HANDLED;

	

	if ( key >= ArraySize ( SecondaryItems ) )

	{

		if ( key != MENU_KEY_EXIT )

			

			ShowMenuBuy_02 ( id );

		

		return PLUGIN_HANDLED;

	}

	

	drop_weapons ( id, 2 );

	

	static WeaponID, WName [32];

	

	ArrayGetString ( SecondaryItems, key, WName, charsmax ( WName ) );

	

	WeaponID = get_weaponid ( WName );

	

	fm_give_item ( id, WName );

	

	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

	

	return PLUGIN_HANDLED;

}



public MenuExtras ( id, MenuID, item )

{

	if ( item == MENU_EXIT )

	{

		menu_destroy ( MenuID );

		

		return PLUGIN_HANDLED;

	}

	

	if ( !IsAlive [id] )

	{

		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );

		

		menu_destroy ( MenuID );

		

		return PLUGIN_HANDLED;

	}



	static Buffer [2], Dummy, ItemID;

	

	menu_item_getinfo ( MenuID, item, Dummy, Buffer, charsmax ( Buffer ), _, _, Dummy );

	

	ItemID = Buffer [0];



	BuyExtraItem ( id, ItemID );

	

	menu_destroy ( MenuID );

	

	return PLUGIN_HANDLED;

}





BuyExtraItem ( id, itemid, IgnoreCost = 0 )

{

	static Team; Team = ArrayGetCell ( ExtraItemTeam_01, itemid );

	

	if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && !( Team & ZP_TEAM_ZOMBIE ) ) || ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && !( Team & ZP_TEAM_HUMAN ) ) || ( IsNemesis [id] && !( Team & ZP_TEAM_NEMESIS ) ) || ( IsAssassin [id] && !( Team & ZP_TEAM_ASSASSIN ) ) || ( IsSurvivor [id] && !( Team & ZP_TEAM_SURVIVOR ) ) || ( IsSniper [id] && !( Team & ZP_TEAM_SNIPER ) ) )

	{

		client_print_color ( id, print_team_default, "%s Unavailable command.", CHAT_PREFIX );

		

		return;

	}

	

	if ( ( itemid == EXTRA_ANTIDOTE && ( EndRound || SwarmRound || NemesisRound || AssassinRound || SurvivorRound || SniperRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound || fnGetZombies (  ) <= 1 || fnGetHumans (  ) == 1 ) )  

	|| ( itemid == EXTRA_MADNESS && NoDamage [id] ) || ( itemid == EXTRA_INFECTIONBOMB && ( EndRound || SwarmRound || NemesisRound || AssassinRound || SurvivorRound || SniperRound || PlagueRound || ArmageddonRound || ApocalypseRound || NightmareRound ) ) )

	{

		client_print_color ( id, print_team_default, "%s You can't use this right now.", CHAT_PREFIX );

		

		return;

	}

	

	if ( !IgnoreCost )

	{

		if (AmmoPacks [id] < ArrayGetCell ( ExtraItemCost_01, itemid ) )

		{

			client_print_color ( id, print_team_default, "%s You dont have enough ammo packs.", CHAT_PREFIX );

			

			return;

		}

		

		AmmoPacks [id] -= ArrayGetCell ( ExtraItemCost_01, itemid );

	}

	

	switch ( itemid )

	{

		case EXTRA_NVISION:

		{

			NVision [id] = true;

			

			if ( !IsBot [id] )

			{

				NVisionEnabled [id] = true;

				

				if ( get_pcvar_num ( Zp_CustomNvg ) )

				{

					remove_task ( id + TASK_NVISION );

					

					set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" ); 

					

					set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

					

					ShowSyncHudMsg ( id, MsgSync_01, "You bought NightVision!" );

				}

				else

					SetUserGNvision ( id, 1 );

			}

			else

				cs_set_user_nvg ( id, 1 );

		}

		case EXTRA_EXPLOSION_NADE: 

		{

			if ( user_has_weapon ( id, CSW_HEGRENADE ) )

			{

				cs_set_user_bpammo ( id, CSW_HEGRENADE, cs_get_user_bpammo ( id, CSW_HEGRENADE ) + 1 );



				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );

				

				write_byte ( AMMOID [CSW_HEGRENADE] ); 

				

				write_byte ( 1 );

				

				message_end (  );

				

				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );

				

				return; 

			}

			

			fm_give_item ( id, "weapon_hegrenade" );

		}

		case EXTRA_NAPALM_NADE: 

		{

			if ( user_has_weapon ( id, CSW_FLASHBANG ) )

			{

				cs_set_user_bpammo ( id, CSW_FLASHBANG, cs_get_user_bpammo ( id, CSW_FLASHBANG ) + 1 );



				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );

				

				write_byte ( AMMOID [CSW_FLASHBANG] ); 

				

				write_byte ( 1 );

				

				message_end (  );

				

				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );

				

				return; 

			}

			

			fm_give_item ( id, "weapon_flashbang" );

		}

		case EXTRA_FROST_NADE: 

		{

			if ( user_has_weapon ( id, CSW_SMOKEGRENADE ) )

			{

				cs_set_user_bpammo ( id, CSW_SMOKEGRENADE, cs_get_user_bpammo ( id, CSW_SMOKEGRENADE ) + 1 );



				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );

				

				write_byte ( AMMOID [CSW_SMOKEGRENADE] ); 

				

				write_byte ( 1 );

				

				message_end (  );

				

				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );

				

				return; 

			}

			

			fm_give_item ( id, "weapon_smokegrenade" );

		}

		case EXTRA_AWP_MAGNUM_SNIPER:

		{

			new WeaponID = cs_weapon_name_to_id ( "weapon_awp" );

			

			if ( MAXBPAMMO [WeaponID] > 2 )

			{

				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )

		

					drop_weapons ( id, 1 );

				else

					drop_weapons ( id, 2 );



				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

			}



			fm_give_item ( id, "weapon_awp" );

		}

		case EXTRA_M249_PARA_MACHINEGUN:

		{

			new WeaponID = cs_weapon_name_to_id ( "weapon_m249" );

			

			if ( MAXBPAMMO [WeaponID] > 2 )

			{

				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )

		

					drop_weapons ( id, 1 );

				else

					drop_weapons ( id, 2 );



				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

			}



			fm_give_item ( id, "weapon_m249" );

		}

		case EXTRA_SG550_AUTO_SNIPER:

		{

			new WeaponID = cs_weapon_name_to_id ( "weapon_sg550" );

			

			if ( MAXBPAMMO [WeaponID] > 2 )

			{

				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )

		

					drop_weapons ( id, 1 );

				else

					drop_weapons ( id, 2 );



				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

			}



			fm_give_item ( id, "weapon_sg550" );

		}

		case EXTRA_G3SG1_AUTO_SNIPER:

		{

			new WeaponID = cs_weapon_name_to_id ( "weapon_g3sg1" );

			

			if ( MAXBPAMMO [WeaponID] > 2 )

			{

				if ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM )

		

					drop_weapons ( id, 1 );

				else

					drop_weapons ( id, 2 );



				ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [WeaponID], AMMOTYPE [WeaponID], MAXBPAMMO [WeaponID] );

			}



			fm_give_item ( id, "weapon_g3sg1" );

		}

		case EXTRA_JETPACK:

		{

		         new Clip, Ammo;

	                  

			new Weapon = get_user_weapon ( id, Clip, Ammo );

			

			set_hudmessage ( 255, 168, 25, -1.0, 0.80, 1, 0.0, 5.0, 1.0, 1.0, -1) 

		         

			ShowSyncHudMsg ( 0, MsgSync_01, "%s bought a Jetpack!!", PlayerName [id] );

			

			client_print_color ( id, print_team_grey, "%s Press^3 -CTRL+SPACE-^1 to fly!", CHAT_PREFIX );

		  

		         client_print_color ( id, print_team_grey, "%s Press^3 -RIGHT CLICK-^1 to shoot!", CHAT_PREFIX );

			

			HasJet [id] = 1;

			

			FlyEnergy [id] = get_pcvar_num ( Zp_FlyMaxEngery );

			

			Rocket [id] = true;

			

			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyJetpack, 1.0, ATTN_NORM, 0, PITCH_NORM ); 

			

			//client_cmd ( id,"spk items/gunpickup2.wav")

			

			if ( Weapon == CSW_KNIFE )

			{

				SwitchModel ( id );

			}

			else

			{

				engclient_cmd ( id, "weapon_knife" ), SwitchModel ( id );

			}    

		}

		case EXTRA_UNLIMITEDCLIP:

		{

			HasUnlimitedClip [id] = true;



			set_hudmessage ( 255, 215, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 )

			

			ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Unlimited Clip", PlayerName [id] );

			

			client_print_color ( id, print_team_grey, "%s^3 %s^1, you bought^4 Unlimited Clip", CHAT_PREFIX, PlayerName [id] );

	         }

		case EXTRA_ARMOR_100:

		{

			set_hudmessage ( 0, 0, 255, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( id, MsgSync_01, "%s, you have been equiped with Armor (100ap)", PlayerName [id] );

			

			client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Armor (100ap)", CHAT_PREFIX, PlayerName [id] );



			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + 100, 600 ) ) );

			

			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyArmor, 1.0, ATTN_NORM, 0, PITCH_NORM ); 

		}

		case EXTRA_ARMOR_200:

		{

			set_hudmessage ( 0, 0, 255, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( id, MsgSync_01, "%s, you have been equiped with Armor (200ap)", PlayerName [id] );

			

			client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Armor (200ap)", CHAT_PREFIX, PlayerName [id] );



			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + 200, 600 ) ) );

			

			engfunc ( EngFunc_EmitSound, id, CHAN_BODY, SoundBuyArmor, 1.0, ATTN_NORM, 0, PITCH_NORM ); 

		}

		case EXTRA_MULTIJUMP:

		{

			MultiJumps [id] ++;



			set_hudmessage ( 235, 156, 9, -1.0, 0.6, 1, 0.0, 5.0, 1.0, 1.0, -1 )

			

			ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Multijump,^nMaxjumps: %d", PlayerName [id], MultiJumps [id] );

				

			client_print_color ( id, print_team_grey, "%s^3 %s^1, you bought^4 Multijump^1, maxjumps:^4 %d", CHAT_PREFIX, PlayerName [id], MultiJumps [id] );

		}

		case EXTRA_TRYDER:

		{

			fm_strip_user_weapons ( id );



			fm_set_rendering ( id, kRenderFxGlowShell, 150, 0, 255, kRenderNormal, 10 );

		

			fm_give_item ( id, "weapon_knife" ); 

		

			fm_give_item ( id, "weapon_ak47" );

		

			fm_give_item ( id, "weapon_g3sg1" );

		

			fm_give_item ( id, "weapon_m4a1" );

			

			fm_give_item ( id, "weapon_xm1014" );

			

			fm_give_item ( id, "weapon_sg550" );

			

			fm_give_item ( id, "weapon_deagle" );

			

			fm_give_item ( id, "weapon_hegrenade" );

			

			fm_give_item ( id, "weapon_flashbang" );

			

			fm_give_item ( id, "weapon_smokegrenade" );

		

			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AK47], AMMOTYPE [CSW_AK47], MAXBPAMMO [CSW_AK47] );

			

			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_G3SG1], AMMOTYPE [CSW_G3SG1], MAXBPAMMO [CSW_G3SG1] );

			

			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_M4A1], AMMOTYPE [CSW_M4A1], MAXBPAMMO [CSW_M4A1] );

			

			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_XM1014], AMMOTYPE [CSW_XM1014], MAXBPAMMO [CSW_XM1014] );

			

			ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_DEAGLE], AMMOTYPE [CSW_DEAGLE], MAXBPAMMO [CSW_DEAGLE] );

		

			HasUnlimitedClip [id] = true;



			IsTryder [id] = true;

		

		         set_pev ( id, pev_gravity, 0.5 );	

		  

			fm_set_user_health ( id, get_pcvar_num ( Zp_TryderHealth ) );



			set_pev ( id, pev_armorvalue, float ( min ( pev ( id, pev_armorvalue ) + get_pcvar_num ( Zp_TryderArmor ), 600 ) ) );

		

			set_hudmessage ( 212, 0, 177, -1.0, 0.72, 1, 0.0, 5.0, 1.0, 1.0, -1)

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s is now a Tryder !!", PlayerName [id] );

		

			client_print_color ( 0, print_team_grey, "%s^3 %s^1 is now a^4 Tryder", CHAT_PREFIX, PlayerName [id] );

		}

		case EXTRA_SURVIVOR:

		{ 

			if ( native_has_round_started (  ) || EndRound )

	                  {

		                  client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );

		

		                  return;

	                  }

			  

			remove_task ( TASK_MAKEZOMBIE );

			  

			cmdMakeZombie ( MODE_SURVIVOR, id );

			

		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Survivor", CHAT_PREFIX, PlayerName [id] );

		

		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Survivor !", PlayerName [id] );

		

		         LogToFile ( "%s bought Survivor", PlayerName [id] );

		}

		case EXTRA_SNIPER:

		{

			if ( native_has_round_started (  ) || EndRound )

	                  {

		                  client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );

		

		                  return;

	                  }

			  

			remove_task ( TASK_MAKEZOMBIE );

			  

			cmdMakeZombie ( MODE_SNIPER, id );



		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Sniper", CHAT_PREFIX, PlayerName [id] );

		

		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Nemesis !", PlayerName [id] );

		

		         LogToFile ( "%s bought Survivor", PlayerName [id] );

		}

		case EXTRA_NEMESIS:

		{

			if ( native_has_round_started (  ) || EndRound )

	                  {

		                 client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );

		

		                  return;

	                  }

			  

			remove_task ( TASK_MAKEZOMBIE );

			  

			cmdMakeZombie ( MODE_NEMESIS, id );

			

		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Nemesis", CHAT_PREFIX, PlayerName [id] );

		

		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Nemesis !", PlayerName [id] );

		

		         LogToFile ( "%s bought Survivor", PlayerName [id] );

		}

		case EXTRA_ASSASSIN:

		{

			if ( native_has_round_started (  ) || EndRound )

	                  {

		                 client_print_color ( id, print_team_default, "%s This item can only be bought before the round mode starts", CHAT_PREFIX );

		

		                  return;

	                  }

			

			remove_task ( TASK_MAKEZOMBIE );

			  

			cmdMakeZombie ( MODE_ASSASSIN, id );			



		         client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Assassin", CHAT_PREFIX, PlayerName [id] );

		

		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		         ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Assassin !", PlayerName [id] );

		

		         LogToFile ( "%s bought Survivor", PlayerName [id] );

		}

		case EXTRA_ANTIDOTE: 

		{

			UserHuman ( id, 0, 0, 0 );

		}

		case EXTRA_MADNESS: 

		{

			client_print_color ( 0, print_team_grey, "%s^3 %s^1 bought^4 Zombie Madness", CHAT_PREFIX, PlayerName [id] );

			

			set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 )

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s bought Zombie Madness!", PlayerName [id] );

			

			NoDamage [id] = true;

			

			fm_set_rendering ( id, kRenderFxGlowShell, 100, 0, 0, kRenderNormal, 200 );

			

			set_task ( get_pcvar_float ( Zp_MadnessDuration ), "MadnessOver", id + TASK_BLOOD );

			

			static Sound [64];

			

			ArrayGetString ( ZombieMadness, random_num ( 0, ArraySize ( ZombieMadness ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

		}

		case EXTRA_INFECTIONBOMB: 

		{

			set_hudmessage ( 255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( id, MsgSync_01, "You bought Infection Bomb!" );

			

			if ( user_has_weapon ( id, CSW_HEGRENADE ) )

			{

				cs_set_user_bpammo ( id, CSW_HEGRENADE, cs_get_user_bpammo ( id, CSW_HEGRENADE ) + 1 );



				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "AmmoPickup" ), _, id );

				

				write_byte ( AMMOID [CSW_HEGRENADE] ); 

				

				write_byte ( 1 );

				

				message_end (  );

				

				emit_sound ( id, CHAN_ITEM, SoundBuyAmmo, 1.0, ATTN_NORM, 0, PITCH_NORM );

				

				return; 

			}

			

			fm_give_item ( id, "weapon_hegrenade" );

		}

		case EXTRA_KNIFEBLINK:

		{

		         iBlinks [id] += 5

			 

		         set_hudmessage ( 255, 0, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		         ShowSyncHudMsg ( id, MsgSync_01, "%s, you bought Knife Blinks ", PlayerName [id] );

		

		         client_print_color ( id, print_team_grey, "%s ^3%s^1, you bought^4 Knife Blinks", CHAT_PREFIX, PlayerName [id] );

	         }

		default:

		{

			ExecuteForward ( fwExtraItemSelected, fwDummyResult, id, itemid );

		

			if ( fwDummyResult >= ZP_PLUGIN_HANDLED && !IgnoreCost )

		

				AmmoPacks [id] += ArrayGetCell ( ExtraItemCost_01, itemid );

		}

	}

}



public MenuZClass ( id, MenuID, Item )

{

	if ( Item == MENU_EXIT )

	{

		menu_destroy ( MenuID );

		

		return PLUGIN_HANDLED;

	}

	

	static Buffer [2], Dummy, ClassID;

	

	menu_item_getinfo ( MenuID,Item, Dummy, Buffer, charsmax ( Buffer ), _, _, Dummy );

	

	ClassID = Buffer [0];



	ZombieClassNext [id] = ClassID;

	

	static Name [32];

	

	ArrayGetString ( ZClassName_01, ZombieClassNext [id], Name, charsmax ( Name ) );

	

	static HealthString [16];

	

	AddCommas ( ArrayGetCell ( ZClassHealth_01, ZombieClassNext [id] ), HealthString, charsmax ( HealthString ) );

	

	client_print_color ( id, print_team_default, "%s Your zombie class after the next infection will be:^4 %s", CHAT_PREFIX, Name );

	

	client_print_color ( id, print_team_default, "%s Health:^4 %s^1 | Speed:^4 %d^1 | Gravity:^4 %d^1 | Knockback:^4 %d%%", CHAT_PREFIX, HealthString, ArrayGetCell ( ZClassSpeed_01, ZombieClassNext [id] ),

	

	floatround ( Float: ArrayGetCell ( ZClassGravity_01, ZombieClassNext [id] ) * 800.0 ), floatround ( Float: ArrayGetCell ( ZClassKnockback_01, ZombieClassNext [id] ) * 100.0 ) );

	

	menu_destroy ( MenuID );

	

	return PLUGIN_HANDLED;

}



public cmdMadeZombie ( id )

{

	if ( NewRound )

	{

		if ( !access ( id, AccessFlag [ACCESS_MODE_INFECTION] ) )

		

		return PLUGIN_HANDLED;

	}

	else

	{

                  if ( !access ( id, AccessFlag [ACCESS_MAKE_ZOMBIE] ) )

		  

	          return PLUGIN_HANDLED;

	}

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_zombie (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedZombie ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandZombie ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdMadeTryder ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MAKE_HUMAN] ) ) return PLUGIN_HANDLED;

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_tryder (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( IsTryder [Player] || IsZombie [Player] || IsNemesis [Player] || IsAssassin [Player] || IsSurvivor [Player] || IsSniper [Player] )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandTryder ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdMadeHuman ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MAKE_HUMAN] ) ) return PLUGIN_HANDLED;

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_human (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedHuman ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandHuman ( id, Player );

	

	return PLUGIN_HANDLED;
}



public cmdMadeNemesis ( id )

{

	if ( NewRound )

	{

		if ( !access ( id, AccessFlag [ACCESS_MODE_NEMESIS] ) ) return PLUGIN_HANDLED;

	}

	else

	{

                  if ( !access ( id, AccessFlag [ACCESS_MAKE_NEMESIS] ) ) return PLUGIN_HANDLED;

	}

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_nemesis (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedNemesis ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandNemesis ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdMadeAssassin ( id )

{

	if ( NewRound )

	{

		if ( !access ( id, AccessFlag [ACCESS_MODE_ASSASSIN] ) ) return PLUGIN_HANDLED;

	}

	else

	{

                  if ( !access ( id, AccessFlag [ACCESS_MAKE_ASSASSIN] ) ) return PLUGIN_HANDLED;

	}

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_assassin (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedAssassin ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandAssassin ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdMadeSurvivor ( id )

{

	if ( NewRound )

	{

		if ( !access ( id, AccessFlag [ACCESS_MODE_SURVIVOR] ) ) return PLUGIN_HANDLED;

	}

	else

	{

                  if ( !access ( id, AccessFlag [ACCESS_MAKE_SURVIVOR] ) ) return PLUGIN_HANDLED;

	}

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_survivor (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedSurvivor ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandSurvivor ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdMadeSniper ( id )

{

	if ( NewRound )

	{

		if ( !access ( id, AccessFlag [ACCESS_MODE_SNIPER] ) ) return PLUGIN_HANDLED;

	}

	else

	{

                  if ( !access ( id, AccessFlag [ACCESS_MAKE_SNIPER] ) ) return PLUGIN_HANDLED;

	}

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_sniper (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedSniper ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandSniper ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdRespawn ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_RESPAWN_PLAYERS] ) ) return PLUGIN_HANDLED;

	

	if ( read_argc (  ) < 2 )

	{

		console_print ( id, "* Usage: 'zp_respawn (Name)'" );

		

		return PLUGIN_HANDLED;

	}

	

	static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )

	

	new Player = cmd_target ( id, Arg, CMDTARGET_ALLOW_SELF );

	

	if ( !Player ) return PLUGIN_HANDLED;

	

	if ( IsAlive [Player] )

	{

		console_print ( id, "* Player ^"%s^" is alive !", PlayerName [Player] );

		

		return PLUGIN_HANDLED;

	}

	

	if ( !CheckAllowedRespawn ( Player ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandRespawn ( id, Player );

	

	return PLUGIN_HANDLED;

}



public cmdSwarm ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_SWARM] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedSwarm (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandSwarm ( id )

	

	return PLUGIN_HANDLED;

}



public cmdMulti ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_MULTI] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedMulti (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandMulti ( id )

	

	return PLUGIN_HANDLED;

}



public cmdPlague ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_PLAGUE] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedPlague (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandPlague ( id )

	

	return PLUGIN_HANDLED;

}



public cmdArmageddon ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_ARMAGEDDON] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedArmageddon (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandArmageddon ( id )

	

	return PLUGIN_HANDLED;

}



public cmdApocalypse ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_APOCALYPSE] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedApocalypse (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandApocalypse ( id )

	

	return PLUGIN_HANDLED;

}



public cmdNightmare ( id )

{

         if ( !access ( id, AccessFlag [ACCESS_MODE_NIGHTMARE] ) ) return PLUGIN_HANDLED;

	

	if ( !CheckAllowedNightmare (  ) )

	{

		console_print ( id, "* Unavailable command." );

		

		return PLUGIN_HANDLED;

	}

	

	CommandNightmare ( id )

	

	return PLUGIN_HANDLED;

}



public MessageCurWeapon ( MsgID, MsgDest, MsgEntity )

{

	if ( !IsAlive [MsgEntity] || IsZombie [MsgEntity] ) return;

	

	if ( get_msg_arg_int ( 1 ) != 1 ) return;

	

	if ( IsSurvivor [MsgEntity] ? !get_pcvar_num ( Zp_SurvivorInfiniteAmmo ) : IsSniper [MsgEntity] ? !get_pcvar_num ( Zp_SniperInfiniteAmmo ) : !HasUnlimitedClip [MsgEntity] ) return;	

	

	static Weapon, Clip;

	

	Weapon = get_msg_arg_int ( 2 );

	

	Clip = get_msg_arg_int ( 3 );



	if ( MAXCLIP [Weapon] > 2 )

	{

		set_msg_arg_int ( 3, get_msg_argtype ( 3 ), MAXCLIP [Weapon] );

		

		if ( Clip < 2 )

		{

			static WName [32], WeaponEnt;

			

			get_weaponname ( Weapon, WName, sizeof WName - 1 );

			

			WeaponEnt = fm_find_ent_by_owner ( -1, WName, MsgEntity );



			fm_set_weapon_ammo ( WeaponEnt, MAXCLIP [Weapon] );

		}		

	}	

}



public MessageMoney ( Msg_ID, MsgDest, MsgEntity )

{

	fm_cs_set_user_money ( MsgEntity, 0 );

	

	return PLUGIN_HANDLED;

}



public MessageHealth ( MsgID, MsgDest, MsgEntity )

{

	static Health; Health = get_msg_arg_int ( 1 );

	

	if ( Health < 256 ) return;

	

	if ( Health % 256 == 0 ) fm_set_user_health ( MsgEntity, pev ( MsgEntity, pev_health ) + 1 );

	

	set_msg_arg_int ( 1, get_msg_argtype ( 1 ), 255 );

}



public MessageScreenFade ( MsgID, MsgDest, MsgEntity )

{

	if ( get_msg_arg_int ( 4 ) != 255 || get_msg_arg_int ( 5 ) != 255 || get_msg_arg_int ( 6 ) != 255 || get_msg_arg_int ( 7 ) < 200 ) return PLUGIN_CONTINUE;

	

	if ( IsZombie [MsgEntity] && !IsNemesis [MsgEntity] && !IsAssassin [MsgEntity] )

	{

		set_msg_arg_int ( 4, get_msg_argtype ( 4 ), 0 );

		

		set_msg_arg_int ( 5, get_msg_argtype ( 5 ), 120 );

		

		set_msg_arg_int ( 6, get_msg_argtype ( 6 ), 240 );

		

		return PLUGIN_CONTINUE;

	}

	

	return PLUGIN_HANDLED;

}



public MessageNvgToggle (  ) return PLUGIN_HANDLED;



public MessageWeaponPickup ( MsgID, MsgDest, MsgEntity )

{

	if ( IsZombie [MsgEntity] ) return PLUGIN_HANDLED;

	

	return PLUGIN_CONTINUE;

}



public MessageAmmoPickup ( MsgID, MsgDest, MsgEntity )

{

	if ( IsZombie [MsgEntity] ) return PLUGIN_HANDLED;

	

	return PLUGIN_CONTINUE;

}



public MessageScenario (  )

{

	if ( get_msg_args (  ) > 1 )

	{

		static Sprite [8]; get_msg_arg_string ( 2, Sprite, charsmax ( Sprite ) );

		

		if ( equal ( Sprite, "hostage" ) ) return PLUGIN_HANDLED;

	}

	

	return PLUGIN_CONTINUE;

}



public MessageHostagePos (  ) return PLUGIN_HANDLED;





public MessageTextMsg (  )

{

	static Msg [22]; get_msg_arg_string ( 2, Msg, charsmax ( Msg ) );

	

	if ( equal ( Msg, "#Game_will_restart_in" ) )

	{

		ScoreHumans = 0;

		

		ScoreZombies = 0;

		

		leRoundEnd (  );

	}

	else if ( equal ( Msg, "#Hostages_Not_Rescued" ) || equal ( Msg, "#Round_Draw" ) || equal ( Msg, "#Terrorists_Win" ) || equal ( Msg, "#CTs_Win" ) )

	

		return PLUGIN_HANDLED;

	

	if ( get_msg_args (  ) == 5 )

	{

		if ( get_msg_argtype ( 5 ) == ARG_STRING )

		{

			new Value_01 [64]; get_msg_arg_string ( 5, Value_01, charsmax ( Value_01 ) );

			

			if ( equal ( Value_01, "#Fire_in_the_hole" ) )



				return PLUGIN_HANDLED;

		}

	}

	else if ( get_msg_args (  ) == 6 )

	{

		if ( get_msg_argtype ( 6 ) == ARG_STRING )

		{

			new Value_02 [64]; get_msg_arg_string ( 6, Value_02, charsmax ( Value_02 ) );

			

			if ( equal ( Value_02, "#Fire_in_the_hole" ) )

				

				return PLUGIN_HANDLED;

		}

	}

	

	return PLUGIN_CONTINUE;

}



public MessageSendAudio (  )

{

	static Audio [17]; get_msg_arg_string ( 2, Audio, charsmax ( Audio ) );

	

	if ( equal ( Audio [7], "terwin") || equal ( Audio [7], "ctwin") || equal ( Audio [7], "rounddraw" ) ) 



	          return PLUGIN_HANDLED;

	

	if ( get_msg_args (  ) == 3 )

	{

		if ( get_msg_argtype ( 2 ) == ARG_STRING )

		{

			new Value [64]; get_msg_arg_string ( 2, Value, charsmax ( Value ) );

			

			if ( equal ( Value, "%!MRAD_FIREINHOLE" ) )



			         return PLUGIN_HANDLED;

		}

	}

	

	return PLUGIN_CONTINUE;

}



public MessageTeamScore (  )

{

	static Team [2]; get_msg_arg_string ( 1, Team, charsmax ( Team ) );

	

	switch ( Team [0] )

	{

		case 'C': set_msg_arg_int ( 2, get_msg_argtype ( 2 ), ScoreHumans );



		case 'T': set_msg_arg_int ( 2, get_msg_argtype ( 2 ), ScoreZombies );

	}

}



public MessageTeamInfo ( MsgID, MsgDest )

{

	if ( MsgDest != MSG_ALL && MsgDest != MSG_BROADCAST ) return;

	

	if ( SwitchingTeam ) return;



	static id; id = get_msg_arg_int ( 1 );

	

	set_task ( 0.2, "SpecNVision", id );

	

	if ( NewRound ) return;



	static Team [2]; get_msg_arg_string ( 2, Team, charsmax ( Team ) );

	

	switch ( Team [0] )

	{

		case 'C':

		{

			if ( ( SurvivorRound && fnGetHumans (  ) ) || ( SniperRound && fnGetHumans (  ) ) )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_T );

				

				set_msg_arg_string ( 2, "TERRORIST" );

			}

			else if ( !fnGetZombies (  ) )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_T );

				

				set_msg_arg_string ( 2, "TERRORIST" );

			}

		}

		case 'T':

		{

			if ( fnGetZombies (  ) )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

				

				set_msg_arg_string ( 2, "CT" );

			}

		}

	}

}



public MakeZombieTask (  ) cmdMakeZombie ( MODE_NONE, 0 );



cmdMakeZombie ( Mode, id )

{

	static iPlayersNum; iPlayersNum = fnGetAlive (  );



	if ( iPlayersNum < 1 )

	{

		set_task ( 2.0, "MakeZombieTask", TASK_MAKEZOMBIE );

		

		return;

	}

	

	NewRound = false;

	

	static ForwardID, Sound [64], iZombies, iMaxZombies;

	

	if ( ( Mode == MODE_NONE && ( LastMode != MODE_SURVIVOR ) && random_num ( 1, get_pcvar_num ( Zp_SurvivorChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_SurvivorMinPlayers ) ) || Mode == MODE_SURVIVOR )

	{

		SurvivorRound = true;

		

		LastMode = MODE_SURVIVOR;



		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );

		

		ForwardID = id;

		

		UserHuman ( id, 1, 0, 0 );



		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] ) continue;



			if ( IsSurvivor [id] || IsZombie [id] ) continue;

			

			UserZombie ( id, 0, 0, 0, 1, 0 );

		}

		

		ArrayGetString ( SoundSurvivor, random_num ( 0, ArraySize ( SoundSurvivor ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		set_hudmessage ( 20, 20, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 )

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%s is Survivor!", PlayerName [ForwardID] );

		

		ModeStarted = true;

		

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SURVIVOR, ForwardID );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_SNIPER ) && random_num ( 1, get_pcvar_num ( Zp_SniperChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_SniperMinPlayers ) ) || Mode == MODE_SNIPER )

	{

		SniperRound = true;

		

		LastMode = MODE_SNIPER;

		

		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );

		

		ForwardID = id;



		UserHuman ( id, 0, 1, 0 );

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] ) continue;



			if ( IsSniper [id] || IsZombie [id] ) continue;

			

			UserZombie ( id, 0, 0, 0, 1, 0 );

		}



		ArrayGetString ( SoundSniper, random_num ( 0, ArraySize ( SoundSniper ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );



		set_hudmessage ( 20, 255, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "%s is Sniper!", PlayerName [ForwardID] );

		

		ModeStarted = true;

		

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SNIPER, ForwardID );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_SWARM ) && random_num ( 1, get_pcvar_num ( Zp_SwarmChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_SwarmMinPlayers ) ) || Mode == MODE_SWARM )

	{		

		SwarmRound = true;

		

		LastMode = MODE_SWARM;

		

		iMaxZombies = floatround ( iPlayersNum * 0.5, floatround_ceil );

		

		iZombies = 0;

		

		while ( iZombies < iMaxZombies )

		{

			if ( ++ id > MaxPlayers ) id = 1;

			

			if ( !IsAlive [id] || IsZombie [id] ) continue;

			

			if ( random_num ( 0, 1 ) )

			{

				UserZombie ( id, 0, 0, 0, 1, 0 );

				

				iZombies ++;

			}

		}

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsZombie [id] ) continue;

			

			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

				

				fm_user_team_update ( id );

			}

		}

		

		ArrayGetString ( SoundSwarm, random_num ( 0, ArraySize ( SoundSwarm ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		set_hudmessage ( 20, 255, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Swarm Round!" );

		

		ModeStarted = true;

		

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_SWARM, 0 );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_MULTI ) && random_num ( 1, get_pcvar_num ( Zp_MultiChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_MultiMinPlayers ) ) || Mode == MODE_MULTI )

	{

		LastMode = MODE_MULTI;

		

		iMaxZombies = floatround ( iPlayersNum * 0.5, floatround_ceil );

		

		iZombies = 0;



		while ( iZombies < iMaxZombies )

		{

			if ( ++ id > MaxPlayers ) id = 1;



			if ( !IsAlive [id] || IsZombie [id] ) continue;

			

			if ( random_num ( 0, 1 ) )

			{

				UserZombie ( id, 0, 0, 0, 1, 0 );

				

				iZombies ++;

			}

		}

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsZombie [id] ) continue;



			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

				

				fm_user_team_update ( id );

			}

		}

		

		ArrayGetString ( SoundMulti, random_num ( 0, ArraySize ( SoundMulti ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		set_hudmessage ( 255, 50, 0, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Multiple Infection!" );



		ModeStarted = true;



		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_MULTI, 0 );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_PLAGUE ) && random_num ( 1, get_pcvar_num ( Zp_PlagueChance ) ) == 1 && 

	floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) >= 1 && 

	iPlayersNum - ( get_pcvar_num ( Zp_PlagueSurvivorNum ) + get_pcvar_num ( Zp_PlagueNemesisNum ) + floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) ) >= 1 && 

	iPlayersNum >= get_pcvar_num ( Zp_PlagueMinPlayers ) ) || Mode == MODE_PLAGUE )

	{

		PlagueRound = true;

		

		LastMode = MODE_PLAGUE;

		

		static iSurvivors, iMaxSurvivors;

		

		iMaxSurvivors = get_pcvar_num ( Zp_PlagueSurvivorNum );

		

		iSurvivors = 0;

		

		while ( iSurvivors < iMaxSurvivors )

		{

			id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );

			

			if ( IsSurvivor [id] ) continue;

			

			UserHuman ( id, 1, 0, 0 );

			

			iSurvivors ++;



			fm_set_user_health ( id, get_pcvar_num ( Zp_PlagueSurvivorHealth ) )

		}

		

		static iNemesis, iMaxNemesis;

		

		iMaxNemesis = get_pcvar_num ( Zp_PlagueNemesisNum );

		

		iNemesis = 0;

		

		while ( iNemesis < iMaxNemesis )

		{

			id = fnGetRandomAlive ( random_num(1, iPlayersNum))

			

			if ( IsSurvivor [id] || IsNemesis [id] ) continue;

			

			UserZombie ( id, 0, 1, 0, 0, 0 );

			

			iNemesis ++;

			

			fm_set_user_health ( id, get_pcvar_num ( Zp_PlagueNemesisHealth ) );

		}

		

		iMaxZombies = floatround ( ( iPlayersNum - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil );

		

		iZombies = 0;

		

		while ( iZombies < iMaxZombies )

		{

			if ( ++ id > MaxPlayers ) id = 1;

			

			if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] ) continue;

			

			if ( random_num ( 0, 1 ) )

			{

				UserZombie ( id, 0, 0, 0, 1, 0 );

				

				iZombies ++;

			}

		}

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsZombie [id] || IsSurvivor [id] ) continue;

			

			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_CT);

				

				fm_user_team_update ( id );

			}

		}



		ArrayGetString ( SoundPlague, random_num ( 0, ArraySize ( SoundPlague ) - 1 ), Sound, charsmax ( Sound ) )

		

		PlaySound ( Sound );

		

		set_hudmessage ( 0, 50, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Plague Round!" );



		ModeStarted = true;



		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_PLAGUE, 0 );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_ARMAGEDDON ) && random_num ( 1, get_pcvar_num ( Zp_ArmageddonChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_ArmageddonMinPlayers ) ) || Mode == MODE_ARMAGEDDON )

	{		

		ArmageddonRound = true;

		

		LastMode = MODE_ARMAGEDDON;

		

		static iSurvivors, iMaxSurvivors;

		

		iMaxSurvivors = floatround ( iPlayersNum * 0.5, floatround_ceil );

		

		iSurvivors = 0;

		

		while ( iSurvivors < iMaxSurvivors )

		{

			if ( ++ id > MaxPlayers ) id = 1;



			if ( !IsAlive [id] || IsSurvivor [id] ) continue;

			

			if ( random_num ( 0, 1 ) )

			{

				UserHuman ( id, 1, 0, 0 );

				

				iSurvivors ++;		



				fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseSurvivorHealth ) );

			}

		}



		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsSurvivor [id] ) continue;



			UserZombie ( id, 0, 1, 0, 0, 0 );			

			

			fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseNemesisHealth ) );

		}

		

		ArrayGetString ( SoundArmageddon, random_num ( 0, ArraySize ( SoundArmageddon ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );



		set_hudmessage ( 155, 20, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Armageddon Round!" );		



		ModeStarted = true;



		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_ARMAGEDDON, 0 );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_APOCALYPSE ) && random_num ( 1, get_pcvar_num ( Zp_ApocalypseChance ) ) == 1 && floatround ( iPlayersNum * 0.5, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.5, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_ApocalypseMinPlayers ) ) || Mode == MODE_APOCALYPSE )

	{		

		ApocalypseRound = true;

		

		LastMode = MODE_APOCALYPSE;

		

		static iSnipers, iMaxSnipers;

		

		iMaxSnipers = floatround ( iPlayersNum * 0.5, floatround_ceil )

		

		iSnipers = 0;

		

		while ( iSnipers < iMaxSnipers )

		{

			if ( ++ id > MaxPlayers ) id = 1;

			

			if ( !IsAlive [id] || IsSniper [id] ) continue;

			

			if ( random_num ( 0, 1 ) )

			{

				UserHuman ( id, 0, 1, 0 );

				

				iSnipers ++;		

				

				fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseSniperHealth ) );

			}

		}

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsSniper [id] ) continue;

			

			UserZombie ( id, 0, 0, 1, 0, 0 )	;		

			

			fm_set_user_health ( id, get_pcvar_num ( Zp_ApocalypseAssassinHealth ) );

		}



		ArrayGetString ( SoundApocalypse, random_num ( 0, ArraySize ( SoundApocalypse ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		set_hudmessage ( 255, 20, 155, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Assassins vs. Snipers Round!" );

		

		ModeStarted = true;



		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_APOCALYPSE, 0 );

	}

	else if ( ( Mode == MODE_NONE && ( LastMode != MODE_NIGHTMARE ) && random_num ( 1, get_pcvar_num ( Zp_NightmareChance ) ) == 1 && floatround ( iPlayersNum * 0.2, floatround_ceil ) >= 2 && floatround ( iPlayersNum * 0.2, floatround_ceil ) < iPlayersNum && iPlayersNum >= get_pcvar_num ( Zp_NightmareMinPlayers ) ) || Mode == MODE_NIGHTMARE )

	{

		NightmareRound = true;

	

		LastMode = MODE_NIGHTMARE;

	

		iMaxZombies = floatround ( ( iPlayersNum * 0.2 ), floatround_ceil );

	

		iZombies = 0

	

		while ( iZombies < iMaxZombies )

		{

			if ( ( ++ id ) > MaxPlayers ) id = 1;

		

			if ( !IsAlive [id] ) continue;

		

			if ( random_num ( 0, 1 ) )

			{

				UserZombie ( id, 0, 1, 0, 0, 0 );

			

				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareAssassinHealth ) );

				//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightassahpmulti)))

			

				iZombies ++;

			}

		}

	

		iZombies = 0

	

		while ( iZombies < iMaxZombies )

		{

			if ( ( ++ id ) > MaxPlayers ) id = 1;

		

			if ( !IsAlive [id] || IsAssassin [id] ) continue;

		

			if ( random_num ( 0, 1 ) )

			{

				UserZombie ( id, 0, 0, 1, 0, 0 );

			

				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareNemesisHealth ) );

				//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightnemhpmulti)))

			

				iZombies ++;

			}

		}

	

		iZombies = 0

	

		while ( iZombies < iMaxZombies )

		{

			if ( ( ++ id ) > MaxPlayers ) id = 1;

		

			if ( !IsAlive [id] || IsAssassin [id] || IsNemesis [id] ) continue;

		

			if ( random_num ( 0,  1 ) )

			{

				UserHuman ( id, 1, 0, 0 );

			

				fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareSurvivorHealth ) );

			//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightsurvhpmulti)))

			

				iZombies++

			}

		}

	

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] || IsAssassin [id] || IsNemesis [id] || IsSurvivor [id] ) continue;

		

			UserHuman ( id, 0, 1, 0 );

		

			fm_set_user_health ( id, get_pcvar_num ( Zp_NightmareSniperHealth ) );		         

			//fm_set_user_health(id, floatround(float(pev(id, pev_health)) * get_pcvar_float(cvar_nightsniphpmulti)))

		}

	

		ArrayGetString ( SoundNightmare, random_num ( 0, ArraySize ( SoundNightmare ) - 1 ), Sound, charsmax ( Sound ) );

		

		PlaySound ( Sound );

		

		set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

		

		ShowSyncHudMsg ( 0, MsgSync_01, "Nightmare Round !" );		

		

		ModeStarted = true;

		

		ExecuteForward ( fwRoundStart, fwDummyResult, MODE_NIGHTMARE, 0 );



	}

	else

	{

		LastMode = MODE_INFECTION;

		

		if ( Mode == MODE_NONE ) id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) );



		ForwardID = id;

		

		if ( ( Mode == MODE_NONE && ( LastMode != MODE_NEMESIS ) && random_num ( 1, get_pcvar_num ( Zp_NemesisChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_NemesisMinPlayers ) ) || Mode == MODE_NEMESIS )

		{

			NemesisRound = true;

			

			LastMode = MODE_NEMESIS;

			

			UserZombie ( id, 0, 1, 0, 0, 0 );

		}

		else if ( ( Mode == MODE_NONE && ( LastMode != MODE_ASSASSIN ) && random_num ( 1, get_pcvar_num ( Zp_AssassinChance ) ) == 1 && iPlayersNum >= get_pcvar_num ( Zp_AssassinMinPlayers ) ) || Mode == MODE_ASSASSIN )

		{

			AssassinRound = true;

			

			LastMode = MODE_ASSASSIN;



			UserZombie ( id, 0, 0, 1, 0, 0 ); 

		}

		else

		{

			LastMode = MODE_INFECTION;



			UserZombie ( id, 0, 0, 0, 0, 0 );

		}

		

		for ( id = 1; id <= MaxPlayers; id ++ )

		{

			if ( !IsAlive [id] ) continue;

			

			if ( IsZombie [id] ) continue;

			

			if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

			{

				remove_task ( id + TASK_TEAM );

				

				fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

				

				fm_user_team_update ( id );

			}

		}		

		

		if ( NemesisRound )

		{

			ArrayGetString ( SoundNemesis, random_num ( 0, ArraySize ( SoundNemesis ) - 1 ), Sound, charsmax ( Sound ) );

			

			PlaySound ( Sound );

			

			set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s is Nemesis !", PlayerName [ForwardID] );



			ModeStarted = true;			



			ExecuteForward ( fwRoundStart,  fwDummyResult, MODE_NEMESIS, ForwardID );

		}

		else if ( AssassinRound )

		{

			ArrayGetString ( SoundAssassin, random_num ( 0, ArraySize ( SoundAssassin ) - 1 ), Sound, charsmax ( Sound ) );

			

			PlaySound ( Sound );



			set_hudmessage ( 255, 255, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s is Assassin !", PlayerName [ForwardID] );

			

			ModeStarted = true;



			ExecuteForward ( fwRoundStart, fwDummyResult, MODE_ASSASSIN, ForwardID );

		}

		else

		{

			set_hudmessage ( 255, 20, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s is First Zombie !", PlayerName [ForwardID] );

			

			ModeStarted = true;

			

			ExecuteForward ( fwRoundStart, fwDummyResult, MODE_INFECTION, ForwardID );

		} 

	}  



	if ( ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && NemesisRound ) || 

	( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && AssassinRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && SurvivorRound ) || 

	( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && SniperRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && SwarmRound ) || 

	( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && PlagueRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && ArmageddonRound ) || 

	( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && ApocalypseRound ) || ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && NightmareRound ) || 

	( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && !NemesisRound && !AssassinRound && !SurvivorRound && !SniperRound && !SwarmRound && !PlagueRound && !ArmageddonRound && !ApocalypseRound && !NightmareRound ) )

	{

		remove_task ( TASK_AMBIENCESOUNDS );

		

		set_task ( 2.0, "AmbienceSoundEffects", TASK_AMBIENCESOUNDS );

	}	

}



UserZombie ( id, Infector, Nemesis, Assassin, SilentMode, Rewards )

{

	ExecuteForward ( fwUserInfectAttempt, fwDummyResult, id, Infector, Nemesis );

	

	if ( fwDummyResult >= ZP_PLUGIN_HANDLED && ModeStarted && fnGetZombies (  ) > LastPlayerLeaving ) return;

	

	ExecuteForward ( fwUserInfectedPre, fwDummyResult, id, Infector, Nemesis );

	

	if ( ZombieClassNext [id] == ZCLASS_NONE ) set_task ( 0.2, "ShowMenuZClass", id );



	ZombieClass [id] = ZombieClassNext [id];

	

	if ( ZombieClass [id] == ZCLASS_NONE ) ZombieClass [id] = 0;

	

	IsZombie [id] = true;

	

	IsNemesis [id] = false;

	

	IsAssassin [id] = false;

	

	IsSurvivor [id] = false;

	

	IsSniper [id] = false;

	

	FirstZombie [id] = false;

	

	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_BRIGHTLIGHT );

	

	NoDamage [id] = false;

	

	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_NODRAW );

	

	BurningDuration [id] = 0;



	if ( Rewards && Infector )

	{

		SendDeathMsg ( Infector, id );

		

		FixDeadAttrib ( id );

		

		UpdateFrags ( Infector, id, 1, 1, 1 );

		

		AmmoPacks [Infector] += get_pcvar_num ( Zp_AmmoInfect );

	}

	

	ZombieSpeed [id] = float ( ArrayGetCell ( ZClassSpeed_01, ZombieClass [id] ) );

	

	ZombieKnockback [id] = Float:ArrayGetCell ( ZClassKnockback_01, ZombieClass [id] );

	

	ArrayGetString ( ZClassName_01, ZombieClass [id], ZombieClassName [id], charsmax ( ZombieClassName [ ] ) );



	static Sound [64];

	

	if ( !SilentMode )

	{

		if ( Nemesis )

		{

			IsNemesis [id] = true;



			if ( get_pcvar_num ( Zp_NemesisHealth ) < 50000 )

			

				fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, 0 ) * fnGetAlive (  ) );

			else

				fm_set_user_health ( id, get_pcvar_num ( Zp_NemesisHealth ) );



			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_NemesisGravity ) );

		}

		else if ( Assassin )

		{

			IsAssassin [id] = true;



			if ( get_pcvar_num ( Zp_AssassinHealth ) < 15000 )

			

				fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, 0 ) * fnGetAlive (  ) );

			else

				fm_set_user_health ( id, get_pcvar_num ( Zp_AssassinHealth ) );

			

			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_AssassinGravity ) );

		}

		else if ( fnGetZombies (  ) == 1 )

		{

			FirstZombie [id] = true;



			fm_set_user_health ( id, floatround ( float ( ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) ) * 1.0 ) );

			

			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );



			ArrayGetString ( ZombieInfect, random_num ( 0, ArraySize ( ZombieInfect ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

		}

		else

		{

			fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) )

			

			if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );

			

			ArrayGetString ( ZombieInfect, random_num ( 0, ArraySize ( ZombieInfect ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

			

			set_hudmessage ( 255, 20, 20, 0.05, 0.45, 0, 0.0, 5.0, 1.0, 1.0, -1 );

			

			if ( Infector )

			

				ShowSyncHudMsg ( 0, MsgSync_01, "%s's brains has been eaten by %s...", PlayerName [id], PlayerName [Infector] );

			else

				ShowSyncHudMsg ( 0, MsgSync_01, "%s's brains has been eaten...", PlayerName [id] );

		}

	}

	else

	{

		fm_set_user_health ( id, ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) )

		

		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, Float: ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );

	}



	remove_task ( id + TASK_MODEL );

	

	remove_task ( id + TASK_BLOOD );

	

	remove_task ( id + TASK_BURN );

	

	if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_T )

	{

		remove_task ( id + TASK_TEAM );

		

		fm_cs_set_user_team ( id, FM_CS_TEAM_T);

		

		fm_user_team_update ( id );

	}



	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;

	

	AlreadyHasModel = false;

	

	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );



	if ( IsNemesis [id] && GetModels [NEMESIS] )

	{

		size = ArraySize ( ModelNemesis );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelNemesis, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0, size - 1 );

			

			ArrayGetString ( ModelNemesis, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else if ( IsAssassin [id] && GetModels [ASSASSIN] )

	{

		size = ArraySize ( ModelAssassin );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelAssassin, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0, size - 1 );

				

			ArrayGetString ( ModelAssassin, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else

	{

		for ( i = ArrayGetCell ( ZClassModelsStart_01, ZombieClass [id] ); i < ArrayGetCell ( ZClassModelSend_01, ZombieClass [id] ); i ++ )

		{

			ArrayGetString ( ZClassPlayerModel_01, i, TempModel, charsmax ( TempModel ) );

					

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

				

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( ArrayGetCell ( ZClassModelsStart_01, ZombieClass [id] ), ArrayGetCell ( ZClassModelSend_01, ZombieClass [id] ) - 1 );

				

			ArrayGetString ( ZClassPlayerModel_01, iRandom, PlayerModel[ id], charsmax ( PlayerModel [ ] ) );

		}

	}

		

	if ( !AlreadyHasModel )

	{

		if ( NewRound )

			

			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );

		else

			fmUserModelUpdate ( id + TASK_MODEL );

	}

		

	if ( !IsFrozen [id] )

	{

		if ( IsNemesis [id] )



		         fm_set_rendering ( id, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 25  );

			//fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

			

		else if ( IsAssassin [id] )



			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

		else

			fm_set_rendering ( id );

	}



	cs_set_user_zoom ( id, CS_RESET_ZOOM, 1 );

	

	set_pev ( id, pev_armorvalue, 0.0 );

	

	drop_weapons ( id, 1 );

	

	drop_weapons ( id, 2 );

	

	fm_strip_user_weapons ( id );

	

	fm_give_item ( id, "weapon_knife" );

	

	InfectionEffects ( id );

	

	if ( get_pcvar_num ( Zp_NvgGive ) )

	{

		NVision [id] = true;

		

		if ( !IsBot [id] )

		{

			if ( get_pcvar_num ( Zp_NvgGive ) == 1 )

			{

				NVisionEnabled [id] = true;

				

				if ( get_pcvar_num ( Zp_CustomNvg ) )

				{

					remove_task ( id + TASK_NVISION );

					

					set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );

				}

				else

					SetUserGNvision ( id, 1 );

			}



			else if ( NVisionEnabled [id] )

			{

				if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );

				

				else SetUserGNvision ( id, 0 );

				

				NVisionEnabled [id] = false;

			}

		}

		else

			cs_set_user_nvg ( id, 1 );

	}

	else if ( NVision [id] )

	{

		if ( IsBot [id] ) cs_set_user_nvg ( id, 0 )

		

		if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );

		

		else if ( NVisionEnabled [id] ) SetUserGNvision ( id, 0 );

			

		NVision [id] = false;

		

		NVisionEnabled [id] = false;

	}

	

	if ( !IsNemesis [id] && !IsNemesis [id] && get_pcvar_num ( Zp_ZombieBleeding ) ) set_task ( 0.7, "MakeBlood", id + TASK_BLOOD, _, _, "b" );

	

	if ( !IsNemesis [id] && !IsAssassin [id] ) set_task ( random_float ( 50.0, 70.0 ), "ZombiePlayIdle", id + TASK_BLOOD, _, _, "b" );

	

	ExecuteForward ( fwUserInfectedPost, fwDummyResult, id, Infector, Nemesis );

	

	fnCheckLastZombie (  );

}



UserHuman ( id, Survivor, Sniper, SilentMode )

{



	ExecuteForward ( fwUserHumanizeAttempt, fwDummyResult, id, Survivor )

	

	if ( fwDummyResult >= ZP_PLUGIN_HANDLED && ModeStarted && fnGetHumans (  ) > LastPlayerLeaving ) return;

	

	ExecuteForward ( fwUserHumanizedPre, fwDummyResult, id, Survivor );



	remove_task ( id + TASK_MODEL );

	

	remove_task ( id + TASK_BLOOD );

	

	remove_task ( id + TASK_BURN );

	

	remove_task ( id + TASK_NVISION );



	IsZombie [id] = false;

	

	IsNemesis [id] = false;

	

	IsAssassin [id] = false;

	

	IsSurvivor [id] = false;

	

	IsSniper [id] = false;

	

	FirstZombie [id] = false;

	

	CanBuy [id] = true;

	

	NVision [id] = false;

	

	NVisionEnabled [id] = false;

	

	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_BRIGHTLIGHT );

	

	NoDamage [id] = false;

	

	set_pev ( id, pev_effects, pev ( id, pev_effects ) &~ EF_NODRAW );

	

	BurningDuration [id] = 0;

	

	drop_weapons ( id, 1 );

	

	drop_weapons ( id, 2 );



	fm_strip_user_weapons ( id );

	

	fm_give_item ( id, "weapon_knife" );



	if ( Survivor )

	{

		IsSurvivor [id] = true;

		

		if ( get_pcvar_num ( Zp_SurvivorHealth ) < 3500 )



			fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) * fnGetAlive (  ) );

		else

			fm_set_user_health ( id, get_pcvar_num ( Zp_SurvivorHealth ) );

		

		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SurvivorGravity ) );

		                  

		fm_give_item ( id, "weapon_xm1014" );

		fm_give_item ( id, "weapon_ak47" );

		fm_give_item ( id, "weapon_m4a1" );

		

		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_XM1014], AMMOTYPE [CSW_XM1014], MAXBPAMMO [CSW_XM1014] );               

		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AK47], AMMOTYPE [CSW_AK47], MAXBPAMMO [CSW_AK47] );                

		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_M4A1], AMMOTYPE [CSW_M4A1], MAXBPAMMO [CSW_M4A1] );                       		

	}

	else if ( Sniper )

	{

		IsSniper [id] = true

		

		if ( get_pcvar_num ( Zp_SniperHealth ) < 2000 )



			fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) * fnGetAlive (  ) );

		else

			fm_set_user_health ( id, get_pcvar_num ( Zp_SniperHealth ) );

		

		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SniperGravity ) );

			

		fm_give_item ( id, "weapon_awp" ) ;               

		

		ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [CSW_AWP], AMMOTYPE [CSW_AWP], MAXBPAMMO [CSW_AWP] );               	

	}

	else

	{

		fm_set_user_health ( id, get_pcvar_num ( Zp_HumanHealth ) );		

		

		if ( !IsFrozen [id] ) set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );		

		

		set_task ( 0.2, "ShowMenuBuy_01", id + TASK_SPAWN );



		if ( !SilentMode )

		{

			static Sound [64];

			

			ArrayGetString ( SoundAntidote, random_num ( 0, ArraySize ( SoundAntidote ) - 1 ), Sound, charsmax ( Sound ) );

			

			emit_sound ( id, CHAN_ITEM, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

			

			set_hudmessage ( 20, 155, 255, 0.05, 0.45, 0, 0.0, 5.0, 1.0, 1.0, -1 );

			

			ShowSyncHudMsg ( 0, MsgSync_01, "%s has used an antidote...", PlayerName [id] )

		}

	}



	if ( fm_cs_get_user_team ( id ) != FM_CS_TEAM_CT )

	{

		remove_task ( id + TASK_TEAM );

		

		fm_cs_set_user_team ( id, FM_CS_TEAM_CT);

		

		fm_user_team_update ( id );

	}



	static CurrentModel [32], TempModel [32], AlreadyHasModel, i, iRandom, size;

	

	AlreadyHasModel = false;

	

	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) );

		

	if ( IsSurvivor [id] && GetModels [SURVIVOR] )

	{

		size = ArraySize ( ModelSurvivor );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelSurvivor, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0, size - 1 );

				

			ArrayGetString ( ModelSurvivor, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else if ( IsSniper [id] && GetModels [SNIPER] )

	{

		size = ArraySize ( ModelSniper );

			

		for ( i = 0; i < size; i ++ )

		{

			ArrayGetString ( ModelSniper, i, TempModel, charsmax ( TempModel ) );

				

			if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

		}

			

		if ( !AlreadyHasModel )

		{

			iRandom = random_num ( 0, size - 1 );

				

			ArrayGetString ( ModelSniper, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

		}

	}

	else

	{

		if ( GetModels [OWNER] && ( get_user_flags ( id ) & AccessFlag [ACCESS_OWNER_MODELS] ) )

		{

			size = ArraySize ( ModelOwnerHuman );

				

			for ( i = 0; i < size; i ++ )

			{

				ArrayGetString ( ModelOwnerHuman, i, TempModel, charsmax ( TempModel ) )

					

				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

			}

				

			if ( !AlreadyHasModel )

			{

				iRandom = random_num ( 0, size - 1 );

					

				ArrayGetString ( ModelOwnerHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

			}				

		}

		else if ( GetModels [ADMIN] && ( get_user_flags ( id ) & AccessFlag [ACCESS_ADMIN_MODELS] ) )

		{

			size = ArraySize ( ModelAdminHuman );

				

			for ( i = 0; i < size; i ++ )

			{

				ArrayGetString ( ModelAdminHuman, i, TempModel, charsmax ( TempModel ) )

				

				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

			}

				

			if ( !AlreadyHasModel )

			{

				iRandom = random_num ( 0, size - 1 );

					

				ArrayGetString ( ModelAdminHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

			}				

		}

		else 

		{

			size = ArraySize ( ModelHuman );

				

			for ( i = 0; i < size; i ++ )

			{

				ArrayGetString ( ModelHuman, i, TempModel, charsmax ( TempModel ) )

					

				if ( equal ( CurrentModel, TempModel ) ) AlreadyHasModel = true;

			}

				

			if ( !AlreadyHasModel )

			{

				iRandom = random_num ( 0, size - 1 );

					

				ArrayGetString ( ModelHuman, iRandom, PlayerModel [id], charsmax ( PlayerModel [ ] ) );

			}

		}

	}

		

	if ( !AlreadyHasModel )

	{

		if ( NewRound )

			

			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );

		else

			fmUserModelUpdate ( id + TASK_MODEL );

	}

		

	if ( !IsFrozen [id] )

	{

		if ( IsSurvivor [id] || IsSniper [id] )



			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

		else

			fm_set_rendering ( id );

	}



	if ( IsBot [id] ) cs_set_user_nvg ( id, 0 );

	

	else if ( !get_pcvar_num ( Zp_CustomNvg ) && NVisionEnabled [id] ) SetUserGNvision ( id, 0 );

		

	ExecuteForward ( fwUserHumanizedPost, fwDummyResult, id, Survivor );



	fnCheckLastZombie (  );

}



public CacheCvars (  )

{      	

	CachedHumanSpeed = get_pcvar_float ( Zp_HumanSpeed );

	

	CachedNemesisSpeed = get_pcvar_float ( Zp_NemesisSpeed );

	

	CachedAssassinSpeed = get_pcvar_float ( Zp_AssassinSpeed );

	

	CachedSurvivorSpeed = get_pcvar_float ( Zp_SurvivorSpeed );

	

	CachedSniperSpeed = get_pcvar_float ( Zp_SniperSpeed );



	CachedLeapNemesis = get_pcvar_num ( Zp_LeapNemesis );

	

	CachedLeapNemesisCooldown = get_pcvar_float ( Zp_LeapNemesisCooldown );

}



LoadCustomizationFromFiles (  )

{

	new Path [64]; get_configsdir ( Path, charsmax ( Path ) );



	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_CUSTOMIZATION_FILE );



	if ( !file_exists ( Path ) )

	{

		new Error [100]; formatex ( Error, charsmax ( Error ), "Cannot load customization file %s!", Path );

	

		set_fail_state ( Error );

	

		return;

	}



	new LineData [1024], Key [64], Value [960], Section, Teams, i, Buffer [100];



	new File = fopen ( Path, "rt" );



	while ( File && !feof ( File ) )

	{

		fgets ( File, LineData, charsmax ( LineData ) );

	

		replace ( LineData, charsmax ( LineData ), "^n", "" );

	

		if ( !LineData [0] || LineData [0] == ';' ) continue;

	

		if ( LineData [0] == '[' )

		{

			Section ++;

		

			continue;

		}

	

		strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );

	

		trim ( Key );

		trim ( Value );

	

		switch ( Section )

		{

			case SECTION_ACCESS_FLAGS:

			{

				if ( equal ( Key, "START MODE INFECTION"))

					

					AccessFlag [ACCESS_MODE_INFECTION] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE NEMESIS"))

					

					AccessFlag [ACCESS_MODE_NEMESIS] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE ASSASSIN"))

					

					AccessFlag [ACCESS_MODE_ASSASSIN] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE SURVIVOR"))

					

					AccessFlag [ACCESS_MODE_SURVIVOR] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE SNIPER"))

					

					AccessFlag [ACCESS_MODE_SNIPER] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE SWARM"))

							

					AccessFlag [ACCESS_MODE_SWARM] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE MULTI"))

					

					AccessFlag [ACCESS_MODE_MULTI] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE PLAGUE"))

					

					AccessFlag [ACCESS_MODE_PLAGUE] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE ARMAGEDDON"))

					

					AccessFlag [ACCESS_MODE_ARMAGEDDON] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE APOCALYPSE"))

					

					AccessFlag [ACCESS_MODE_APOCALYPSE] = read_flags ( Value );

				

				else if ( equal ( Key, "START MODE NIGHTMARE"))

					

					AccessFlag [ACCESS_MODE_NIGHTMARE] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE ZOMBIE"))

					

					AccessFlag [ACCESS_MAKE_ZOMBIE] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE HUMAN"))

					

					AccessFlag [ACCESS_MAKE_HUMAN] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE NEMESIS"))

					

					AccessFlag [ACCESS_MAKE_NEMESIS] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE ASSASSIN"))

					

					AccessFlag [ACCESS_MAKE_ASSASSIN] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE SURVIVOR"))

					

					AccessFlag [ACCESS_MAKE_SURVIVOR] = read_flags ( Value );

				

				else if ( equal ( Key, "MAKE SNIPER"))

					

					AccessFlag [ACCESS_MAKE_SNIPER] = read_flags ( Value );

				

				else if ( equal ( Key, "RESPAWN PLAYERS"))

					

					AccessFlag [ACCESS_RESPAWN_PLAYERS] = read_flags ( Value );

				

				else if ( equal ( Key, "OWNER MODELS"))

					

					AccessFlag [ACCESS_OWNER_MODELS] = read_flags ( Value );

				

				else if ( equal ( Key, "ADMIN MODELS" ) )

				

					AccessFlag [ACCESS_ADMIN_MODELS] = read_flags ( Value );

			}

			case SECTION_PLAYER_MODELS:

			{

				if ( equal ( Key, "HUMAN" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ModelHuman, Key );

					}

				}

				else if ( equal ( Key, "NEMESIS" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [NEMESIS] = false;

					}

					else

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [NEMESIS] = true;

							

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelNemesis, Key );

							

							for ( i = 0; i < ArraySize ( ModelNemesis ); i ++ )

							{

								ArrayGetString( ModelNemesis, i, Buffer, charsmax ( Buffer ) );

		

								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



								engfunc ( EngFunc_PrecacheModel, Buffer );

								

								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "ASSASSIN" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [ASSASSIN] = false;

					}

					else

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [ASSASSIN] = true;

							

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelAssassin, Key );

							

							for ( i = 0; i < ArraySize ( ModelAssassin ); i ++ )

							{

								ArrayGetString ( ModelAssassin, i, Buffer, charsmax ( Buffer ) );

		

								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



								engfunc ( EngFunc_PrecacheModel, Buffer );

								

								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "SURVIVOR" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [SURVIVOR] = false;

					}

					else

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [SURVIVOR] = true;

							

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelSurvivor, Key );

						

							for ( i = 0; i < ArraySize ( ModelSurvivor); i ++ )

							{

								ArrayGetString( ModelSurvivor, i, Buffer, charsmax ( Buffer ) );

		

								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );

		

		                                                       engfunc ( EngFunc_PrecacheModel, Buffer );

		

								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "SNIPER" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [SNIPER] = false;

					}

					else

					{	

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [SNIPER] = true;

							

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelSniper, Key );

	

                                                                for ( i = 0; i < ArraySize ( ModelSniper ); i ++ )

	                                                       {

                                                                      	 ArrayGetString( ModelSniper, i, Buffer, charsmax ( Buffer ) );

		

                                                                      	 format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



								 engfunc ( EngFunc_PrecacheModel, Buffer );	 

									 

                                                                      	 if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

                                                                      	 if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "OWNER HUMAN" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [OWNER] = false;

					}

					else

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [OWNER] = true;

							

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelOwnerHuman, Key );

							

							for ( i = 0; i < ArraySize ( ModelOwnerHuman ); i ++ )

							{

								ArrayGetString ( ModelOwnerHuman, i, Buffer, charsmax ( Buffer ) );

		

								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



								engfunc ( EngFunc_PrecacheModel, Buffer );

								

								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "ADMIN HUMAN" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						GetModels [ADMIN] = false;

					}

					else

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

						{

							GetModels [ADMIN] = true;

						

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( ModelAdminHuman, Key );



							for ( i = 0; i < ArraySize ( ModelAdminHuman ); i ++ )

							{

								ArrayGetString ( ModelAdminHuman, i, Buffer, charsmax ( Buffer ) );

		

								format ( Buffer, charsmax ( Buffer ), "models/player/%s/%s.mdl", Buffer, Buffer );



								engfunc ( EngFunc_PrecacheModel, Buffer );

								

								if ( ForceConsistency == 1) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, Buffer ); 

		

								if ( ForceConsistency == 2) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, Buffer );

							}

						}

					}

				}

				else if ( equal ( Key, "FORCE CONSISTENCY" ) )

					

					ForceConsistency = str_to_num ( Value );

			}

			case SECTION_WEAPON_MODELS:

			{				

				if ( equal ( Key, "V_KNIFE HUMAN" ) )

					

					copy ( ModelVKnifeHuman, charsmax ( ModelVKnifeHuman ), Value );

				

				else if ( equal ( Key, "V_KNIFE NEMESIS" ) )

					

					copy ( ModelVKnifeNemesis, charsmax ( ModelVKnifeNemesis ), Value );

				

				else if ( equal ( Key, "V_KNIFE ASSASSIN"))

					

					copy ( ModelVKnifeAssassin, charsmax ( ModelVKnifeAssassin ), Value );

				

				else if ( equal ( Key, "V_XM1014 SURVIVOR"))

					

					copy ( ModelVxm1014Survivor, charsmax ( ModelVxm1014Survivor ), Value );

				

				else if ( equal ( Key, "P_XM1014 SURVIVOR"))

					

					copy ( ModelPxm1014Survivor, charsmax ( ModelPxm1014Survivor ), Value );

				

				else if ( equal ( Key, "V_AK47 SURVIVOR"))

					

					copy ( ModelVak47Survivor, charsmax ( ModelVak47Survivor ), Value );

				

				else if ( equal ( Key, "P_AK47 SURVIVOR"))

					

					copy ( ModelPak47Survivor, charsmax ( ModelPak47Survivor ), Value );

				

				else if ( equal ( Key, "V_M4A1 SURVIVOR"))

					

					copy ( ModelVm4a1Survivor, charsmax ( ModelVm4a1Survivor ), Value );

				

				else if ( equal ( Key, "P_M4A1 SURVIVOR"))

					

					copy ( ModelPm4a1Survivor, charsmax ( ModelPm4a1Survivor ), Value );

				

				else if ( equal ( Key, "V_AWP SNIPER"))

					

					copy ( ModelVawpSniper, charsmax ( ModelVawpSniper ), Value );

				

				else if ( equal ( Key, "P_AWP SNIPER"))

					

					copy ( ModelPawpSniper , charsmax ( ModelPawpSniper ), Value );

				

				else if ( equal ( Key, "GRENADE INFECT"))

					

					copy ( ModelGrenadeInfect, charsmax ( ModelGrenadeInfect ), Value );

				

				else if ( equal ( Key, "GRENADE EXPLODE"))

					

					copy ( ModelGrenadeExplode, charsmax ( ModelGrenadeExplode ), Value );

				

				else if ( equal ( Key, "GRENADE FIRE"))

					

					copy( ModelGrenadeFire, charsmax ( ModelGrenadeFire ), Value );

				

				else if ( equal ( Key, "GRENADE FROST"))

					

					copy ( ModelGrenadeFrost, charsmax ( ModelGrenadeFrost ), Value );

				

				else if ( equal ( Key, "ROCKET MODEL" ) )

					

					copy ( RocketModel, charsmax ( RocketModel ), Value );

				

				else if ( equal ( Key, "TRIP MINE VIEW"))

					

					copy ( ModelTripMine, charsmax ( ModelTripMine ), Value );

			}

			case SECTION_SOUNDS:

			{

				if ( equal ( Key, "WIN ZOMBIES" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundWinZombies, Key );

					}

				}

				else if ( equal ( Key, "WIN HUMANS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundWinHumans, Key );

					}

				}

				else if ( equal ( Key, "WIN NO ONE" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundWinNoOne, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE INFECT" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ZombieInfect, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE PAIN" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ZombiePain, Key );

					}

				}

				else if ( equal ( Key, "NEMESIS PAIN" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( NemesisPain, Key );

					}

				}

				else if ( equal ( Key, "ASSASSIN PAIN" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( AssassinPain, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE DIE" ) )

				{

					while ( Value[0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ZombieDie, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE FALL" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ZombieFall, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE MISS SLASH" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieMissSlash, Key );

					}

				}

				else if (equal( Key, "ZOMBIE MISS WALL"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieMissWall, Key );

					}

				}

				else if (equal(Key, "ZOMBIE HIT NORMAL"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieHitNormal, Key );

					}

				}

				else if (equal(Key, "ZOMBIE HIT STAB"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieHitStab, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE IDLE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieIdle, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE IDLE LAST"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieIdleLast, Key );

					}

				}

				else if ( equal ( Key, "ZOMBIE MADNESS"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( ZombieMadness, Key );

					}

				}

				else if ( equal ( Key, "ROUND NEMESIS"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundNemesis, Key );

					}

				}

				else if ( equal ( Key, "ROUND ASSASSIN"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundAssassin, Key );

					}

				}

				else if ( equal ( Key, "ROUND SURVIVOR"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundSurvivor, Key );

					}

				}

				else if ( equal ( Key, "ROUND SNIPER"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundSniper, Key );

					}

				}

				else if (equal( Key, "ROUND SWARM"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundSwarm, Key );

					}

				}

				else if ( equal( Key, "ROUND MULTI"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundMulti,Key );

					}

				}

				else if ( equal ( Key, "ROUND PLAGUE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundPlague, Key );

					}

				}

				else if ( equal ( Key, "ROUND ARMAGEDDON"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundArmageddon, Key );

					}

				}

				else if (equal( Key, "ROUND APOCALYPSE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundApocalypse, Key );

					}

				}

				else if ( equal ( Key, "ROUND NIGHTMARE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundNightmare, Key );

					}

				}

				else if (equal(Key, "GRENADE INFECT EXPLODE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeInfect, Key );

					}

				}

				else if (equal(Key, "GRENADE INFECT PLAYER"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeInfectPlayer, Key );

					}

				}

				else if (equal( Key, "GRENADE EXPLODE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeExplode, Key );

					}

				}

				else if (equal(Key, "GRENADE FIRE EXPLODE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeFire, Key );

					}

				}

				else if ( equal ( Key, "GRENADE FIRE PLAYER"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeFirePlayer, Key );

					}

				}

				else if (equal(Key, "GRENADE FROST EXPLODE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeFrost, Key );

					}

				}

				else if (equal(Key, "GRENADE FROST PLAYER"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeFrostPlayer, Key );

					}

				}

				else if (equal(Key, "GRENADE FROST BREAK"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( GrenadeFrostBreak, Key );

					}

				}				

				else if (equal(Key, "ANTIDOTE"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundAntidote, Key );

					}

				}

			}

			case SECTION_AMBIENCE_SOUNDS:

			{

				if ( equal ( Key, "INFECTION ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && equal ( Key, "INFECTION SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_01, Key );

						

						ArrayPushCell ( SoundAmbienceMp3_01, equal ( Key [strlen ( Key ) -4], ".mp3") ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_INFECTION] && equal ( Key, "INFECTION DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key ); 

						

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_01, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "NEMESIS ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && equal ( Key, "NEMESIS SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_02, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_02, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NEMESIS] && equal(Key, "NEMESIS DURATIONS"))

				{

					while ( Value[0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_02, str_to_num ( Key ) )

					}

				}

				else if ( equal ( Key, "ASSASSIN ENABLE"))

					

					AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && equal ( Key, "ASSASSIN SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax (Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_03, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_03, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ASSASSIN] && equal ( Key, "ASSASSIN DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ','))

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_03, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "SURVIVOR ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SURVIVOR] && equal ( Key, "SURVIVOR SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_04, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_04, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds[AMBIENCE_SOUNDS_SURVIVOR] && equal( Key, "SURVIVOR DURATIONS"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_04, str_to_num ( Key ) )

					}

				}

				else if ( equal ( Key, "SNIPER ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SNIPER] && equal ( Key, "SNIPER SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_05, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_05, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds[AMBIENCE_SOUNDS_SNIPER] && equal ( Key, "SNIPER DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_05, str_to_num ( Key ) )

					}

				}

				else if ( equal ( Key, "SWARM ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_SWARM] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && equal ( Key, "SWARM SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_06, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_06, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_SWARM] && equal ( Key, "SWARM DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_06, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "PLAGUE ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && equal ( Key, "PLAGUE SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_07, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_07, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_PLAGUE] && equal ( Key, "PLAGUE DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_07, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "ARMAGEDDON ENABLE" ) )

					

					AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && equal ( Key, "ARMAGEDDON SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_08, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_08, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_ARMAGEDDON] && equal ( Key, "ARMAGEDDON DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_08, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "APOCALYPSE ENABLE" ) )
					

				AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && equal ( Key, "APOCALYPSE SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_09, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_09, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_APOCALYPSE] && equal ( Key, "APOCALYPSE DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_09, str_to_num ( Key ) );

					}

				}

				else if ( equal ( Key, "NIGHTMARE ENABLE" ) )

					

				AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] = str_to_num ( Value )

				

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && equal ( Key, "NIGHTMARE SOUNDS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( SoundAmbience_10, Key )

						

						ArrayPushCell ( SoundAmbienceMp3_10, equal ( Key [strlen ( Key ) -4], ".mp3" ) ? 1 : 0 );

					}

				}

				else if ( AmbienceSounds [AMBIENCE_SOUNDS_NIGHTMARE] && equal ( Key, "NIGHTMARE DURATIONS" ) )

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushCell ( SoundAmbienceDuration_10, str_to_num ( Key ) );

					}

				}

			}

			case SECTION_HARD_CODED_ITEMS_COSTS:

			{

				if ( equal ( Key, "NIGHT VISION" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_NVISION] = false;

					}

					else

					{

						ExtraItems [EXTRA_NVISION] = true;

						

						ExtraCosts [EXTRA_NVISION] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "EXPLOSION NADE" ) )

				{

				         if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_EXPLOSION_NADE] = false;

					}

					else

					{

						ExtraItems [EXTRA_EXPLOSION_NADE] = true;

						

						ExtraCosts [EXTRA_EXPLOSION_NADE] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "NAPALM NADE" ) )

				{

				         if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_NAPALM_NADE] = false;

					}

					else

					{

						ExtraItems [EXTRA_NAPALM_NADE] = true;

					         

						ExtraCosts [EXTRA_NAPALM_NADE] = str_to_num ( Value );

					}

				}	

				else if ( equal ( Key, "FROST NADE" ) )

				{	

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_FROST_NADE] = false;

					}

					else

					{

						ExtraItems [EXTRA_FROST_NADE] = true;

					         

						ExtraCosts [EXTRA_FROST_NADE] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "AWP MAGNUM SNIPER" ) )

				{	

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] = false;

					}

					else

					{

						ExtraItems [EXTRA_AWP_MAGNUM_SNIPER] = true;

					    

						ExtraCosts [EXTRA_AWP_MAGNUM_SNIPER] = str_to_num ( Value );

					}

				}

		

				else if ( equal ( Key, "M249 PARA MACHINEGUN" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_M249_PARA_MACHINEGUN] = false;

					}

					else

					{

						ExtraItems [EXTRA_M249_PARA_MACHINEGUN] = true;

					    

						ExtraCosts [EXTRA_M249_PARA_MACHINEGUN] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "SG550 AUTO SNIPER" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_SG550_AUTO_SNIPER] = false;

					}

					else

					{

						ExtraItems [EXTRA_SG550_AUTO_SNIPER] = true;

					    

						ExtraCosts [EXTRA_SG550_AUTO_SNIPER] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "G3SG1 AUTO SNIPER" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] = false;

					}

					else

					{

						ExtraItems [EXTRA_G3SG1_AUTO_SNIPER] = true;

					    

						ExtraCosts [EXTRA_G3SG1_AUTO_SNIPER] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "JETPACK + BAZOOKA" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_JETPACK] = false;

					}

					else

					{

						ExtraItems [EXTRA_JETPACK] = true;

					    

						ExtraCosts [EXTRA_JETPACK] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "UNLIMITED CLIP" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_UNLIMITEDCLIP] = false;

					}

					else

					{

						ExtraItems [EXTRA_UNLIMITEDCLIP] = true;

					    

						ExtraCosts [EXTRA_UNLIMITEDCLIP] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "ARMOR (100)" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_ARMOR_100] = false;

					}

					else

					{

						ExtraItems [EXTRA_ARMOR_100] = true;

					    

						ExtraCosts [EXTRA_ARMOR_100] = str_to_num ( Value );

					}

				}	

				else if ( equal ( Key, "ARMOR (200)" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_ARMOR_200] = false;

					}

					else

					{

						ExtraItems [EXTRA_ARMOR_200] = true;

					    

						ExtraCosts [EXTRA_ARMOR_200] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "MULTIJUMP" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_MULTIJUMP] = false;

					}

					else

					{

						ExtraItems [EXTRA_MULTIJUMP] = true;

					    

						ExtraCosts [EXTRA_MULTIJUMP] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "BUY TRYDER" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_TRYDER] = false;

					}

					else

					{

						ExtraItems [EXTRA_TRYDER] = true;

					    

						ExtraCosts [EXTRA_TRYDER] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "BUY SURVIVOR" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_SURVIVOR] = false;

					}

					else

					{

						ExtraItems [EXTRA_SURVIVOR] = true;

					    	

						ExtraCosts [EXTRA_SURVIVOR] = str_to_num ( Value );

					}

				}	

				else if ( equal ( Key, "BUY SNIPER" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_SNIPER] = false;

					}

					else

					{

						ExtraItems [EXTRA_SNIPER] = true;

					    	

						ExtraCosts [EXTRA_SNIPER] = str_to_num ( Value );

					}

				}	

				else if ( equal ( Key, "BUY NEMESIS" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_NEMESIS] = false;

					}

					else

					{

						ExtraItems [EXTRA_NEMESIS] = true;

					    		

						ExtraCosts [EXTRA_NEMESIS] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "BUY ASSASSIN" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_ASSASSIN] = false;

					}

					else

					{

						ExtraItems [EXTRA_ASSASSIN] = true;

					    	

						ExtraCosts [EXTRA_ASSASSIN] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "ANTIDOTE" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_ANTIDOTE] = false;

					}

					else

					{

						ExtraItems [EXTRA_ANTIDOTE] = true;

					    	

						ExtraCosts [EXTRA_ANTIDOTE] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "ZOMBIE MADNESS" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_MADNESS] = false;

					}

					else

					{

						ExtraItems [EXTRA_MADNESS] = true;

					    	

						ExtraCosts [EXTRA_MADNESS] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "INFECTION BOMB" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_INFECTIONBOMB] = false;

					}

					else

					{

						ExtraItems [EXTRA_INFECTIONBOMB] = true;

					    	

						ExtraCosts [EXTRA_INFECTIONBOMB] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "KNIFE BLINK" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_KNIFEBLINK] = false;

					}

					else

					{

						ExtraItems [EXTRA_KNIFEBLINK] = true;

					    	

						ExtraCosts [EXTRA_KNIFEBLINK] = str_to_num ( Value );

					}

				}

				else if ( equal ( Key, "TRIP MINE" ) )

				{

					if ( equal ( Value, "OFF" ) || equal ( Value, "" ) )

					{

						ExtraItems [EXTRA_TRIPMINE] = false;

					}

					else

					{

						ExtraItems [EXTRA_TRIPMINE] = true;

					    	

						ExtraCosts [EXTRA_TRIPMINE] = str_to_num ( Value );

					}

				}

			}

			case SECTION_WEATHER_EFFECTS:

			{

				if ( equal ( Key, "FOG" ) )

				{

					if ( equal ( Value, "OFF" ))



						AmbienceFog = false;

						

					else //if ( !equal ( Value, "OFF" ) )

					

						AmbienceFog = true;

				}

				else if ( equal ( Key, "FOG DENSITY" ) )

					

					copy ( FogDensity, charsmax ( FogDensity ), Value );

				

				else if ( equal ( Key, "FOG COLOR" ) )

					

					copy ( FogColor, charsmax ( FogColor ), Value );

			}

			case SECTION_SKY:

			{

				if ( equal ( Key, "SKY NAMES" ) )

				{

					if ( equal ( Value, "OFF" ) )

					{

						SkyEnable = false;

					}

					else 

					{

						while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) ) 

						{

							SkyEnable = true;

						

							trim ( Key );

							trim ( Value );

						

							ArrayPushString ( SkyNames, Key );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%sbk.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%sdn.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%sft.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%slf.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%srt.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						

							formatex ( LineData, charsmax( LineData ), "gfx/env/%sup.tga", Key )

							engfunc ( EngFunc_PrecacheGeneric, LineData );

						}

					}

				}

			}

			case SECTION_ZOMBIE_DECALS:

			{

				if ( equal ( Key, "DECALS"))

				{

					while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

					{

						trim ( Key );

						trim ( Value );

						

						ArrayPushString ( ZombieDecals, Key );

					}

				}

			}

			case SECTION_KNOCKBACK:

			{

				strtolower ( Key );

				

				format ( Key, charsmax ( Key ), "weapon_%s", Key );

				

				KnockbackWeaponPower [cs_weapon_name_to_id ( Key ) ] = str_to_float ( Value );

			}

		}

	}

	

	if ( File ) fclose ( File );

	

	get_configsdir ( Path, charsmax ( Path ) );

	

	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_ZOMBIECLASSES_FILE );

	

	if ( file_exists ( Path ) )

	{

		File = fopen ( Path, "rt" )

		

		while ( File && !feof ( File ) )

		{

			fgets ( File, LineData, charsmax ( LineData ) );

			

			replace ( LineData, charsmax ( LineData ), "^n", "" );

			

			if ( !LineData [0] || LineData [0] == ';' ) continue;

			

			if ( LineData [0] == '[' )

			{

				LineData [strlen ( LineData ) - 1] = 0;

				

				copy ( LineData, charsmax ( LineData ), LineData [1] );

				

				ArrayPushString ( ZClassRealName, LineData );

				

				continue;

			}

			

			strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );

			

			trim ( Key );

			trim ( Value );

			

			if ( equal ( Key, "NAME" ) )

				

			ArrayPushString ( ZClassName_02, Value );

			

			else if ( equal ( Key, "INFO" ) )

				

			ArrayPushString( ZClassInfo_02, Value );

			

			else if ( equal ( Key, "MODELS" ) )

			{

				ArrayPushCell ( ZClassModelsStart_02, ArraySize ( ZClassPlayerModel_02 ) );

				

				while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

				{

					trim ( Key );

					trim ( Value );

					

					ArrayPushString ( ZClassPlayerModel_02, Key );

					

					ArrayPushCell ( ZClassModelIndex_02, -1 );

				}

				

				ArrayPushCell ( ZClassModelSend_02, ArraySize ( ZClassPlayerModel_02 ) );

			}

			else if ( equal ( Key, "CLAWMODEL" ) )

				

			ArrayPushString ( ZClassClawModel_02, Value );

			

			else if ( equal ( Key, "HEALTH" ) )

				

			ArrayPushCell ( ZClassHealth_02, str_to_num ( Value ) );

			

			else if ( equal ( Key, "SPEED" ) )

				

			ArrayPushCell ( ZClassSpeed_02, str_to_num ( Value ) );

			

			else if ( equal ( Key, "GRAVITY" ) )

				

			ArrayPushCell ( ZClassGravity_02, str_to_float ( Value ) );

			

			else if ( equal ( Key, "KNOCKBACK" ) ) 

				

			ArrayPushCell ( ZClassKnockback_02, str_to_float ( Value ) );

		}

		

		if ( File ) fclose ( File );

	}

	

	get_configsdir ( Path, charsmax ( Path ) );

	

	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_EXTRAITEMS_FILE );

	

	if ( file_exists ( Path ) )

	{

		File = fopen ( Path, "rt" );

		

		while ( File && !feof ( File ) )

		{

			fgets ( File, LineData, charsmax ( LineData ) );

			

			replace ( LineData, charsmax ( LineData ), "^n", "" );

			

			if ( !LineData [0] || LineData [0] == ';' ) continue;

			

			if ( LineData [0] == '[' )

			{

				LineData [strlen ( LineData) - 1] = 0;

				

				copy ( LineData, charsmax ( LineData ), LineData [1] );

				

				ArrayPushString ( ExtraItemRealName, LineData );

				

				continue;

			}

			

			strtok ( LineData, Key, charsmax ( Key ), Value, charsmax ( Value ), '=' );

			

			trim ( Key );

			

			trim ( Value );

			

			if ( equal ( Key, "NAME" ) )

				

				ArrayPushString ( ExtraItemName_02, Value );

			

			else if ( equal ( Key, "COST" ) )

				

				ArrayPushCell ( ExtraItemCost_02, str_to_num ( Value ) );

			

			else if ( equal ( Key, "TEAMS" ) )

			{

				Teams = 0;

				

				while ( Value [0] != 0 && strtok ( Value, Key, charsmax ( Key ), Value, charsmax ( Value ), ',' ) )

				{

					trim ( Key );

					trim ( Value );

					

					if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_ZOMBIE] ) )

						

						Teams |= ZP_TEAM_ZOMBIE;

					

					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_HUMAN] ) )

						

						Teams |= ZP_TEAM_HUMAN;

					

					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_NEMESIS] ) )

						

						Teams |= ZP_TEAM_NEMESIS;

					

					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_ASSASSIN] ) )

						

						Teams |= ZP_TEAM_ASSASSIN;

					

					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_SURVIVOR] ) )

						

						Teams |= ZP_TEAM_SURVIVOR;

					

					else if ( equal ( Key, ZP_TEAM_NAMES [ZP_TEAM_SNIPER] ) )

						

						Teams |= ZP_TEAM_SNIPER;

				}

				

				ArrayPushCell ( ExtraItemTeam_02, Teams );

			}

		}

		

		if ( File ) fclose ( File );

	}		

}







SaveCustomization (  )

{

	new i, k, Buffer [512];



	new Path [64]; get_configsdir ( Path, charsmax ( Path ) );

	

	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_ZOMBIECLASSES_FILE );



	new File = fopen ( Path, "at" ), size = ArraySize ( ZClassName_01 );

	

	for ( i = 0; i < size; i ++ )

	{

		if ( ArrayGetCell ( ZClassNew, i ) )

		{

			ArrayGetString ( ZClassName_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^n[%s]", Buffer );

			

			fputs ( File, Buffer );

			

			

			ArrayGetString ( ZClassName_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^nNAME = %s", Buffer );

			

			fputs ( File, Buffer );

			

			

			ArrayGetString ( ZClassInfo_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^nINFO = %s", Buffer );

			

			fputs ( File, Buffer );

			

			for ( k = ArrayGetCell ( ZClassModelsStart_01, i ); k < ArrayGetCell ( ZClassModelSend_01, i ); k ++ )

			{

				if ( k == ArrayGetCell ( ZClassModelsStart_01, i ) )

				{

					ArrayGetString ( ZClassPlayerModel_01, k, Buffer, charsmax ( Buffer ) );

				}

				else

				{

					ArrayGetString ( ZClassPlayerModel_01, k, Path, charsmax ( Path ) );

					

					format ( Buffer, charsmax ( Buffer ), "%s , %s", Buffer, Path );

				}

			}

			format ( Buffer, charsmax ( Buffer ), "^nMODELS = %s", Buffer );

			

			fputs ( File, Buffer );

			

			ArrayGetString ( ZClassClawModel_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^nCLAWMODEL = %s", Buffer );

			

			fputs ( File, Buffer );

			

			formatex ( Buffer, charsmax ( Buffer ), "^nHEALTH = %d", ArrayGetCell ( ZClassHealth_01, i ) );

			

			fputs ( File, Buffer );

			

			formatex ( Buffer, charsmax ( Buffer ), "^nSPEED = %d", ArrayGetCell ( ZClassSpeed_01, i ) );

			

			fputs ( File, Buffer );



			formatex ( Buffer, charsmax ( Buffer ), "^nGRAVITY = %.2f", Float:ArrayGetCell ( ZClassGravity_01, i ) );

			

			fputs ( File, Buffer );

			

			formatex ( Buffer, charsmax ( Buffer ), "^nKNOCKBACK = %.2f^n", Float:ArrayGetCell ( ZClassKnockback_01, i ) );

			

			fputs ( File, Buffer );

		}

	}

	

	fclose ( File );



	get_configsdir ( Path, charsmax ( Path ) );

	

	format ( Path, charsmax ( Path ), "%s/%s", Path, ZP_EXTRAITEMS_FILE );

	

	File = fopen ( Path, "at" ); size = ArraySize ( ExtraItemName_01 );



	for ( i = EXTRA_WEAPONS_STARTID; i < size; i ++ )

	{

		if ( ArrayGetCell ( ExtraItemNew, i ) )

		{

			ArrayGetString ( ExtraItemName_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^n[%s]", Buffer );

			

			fputs ( File, Buffer );



			ArrayGetString ( ExtraItemName_01, i, Buffer, charsmax ( Buffer ) );

			

			format ( Buffer, charsmax ( Buffer ), "^nNAME = %s", Buffer );

			

			fputs(  File, Buffer );

			

			formatex ( Buffer, charsmax ( Buffer ), "^nCOST = %d", ArrayGetCell ( ExtraItemCost_01, i ) );

			

			fputs ( File, Buffer );



			formatex ( Buffer, charsmax ( Buffer ), "^nTEAMS = %s^n", ZP_TEAM_NAMES [ArrayGetCell ( ExtraItemTeam_01, i) ] );

			

			fputs ( File, Buffer );

		}

	}

	

	fclose ( File );



         ArrayDestroy ( ZClassRealName );

	ArrayDestroy ( ZClassName_02 );

	ArrayDestroy ( ZClassInfo_02 );

	ArrayDestroy ( ZClassModelsStart_02 );

	ArrayDestroy ( ZClassModelSend_02 );

	ArrayDestroy ( ZClassPlayerModel_02 );

	ArrayDestroy ( ZClassModelIndex_02 );

	ArrayDestroy ( ZClassClawModel_02 );

	ArrayDestroy ( ZClassHealth_02 );

	ArrayDestroy ( ZClassSpeed_02 );

	ArrayDestroy ( ZClassGravity_02 );

	ArrayDestroy ( ZClassKnockback_02 );

	ArrayDestroy ( ZClassNew );

	ArrayDestroy ( ExtraItemRealName );

	ArrayDestroy ( ExtraItemName_02 );

	ArrayDestroy ( ExtraItemCost_02 );

	ArrayDestroy ( ExtraItemTeam_02 );

	ArrayDestroy ( ExtraItemNew );

}



public RegisterHamCzBots ( id )

{

         if ( HamCzBots || !IsConnected [id] ) return;

	

	RegisterHamFromEntity ( Ham_Spawn, id, "fwPlayerSpawnPost", 1 );

	RegisterHamFromEntity ( Ham_Killed, id, "fwPlayerKilled" );

	RegisterHamFromEntity ( Ham_Killed, id, "fwPlayerKilledPost", 1 );

	RegisterHamFromEntity ( Ham_TakeDamage, id, "fwTakeDamage" );

	RegisterHamFromEntity ( Ham_TakeDamage, id, "fwTakeDamagePost", 1 );

	RegisterHamFromEntity ( Ham_TraceAttack, id, "fwTraceAttack" );



	HamCzBots = true;

	

	if ( is_user_alive ( id ) ) fwPlayerSpawnPost ( id );

}



public BotBuyExtras ( taskid )

{

	if ( !IsAlive [ID_SPAWN] || IsNemesis [ID_SPAWN] || IsAssassin [ID_SPAWN] || IsSurvivor [ID_SPAWN] || IsSniper [ID_SPAWN] ) return;

	

	if ( !IsZombie [ID_SPAWN] ) 

	{

		BuyExtraItem ( ID_SPAWN, EXTRA_NVISION );

		

		BuyExtraItem ( ID_SPAWN, random ( EXTRA_WEAPONS_STARTID -1  ) );

	}

	else 

	{

		BuyExtraItem ( ID_SPAWN, EXTRA_ANTIDOTE );

	}

}



public RefillBpAmmo ( const Args [], id )

{

	if ( !IsAlive [id] || IsZombie [id] ) return;

	

	set_msg_block ( get_user_msgid ( "AmmoPickup" ), BLOCK_ONCE );



	ExecuteHamB ( Ham_GiveAmmo, id, MAXBPAMMO [REFILL_WEAPONID], AMMOTYPE [REFILL_WEAPONID], MAXBPAMMO [REFILL_WEAPONID] );

}



BalanceTeams (  )

{

	static iPlayersNum;

	

	iPlayersNum = fnGetPlaying (  );

	

	if ( iPlayersNum < 1 ) return;



	static iTerrors, iMaxTerrors, id, Team [33];

	

	iMaxTerrors = iPlayersNum / 2;

	

	iTerrors = 0;



	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( !IsConnected [id] ) continue;

		

		Team [id] = fm_cs_get_user_team ( id );

		

		if ( Team [id] == FM_CS_TEAM_SPECTATOR || Team [id] == FM_CS_TEAM_UNASSIGNED ) continue;



		remove_task ( id + TASK_TEAM );

		

		fm_cs_set_user_team ( id, FM_CS_TEAM_CT );

		

		Team [id] = FM_CS_TEAM_CT;

	}



	while ( iTerrors < iMaxTerrors )

	{

		if ( ++ id > MaxPlayers ) id = 1;

		

		if ( !IsConnected [id] ) continue;



		if ( Team [id] != FM_CS_TEAM_CT ) continue;

		

		if ( random_num ( 0, 1 ) )

		{

			fm_cs_set_user_team ( id, FM_CS_TEAM_T );

			

			Team [id] = FM_CS_TEAM_T;

			

			iTerrors ++;

		}

	}

}



public SendWelcomeMessage (  )

{    

	client_print_color ( 0, print_team_grey, "^1****^4 Zombie Plague 6.2^3 (^4By Dante Nikolas^3)^1 ||^4 ...:::^1[^3 FREE-VIP-ALL !^1 ]^4:::...^1 ****" );

	

	client_print_color ( 0, print_team_default, "%s Press^4 M^1 to open the game menu!", CHAT_PREFIX );

	

	set_hudmessage ( 20, 155, 255, -1.0, 0.17, 1, 0.0, 3.0, 2.0, 1.0, -1 );

	

	ShowSyncHudMsg ( 0, MsgSync_01, "The T-Virus has been set loose..." );

}



CheckRound ( leaving_player )

{

         if ( EndRound || task_exists ( TASK_MAKEZOMBIE ) ) return;

	

	static iPlayersNum, id; iPlayersNum = fnGetAlive (  );

	

	if ( iPlayersNum < 2 ) return;



	if ( IsZombie [leaving_player] && fnGetZombies (  ) == 1 )

	{

		if ( fnGetHumans (  ) == 1 && fnGetCTs (  ) == 1 ) return;

		

		while ( ( id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) ) ) == leaving_player ) {  }



		client_print_color ( 0, print_team_default, "%s Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie.", CHAT_PREFIX, PlayerName [leaving_player], PlayerName [id] )

		

		LastPlayerLeaving = true;

		

		if ( IsNemesis [leaving_player] )

		{

			UserZombie ( id, 0, 1, 0, 0, 0 );

			

			if ( ModeNemesis ) zp_round_started ( MODE_NEMESIS, id );

		}

		

		else if ( IsAssassin [leaving_player] )

		{	

			UserZombie ( id, 0, 0, 1, 0, 0 );

			

			if ( ModeAssassin ) zp_round_started ( MODE_ASSASSIN, id );

		}

		else

		         UserZombie ( id, 0, 0, 0, 0, 0 );

		

		LastPlayerLeaving = false;

		

		if ( IsNemesis [leaving_player] )



		         fm_set_user_health ( id, pev ( leaving_player, pev_health ) );

		

		if ( IsAssassin [leaving_player] )

			

			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );

	}

	else if ( !IsZombie [leaving_player] && fnGetHumans (  ) == 1 )

	{

		if ( fnGetZombies (  ) == 1 && fnGetTs (  ) == 1 ) return;



		while ( ( id = fnGetRandomAlive ( random_num ( 1, iPlayersNum ) ) ) == leaving_player ) {  }

		

		client_print_color ( 0, print_team_default, "%s Last human,^3 %s^1 disconnected,^4 %s^1 is the last human.", CHAT_PREFIX, PlayerName [leaving_player], PlayerName [id] )

		

		LastPlayerLeaving = true;

		

		if ( IsSurvivor [leaving_player] )

		{	

			UserHuman ( id, 1, 0, 0 );

			

			if ( ModeSurvivor ) zp_round_started ( MODE_SURVIVOR, id );

		}

		else if ( IsSniper [leaving_player] )

		{

		         UserHuman ( id, 0, 1, 0 );

			 

			if ( ModeSniper ) zp_round_started ( MODE_SNIPER, id );

		}

		else

			UserHuman ( id, 0, 0, 0 );

		

		LastPlayerLeaving = false;

		

		if ( IsSurvivor [leaving_player] )

			

			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );

		

		if ( IsSniper [leaving_player] )

			

			fm_set_user_health ( id, pev ( leaving_player, pev_health ) );

	}

}



public AmbienceSoundEffects ( taskid )

{

	static Sound [64], iRandom, Duration, IsMp3;

	

	if ( NemesisRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_02 ) - 1 )

		

		ArrayGetString ( SoundAmbience_02, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_02, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_02, iRandom );

	}

	else if ( AssassinRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_03 ) - 1 )

		

		ArrayGetString ( SoundAmbience_03, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_03, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_03, iRandom );

	}

	else if ( SurvivorRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_04 ) - 1 )

		

		ArrayGetString ( SoundAmbience_04, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_04, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_04, iRandom );

	}

	else if ( SniperRound ) 

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_05 ) - 1 )

		

		ArrayGetString ( SoundAmbience_05, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_05, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_05, iRandom );

	}

	else if ( SwarmRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_06 ) - 1 )

		

		ArrayGetString ( SoundAmbience_06, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_06, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_06, iRandom );

	}

	else if ( PlagueRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_07 ) - 1 )

		

		ArrayGetString ( SoundAmbience_07, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_07, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_07, iRandom );

	}

	else if ( ArmageddonRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_08 ) - 1 )

		

		ArrayGetString ( SoundAmbience_08, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_08, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_08, iRandom );

	}

	else if ( ApocalypseRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_09 ) - 1 )

		

		ArrayGetString ( SoundAmbience_09, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_09, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_09, iRandom );

	}

	else if ( NightmareRound )

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_10 ) - 1 )

		

		ArrayGetString ( SoundAmbience_10, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_10, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_10, iRandom );

	}

	else 

	{

		iRandom = random_num ( 0, ArraySize( SoundAmbience_01 ) - 1 )

		

		ArrayGetString ( SoundAmbience_01, iRandom, Sound, charsmax ( Sound ) );

		

		Duration = ArrayGetCell ( SoundAmbienceDuration_01, iRandom );

		

		IsMp3 = ArrayGetCell ( SoundAmbienceMp3_01, iRandom );

	}

	

	if ( IsMp3 )

		client_cmd ( 0, "mp3 play ^"sound/%s^"", Sound );

	else

		PlaySound ( Sound );

		

	set_task ( float ( Duration ), "AmbienceSoundEffects", TASK_AMBIENCESOUNDS );

}



AmbienceSoundStop (  ) client_cmd ( 0, "mp3 stop; stopsound" );





public TaskHideMoney ( taskid )

{

         if ( !IsAlive [ID_SPAWN] ) return;

	

	message_begin ( MSG_ONE, get_user_msgid ( "HideWeapon" ), _, ID_SPAWN );

	write_byte ( HIDE_MONEY );

	message_end (  )



	message_begin ( MSG_ONE, get_user_msgid ( "Crosshair" ), _, ID_SPAWN );

	write_byte ( 0 );

	message_end (  );

}



InfectionExplode ( Entity )

{

	if ( EndRound ) return;

	

	static Float: Origin [3];

	

	pev ( Entity, pev_origin, Origin );

	

	CreateBlastInfection ( Origin );

	

	static Sound [64];

	

	ArrayGetString ( GrenadeInfect, random_num ( 0, ArraySize ( GrenadeInfect ) - 1 ), Sound, charsmax ( Sound ) )

	

	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	

	static Attacker;

	

	Attacker = pev ( Entity, pev_owner );

	

	static Victim;

	

	Victim = -1

	

	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )

	{

		if ( !is_user_valid_alive ( Victim ) || IsZombie [Victim] || NoDamage [Victim] ) continue;

		

		if ( fnGetHumans (  ) == 1 )

		{

			ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );

			

			continue;

		}

		

		ArrayGetString ( GrenadeInfectPlayer, random_num ( 0, ArraySize ( GrenadeInfectPlayer ) - 1 ), Sound, charsmax ( Sound ) );

		

		emit_sound ( Victim, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

		

		UserZombie ( Victim, Attacker, 0, 1, 1, 0 );

	}

	

	engfunc ( EngFunc_RemoveEntity, Entity );

}



public HeExplode ( Entity )

{

	static Float: Origin [3];

	

	pev ( Entity, pev_origin, Origin );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_EXPLOSION );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	write_short ( HExplode );

	write_byte ( 30 ); 

	write_byte ( 15 ); 

	write_byte ( 0 );

	message_end (  );

	

	static Attacker;

	

	Attacker = pev ( Entity, pev_owner );

	

	for ( new Victim = 1; Victim < MaxPlayers + 1; Victim ++ )

	{

		if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;

		

		if ( IsZombie [Victim] )

		{

			static Float: fDistance, Float: fDamage;

			

			fDistance = EntityRange ( Victim, Entity );

			

			if ( fDistance < 300.0 )

			{

				fDamage = 667.0 - fDistance;

				

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );

				write_short ( 2048 );

				write_short ( 1024 );

				write_short ( FFADE_IN );

				write_byte ( 250 );

				write_byte ( 0 );

				write_byte ( 0 );

				write_byte ( fDistance < 220 ? 220 : 205 );

				message_end (   );

				

				//emit_sound ( Victim, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, IsZombie [Victim], PITCH_NORM );

				client_cmd ( Victim, "spk ^"%s^"", SOUND_EXPLODE );

				

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );

				write_short ( UNIT_SECOND * 4 );

				write_short ( UNIT_SECOND * 2 ); 

				write_short ( UNIT_SECOND * 10 );

				message_end (  );

				

				if ( float ( get_user_health ( Victim ) ) - fDamage > 0.0 )

					

					ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );

				else

					ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );

				

				if ( !IsNemesis [Victim] && !IsAssassin [Victim] ) fDamage *= 0.75;

				

				client_print_color ( Attacker, print_team_default, "%s Damage to^4 %s^1 ::^4 %0.0f^1 damage", CHAT_PREFIX, PlayerName [Victim], fDamage );

				

				if ( fDamage >= get_pcvar_num ( Zp_AmmoDamage ) )

					

					AmmoPacks [Attacker] += 2;

				else

					AmmoPacks [Attacker] += 1;

			}

		}

	}

	

	engfunc ( EngFunc_RemoveEntity, Entity );

}



FireExplode ( Entity )

{

	static Float: Origin [3]

	

	pev ( Entity, pev_origin, Origin );

	

	CreateBlastFire ( Origin );

	

	static Sound [64];

	

	ArrayGetString ( GrenadeFire, random_num ( 0, ArraySize ( GrenadeFire ) - 1 ), Sound, charsmax ( Sound ) )

	

	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	

	static Victim; Victim = -1;

	

	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )

	{

		if ( !is_user_valid_alive ( Victim ) || !IsZombie [Victim] || NoDamage [Victim] ) continue;

		

		if ( IsNemesis [Victim] || IsAssassin [Victim] )

			

			BurningDuration [Victim] += get_pcvar_num ( Zp_FireDuration );

		else

			BurningDuration [Victim] += get_pcvar_num ( Zp_FireDuration ) * 5;



		if ( !task_exists ( Victim + TASK_BURN ) ) set_task ( 0.2, "BurningFlame", Victim + TASK_BURN, _, _, "b" );

	}

	

	engfunc ( EngFunc_RemoveEntity, Entity );

}



FrostExplode ( Entity )

{

	static Float: Origin [3];

	

	pev ( Entity, pev_origin, Origin )

	

	CreateBlastFrost ( Origin )

	

	static Sound [64];

	

	ArrayGetString ( GrenadeFrost, random_num ( 0, ArraySize ( GrenadeFrost ) - 1 ), Sound, charsmax ( Sound ) ) 

	

	emit_sound ( Entity, CHAN_WEAPON, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	

	static Victim; Victim = -1;

	

	while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, NADE_EXPLOSION_RADIUS ) ) != 0 )

	{

		if ( !is_user_valid_alive ( Victim ) || !IsZombie [Victim] || IsFrozen [Victim] || NoDamage [Victim] ) continue;



		if ( IsNemesis [Victim] || IsAssassin [Victim] )

		{

			static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );



			ArrayGetString ( GrenadeFrostBreak, random_num ( 0, ArraySize ( GrenadeFrostBreak ) - 1 ), Sound, charsmax ( Sound ) )

			

			emit_sound ( Victim, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );



			message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin_2 );

			write_byte ( TE_BREAKMODEL ); 

			write_coord ( Origin_2 [0] ); 

			write_coord ( Origin_2 [1] ); 

			write_coord ( Origin_2 [2] + 24 ); 

			write_coord ( 16 ); 

			write_coord ( 16 ); 

			write_coord ( 16 );

			write_coord ( random_num (-50, 50) );

			write_coord ( random_num (-50, 50) );

			write_coord ( 25 ); 

			write_byte ( 10 ); 

			write_short ( GlassSpr ); 

			write_byte ( 10 ); 

			write_byte ( 25 );

			write_byte ( BREAK_GLASS ); 

			message_end (  );

			

			continue;

		}

		

		fm_set_rendering ( Victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25 );

		

		ArrayGetString ( GrenadeFrostPlayer, random_num ( 0, ArraySize ( GrenadeFrostPlayer ) - 1 ), Sound, charsmax ( Sound ) );

		

		emit_sound ( Victim, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

		

		message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );

		write_short ( 0 );

		write_short ( 0 );

		write_short ( FFADE_STAYOUT );

		write_byte ( 0 );

		write_byte ( 100 );

		write_byte ( 200 );

		write_byte ( 100 );

		message_end (  );

		

		if ( pev ( Victim, pev_flags ) & FL_ONGROUND )

		

			set_pev ( Victim, pev_gravity, 999999.9 );

		else

			set_pev ( Victim, pev_gravity, 0.000001 );



		IsFrozen [Victim] = true;

		

		set_task ( get_pcvar_float ( Zp_FreezeDuration ), "RemoveFreeze", Victim );

	}

	engfunc ( EngFunc_RemoveEntity, Entity );

}



public RemoveFreeze ( id )

{

	if ( !IsAlive [id] || !IsFrozen [id] ) return;



	IsFrozen [id] = false;

	

	if ( IsZombie [id] )

	{

		if ( IsNemesis [id] )



		         set_pev ( id, pev_gravity, get_pcvar_float ( Zp_NemesisGravity ) );

		

		else if ( IsAssassin [id] )

			

			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_AssassinGravity ) );

		

		else

			set_pev ( id, pev_gravity, Float:ArrayGetCell ( ZClassGravity_01, ZombieClass [id] ) );

	}

	else

	{

		if ( IsSurvivor [id] )

			

			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SurvivorGravity ) );

		

		else if ( IsSniper [id] )

			

			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_SniperGravity ) );

		else	    

			set_pev ( id, pev_gravity, get_pcvar_float ( Zp_HumanGravity ) );	

	}



	if ( IsZombie [id] )

	{

		if ( IsNemesis [id] )

			

			fm_set_rendering ( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25 );

			//fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );



		else if ( IsAssassin [id] )



			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

		else

			fm_set_rendering ( id );

	}

	else

	{

		if ( IsSurvivor [id] || IsSniper [id] )



			fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );

		else

			fm_set_rendering ( id );

	}	

	

	message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, id );

	write_short ( UNIT_SECOND );

	write_short ( 0 );

	write_short ( FFADE_IN );

	write_byte ( 0 );

	write_byte ( 50 );

	write_byte ( 200 );

	write_byte ( 100 );

	message_end (  );

	

	static Sound [64];

	

	ArrayGetString ( GrenadeFrostBreak, random_num ( 0, ArraySize ( GrenadeFrostBreak ) - 1 ), Sound, charsmax ( Sound ) );

	

	emit_sound ( id, CHAN_BODY, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	

	static Origin [3]; get_user_origin ( id, Origin )



	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );

	write_byte ( TE_BREAKMODEL ); 

	write_coord ( Origin [0] ); 

	write_coord ( Origin [1] );

	write_coord ( Origin [2]+24 ); 

	write_coord ( 16 );

	write_coord ( 16 ); 

	write_coord ( 16 ); 

	write_coord ( random_num (-50, 50) ); 

	write_coord ( random_num (-50, 50) ); 

	write_coord ( 25 ); 

	write_byte ( 10 ); 

	write_short ( GlassSpr ); 

	write_byte ( 10 ); 

	write_byte ( 25 );

	write_byte ( BREAK_GLASS ); 

	message_end (  );

	

	ExecuteForward ( fwUserUnfrozen, fwDummyResult, id );

}



public RemoveStuff (  )

{

	static Ent

	

	if ( get_pcvar_num ( Zp_RemoveDoors ) > 0 )

	{

		Ent = -1;

		

		while ( ( Ent = engfunc ( EngFunc_FindEntityByString, Ent, "classname", "func_door_rotating" ) ) != 0 )

		

			engfunc ( EngFunc_SetOrigin, Ent, Float: {8192.0 ,8192.0 ,8192.0} );

	}

	

	if ( get_pcvar_num ( Zp_RemoveDoors ) > 1 )

	{

		Ent = -1;

		while ( ( Ent = engfunc ( EngFunc_FindEntityByString, Ent, "classname", "func_door" ) ) != 0 )

			

			engfunc ( EngFunc_SetOrigin, Ent, Float: {8192.0 ,8192.0 ,8192.0} );

	}

}



ReplaceWeaponModels ( id, weaponid )

{

	switch ( weaponid )

	{

		case CSW_KNIFE: 

		{

			if ( IsZombie [id] )

			{

				if ( IsNemesis [id] )

				{

					set_pev ( id, pev_viewmodel2, ModelVKnifeNemesis );

					

					set_pev ( id, pev_weaponmodel2, "" );

				}

				else if ( IsAssassin [id] ) 

				{

					set_pev(id, pev_viewmodel2, ModelVKnifeAssassin );

					

					set_pev(id, pev_weaponmodel2, "" );

				}

				else 

				{

					static ClawModel [100];

						

					ArrayGetString ( ZClassClawModel_01, ZombieClass [id], ClawModel, charsmax ( ClawModel ) ); 

						

					format ( ClawModel, charsmax ( ClawModel ), "models/zombie_plague/%s", ClawModel );

						

					set_pev ( id, pev_viewmodel2, ClawModel );

						

					set_pev ( id, pev_weaponmodel2, "" );

				}

			}

			else 

			{

					set_pev ( id, pev_viewmodel2, ModelVKnifeHuman );

					

					set_pev ( id, pev_weaponmodel2, "models/p_knife.mdl" );

			}

		}

		case CSW_XM1014: 

		{

			if ( IsSurvivor [id] )

			{

				set_pev ( id, pev_viewmodel2, ModelVxm1014Survivor );

				

				set_pev ( id, pev_weaponmodel2, ModelPxm1014Survivor );                                

			}

		}

		case CSW_AK47: 

		{

			if ( IsSurvivor [id] )

			{

				set_pev(id, pev_viewmodel2, ModelVak47Survivor );

				

				set_pev(id, pev_weaponmodel2, ModelPak47Survivor );

			}

		}

		case CSW_M4A1:

		{

			if ( IsSurvivor [id] )

			{

				set_pev ( id, pev_viewmodel2, ModelVm4a1Survivor );

				

				set_pev ( id, pev_weaponmodel2, ModelPm4a1Survivor );

			}

		}

		case CSW_AWP: 

		{

			if ( IsSniper [id] )

			{

				set_pev ( id, pev_viewmodel2, ModelVawpSniper );

				

				set_pev ( id, pev_weaponmodel2, ModelPawpSniper );

			}

		}

		case CSW_HEGRENADE: 

		{

			if ( IsZombie [id] )

			

				set_pev ( id, pev_viewmodel2, ModelGrenadeInfect );

			else

				set_pev ( id, pev_viewmodel2, ModelGrenadeExplode );

		}

		case CSW_FLASHBANG: 

		{

			set_pev ( id, pev_viewmodel2, ModelGrenadeFire );

		}

		case CSW_SMOKEGRENADE: 

		{

			set_pev ( id, pev_viewmodel2, ModelGrenadeFrost );

		}

	}

}



ResetVars ( id, resetall )

{

	IsZombie [id] = false;

	

	IsNemesis [id] = false;

	

	IsAssassin [id] = false;

	

	IsSurvivor [id] = false;

	

	IsSniper [id] = false;

	 

	FirstZombie [id] = false;

	

	LastZombie [id] = false;

	

	LastHuman [id] = false;

	

	IsFrozen [id] = false;

	

	NoDamage [id] = false;

	

	NVision [id] = false;

	

	NVisionEnabled [id] = false;

	

	CanBuy [id] = true;

	

	BurningDuration [id] = 0;

	

	if ( resetall )

	{

		AmmoPacks [id] = get_pcvar_num ( Zp_StartPacks );		

		

		ZombieClass [id] = ZCLASS_NONE; 

		

		ZombieClassNext [id] = ZCLASS_NONE;

		

		DamageDealt [id] = 0;			

	}

}



public SpecNVision ( id )

{

	if ( !IsConnected [id] || IsAlive [id] || IsBot [id] ) return;



	if ( get_pcvar_num ( Zp_NvgGive ) )

	{

		NVision [id] = true;



		if ( get_pcvar_num ( Zp_NvgGive ) == 1 )

		{

			NVisionEnabled [id] = true;



			if ( get_pcvar_num ( Zp_CustomNvg ) )

			{

				remove_task ( id + TASK_NVISION );

				

				set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );

			}

			else

				SetUserGNvision ( id, 1 );

		}

	}

}



public SpectatorHudMessage ( taskid )

{

	static id; id = ID_SHOWHUD;

	

	if ( !IsAlive [id] )

	{

		id = pev ( id, PEV_SPEC_TARGET );   

		

		if ( !IsAlive [id] ) return;

	}

	

	static Class [32], Red, Green, Blue;

	

	

	if ( IsZombie [id] )

	{

		Red = 220;

		

		Green = 80;

		

		Blue = 0;

		

		if ( IsNemesis [id] )

			

		         formatex ( Class, charsmax ( Class ), "Nemesis" );

		

		else if ( IsAssassin [id] )

			

		         formatex ( Class, charsmax ( Class ), "Assassin" );

		else

			copy ( Class, charsmax ( Class ), ZombieClassName [id] );

	}

	else 

	{

		Red = 0;

		

		Green = 175;

		

		Blue = 255;

		

		if ( IsSurvivor [id] )

			

		         formatex ( Class, charsmax ( Class ), "Survivor" );

		

		else if ( IsSniper [id] )

			

		         formatex ( Class, charsmax ( Class ), "Sniper" );

		else

			formatex ( Class, charsmax ( Class ), "Human" );

	}

	

	if ( id != ID_SHOWHUD )

	{

		

		static HealthString [16], PacksString [16], UserIp [16], Country [44], City[44];



		AddCommas ( pev ( id, pev_health ), HealthString, charsmax ( HealthString ) );

		

		AddCommas ( AmmoPacks [id], PacksString, charsmax ( PacksString ) );

		

	         get_user_ip ( id, UserIp, charsmax ( UserIp ) );

	

	         geoip_country_ex ( UserIp, Country, charsmax ( City ) );

	

	         geoip_city ( UserIp, City, charsmax ( City ) );



		set_hudmessage ( 0, 80, 255, -1.0, 0.80, 0, 6.0, 1.1, 0.0, 0.0, -1 );

		

		if ( equal ( Country, "" ) && !equal ( City, "" ) )

		

			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: N/A, %s", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), City )

		

		else if ( !equal ( Country, "" ) && equal ( City, "" ) )

		

			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: %s, N/A", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), Country )

			

		else if ( equal ( Country, "" ) && equal ( City, "" ) )

	

			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: N/A, N/A", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ) )

			

		else if ( !equal ( Country, "" ) && !equal ( City, "" ) ) 

		

			ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Spectating %s^nHealth: %s - Class: %s - Ammo: %s - Armor: %d^nFrom: %s, %s", PlayerName [id], HealthString, Class, PacksString, pev ( id, pev_armorvalue ), Country, City )

	}

	else	

	{

		

		static HealthString [16], PacksString [16];

		

		AddCommas ( pev ( ID_SHOWHUD, pev_health ), HealthString, charsmax ( HealthString ) );

		

		AddCommas ( AmmoPacks [ID_SHOWHUD], PacksString, charsmax ( PacksString ) );



		set_hudmessage ( Red, Green, Blue, 0.03, 0.90, 0, 6.0, 1.1, 0.0, 0.0, -1)

		

		ShowSyncHudMsg ( ID_SHOWHUD, MsgSync_02, "Health: %s - Class: %s - Ammo: %s - Armor: %d", HealthString, Class, PacksString, pev ( ID_SHOWHUD, pev_armorvalue ) );

	}

}



public ZombiePlayIdle ( taskid )

{



         if ( EndRound || NewRound ) return;

	

	static Sound [64]

	

	if ( LastZombie [ID_BLOOD] )

	{

		ArrayGetString ( ZombieIdleLast, random_num ( 0, ArraySize ( ZombieIdleLast ) - 1 ), Sound, charsmax ( Sound ) );

		

		emit_sound ( ID_BLOOD, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	}

	else

	{

		ArrayGetString ( ZombieIdle, random_num ( 0, ArraySize ( ZombieIdle ) - 1 ), Sound, charsmax ( Sound ) );

		

		emit_sound ( ID_BLOOD, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	}

}



public MadnessOver ( taskid )

{

	NoDamage [ID_BLOOD] = false;

	

	fm_set_rendering ( ID_BLOOD );

}



DoRandomSpawn ( id, regularspawns = 0 )

{

	static Hull, SpIndex, i;

	

	Hull = ( pev ( id, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN



	if ( !regularspawns )

	{

		if ( !SpawnCount_01 ) return;

		

		SpIndex = random_num ( 0, SpawnCount_01 - 1 );

		

		for ( i = SpIndex + 1; /*no condition*/ ; i ++ )

		{

			if ( i >= SpawnCount_01 ) i = 0;

			

			if ( is_hull_vacant ( Spawns_01 , Hull ) )

			{

				engfunc ( EngFunc_SetOrigin, id, Spawns_01  );

				

				break;

			}

			

			if ( i == SpIndex ) break;

		}

	}

	else

	{

		if ( !SpawnCount_02 ) return;

		

		SpIndex = random_num ( 0, SpawnCount_02 - 1 );

		

		for ( i = SpIndex + 1; /*no condition*/ ; i ++ )

		{

			if ( i >= SpawnCount_02 ) i = 0;

			

			if ( is_hull_vacant ( Spawns_02 [i], Hull ) )

			{

				engfunc ( EngFunc_SetOrigin, id, Spawns_02 [i] );

				

				break;

			}



			if ( i == SpIndex ) break;

		}

	}

}



fnGetZombies (  )

{

	static iZombies, id;

	

	iZombies = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsZombie [id] )

			

			iZombies ++;

	}

	

	return iZombies;

}



fnGetHumans (  )

{

	static iHumans, id;

	

	iHumans = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && !IsZombie [id] )

			

			iHumans ++;

	}

	

	return iHumans;

}



fnGetNemesis (  )

{

	static iNemesis, id;

	

	iNemesis = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsNemesis [id] )

		

			iNemesis ++;

	}

	

	return iNemesis;

}



fnGetAssassins (  )

{

	static iAssassins, id;

	

	iAssassins = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsAssassin [id] )

		

			iAssassins ++;

	}

	

	return iAssassins;

}



fnGetSurvivors (  )

{

	static iSurvivors, id;

	

	iSurvivors = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsSurvivor [id] )

		

			iSurvivors ++;

	}

	

	return iSurvivors;

}



fnGetSnipers (  )

{

	static iSnipers, id;

	

	iSnipers = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsSniper [id] )

		

			iSnipers ++;

	}

	

	return iSnipers;

}



fnGetAlive (  )

{

	static iAlive, id;

	

	iAlive = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] )

			

			iAlive ++;

	}

	

	return iAlive;

}



fnGetRandomAlive ( n )

{

	static iAlive, id;

	

	iAlive = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] )

			

			iAlive ++; 

		

		if ( iAlive == n )

			

			return id;

	}

	

	return -1;

}



fnGetPlaying (  )

{

	static iPlaying, id, Team

	

	iPlaying = 0

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsConnected [id] )

		{

			Team = fm_cs_get_user_team ( id );

			

			if ( Team != FM_CS_TEAM_SPECTATOR && Team != FM_CS_TEAM_UNASSIGNED )

				

				iPlaying ++;

		}

	}

	return iPlaying;

}



fnGetCTs (  )

{

	static iCTs, id;

	

	iCTs = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsConnected [id] )

		{			

			if ( fm_cs_get_user_team ( id ) == FM_CS_TEAM_CT )

				

				iCTs ++;

		}

	}

	return iCTs;

}



fnGetTs (  )

{

	static iTs, id;

	

	iTs = 0;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsConnected [id] )

		{			

			if ( fm_cs_get_user_team ( id ) == FM_CS_TEAM_T )

				

				iTs ++;

		}

	}

	return iTs;

}



fnCheckLastZombie (  )

{

	static id;

	

	for ( id = 1; id <= MaxPlayers; id ++ )

	{

		if ( IsAlive [id] && IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] && fnGetZombies (  ) == 1 )

		{

			if ( !LastZombie [id] )

			{

				ExecuteForward ( fwUserLastZombie, fwDummyResult, id );

			}

			

			LastZombie [id] = true;

		}

		else

			LastZombie [id] = false;



		if ( IsAlive [id] && !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] && fnGetHumans (  ) == 1 ) 

		{

			if ( !LastHuman [id] )

			{

				ExecuteForward ( fwUserLastHuman, fwDummyResult, id );

			}

			

			LastHuman [id] = true;

		}

		else

			LastHuman [id] = false;

	}

}



SaveStats ( id )

{

	if ( DBName [id] [0] && !equal ( PlayerName [id], DBName [id] ) )

	{

		if ( DBSlot >= sizeof DBName ) DBSlot = MaxPlayers + 1;

		

		copy ( DBName [DBSlot], charsmax ( DBName [ ] ), DBName [id] );

		

		DBPacks [DBSlot] = DBPacks [id];

		

		DBZombieClass [DBSlot] = DBZombieClass [id];

		

		DBSlot ++;

	}

	

	copy ( DBName [id], charsmax ( DBName [ ] ), PlayerName [id] );

	

	DBPacks [id] = AmmoPacks [id];

	

	DBZombieClass [id] = ZombieClassNext [id];

}



LoadStats ( id )

{

	static i;

	

	for ( i = 0; i < sizeof DBName; i ++ )

	{

		if ( equal ( PlayerName [id], DBName [i] ) )

		{

			AmmoPacks [id] = DBPacks [i];			

			

			ZombieClass [id] = DBZombieClass [i];

			

			ZombieClassNext[id] = DBZombieClass [i];

			

			return;

		}

	}

}



CheckAllowedZombie ( id )

{

	if ( ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] ) || EndRound || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedHuman ( id )

{

	if ( ( !IsZombie [id] && !IsSurvivor [id] && !IsSniper [id] ) || EndRound || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedNemesis ( id )

{

	if ( EndRound || IsNemesis [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedAssassin ( id )

{

	if ( EndRound || IsAssassin [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && !IsZombie [id] && fnGetHumans (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedSurvivor ( id )

{

	if ( EndRound || IsSurvivor [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedSniper ( id )

{

	if ( EndRound || IsSniper [id] || !IsAlive [id] || task_exists ( TASK_WELCOMEMSG ) || ( !NewRound && IsZombie [id] && fnGetZombies (  ) == 1 ) )

		

		return false;

	

	return true;

}



CheckAllowedRespawn ( id ) 

{

	static Team;

	

	Team = fm_cs_get_user_team ( id );

	

	if ( EndRound || Team == FM_CS_TEAM_SPECTATOR || Team == FM_CS_TEAM_UNASSIGNED || IsAlive [id] )

		

		return false;

	

	return true;

}



CheckAllowedSwarm (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )

		

		return false;

	

	return true;

}



CheckAllowedMulti (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )

		

		return false;

	

	return true;

}



CheckAllowedPlague (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( ( fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) < 1 ||

	

	fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueSurvivorNum ) + get_pcvar_num ( Zp_PlagueNemesisNum ) + floatround ( (fnGetAlive (  ) - ( get_pcvar_num ( Zp_PlagueNemesisNum ) + get_pcvar_num ( Zp_PlagueSurvivorNum ) ) ) * 0.4, floatround_ceil ) ) < 1 )



	          return false;

	

	return true;

}



CheckAllowedArmageddon (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )

		

		return false;

	

	return true;

}



CheckAllowedApocalypse (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.5, floatround_ceil ) >= fnGetAlive (  ) )

		

		return false;

	

	return true;

}



CheckAllowedNightmare (  )

{

	if ( EndRound || !NewRound || task_exists ( TASK_WELCOMEMSG ) || floatround ( fnGetAlive (  ) * 0.2, floatround_ceil ) < 2 || floatround ( fnGetAlive (  ) * 0.2, floatround_ceil ) >= fnGetAlive (  ) )

		

		return false;

	

	return true;

}



CommandZombie ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Zombie", PlayerName [id], PlayerName [player] );

	

	LogToFile ( "ADMIN %s: made %s Zombie", PlayerName [id], PlayerName [player] );



	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		remove_task ( TASK_ID );

		

		cmdMakeZombie ( MODE_INFECTION, player );

	}

	else

		UserZombie ( player, 0, 0, 0, 0, 0 );

}



CommandTryder ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Tryder", PlayerName [id], PlayerName [player] );

	

	LogToFile ( "ADMIN %s: made %s Tryder", PlayerName [id], PlayerName [player] );



	BuyExtraItem ( player, EXTRA_TRYDER, true )

}



CommandHuman ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Human", PlayerName [id], PlayerName [player] );

	

	LogToFile ( "ADMIN %s: made %s Human", PlayerName [id], PlayerName [player] );



	UserHuman ( player, 0, 0, 0 );

}



CommandNemesis ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Nemesis", PlayerName [id], PlayerName [player] )

	

	LogToFile ( "ADMIN %s: made %s Nemesis", PlayerName [id], PlayerName [player] );

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		remove_task ( TASK_ID );

		

		cmdMakeZombie ( MODE_NEMESIS, player );

	}

	else

		UserZombie ( player, 0, 1, 0, 0, 0 );

}



CommandAssassin ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Assassin", PlayerName [id], PlayerName [player] );

	

	LogToFile ( "ADMIN %s: made %s Assassin", PlayerName [id], PlayerName [player] );



	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		remove_task ( TASK_ID );

		

		cmdMakeZombie ( MODE_ASSASSIN, player );

	}

	else

		UserZombie ( player, 0, 0, 1, 0, 0 );

}



CommandSurvivor ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Survivor", PlayerName [id], PlayerName [player] )

	

	LogToFile ( "ADMIN %s: made %s Survivor", PlayerName [id], PlayerName [player] );

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		remove_task ( TASK_ID );

		

		cmdMakeZombie ( MODE_SURVIVOR, player );

	}

	else

		UserHuman ( player, 1, 0, 0 );

}



CommandSniper ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : made^4 %s^1 Sniper", PlayerName [id], PlayerName [player] )

	

	LogToFile ( "ADMIN %s: made %s Sniper", PlayerName [id], PlayerName [player] );

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		remove_task ( TASK_ID );

		

		cmdMakeZombie ( MODE_SNIPER, player );

	}

	else

		UserHuman ( player, 0, 1, 0 );

}



CommandRespawn ( id, player )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : respawn^4 %s", PlayerName [id], PlayerName [player] );

	

	LogToFile ( "ADMIN %s: respawn %s", PlayerName [id], PlayerName [player] );

	

	ExecuteHamB ( Ham_CS_RoundRespawn, player );

}



CommandSwarm ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Swarm mode", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Swarm mode", PlayerName [id] );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_SWARM, 0 );

}



CommandMulti ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Multiple infection", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Multiple infection", PlayerName [id] );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_MULTI, 0 );

}



CommandPlague ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Plague mode", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Plague mode", PlayerName [id] );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_PLAGUE, 0 );

}



CommandArmageddon ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Armageddon mode", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Armageddon mode", PlayerName [id] );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_ARMAGEDDON, 0 );

}



CommandApocalypse ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Apocalypse mode", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Apocalypse mode", PlayerName [id] );

	

	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_APOCALYPSE, 0 );

}



CommandNightmare ( id )

{

	client_print_color ( 0, print_team_default, "^1[ADMIN]^4 %s^1 : started^4 Nightmare mode", PlayerName [id] );

	

	LogToFile ( "ADMIN %s: started Nightmare mode", PlayerName [id] );



	remove_task ( TASK_MAKEZOMBIE );

	

	remove_task ( TASK_ID );

	

	cmdMakeZombie ( MODE_NIGHTMARE, 0 );

} 



public native_get_user_human ( id ) return IsHuman [id];



public native_get_user_zombie ( id ) return IsZombie [id];



public native_get_user_nemesis ( id ) return IsNemesis [id];



public native_get_user_assassin ( id ) return IsAssassin [id];



public native_get_user_survivor ( id ) return IsSurvivor [id];



public native_get_user_sniper ( id ) return IsSniper [id];



public native_get_user_first_zombie ( id ) return FirstZombie [id];



public native_get_user_last_zombie ( id ) return LastZombie [id];



public native_get_user_last_human ( id ) return LastHuman [id];



public native_get_user_zombie_class ( id ) return ZombieClass [id];



public native_get_user_next_class ( id ) return ZombieClassNext [id];



public native_set_user_zombie_class ( id, classid )

{

	if ( classid < 0 || classid >= iZClass ) return 0;

	

	ZombieClassNext [id] = classid;

	

	return 1;

}



public native_get_user_ammo_packs ( id ) return AmmoPacks [id];



public native_set_user_ammo_packs ( id, amount ) AmmoPacks [id] = amount;



public native_get_zombie_maxhealth ( id )

{

	if ( IsZombie [id] && !IsNemesis [id] && !IsAssassin [id] )

	{

		if ( FirstZombie [id] )

		

			return floatround ( float ( ArrayGetCell ( ZClassHealth_01, ZombieClass [id] ) ) * 1.0 ) ;

		else

			return ArrayGetCell ( ZClassHealth_01, ZombieClass [id] );

	}

	return -1;

}



public native_get_user_nightvision ( id ) return NVision [id];



public native_set_user_nightvision ( id, set )

{

	if ( set )

	{

		NVision [id] = true;

		

		if ( !IsBot [id] )

		{

			NVisionEnabled [id] = true;

			

			if ( get_pcvar_num ( Zp_CustomNvg ) )

			{

				remove_task ( id + TASK_NVISION );

				

				set_task ( 0.1, "UserNVision", id + TASK_NVISION, _, _, "b" );

			}

			else

				SetUserGNvision ( id, 1 );

		}

		else

			cs_set_user_nvg ( id, 1 );

	}

	else

	{

		if ( IsBot [id] ) cs_set_user_nvg ( id, 0 );

		

		if ( get_pcvar_num ( Zp_CustomNvg ) ) remove_task ( id + TASK_NVISION );

		

		else if ( NVisionEnabled [id] ) SetUserGNvision ( id, 0 );

			

			NVision [id] = false;

		

		NVisionEnabled [id] = false;

	}

}



public native_infect_user ( id, infector, silent, rewards )

{

	if ( !CheckAllowedZombie ( id ) ) return 0;



	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		cmdMakeZombie ( MODE_INFECTION, id );

	}

	else

		UserZombie ( id, is_user_valid_alive ( infector ) ? infector : 0, 0, 0, ( silent == 1 ) ? 1 : 0, ( rewards == 1 ) ? 1 : 0 );

	

	return 1;

}



public native_disinfect_user ( id, silent )

{

         if ( !CheckAllowedHuman ( id ) ) return 0;



	UserHuman ( id, 0, 0, ( silent == 1 ) ? 1 : 0 );

	

	return 1;

}



public native_make_user_nemesis ( id )

{

         if ( !CheckAllowedNemesis ( id ) ) return 0;



	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		cmdMakeZombie ( MODE_NEMESIS, id );

	}

	else

		UserZombie ( id, 0, 1, 0, 0, 0 );

	

	return 1;

}



public native_make_user_assassin ( id )

{

	if ( !CheckAllowedAssassin ( id ) ) return 0;

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		cmdMakeZombie ( MODE_ASSASSIN, id );

	}

	else

		UserZombie ( id, 0, 0, 1, 0, 0 );

	

	return 1;

}



public native_make_user_survivor ( id )

{

         if ( !CheckAllowedSurvivor ( id ) ) return 0;

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		cmdMakeZombie ( MODE_SURVIVOR, id );

	}

	else

		UserHuman ( id, 1, 0, 0 );



	return 1;

}



public native_make_user_sniper ( id )

{

         if ( !CheckAllowedSniper ( id ) ) return 0;

	

	if ( NewRound )

	{

		remove_task ( TASK_MAKEZOMBIE );

		

		cmdMakeZombie ( MODE_SNIPER, id );

	}

	else

		UserHuman ( id, 0, 1, 0 );

	

	return 1;

}



public native_force_buy_extra_item ( id, ItemID, IgnoreCost )

{



         if ( ItemID < 0 || ItemID >= iExtraItem ) return 0;

	

	BuyExtraItem ( id, ItemID, IgnoreCost )

	

	return 1;

}



public native_override_user_model ( id, const newmodel[], modelindex )

{

	if ( !is_user_valid_connected ( id ) ) return 0;

	

	param_convert ( 2 );



	remove_task ( id + TASK_MODEL );

	

	static CurrentModel [32];



	fm_cs_get_user_model ( id, CurrentModel, charsmax ( CurrentModel ) )



	if ( !equal ( CurrentModel, newmodel ) )

	{

		copy ( PlayerModel [id], charsmax ( PlayerModel [ ] ), newmodel );



		if ( NewRound )

				

			set_task ( 1.0, "fmUserModelUpdate", id + TASK_MODEL );

		else

			fmUserModelUpdate ( id + TASK_MODEL );

	}



	return true;

}



public native_has_round_started (  )

{

	if ( NewRound ) return 0; 

	

	if ( ModeStarted ) return 1;

	

	return 2; 

}



public native_is_nemesis_round (  ) return NemesisRound;



public native_is_assassin_round (  ) return AssassinRound;



public native_is_survivor_round (  ) return SurvivorRound;



public native_is_sniper_round (  ) return SniperRound;



public native_is_swarm_round (  ) return SwarmRound;



public native_is_plague_round (  ) return PlagueRound;



public native_is_armageddon_round (  ) return ArmageddonRound;



public native_is_apocalypse_round (  ) return ApocalypseRound;



public native_is_nightmare_round ( ) return NightmareRound;



public native_get_zombie_count (  ) return fnGetZombies (  );



public native_get_human_count (  ) return fnGetHumans (  );



public native_get_nemesis_count (  ) return fnGetNemesis (  );



public native_get_assassin_count (  ) return fnGetAssassins (  );



public native_get_survivor_count (  ) return fnGetSurvivors (  );



public native_get_sniper_count (  ) return fnGetSnipers (  );



public native_register_extra_item ( const Name [ ], Cost, Team )

{

	if ( !ArraysCreated ) return -1;

	

	if ( Team == ZP_TEAM_ANY ) Team = ZP_TEAM_ZOMBIE | ZP_TEAM_HUMAN;

	

	param_convert ( 1 );

	

	ArrayPushString ( ExtraItemName_01, Name );

	

	ArrayPushCell ( ExtraItemCost_01, Cost );

	

	ArrayPushCell ( ExtraItemTeam_01, Team );

	

	ArrayPushCell ( ExtraItemNew, 1 );

	

	

	new i, Buffer [32], size = ArraySize ( ExtraItemRealName );

	

	for ( i = 0; i < size; i ++ )

	{

		ArrayGetString ( ExtraItemRealName, i, Buffer, charsmax ( Buffer ) );

		

		if ( !equal ( Name, Buffer ) ) continue;

		

		ArraySetCell ( ExtraItemNew, iExtraItem, 0 );

		
		ArrayGetString ( ExtraItemName_02, i, Buffer, charsmax ( Buffer ) );

		

		ArraySetString ( ExtraItemName_01, iExtraItem, Buffer );

		

		Buffer [0] = ArrayGetCell ( ExtraItemCost_02, i );

		

		ArraySetCell ( ExtraItemCost_01, iExtraItem, Buffer [0] );

		

		Buffer [0] = ArrayGetCell ( ExtraItemTeam_02, i );

		

		ArraySetCell ( ExtraItemTeam_01, iExtraItem, Buffer [0] );

	}

	

	iExtraItem ++;

	

	return iExtraItem -1;

}



native_register_item ( const Name [ ], Cost, Team )

{

	ArrayPushString ( ExtraItemName_01, Name );

	

	ArrayPushCell ( ExtraItemCost_01, Cost );

	

	ArrayPushCell ( ExtraItemTeam_01, Team );

	

	ArrayPushCell ( ExtraItemNew, 1 );

	

	iExtraItem ++;

}



public native_register_zombie_class ( const Name [ ], const Info [ ], const model [ ], const clawmodel[], hp, speed, Float:gravity, Float:knockback )

{

	if ( !ArraysCreated ) return -1;

	

	param_convert ( 1 );

	param_convert ( 2 );

	param_convert ( 3 );

	param_convert ( 4 );



	ArrayPushString ( ZClassName_01, Name )

	

	ArrayPushString ( ZClassInfo_01, Info )



	ArrayPushCell ( ZClassModelsStart_01, ArraySize ( ZClassPlayerModel_01 ) );

	

	ArrayPushString ( ZClassPlayerModel_01, model );

		

	ArrayPushCell ( ZClassModelSend_01, ArraySize ( ZClassPlayerModel_01 ) );

		

	ArrayPushCell ( ZClassModelIndex_01, -1 );



	ArrayPushString ( ZClassClawModel_01, clawmodel );

	

	ArrayPushCell ( ZClassHealth_01, hp );

	

	ArrayPushCell ( ZClassSpeed_01, speed );

	

	ArrayPushCell ( ZClassGravity_01, gravity );

	

	ArrayPushCell ( ZClassKnockback_01, knockback );

	

	ArrayPushCell ( ZClassNew, 1 );



	new i, k, Buffer [32], Float: Buffer_2, NumModelsCustom, NumModelsDefault, prec_mdl [100], size = ArraySize ( ZClassRealName );

	

	for ( i = 0; i < size; i ++ )

	{

		ArrayGetString ( ZClassRealName, i, Buffer, charsmax ( Buffer ) );

		

		if ( !equal ( Name, Buffer ) ) continue;

		

		ArraySetCell ( ZClassNew, iZClass, 0 );

		

		ArrayGetString ( ZClassName_02, i, Buffer, charsmax ( Buffer ) );

		

		ArraySetString ( ZClassName_01, iZClass, Buffer );

		

		ArrayGetString ( ZClassInfo_02, i, Buffer, charsmax ( Buffer ) );

		

		ArraySetString ( ZClassInfo_01, iZClass, Buffer );



		NumModelsCustom = ArrayGetCell ( ZClassModelSend_02, i ) - ArrayGetCell ( ZClassModelsStart_02, i );

			

		NumModelsDefault = ArrayGetCell ( ZClassModelSend_01, iZClass ) - ArrayGetCell ( ZClassModelsStart_01, iZClass );



		for ( k = 0; k < min ( NumModelsCustom, NumModelsDefault ); k ++ )

		{

			ArrayGetString ( ZClassPlayerModel_02, ArrayGetCell ( ZClassModelsStart_02, i ) + k, Buffer, charsmax ( Buffer ) );

				

			ArraySetString ( ZClassPlayerModel_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k, Buffer );

				

			formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", Buffer, Buffer );

				

			ArraySetCell ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k, engfunc ( EngFunc_PrecacheModel, prec_mdl ) );

				

			if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );

				

			if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );

		}

			

		if ( NumModelsCustom > NumModelsDefault )

		{

			for ( k = NumModelsDefault; k < NumModelsCustom; k ++ )

			{

				ArrayGetString ( ZClassPlayerModel_02, ArrayGetCell ( ZClassModelsStart_02, i ) + k, Buffer, charsmax ( Buffer ) );

					

				ArrayInsertStringAfter ( ZClassPlayerModel_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k - 1, Buffer );

					

				formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", Buffer, Buffer );



				ArrayInsertCellAfter ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ) + k - 1, engfunc ( EngFunc_PrecacheModel, prec_mdl ) ); 

					

				if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );

					

				if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );

			}



			ArraySetCell ( ZClassModelSend_01, iZClass, ArrayGetCell ( ZClassModelSend_01, iZClass ) + ( NumModelsCustom - NumModelsDefault ) );

		}

		

		ArrayGetString ( ZClassClawModel_02, i, Buffer, charsmax ( Buffer ) );

		

		ArraySetString ( ZClassClawModel_01, iZClass, Buffer );

		

		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/zombie_plague/%s", Buffer );

		

		engfunc ( EngFunc_PrecacheModel, prec_mdl );



		Buffer [0] = ArrayGetCell ( ZClassHealth_02, i );

		

		ArraySetCell ( ZClassHealth_01, iZClass, Buffer [0] );

		

		Buffer [0] = ArrayGetCell ( ZClassSpeed_02, i );

		

		ArraySetCell ( ZClassSpeed_01, iZClass, Buffer [0] );

		

		Buffer_2 = Float: ArrayGetCell ( ZClassGravity_02, i );

		

		ArraySetCell ( ZClassGravity_01, iZClass, Buffer_2 );

		

		Buffer_2 = Float: ArrayGetCell ( ZClassKnockback_02, i );

		

		ArraySetCell ( ZClassKnockback_01, iZClass, Buffer_2 );

	}



	if ( ArrayGetCell ( ZClassNew, iZClass ) )

	{

		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/player/%s/%s.mdl", model, model );

			

		ArraySetCell ( ZClassModelIndex_01, ArrayGetCell ( ZClassModelsStart_01, iZClass ), engfunc ( EngFunc_PrecacheModel, prec_mdl ) );

			

		if ( ForceConsistency == 1 ) force_unmodified ( force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl );

			

		if ( ForceConsistency == 2 ) force_unmodified ( force_exactfile, {0,0,0}, {0,0,0}, prec_mdl );



		formatex ( prec_mdl, charsmax ( prec_mdl ), "models/zombie_plague/%s", clawmodel );

		

		engfunc ( EngFunc_PrecacheModel, prec_mdl );

	}

	

	iZClass ++;

	

	return iZClass -1;

}





public native_get_extra_item_id ( const Name [ ] )

{

	param_convert ( 1 );

	

	static i, ItemName [32];

	

	for ( i = 0; i < iExtraItem; i ++ )

	{

		ArrayGetString ( ExtraItemName_01, i, ItemName, charsmax ( ItemName ) );

		

		if ( equali ( Name, ItemName ) ) return i;

	}

	

	return -1;

}



public native_get_zombie_class_id ( const Name [ ] )

{

	param_convert ( 1 );

	

	static i, ClassName [32];

	

	for ( i = 0; i < iZClass; i ++ )

	{

		ArrayGetString ( ZClassName_01, i, ClassName, charsmax ( ClassName ) );

		

		if ( equali ( Name, ClassName ) ) return i;

	}

	

	return -1;

}



public UserNVision ( taskid )

{

	static origin [3]; get_user_origin ( ID_NVISION, origin );

	

	message_begin ( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, ID_NVISION );

	write_byte ( TE_DLIGHT );

	write_coord ( origin [0] );

	write_coord ( origin [1] );

	write_coord ( origin [2] );

	write_byte ( 100 );

	

	if ( NoDamage [ID_NVISION] )

	{

		write_byte ( 255 );

		write_byte ( 0 );

		write_byte ( 0 );

	}

	else

	{

		write_byte ( 0 );

		write_byte ( 120 );

		write_byte ( 240 );

	}

	

	write_byte ( 2 );

	write_byte ( 0 ); 

	message_end (  );

}



InfectionEffects ( id )

{

	if ( !IsFrozen [id] )

	{

		message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, id );

		write_short ( UNIT_SECOND );

		write_short ( 0 );

		write_short ( FFADE_IN );	

		write_byte ( 255 );

		write_byte ( 0 );

		write_byte ( 0 );	

		write_byte ( 255 );

		message_end (  )

	}

	

	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, id );

	write_short ( UNIT_SECOND * 4 );

	write_short ( UNIT_SECOND * 2 );

	write_short ( UNIT_SECOND * 10 );

	message_end (  )

	

	static Origin [3]; get_user_origin ( id, Origin );

	

	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );

	write_byte ( TE_IMPLOSION );

	write_coord ( Origin [0] );

	write_coord ( Origin [1] );

	write_coord ( Origin[2] );

	write_byte ( 128 );

	write_byte ( 20 );

	write_byte ( 3 );

	message_end (  );

	 

	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );

	write_byte ( TE_PARTICLEBURST );

	write_coord ( Origin [0] );

	write_coord ( Origin [1] );

	write_coord ( Origin [2] );

	write_short ( 50 );

	write_byte ( 70 );

	write_byte ( 3 );

	message_end (  );

	

	message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );

	write_byte ( TE_DLIGHT );

	write_coord ( Origin [0] );

	write_coord ( Origin [1] );

	write_coord ( Origin [2] );

	write_byte ( 20 );

	write_byte ( 250 );

	write_byte ( 0 );

	write_byte ( 40 );

	write_byte ( 2 );

	write_byte ( 0 );

	message_end (  );

}



public MakeBlood ( taskid )

{

         if ( !( pev ( ID_BLOOD, pev_flags ) & FL_ONGROUND ) || fm_get_speed ( ID_BLOOD ) < 80 ) return;



	static Float: origin [3]; pev ( ID_BLOOD, pev_origin, origin );



	if ( pev ( ID_BLOOD, pev_bInDuck ) )

		

		origin [2] -= 18.0;

	else

		origin [2] -= 36.0;

	

	engfunc ( EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, origin, 0 ); 

	

	write_byte ( TE_WORLDDECAL );

	

	engfunc ( EngFunc_WriteCoord, origin [0] );

	

	engfunc ( EngFunc_WriteCoord, origin [1] ); 

	

	engfunc ( EngFunc_WriteCoord, origin [2] );

	

	write_byte ( ArrayGetCell ( ZombieDecals, random_num ( 0, ArraySize ( ZombieDecals ) - 1 ) )  + ( CZero * 12 ) );

	

	message_end (  );

}



public BurningFlame ( taskid )

{

	static origin [3], flags;

	

	get_user_origin ( ID_BURN, origin );

	

	flags = pev ( ID_BURN, pev_flags );

	

	if ( NoDamage [ID_BURN] || ( flags & FL_INWATER ) || BurningDuration [ID_BURN] < 1 )

	{

		message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );

		write_byte ( TE_SMOKE ); 

		write_coord ( origin [0] ); 

		write_coord ( origin [1] ); 

		write_coord ( origin [2] - 50 );

		write_short ( SmokeSpr ); 

		write_byte ( random_num (15, 20) ); 

		write_byte ( random_num (10, 20) );

		message_end (  );



		remove_task ( taskid );

		

		return;

	}



	if ( !IsNemesis [ID_BURN] && !IsAssassin [ID_BURN] && !random_num ( 0, 20 ) )

	{

		static Sound [64];

		

		ArrayGetString ( GrenadeFirePlayer, random_num ( 0, ArraySize ( GrenadeFirePlayer ) - 1 ), Sound, charsmax ( Sound ) )

		

		emit_sound ( ID_BURN, CHAN_VOICE, Sound, 1.0, ATTN_NORM, 0, PITCH_NORM );

	}



	if ( !IsNemesis [ID_BURN] && !IsAssassin [ID_BURN] && ( flags & FL_ONGROUND ) && get_pcvar_float ( Zp_FireSlowdown ) > 0.0 )

	{

		static Float: velocity [3];

		

		pev ( ID_BURN, pev_velocity, velocity );

		

		xs_vec_mul_scalar ( velocity, get_pcvar_float ( Zp_FireSlowdown ), velocity );

		

		set_pev ( ID_BURN, pev_velocity, velocity );

	}

	

	static health;

	

	health = pev ( ID_BURN, pev_health ); 

	

	if ( health - floatround ( get_pcvar_float ( Zp_FireDamage ), floatround_ceil ) > 0 )

		

		fm_set_user_health ( ID_BURN, health - floatround ( get_pcvar_float ( Zp_FireDamage ), floatround_ceil ) );

	

	message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );

	

	write_byte ( TE_SPRITE );

	

	write_coord ( origin [0] + random_num (-5, 5) );

	

	write_coord ( origin [1] + random_num (-5, 5) ); 

	

	write_coord ( origin [2] + random_num (-10, 10) ); 

	

	write_short ( FlameSpr );

	

	write_byte ( random_num (5, 10) );

	

	write_byte ( 200 );

	

	message_end (  );



	BurningDuration [ID_BURN]--

}



CreateBlastInfection ( const Float: Origin [3] )

{

	engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );

	write_byte ( TE_BEAMCYLINDER );

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] ); 

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] ); 

	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 

	//engfunc ( EngFunc_WriteCoord, originF[2]+385.0 );    // SMALL

	//engfunc ( EngFunc_WriteCoord, originF[2]+555.0 ); // LARGEST

	write_short ( ExploSpr ); 

	write_byte ( 0 ); 

	write_byte ( 0 ); 

	write_byte ( 4 ); 

	write_byte ( 60 ); 

	write_byte ( 0 ); 

	write_byte ( 0 ); 

	write_byte ( 250 ); 

	write_byte ( 0 ); 

	write_byte ( 200 ); 

	write_byte ( 0 ); 

	message_end (  );

}



CreateBlastFire ( const Float: Origin [3] )

{

         engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );

         write_byte ( TE_BEAMCYLINDER );

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] ); 

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] ); 

	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 

         write_short ( ExploSpr ); 

         write_byte ( 0 ); 

         write_byte ( 0 ); 

         write_byte ( 4 ); 

         write_byte ( 60 ); 

         write_byte ( 0 ); 

         write_byte ( 250 );

         write_byte ( 40 );

         write_byte ( 0 );

         write_byte ( 200 );

         write_byte ( 0 );

         message_end (  )

}



CreateBlastFrost ( const Float: Origin [3] )

{

         engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );

         write_byte ( TE_BEAMCYLINDER );

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] ); 

	engfunc ( EngFunc_WriteCoord, Origin [0] ); 

	engfunc ( EngFunc_WriteCoord, Origin [1] ); 

	engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 ); 

         write_short ( ExploSpr ); 

         write_byte ( 0 ); 

         write_byte ( 0 ); 

         write_byte ( 4 ); 

         write_byte ( 60 ); 

         write_byte ( 0 );

         write_byte ( 0 );

         write_byte ( 100 );

         write_byte ( 200 );

         write_byte ( 200 );

         write_byte ( 0 );

         message_end (  );

}



FixDeadAttrib ( id )

{

         message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreAttrib" ) );

         write_byte ( id ); 

         write_byte ( 0 );

         message_end (  );

}



SendDeathMsg ( Attacker, Victim )

{

         message_begin ( MSG_BROADCAST, get_user_msgid ( "DeathMsg" ) );

         write_byte ( Attacker );

         write_byte ( Victim ); 

         write_byte ( 1 );
         write_string ( "infection" )

         message_end (  )

}



UpdateFrags ( Attacker, Victim, frags, deaths, scoreboard )

{

	set_pev ( Attacker, pev_frags, float ( pev ( Attacker, pev_frags ) + frags ) );

	

	fm_cs_set_user_deaths ( Victim, cs_get_user_deaths ( Victim ) + deaths );

	

	if ( scoreboard )

	{

		message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreInfo" ) );

		write_byte ( Attacker );

		write_short ( pev ( Attacker, pev_frags ) );

		write_short ( cs_get_user_deaths ( Attacker ) );

		write_short ( 0 );

		write_short ( fm_cs_get_user_team ( Attacker ) );

		message_end (  );

		

		message_begin ( MSG_BROADCAST, get_user_msgid ( "ScoreInfo" ) );

		write_byte ( Victim );

		write_short ( pev ( Victim, pev_frags ) );

		write_short ( cs_get_user_deaths ( Victim ) );

		write_short ( 0 );

		write_short ( fm_cs_get_user_team ( Victim ) );

		message_end (  );

	}

}



PlaySound ( const Sound [ ] ) client_cmd ( 0, "spk ^"%s^"", Sound );



SetUserGNvision ( id, toggle )

{

         message_begin ( MSG_ONE, get_user_msgid ( "NVGToggle" ), _, id );

         write_byte ( toggle );

         message_end (  );

}



AddCommas ( iNum , szOutput[] , iLen )

{

	new szTmp [17] , iOutputPos , iNumPos , iNumLen;

    

	//if ( iNum < 0 )

	//{

	//    iNum = abs( iNum );

	//}

    

	iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );

    

	if ( iNumLen <= 3 )

	{

        		iOutputPos += copy ( szOutput [iOutputPos] , iLen , szTmp );

    	}

    	else

    	{

        		while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) ) 

       	 	{

                   	szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];

            

            		if ( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) ) 



					szOutput[ iOutputPos++ ] = ',';

       		}

            

	    	szOutput[ iOutputPos ] = EOS;

    	}

    

    	return iOutputPos;

} 



public LogToFile ( const msg [ ], any:...)

{

	new Message [256];

	

	vformat ( Message, sizeof ( Message ) -1, msg , 2 );

	

	new Director [64], File [128], Log [256], LogTime [32];

	

	get_time ( "%d.%m.%Y - %H:%M:%S", LogTime, sizeof ( LogTime ) -1 );

	

	if( !Director [0] )

	{	

		get_basedir ( Director, sizeof ( Director ) -1 );

		

		formatex ( File, sizeof ( File ) -1, "%s/logs/ZombiePlague-UltimateX.log", Director );

	}

	

	formatex ( Log, sizeof ( Log ) -1, "|%s| %s ", LogTime, Message );

	

	write_file ( File, Log, -1 );

}



/* --------------- | Extra Items | -------------- */



public BuyTripMine ( id )

{

	if ( !IsAlive [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );

		

		return PLUGIN_CONTINUE;

	}

	

	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );

		

		return PLUGIN_CONTINUE;

	}

	

	if ( AmmoPacks [id] < ExtraCosts [EXTRA_TRIPMINE] )

	{

		client_print_color ( id, print_team_grey, "%s You need^4 %d ammo packs^1.", CHAT_PREFIX, ExtraCosts [EXTRA_TRIPMINE] );

		

		return PLUGIN_CONTINUE;

	}

	

	

	AmmoPacks [id] -= ExtraCosts [EXTRA_TRIPMINE];

	

	HasTripMines [id] ++;

	

	client_print_color ( id, print_team_grey, "%s You bought a trip mine. Press^3 V^1 to plant it or^3 C^1 to take it.", CHAT_PREFIX );

	

	client_cmd ( id, "bind ^"v^" ^"createlaser^"" );

	

	client_cmd ( id, "bind ^"c^" ^"removelaser^"" );

	

	return PLUGIN_CONTINUE;

}



public PlantTripMine ( id )

{

	if( !IsAlive [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

		

	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

	

	if ( !HasTripMines [id] )

	{

		client_print_color ( id, print_team_default, "%s You don't have a trip mine to plant.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

	

	if ( PlantedMines [id] > 1 )

	{

		client_print_color ( id, print_team_grey, "%s You can plant only^3 2^1 mines.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}



	

	if ( HasPlanting [id] || HasRemoving [id] ) return PLUGIN_HANDLED;

	

	if ( CanPlant ( id ) ) 

	{

		HasPlanting [id] = true;

		

		message_begin ( MSG_ONE_UNRELIABLE, 108, _, id );

		write_byte ( 1 );

		write_byte ( 0 );

		message_end ( );

		

		set_task ( 1.2, "fwPlantMines", id + TASK_CREATE );

	}

	

	return PLUGIN_HANDLED;

}



public TakeTripMine ( id )

{

	if ( !IsAlive [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Alive^1.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

	

	if ( IsZombie [id] || IsNemesis [id] || IsAssassin [id] )

	{

		client_print_color ( id, print_team_grey, "%s You should be^3 Human^1.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

	

	if ( !PlantedMines [id] )

	{

		client_print_color ( id, print_team_default, "%s You don't have a planted mine.", CHAT_PREFIX );

		

		return PLUGIN_HANDLED;

	}

	

	if ( HasPlanting [id] || HasRemoving [id] ) return PLUGIN_HANDLED;

	

	if ( CanTake ( id ) ) 

	{

		HasRemoving [id] = true;

		

		message_begin ( MSG_ONE_UNRELIABLE, 108, _, id );

		write_byte ( 1 );

		write_byte ( 0 );

		message_end (  );

		

		set_task ( 1.2, "fwTakeMines", id + TASK_REMOVE );

	}

	

	return PLUGIN_HANDLED;

}



public fwPlantMines ( id ) 

{

	id -= TASK_CREATE;

	

	HasPlanting [id] = false;

	

	static Float: Origin [3]; entity_get_vector ( id, EV_VEC_origin, Origin );

	

	static Float: TraceDirection [3], Float: TraceEnd [3], Float: iTraceResult [3], Float: Normal [3];

	

	velocity_by_aim ( id, 128, TraceDirection );

	

	TraceEnd [0] = TraceDirection [0] + Origin [0];

	

	TraceEnd [1] = TraceDirection [1] + Origin [1];

	

	TraceEnd [2] = TraceDirection [2] + Origin [2];

	

	static Float: Fraction, iTr; iTr = 0;

	

	engfunc ( EngFunc_TraceLine, Origin, TraceEnd, 0, id, iTr );

	

	get_tr2 ( iTr, TR_vecEndPos, iTraceResult );

	

	get_tr2 ( iTr, TR_vecPlaneNormal, Normal );

	

	get_tr2 ( iTr, TR_flFraction, Fraction );

	

	static Entity; Entity = create_entity ( "info_target" );

	

	if ( !Entity ) return;

	

	entity_set_string ( Entity, EV_SZ_classname, MINE_CLASSNAME );

	

	entity_set_model ( Entity, ModelTripMine );

	

	entity_set_size ( Entity, Float: { -4.0, -4.0, -4.0 }, Float: { 4.0, 4.0, 4.0 } );

	

	if ( get_pcvar_num ( TripMineGlow ) )

	

		fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 120, 240, kRenderNormal, 13 );

	

	entity_set_int ( Entity, EV_INT_iuser2, id );

	

	PlantedMines [id] ++;



	set_pev ( Entity, pev_iuser3, PlantedMines [id] );

	

	entity_set_float ( Entity, EV_FL_frame, 0.0 );

	

	entity_set_float ( Entity, EV_FL_framerate, 0.0 );

	

	entity_set_int ( Entity, EV_INT_movetype, MOVETYPE_FLY );

	

	entity_set_int ( Entity, EV_INT_solid, SOLID_NOT );

	

	entity_set_int ( Entity, EV_INT_body, 3 );

	

	entity_set_int ( Entity, EV_INT_sequence, 7 );

	

	entity_set_float ( Entity, EV_FL_takedamage, DAMAGE_NO );

	

	entity_set_int ( Entity, EV_INT_iuser1, 0 );

	

	static Float: NewOrigin [3], Float: EntAngles [3];

	

	NewOrigin [0] = iTraceResult [0] + ( Normal [0] * 8.0 );

	

	NewOrigin [1] = iTraceResult [1] + ( Normal [1] * 8.0 );

	

	NewOrigin [2] = iTraceResult [2] + ( Normal [2] * 8.0 );

	

	entity_set_origin ( Entity, NewOrigin );

	

	vector_to_angle ( Normal, EntAngles );

	

	entity_set_vector ( Entity, EV_VEC_angles, EntAngles );

	

	EntAngles [0] *= -1.0;

	

	EntAngles [1] *= -1.0;

	

	EntAngles [2] *= -1.0;

	

	entity_set_vector ( Entity, EV_VEC_v_angle, EntAngles );

	

	HasTripMines [id] --;

	

	emit_sound ( Entity, CHAN_WEAPON, MINE_SOUND_DEPLOY, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

	

	emit_sound ( Entity, CHAN_VOICE, MINE_SOUND_CHARGE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

	

	entity_set_float ( Entity, EV_FL_nextthink, get_gametime (  ) + 0.6 );

}



public fwTakeMines ( id ) 

{

	id -= TASK_REMOVE;

	

	HasRemoving [id] = false;

	

	static Entity, ClassName [32], Float: OwnerOrigin [3], Float: EntityOrigin [3];

	

	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 

	{

		if ( !is_valid_ent ( Entity ) ) continue;

		

		ClassName [0] = '^0';

		

		entity_get_classname ( Entity, ClassName );

		

		if ( equal ( ClassName, MINE_CLASSNAME ) ) 

		{

			if ( entity_get_owner ( Entity ) == id ) 

			{

				entity_get_vector ( id, EV_VEC_origin, OwnerOrigin );

				

				entity_get_vector ( Entity, EV_VEC_origin, EntityOrigin );

				

				if ( get_distance_f ( OwnerOrigin, EntityOrigin ) < 55.0 ) 

				{

					PlantedMines [id] --;

					

					HasTripMines [id] ++;

					

					remove_entity ( Entity );

					

					break;

				}

			}

		}

	}

}



public bool: CanPlant ( id ) 

{

	static Float: Origin [3];

	

	entity_get_vector ( id, EV_VEC_origin, Origin );

	

	static Float: TraceDirection [3], Float: TraceEnd [3], Float: iTraceResult [3], Float: Normal [3];

	

	velocity_by_aim ( id, 64, TraceDirection );

	

	TraceEnd [0] = TraceDirection [0] + Origin [0];

	

	TraceEnd [1] = TraceDirection [1] + Origin [1];

	

	TraceEnd [2] = TraceDirection [2] + Origin [2];

	

	static Float: Fraction, iTr; iTr = 0;

	

	engfunc ( EngFunc_TraceLine, Origin, TraceEnd, 0, id, iTr );

	

	get_tr2 ( iTr, TR_vecEndPos, iTraceResult );

	

	get_tr2 ( iTr, TR_vecPlaneNormal, Normal );

	

	get_tr2 ( iTr, TR_flFraction, Fraction );

	

	if ( Fraction >= 1.0 ) 

	{

		client_print_color ( id, print_team_default, "%s You must plant the tripmine on a wall.", CHAT_PREFIX );

			

		return false;

	}

	

	return true;

}



public bool: CanTake ( id ) 

{

	static Entity, ClassName [32], Float: OwnerOrigin [3], Float: EntityOrigin [3];

	

	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 

	{

		if ( !is_valid_ent ( Entity ) ) continue;

		

		ClassName [0] = '^0';

		

		entity_get_classname ( Entity, ClassName );

		

		if ( equal ( ClassName, MINE_CLASSNAME ) ) 

		{

			if ( entity_get_owner ( Entity ) == id ) 

			{

				entity_get_vector ( id, EV_VEC_origin, OwnerOrigin );

				

				entity_get_vector ( Entity, EV_VEC_origin, EntityOrigin );

				

				if ( get_distance_f ( OwnerOrigin, EntityOrigin ) < 55.0 )

					

					return true;

			}

		}

	}

	

	return false;

}



public fwRemoveMinesByOwner ( id ) 

{

	static Entity, ClassName [32];

	

	for ( Entity = 0; Entity < MAX_ENTITIES + 1; Entity ++ ) 

	{

		if ( !is_valid_ent ( Entity ) ) continue;

		

		ClassName [0] = '^0';

		

		entity_get_classname ( Entity, ClassName );

		

		if ( equal ( ClassName, MINE_CLASSNAME ) )

		

			if ( entity_get_int ( Entity, EV_INT_iuser2 ) == id )

				

				remove_entity ( Entity );

	}

}



fwExplodeMine ( Entity ) 

{

	PlantedMines [entity_get_owner ( Entity )] --;

	

	static Float: Origin [3], Float: ZombieOrigin [3], Float: Velocity [3];

	

	entity_get_vector ( Entity, EV_VEC_origin, Origin );



	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_EXPLOSION );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	write_short ( HExplode )

	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

	write_byte ( 55 );

	write_byte ( 15 );

	write_byte ( 0 );

	message_end (  );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_EXPLOSION );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	write_short( HExplode );

	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

	write_byte ( 65 );

	write_byte ( 15 );

	write_byte ( 0 );

	message_end (  );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_EXPLOSION );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	write_short ( HExplode );

	emit_sound ( Entity, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

	write_byte ( 85 );

	write_byte ( 15 );

	write_byte ( 0 );

	message_end (  );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_BEAMCYLINDER );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] + 400.0 ); 

	write_short ( ExploSpr );

	write_byte ( 0 ); 

	write_byte ( 0 ); 

	write_byte ( 4 ); 

	write_byte ( 60 ); 

	write_byte ( 0 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 200 ); 

	write_byte ( 0 );

	message_end (  );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_BEAMCYLINDER );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] + 700.0 ); 

	write_short ( ExploSpr ); 

	write_byte ( 0 ); 

	write_byte ( 0 ); 

	write_byte ( 4 ); 

	write_byte ( 110 ); 

	write_byte ( 0 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 200 );

	write_byte ( 0 );

	message_end (  );

	

	message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

	write_byte ( TE_BEAMCYLINDER ); 

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] );

	engfunc ( EngFunc_WriteCoord, Origin [0] );

	engfunc ( EngFunc_WriteCoord, Origin [1] );

	engfunc ( EngFunc_WriteCoord, Origin [2] + 900.0 ); 

	write_short ( ExploSpr ); 

	write_byte ( 0 );

	write_byte ( 0 ); 

	write_byte ( 4 ); 

	write_byte ( 160 ); 

	write_byte ( 0 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 121 ); 

	write_byte ( 200 ); 

	write_byte ( 0 ); 

	message_end (  );

	

	static iZombie;

	

	for ( iZombie = 1; iZombie < MaxPlayers + 1; iZombie ++ ) 

	{

		if ( is_user_connected ( iZombie ) ) 

		{

			if ( is_user_alive ( iZombie ) ) 

			{

				entity_get_vector ( iZombie, EV_VEC_origin, ZombieOrigin );

				

				if ( get_distance_f ( Origin, ZombieOrigin ) < 340.0 ) 

				{

					entity_get_vector ( iZombie, EV_VEC_velocity, Velocity );

					

					Velocity [2] += 240.0;

					

					Velocity [1] += 200.0;

					

					Velocity [0] += 160.0;

					

					entity_set_vector ( iZombie, EV_VEC_velocity, Velocity );

				}

			}

		}

	}

	

	for ( new i = 1; i < MaxPlayers + 1; i ++ )

	{

		if ( !is_user_connected ( i ) || !is_user_alive ( i ) ) continue;

		

		if ( IsZombie [i] )

		{

			static Float: fDistance, Float: fDamage;



			fDistance = EntityRange ( i, Entity );



			if ( fDistance < 340 )

			{

				fDamage = 2850.0 - fDistance;



				static Float: fVelocity [3];

				

				pev ( i, pev_velocity, fVelocity );



				xs_vec_mul_scalar ( fVelocity, 1.75, fVelocity );



				set_pev ( i, pev_velocity, fVelocity );



				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, i );

				write_short ( UNIT_SECOND );

				write_short ( UNIT_SECOND );

				write_short ( FFADE_IN );

				write_byte ( 250 );

				write_byte ( 0 );

				write_byte ( 0 );

				write_byte ( fDistance < 220 ? 230 : 210 );

				message_end (   );

				

				message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, i );

			        write_short ( UNIT_SECOND * 3 );

			        write_short ( UNIT_SECOND * 2 );

			        write_short ( UNIT_SECOND * 4 );

				message_end (  );



				if ( float ( get_user_health ( i ) ) - fDamage > 0 )

		

					ExecuteHamB ( Ham_TakeDamage, i, Entity, entity_get_owner ( Entity ), fDamage, DMG_BLAST );

				else 

					ExecuteHamB ( Ham_Killed, i, entity_get_owner ( Entity ), 2 );

			

				

				if ( !IsNemesis [i] && !IsAssassin [i] ) fDamage *= 0.75;



				client_print_color ( entity_get_owner ( Entity ), print_team_default, "%s Damage to^4 %s^1 ::^4 %0.0f^1 damage", CHAT_PREFIX, PlayerName [i], fDamage );

			}

		}

	}



	for ( new i = 1; i < MaxPlayers + 1; i ++ )

	{

		if ( !is_user_connected ( i ) || !is_user_alive ( i ) ) continue;

		

		if ( !IsZombie [i] )

		{

			message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, i );

			write_short ( UNIT_SECOND * 3 );

			write_short ( UNIT_SECOND * 2 );

			write_short ( UNIT_SECOND * 4 );

			message_end (  );

			

			if ( EntityRange ( i, Entity ) < 340 )

			{

				static Float: fVelocity [3];

				

				pev ( i, pev_velocity, fVelocity );



				xs_vec_mul_scalar ( fVelocity, 1.5, fVelocity );



				set_pev ( i, pev_velocity, fVelocity );

			}

		}

	}



	remove_entity ( Entity );

}



public fwThinkMine ( Entity ) 

{

	static Float: GameTime, iStatus;

	

	GameTime = get_gametime (  );

	

	iStatus = entity_get_status ( Entity );

	

	switch ( iStatus ) 

	{

		case 0: 

		{

			entity_set_int ( Entity, EV_INT_iuser1, 1 );

			

			entity_set_float ( Entity, EV_FL_takedamage, DAMAGE_YES );

			

			entity_set_int ( Entity, EV_INT_solid, SOLID_BBOX );

			

			entity_set_float ( Entity, EV_FL_health, float ( get_pcvar_num ( TripMineHealth ) ) + 1000.0 );

			

			emit_sound ( Entity, CHAN_VOICE, MINE_SOUND_ACTIVATE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

		}

		case 1: 

		{

			static Float: Health;

			

			Health = entity_get_float ( Entity, EV_FL_health );



			if ( is_user_alive ( entity_get_owner ( Entity ) ) )

			{

				if ( entity_get_owner ( Entity ) )

				{

					if ( pev ( Entity, pev_iuser3 ) == 1 )

					{

						set_hudmessage ( 0, 120, 240, 0.08, 0.3, 0, 0.0, 0.12, 2.0, 1.0, -1 ),

						

						ShowSyncHudMsg ( entity_get_owner ( Entity ), MsgSync_01, "First mine's health: %0.0f", Health - 1000.0 );

					}

					else

					{

						set_hudmessage ( 0, 120, 240, 0.08, 0.33, 0, 0.0, 0.12, 2.0, 1.0, -1 ),

						

						ShowSyncHudMsg ( entity_get_owner ( Entity ), MsgSync_02, "Second mine's health: %0.0f", Health - 1000.0 );

					}

				}

				

				if ( Health <= 1000.0 ) 

				{

					fwExplodeMine ( Entity );

				

					return FMRES_IGNORED;

				}

			}

		}

	}

	

	if ( is_valid_ent ( Entity ) )

		

		entity_set_float ( Entity, EV_FL_nextthink, GameTime + 0.1 );

	

	return FMRES_IGNORED;

}



public fwStartFrame (  )

{ 

	iTime = get_gametime (  );

	

	static id; 

	

	for ( id = 1; id <= MaxPlayers; id ++ ) 

		

		Frame [id] ++;

}



public fwPlayerPreThink_02 ( id )

{

	engfunc ( EngFunc_LightStyle, 0, AssassinRound ? "a" : "d" );

	

	if ( is_user_alive ( id ) ) 

		

		JPForward ( id );

}

	

public JPForward ( id ) 

{	

	if ( !is_user_alive ( id ) && ( IsZombie [id] || IsNemesis [id] || IsSurvivor [id] ) )

		

		return FMRES_IGNORED;		

		

	if ( !HasJet [id] ) return FMRES_IGNORED;

	

	if ( JPCal [id] < iTime ){

		

		JPEnergy ( id );  JPCal [id] = iTime + get_pcvar_float ( Zp_CalTime );

	}

	

	CheckRocket ( id );

	

	new Clip, Ammo;

	

	new WeaponID = get_user_weapon ( id, Clip, Ammo );

	

	if ( WeaponID == CSW_KNIFE || WeaponID != CSW_KNIFE )

	{

		if ( ( pev ( id, pev_button ) & IN_ATTACK2 ) )

		{

			Attack_02 ( id );	

		}	

	}

	if( ( !( pev ( id, pev_flags ) & FL_ONGROUND ) ) && ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) )

	{			

		if ( ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.3 ) && ( FlyEnergy [id] <= get_pcvar_num ( Zp_FlyMaxEngery ) ) ) 

		{

			if ( JPSound [id] < iTime )

			{

				emit_sound ( id, CHAN_ITEM, SoundJetpack, 1.0, ATTN_NORM, 1, PITCH_HIGH );

				

				JPSound [id] = iTime + 1.0;

			}

		}					

		else if ( ( FlyEnergy [id] > 0 ) && ( FlyEnergy [id] < get_pcvar_num ( Zp_FlyMaxEngery ) * 0.3 ) )

		{

			if ( JPSound [id] < iTime )

			{

				emit_sound ( id, CHAN_ITEM, SoundJetpackBlow, 1.0, ATTN_NORM, 1, PITCH_HIGH );

				

				JPSound [id] = iTime + 1.0;

			}

		}

		

		HumanFly ( id );

		

		Attack_01 ( id );

	}	

	

	return FMRES_IGNORED

}

public JPEnergy ( id ) 

{

	if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) && pev ( id, pev_button ) & IN_ATTACK )	

	{	

		new Clip, Ammo;

			

		new WeaponID = get_user_weapon ( id, Clip, Ammo )

			

		if ( WeaponID == CSW_KNIFE ) 

		{

			if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.09 )

				

				FlyEnergy [id] = FlyEnergy [id] - get_pcvar_num ( Zp_FlyEngery );	 

		}

	}

	else if ( ( !( pev ( id, pev_flags ) & FL_ONGROUND ) ) && ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) )

	{

		if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.09 )

			

			FlyEnergy [id] = FlyEnergy [id] - get_pcvar_num ( Zp_FlyEngery );

	}

		

	if ( pev ( id, pev_flags ) & FL_ONGROUND )	

			

		FlyEnergy [id] = FlyEnergy [id] + get_pcvar_num ( Zp_RegainEnergy );

}



public Attack_01 ( id ) 

{

	if ( Fly [id] )

	{	

		static Float: JetpackData_01 [3];

		

		pev ( id, pev_velocity, JetpackData_01 );

		

		new Origin [3], Float: Aim [3];

		

		VelocityByAim ( id, 10, Aim );

		

		get_user_origin ( id, Origin );

		

		Origin [0] -= floatround ( Aim [0] );

		

		Origin [1] -= floatround ( Aim [1] );

		

		Origin [2] -= floatround ( Aim [2] );

		

		

		if( ( pev ( id, pev_button ) & IN_JUMP && pev ( id, pev_button ) & IN_DUCK ) && !( pev ( id, pev_flags ) & FL_ONGROUND ) )

		{

			

			message_begin ( MSG_ALL,SVC_TEMPENTITY );

			write_byte ( 17 );

			write_coord ( Origin [0] );

			write_coord ( Origin [1] );

			write_coord ( Origin [2] );

			write_short ( xFireBallSpr );

			write_byte ( 9 );

			write_byte ( 180 );

			message_end (  );	

			

			static Float: Speed;

			

			Speed = floatsqroot ( JetpackData_01 [0] * JetpackData_01 [0] + JetpackData_01 [1] * JetpackData_01 [1] )

			

			if ( Speed !=0.0 )

		         {

			         set_pev ( id, EV_INT_movetype,6 );

			        

				set_pev ( id, pev_frame, 0.9 );

		         }

		

		         if ( Speed < get_pcvar_float ( Zp_JetpackSpeed ) )



			         Speed += get_pcvar_float ( Zp_JetpackAccelerate );

			

			static Float: JetpackData_02 [3];

			

			pev ( id, pev_angles, JetpackData_02 );

			

			JetpackData_02 [2] = 0.0;

			

			angle_vector ( JetpackData_02, ANGLEVECTOR_FORWARD, JetpackData_02 );

			

			JetpackData_02 [0] *= Speed;

			

			JetpackData_02 [1] *= Speed;

			

			JetpackData_01 [0] = JetpackData_02 [0];

			

			JetpackData_01 [1] = JetpackData_02 [1];

		}

		

		if ( JetpackData_01 [2] < get_pcvar_float ( Zp_JetpackSpeed ) && JetpackData_01 [2] > 0.0 )



		         JetpackData_01 [2] += get_pcvar_float ( Zp_JetpackUpSpeed );

		

		else if ( JetpackData_01 [2] < 0.0 )

			

			JetpackData_01 [2] += ( get_pcvar_float ( Zp_JetpackUpSpeed ) * 1.15 );

		

		set_pev ( id, pev_velocity, JetpackData_01 );

	}

}



public Attack_02 ( id ) 

{	

	if ( Rocket [id] )

	{

		new RocketEntity = create_entity ( "info_target" );

		

		if ( RocketEntity == 0 ) return PLUGIN_CONTINUE;

		

		entity_set_string ( RocketEntity, EV_SZ_classname, "zp_jp_rocket" );

		

		entity_set_model ( RocketEntity, RocketModel );

		

		entity_set_size ( RocketEntity, Float:{0.0, 0.0, 0.0}, Float: {0.0, 0.0, 0.0} );

		

		entity_set_int ( RocketEntity, EV_INT_movetype, MOVETYPE_FLY );

		

		entity_set_int ( RocketEntity, EV_INT_solid, SOLID_BBOX );

		

		new Float: vSrc [3];

		

		entity_get_vector ( id, EV_VEC_origin, vSrc );

		

		new Float: Aim [3], Float: Origin [3];

		

		VelocityByAim ( id, 64, Aim );

		

		entity_get_vector ( id, EV_VEC_origin, Origin );

		

		vSrc [0] += Aim [0];

		vSrc [1] += Aim [1];

		

		entity_set_origin ( RocketEntity, vSrc );

		

		new Float: Velocity [3], Float: Angles [3], iOrigin [3]

		

		VelocityByAim ( id, get_pcvar_num ( Zp_RocketSpeed ), Velocity );

		

		entity_set_vector ( RocketEntity, EV_VEC_velocity, Velocity );

		

		vector_to_angle ( Velocity, Angles );

		

		entity_set_vector ( RocketEntity, EV_VEC_angles, Angles );

		

		entity_set_edict ( RocketEntity,EV_ENT_owner, id );

		

		entity_set_float ( RocketEntity, EV_FL_takedamage, 1.0 );

		 

		set_pev ( RocketEntity, pev_effects, EF_LIGHT );

		

		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

		

		write_byte ( TE_BEAMFOLLOW );

		

		write_short ( RocketEntity );

		

		write_short ( JPSmokeSpr );

		

		write_byte ( 25 );

		

		write_byte ( 8 );

		

		write_byte ( 255 );

		

		write_byte ( 255 );

		

		write_byte ( 255 );

		

		write_byte ( 200 );

		

		message_end (  );

		

		

		message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );

		write_byte ( TE_BEAMTORUS );

		write_coord ( iOrigin [0] ); 

		write_coord ( iOrigin [1] ); 

		write_coord ( iOrigin [2] ); 

		write_coord ( iOrigin [0] ); 

		write_coord ( iOrigin [1] );

		write_coord ( iOrigin [2] + 10 );

		write_short ( xFireBallSpr ); 

		write_byte ( 0 );

		write_byte ( 0  ); 

		write_byte ( 8 ); 

		write_byte ( 50 ); 

		write_byte ( 0 ); 

		write_byte ( 0 ); 

		write_byte ( 255 ); 

		write_byte ( 0 ); 

		write_byte ( 255 ); 

		write_byte ( 0 ); 

		message_end (  );

		

		emit_sound ( RocketEntity, CHAN_WEAPON, SoundRocket, 1.0, ATTN_NORM, 0, PITCH_NORM );

		

		Shot [id] = true;

		

		LastRocket [id] = iTime + get_pcvar_num ( Zp_RocketDelay );

	}

	return PLUGIN_CONTINUE

}



public CheckModels ( id ) 

{	

	if ( IsZombie [id] || IsNemesis [id] || IsSurvivor [id] ) return FMRES_IGNORED

	

	if ( HasJet [id] ) 

	{

		new Clip, Ammo;

		

		new WeaponID = get_user_weapon ( id, Clip, Ammo );

		

		if ( WeaponID == CSW_KNIFE ) 

		

			SwitchModel ( id );

			

		return PLUGIN_CONTINUE

	}

	return PLUGIN_CONTINUE

}



public SwitchModel ( id ) 

{

	entity_set_string ( id,EV_SZ_viewmodel, "models/v_egon.mdl" );

	

	entity_set_string ( id,EV_SZ_weaponmodel, "models/p_egon.mdl" );

}



public RemoveJetpacks (  ) 

{

	new NextItem  = find_ent_by_class ( -1, "zp_jp_jetpack" );

	

        while ( NextItem ) 

        {

		remove_entity ( NextItem );

		

                NextItem = find_ent_by_class ( -1, "zp_jp_jetpack" );

	}



	return PLUGIN_CONTINUE;

}



public HumanFly ( id ) 

{	

	if ( FlyEnergy [id] <= get_pcvar_num ( Zp_FlyMaxEngery ) * 0.1 )

	{

		JPOff ( id );	

	}

	if ( FlyEnergy [id] > get_pcvar_num ( Zp_FlyMaxEngery ) * 0.1 )

	{

		JPOn ( id );

	}

}



public JPOn ( id ) 

{

	Fly [id] = true;

	

}

public JPOff ( id ) 

{

	Fly [id] = false;

	

}



public CheckRocket ( id ) 

{	

	if ( LastRocket [id] > iTime )

	{	

		RK_Forbidden ( id );

		

		RSound [id] = true;

	}

	else

	{	

		if ( Shot [id] )

		{

			RSound [id] = false;

			

			Shot [id] = false;

		}

		

		RK_Sound ( id );

		

		RK_Allow ( id);

	}

}



public RK_Allow ( id ) Rocket [id] = true;





public RK_Forbidden ( id ) Rocket [id] = false;

	



public RK_Sound ( id ) 

{

	if ( !RSound [id] )

	{

		engfunc ( EngFunc_EmitSound, id, CHAN_WEAPON, SoundGetRocket, 1.0, ATTN_NORM, 0, PITCH_NORM );

		

		//client_print(player, print_center, "")

		

		RSound [id] = true;

	}

	/*else if ( RSound [id] )

	{

		

	}*/

	

}



public DropJetpack ( id ) 

{

	if ( HasJet [id] ) 

	{

		new Float: Aim [3], Float: Origin [3];

		

		VelocityByAim ( id, 64, Aim );

		

		entity_get_vector ( id, EV_VEC_origin, Origin );

		

		Origin [0] += Aim [0];

		

		Origin [1] += Aim [1];

		

		new Jetpack = create_entity ( "info_target" );

		

		entity_set_string ( Jetpack, EV_SZ_classname, "zp_jp_jetpack" );

		

		entity_set_model ( Jetpack, "models/p_egon.mdl" );	 

		

		entity_set_size ( Jetpack, Float: {-16.0,-16.0,-16.0}, Float: {16.0,16.0,16.0} );

		

		entity_set_int ( Jetpack, EV_INT_solid, 1 );

		

		entity_set_int ( Jetpack, EV_INT_movetype, 6 );

		

		entity_set_vector ( Jetpack, EV_VEC_origin, Origin )	;	

		

		HasJet [id] = 0;

		

		Rocket [id] = false;

	}	

}



public pfn_touch ( pentru, ptd ) 

{ 

	if( is_valid_ent ( pentru ) ) 

	{ 

		new ClassName [32];

		

		entity_get_string ( pentru, EV_SZ_classname, ClassName, charsmax ( ClassName ) ); 

		

		if ( equal ( ClassName, "zp_jp_jetpack" ) ) 

		{ 

			if ( is_valid_ent ( ptd ) ) 

			{ 

				new id = ptd;

				

				if ( id > 0 && id < MaxPlayers + 2 ) 

				{ 

					if ( !HasJet [id] && !IsZombie [id] && is_user_alive ( id ) ) 

					{ 	

						HasJet [id] = 1 ;

						

						FlyEnergy [id] = get_pcvar_num ( Zp_FlyEngery );

						

						Rocket [id] = true ;

						

						emit_sound ( id, CHAN_ITEM, SoundBuyJetpack, 1.0, ATTN_NORM, 0, PITCH_NORM );

						//client_cmd(id,"spk items/gunpickup2.wav") 

						

						engclient_cmd ( id, "weapon_knife" ) 

						

						SwitchModel ( id ) 

						

						remove_entity ( pentru )

					}

				}

			}

		}

		else if( equal ( ClassName, "zp_jp_rocket" ) ) 

		{

			new Float: Origin [3], iOrigin [3];

			

			entity_get_vector ( pentru, EV_VEC_origin, Origin );

			

			FVecIVec ( Origin, iOrigin );

			

			JPRadiusDamage ( pentru );

			

			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_EXPLOSION)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_short(HExplode)

			write_byte(55)

			write_byte(15)

			write_byte(0)

			message_end()

			

			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_EXPLOSION)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_short(HExplode)

			write_byte(65)

			write_byte(15)

			write_byte(0)

			message_end()

			

			message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_EXPLOSION)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_short(HExplode)

			write_byte(85)

			write_byte(15)

			write_byte(0)

			message_end()

			

			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_BEAMCYLINDER)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2]+650)

			write_short(WhiteSpr)

			write_byte(0)

			write_byte(1)

			write_byte(6)

			write_byte(100)

			write_byte(1)

			write_byte(255)

			write_byte(255)

			write_byte(255)

			write_byte(200)

			write_byte(0)

			message_end()

			

			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_BEAMCYLINDER)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2]+650)

			write_short(WhiteSpr)

			write_byte(0)

			write_byte(1)

			write_byte(6)

			write_byte(100)

			write_byte(1)

			write_byte(255)

			write_byte(255)

			write_byte(255)

			write_byte(200)

			write_byte(0)

			message_end()

			

			message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)

			write_byte(TE_BEAMCYLINDER)

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2])

			write_coord(iOrigin[0])

			write_coord(iOrigin[1])

			write_coord(iOrigin[2]+650)

			write_short(WhiteSpr)

			write_byte(0)

			write_byte(1)

			write_byte(6)

			write_byte(100)

			write_byte(1)

			write_byte(255)

			write_byte(255)

			write_byte(255)

			write_byte(200)

			write_byte(0)

			message_end()

			

			if ( is_valid_ent ( ptd ) ) 

			{

				new ClassName_02 [32];

				

				entity_get_string ( ptd, EV_SZ_classname, ClassName_02, charsmax ( ClassName_02 ) );

				

				if ( equal ( ClassName_02, "func_breakable" ) )

					

					force_use ( pentru, ptd );

			}

			

			remove_entity ( pentru );

		}

	}

	return PLUGIN_CONTINUE

}



public zp_user_infected_pre ( id, infector )

{

	cmdDrop ( id );

	

	HasJet [id] = 0;

	

	FlyEnergy [id] = 0;

	

	Rocket [id] = false;

	

	IsTryder [id] = false;

	

	HasUnlimitedClip [id] = false;

	

	MultiJumps [id] = false;

}



stock JPRadiusDamage ( Entity ) 

{

	new id = entity_get_edict ( Entity, EV_ENT_owner );

	

	new Packs;

	

	for ( new i = 1; i < MaxPlayers + 1; i ++ ) 

	{

		if ( is_user_alive ( i ) ) 

		{

			new Distance = floatround ( entity_range ( Entity, i ) );

			

			if ( Distance <= get_pcvar_num ( Zp_DamageRange ) ) 

			{

				new HP = get_user_health ( i );

				

				new Float: Damage = get_pcvar_float ( Zp_RocketDamage ) - ( get_pcvar_float ( Zp_RocketDamage ) / get_pcvar_float ( Zp_DamageRange ) ) * float ( Distance );

				

				new Origin [3]; get_user_origin ( i, Origin );

				

				new iPos = ++ iPosition [id];

				

				if ( iPos == sizeof ( iCoords ) )



					iPos = iPosition [id] = 0;



				

				if ( IsZombie [id] != IsZombie [i] ) 

				{

					if ( Damage >= 800 )

					         

					         Packs = 2;

					else

						Packs = 1;

					

					if ( HP > Damage )

					{

						AmmoPacks [id] += Packs;

						

						JPTakeDamage ( i, floatround ( Damage ), Origin, DMG_BLAST );

						

						set_hudmessage ( 0, 40, 80, Float: iCoords [iPos] [0], Float: iCoords [iPos] [1], 0, 0.1, 2.5, 0.02, 0.02, -1 );

						

						ShowSyncHudMsg ( id, MsgSync_04, "%i", floatround ( Damage ) );

						

						client_print_color ( id, print_team_default, "%s Damage to^4 %s^1 ::^4 %i^1 damage", CHAT_PREFIX, PlayerName [i], floatround ( Damage ) ); 	

					}

					else

					{

						LogKill ( id, i, "Jetpack Rocket", 0 );

						

						AmmoPacks [id] += 4;

					}

				}

			}

		}

	}

}



stock LogKill ( Killer, Victim, Weapon [ ], Headshot )

{

	set_msg_block ( get_user_msgid ( "DeathMsg" ), BLOCK_SET );

	

	ExecuteHamB ( Ham_Killed, Victim, Killer, 2 );

	

	set_msg_block ( get_user_msgid ( "DeathMsg" ), BLOCK_NOT );

	

	

	message_begin ( MSG_BROADCAST, get_user_msgid ( "DeathMsg" ) );

	write_byte ( Killer );

	write_byte ( Victim );

	write_byte ( Headshot );

	write_string ( Weapon );

	message_end (  );



	if ( get_user_team ( Killer ) != get_user_team ( Victim ) )

	

	         set_pev ( Killer, pev_frags, float ( pev ( Killer, pev_frags ) + 1 ) );

	

	if ( get_user_team ( Killer ) == get_user_team ( Victim ) )

		

		set_pev ( Killer, pev_frags, float ( pev ( Killer, pev_frags ) - 1 ) );

	

	new KillerAuthid [32], VictimAuthid [32], KillerTeam [10], VictimTeam [10];



	get_user_team ( Killer, KillerTeam, charsmax ( KillerTeam ) );

	

	get_user_authid ( Killer, KillerAuthid, charsmax ( KillerAuthid ) );



	get_user_team ( Victim, VictimTeam, charsmax ( VictimTeam ) );

	

	get_user_authid ( Victim, VictimAuthid, charsmax ( VictimAuthid ) );

	

	log_message ( "^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", PlayerName [Killer], get_user_userid ( Killer ), 

	

	KillerAuthid, KillerTeam, PlayerName [Victim], get_user_userid ( Victim ), VictimAuthid, VictimTeam, Weapon );

	

	return PLUGIN_CONTINUE;

}



stock JPTakeDamage ( Victim, Damage, Origin [3], Bit ) 

{

	message_begin ( MSG_ONE, get_user_msgid ( "Damage" ), {0,0,0}, Victim );

	

	write_byte ( 21 )

	

	write_byte ( 20 )

	

	write_long ( Bit )

	

	write_coord ( Origin [0] )

	

	write_coord ( Origin [1] )

	

	write_coord ( Origin [2] )

	

	message_end (  )

	

	fm_set_user_health ( Victim, get_user_health ( Victim ) - Damage );

	

	//emit_sound ( Victim, CHAN_WEAPON, SOUND_EXPLODE, VOL_NORM, ATTN_NORM, Victim, PITCH_NORM );

	client_cmd ( Victim, "spk ^"%s^"", SOUND_EXPLODE );

	

	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );

	write_short ( 2048 );

	write_short ( 1024 );

	write_short ( FFADE_IN );

	write_byte ( 250 );

	write_byte ( 0 );

	write_byte ( 0 );

	write_byte ( 230 );

	message_end (   );

	

	message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );

	write_short ( UNIT_SECOND * 4 );

	write_short ( UNIT_SECOND * 2 ); 

	write_short ( UNIT_SECOND * 10 );

	message_end (  );

}





public fwTraceLinePost ( Float:start[3], Float:end[3], conditions, id, trace )

{

	if ( !CheckValidPlayer ( id ) ) return FMRES_IGNORED;

	

	new iWeaponID = get_user_weapon ( id );

	

	if ( iWeaponID != CSW_KNIFE )

	{

		OPCancel ( id );

		

		return FMRES_IGNORED;

	}

	

	new Enemy = iEnemy [id];

	

	if ( !Enemy )

	{

		Enemy = get_tr2 ( trace, TR_pHit );

		

		if ( !CheckValidPlayer (Enemy) || IsZombie [Enemy] )

		{

			OPCancel ( id );

			

			return FMRES_IGNORED;

		}

		

		iEnemy [id] = Enemy;

	}

	

	return FMRES_IGNORED;

}



public OPNearEnemy ( id )

{	

	new Enemy = iEnemy [id];

	

	new Float: Time = get_gametime (  );

	

	if ( !Enemy || iLastSlash [id] + iDelay > Time )

	{	

		InBlink [id] = 0;

		

		return;

	}

	

	new Origin [3], OriginEnemy [3];

	

	get_user_origin ( id, Origin, 0 );

	

	get_user_origin ( Enemy, OriginEnemy, 0 );

	

	new Distance = get_distance ( Origin, OriginEnemy );

	

	if ( 50 <= Distance <= 300 )

	{	

		InBlink [id] = 1;

		

		return;	

	}

	else if ( 50 > Distance && InBlink [id] )

	{

		OPSlash ( id );

	}

	

	OPCancel ( id );

}



public OPBlink ( id )

{	

	new Float: NewVelocity [3];

	

	new Enemy = iEnemy [id];

	

	new Float: OriginEnemy [3];

	

	pev ( Enemy, pev_origin, OriginEnemy );

	

	entity_set_aim ( id, OriginEnemy );

	

	get_speed_vector2 ( id, Enemy, iSpeed, NewVelocity );

	

	set_pev ( id, pev_velocity, NewVelocity );

}



public OPCancel ( id )

{	

	InBlink [id] = 0;

	

	iEnemy [id] = 0;

	

	if ( !iCanceled [id] )

	{	

		OPSetBlink ( id );

		

		iCanceled [id] = 1;

	}

}



public OPSlash ( id ) 

{	

	set_pev ( id, pev_velocity, {0.0,0.0,0.0} );	

	

	new WeaponID = get_user_weapon ( id, _, _ );

	

	if ( WeaponID == CSW_KNIFE )

	{

		new Weapon [32];

		

		get_weaponname ( WeaponID, Weapon, charsmax ( Weapon ) );

		

		new Entity = fm_find_ent_by_owner ( -1, Weapon, id );

		

		if ( Entity )

		{	

			set_pdata_float ( Entity, 46, 0.0 );

			

			set_pdata_float ( Entity, 47, 0.0 );

			

			iSlash [id] = 1;

			

			iLastSlash [id] = get_gametime (  );

			

			iBlinks [id] -= 1;

			

			client_print_color ( 0, print_team_grey, "%s^3 %s^1 just used a Knife Blink! (Blinks remaining:^4 %d blinks^1)", CHAT_PREFIX, PlayerName [id], iBlinks [id] );

		}

	}  

}



public OPSetBlink ( id )

{	

	new Blink = InBlink [id];

	

	if ( Blink > 1 ) return;

	

	if ( Blink ) InBlink [id] += 1;

}



public CheckValidPlayer ( id )

{	

	if ( 1 <= id <= MaxPlayers && is_user_alive ( id ) )

		

		return 1;

	

	return 0;

}



public fwPlayerPostThink ( id )

{

	if ( !is_user_alive ( id ) || IsZombie [id] || !MultiJumps [id] ) return PLUGIN_CONTINUE;

	

	if ( DoJump [id] == true )

	{

		new Float: Velocity [3];

			

		pev ( id, pev_velocity, Velocity );

			

		Velocity [2] = random_float ( 265.0,285.0 );

			

		set_pev ( id, pev_velocity, Velocity );

			

		DoJump [id] = false;

			

		return PLUGIN_CONTINUE;

	}

	

	return PLUGIN_CONTINUE

}



stock drop_weapons ( id, dropwhat )

{

	static Weapons [32], Num, i, WeaponID;

	

	Num = 0;

	

	get_user_weapons ( id, Weapons, Num );

	

	for ( i = 0; i < Num; i ++ )

	{

		WeaponID = Weapons [i];

		

		if ( ( dropwhat == 1 && ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM ) ) || ( dropwhat == 2 && ( ( 1 << WeaponID ) & SECONDARY_WEAPONS_BIT_SUM ) ) )

		{

			static DropName [32], WeaponEntity;

			

			get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );

			

			WeaponEntity = fm_find_ent_by_owner ( -1, DropName, id );

			

			set_pev ( WeaponEntity, PEV_ADDITIONAL_AMMO, cs_get_user_bpammo ( id, WeaponID ) );

			

			engclient_cmd ( id, "drop", DropName );

			

			cs_set_user_bpammo ( id, WeaponID, 0 );

		}

	}

}

 

stock fm_set_kvd ( entity, const key[], const value[], const classname[] )

{

	set_kvd ( 0, KV_ClassName, classname );

	set_kvd ( 0, KV_KeyName, key );

	set_kvd ( 0, KV_Value, value );

	set_kvd ( 0, KV_fHandled, 0 );

	

	dllfunc ( DLLFunc_KeyValue, entity, 0 );

}



stock fm_set_rendering ( entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 )

{

	static Float:color[3];

	

	color [0] = float (r);

	color [1] = float (g);

	color [2] = float (b);

	

	set_pev ( entity, pev_renderfx, fx );

	set_pev ( entity, pev_rendercolor, color );

	set_pev ( entity, pev_rendermode, render );

	set_pev ( entity, pev_renderamt, float ( amount ) );

}



stock fm_get_speed ( entity )

{

	static Float: velocity [3];

	

	pev ( entity, pev_velocity, velocity );

	

	return floatround ( vector_length ( velocity ) );

}



stock fm_get_aim_origin ( id, Float: origin [3] )

{

	static Float:origin1F[3], Float:origin2F[3]

	

	pev ( id, pev_origin, origin1F );

	

	pev ( id, pev_view_ofs, origin2F );

	

	xs_vec_add ( origin1F, origin2F, origin1F );

	

	pev ( id, pev_v_angle, origin2F );

	

	engfunc ( EngFunc_MakeVectors, origin2F );

	

	global_get ( glb_v_forward, origin2F );

	

	xs_vec_mul_scalar ( origin2F, 9999.0, origin2F );

	

	xs_vec_add ( origin1F, origin2F, origin2F );

	

	engfunc ( EngFunc_TraceLine, origin1F, origin2F, 0, id, 0 );

	

	get_tr2 ( 0, TR_vecEndPos, origin );

}



stock fm_find_ent_by_owner ( entity, const classname[], owner )

{

	while ( ( entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname ) ) && pev ( entity, pev_owner ) != owner ) {  }

	

	return entity;

}



stock fm_set_user_health ( id, health )

{

	( health > 0) ? set_pev ( id, pev_health, float ( health ) ) : dllfunc ( DLLFunc_ClientKill, id );

}



stock fm_give_item ( id, const item [] )

{

	static Entity;

	

	Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, item ) );

	

	if ( !pev_valid ( Entity ) ) return;

	

	static Float: origin [3];

	

	pev ( id, pev_origin, origin );

	

	set_pev ( Entity, pev_origin, origin );

	

	set_pev ( Entity, pev_spawnflags, pev ( Entity, pev_spawnflags ) | SF_NORESPAWN );

	

	dllfunc ( DLLFunc_Spawn, Entity );

	

	static Save; Save = pev ( Entity, pev_solid );

	

	dllfunc ( DLLFunc_Touch, Entity, id );

	

	if ( pev ( Entity, pev_solid ) != Save ) return;

	

	engfunc ( EngFunc_RemoveEntity, Entity );

}



stock fm_strip_user_weapons ( id )

{

	static ent;

	

	ent = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "player_weaponstrip" ) );

	

	if ( !pev_valid ( ent)) return;

	

	dllfunc ( DLLFunc_Spawn, ent );

	

	dllfunc ( DLLFunc_Use, ent, id );

	

	engfunc ( EngFunc_RemoveEntity, ent );

}



stock is_hull_vacant ( Float:origin [3], Hull )

{

	engfunc ( EngFunc_TraceHull, origin, origin, 0, Hull, 0, 0 )

	

	if ( !get_tr2 ( 0, TR_StartSolid ) && !get_tr2(0, TR_AllSolid ) && get_tr2 ( 0, TR_InOpen ) )

		

		return true;

	

	return false;

}



stock is_player_stuck ( id )

{

	static Float:origin [3];

	

	pev ( id, pev_origin, origin );

	

	engfunc ( EngFunc_TraceHull, origin, origin, 0, ( pev ( id, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN, id, 0 );

	

	if ( get_tr2 ( 0, TR_StartSolid ) || get_tr2 ( 0, TR_AllSolid ) || !get_tr2 ( 0, TR_InOpen ) )

		

		return true;

	

	return false;

}



stock cs_weapon_name_to_id ( const weapon [ ] )

{

	static i;

	

	for ( i = 0; i < sizeof WEAPONENTNAMES; i ++ )

	{

		if ( equal ( weapon, WEAPONENTNAMES [i] ) )

			return i;

	}

	

	return 0;

}



stock fmCsGetCurrentWeaponEnt ( id )

{

	return get_pdata_cbase ( id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX );

}



stock fm_cs_get_weapon_ent_owner ( ent )

{

	return get_pdata_cbase ( ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS );

}



stock fm_set_weapon_ammo ( entity, amount )

{

	set_pdata_int ( entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS );

}



stock fm_cs_set_user_deaths ( id, value )

{

	set_pdata_int ( id, OFFSET_CSDEATHS, value, OFFSET_LINUX );

}



stock fm_cs_get_user_team ( id )

{

	return get_pdata_int ( id, OFFSET_CSTEAMS, OFFSET_LINUX );

}



stock fm_cs_set_user_team ( id, team )

{

	set_pdata_int ( id, OFFSET_CSTEAMS, team, OFFSET_LINUX );

}



stock fm_cs_set_user_money ( id, value )

{

	set_pdata_int ( id, OFFSET_CSMONEY, value, OFFSET_LINUX );

}



stock fm_user_team_update ( id )

{

	static Float: CurrentTime;

	

	CurrentTime = get_gametime (  );

	

	if ( CurrentTime - TeamsTargetTime >= 0.1 )

	{

		set_task ( 0.1, "fm_cs_set_user_team_msg", id + TASK_TEAM );

		

		TeamsTargetTime = CurrentTime + 0.1

	}

	else

	{

		set_task ( ( TeamsTargetTime + 0.1 ) - CurrentTime, "fm_cs_set_user_team_msg", id + TASK_TEAM );

		

		TeamsTargetTime = CurrentTime + 0.1

	}

}



public fm_cs_set_user_team_msg ( taskid )

{

	SwitchingTeam = true;



	emessage_begin ( MSG_ALL, get_user_msgid ( "TeamInfo" ) );

	

	ewrite_byte ( ID_TEAM );

	

	ewrite_string ( CS_TEAM_NAMES [fm_cs_get_user_team (ID_TEAM)] );

	

	emessage_end (  );

	

	SwitchingTeam = false

}



stock fmSetPlayerModelEnt ( id )

{

	fm_set_rendering ( id, kRenderFxNone, 255, 255, 255, kRenderTransTexture, 1 );

	

	static model [100];

	

	formatex ( model, charsmax ( model ), "models/player/%s/%s.mdl", PlayerModel [id], PlayerModel [id] );

	

	if ( !pev_valid ( EntPlayerModel [id] ) )

	{

		EntPlayerModel [id] = engfunc ( EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

		

		if ( !pev_valid ( EntPlayerModel [id] ) ) return;

		

		set_pev ( EntPlayerModel [id], pev_classname, MODEL_ENT_CLASSNAME );

		

		set_pev ( EntPlayerModel [id], pev_movetype, MOVETYPE_FOLLOW );

		

		set_pev ( EntPlayerModel [id], pev_aiment, id );

		

		set_pev ( EntPlayerModel [id], pev_owner, id );

	}

	

	engfunc ( EngFunc_SetModel, EntPlayerModel [id], model );

}



stock fm_set_weaponmodel_ent ( id )

{

	static model [100];

	

	pev ( id, pev_weaponmodel2, model, charsmax ( model ) );

	

	if ( !pev_valid ( EntWeaponModel [id] ) )

	{

		EntWeaponModel [id] = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "info_target" ) );

		

		if ( !pev_valid ( EntWeaponModel [id] ) ) return;

		

		set_pev ( EntWeaponModel [id], pev_classname, WEAPON_ENT_CLASSNAME );

		

		set_pev ( EntWeaponModel [id], pev_movetype, MOVETYPE_FOLLOW );

		

		set_pev ( EntWeaponModel [id], pev_aiment, id );

		

		set_pev ( EntWeaponModel [id], pev_owner, id );

	}

	

	engfunc ( EngFunc_SetModel, EntWeaponModel [id], model );

}



stock fm_remove_model_ents ( id )

{

	if ( pev_valid ( EntPlayerModel [id] ) )

	{

		engfunc ( EngFunc_RemoveEntity, EntPlayerModel [id] );

		

		EntPlayerModel [id] = 0;

	}



	if ( pev_valid ( EntWeaponModel [id] ) )

	{

		engfunc ( EngFunc_RemoveEntity, EntWeaponModel [id] );

		

		EntWeaponModel [id] = 0;

	}

}



public fm_cs_set_user_model ( taskid )

{

	set_user_info ( ID_MODEL, "model", PlayerModel [ID_MODEL] );

}



stock fm_cs_get_user_model ( player, model [ ], len )

{

	get_user_info ( player, "model", model, len );

}



public fmUserModelUpdate ( taskid )

{

	static Float: CurrentTime;

	

	CurrentTime = get_gametime (  );

	

	if ( CurrentTime - ModelTargetTime >= 0.2 )

	{

		fm_cs_set_user_model ( taskid );

		

		ModelTargetTime = CurrentTime;

	}

	else

	{

		set_task ( ( ModelTargetTime + 0.2 ) - CurrentTime, "fm_cs_set_user_model", taskid );

		

		ModelTargetTime = ModelTargetTime + 0.2;

	}

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }

*/

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }

*/
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 0
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 3 times
Been thanked: 46 times

08 Oct 2017, 03:08

pune sursa aici https://pastebin.com/
DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Oct 2017, 03:41

DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Oct 2017, 22:30

:up: :thinking:
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 0
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

27 Oct 2017, 23:12

Prin alte topicuri vad ca te dai destept. Descarca un compiler local si apoi baga toate .inc in el, apoi poti compila
Image
DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

28 Oct 2017, 00:21

*Or!g!naL* ma pricep si eu la Scripting..
dar nu la ori ce intelegi? sunt si eu incepaator ca ori si care toti am placat dela 0
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: Yandex [Bot] and 11 guests