Raised This Month: $51 Target: $400
 12% 

Source to a zombie mod...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 02-24-2008 , 02:15   Source to a zombie mod...
Reply With Quote #1

Edit: Just read the forums and it seems another zombie infection mod is causing problems haha. Sorry to bring up more zombie stuff ;)

I was working on a zombie mod of my own but now I'm playing WoW again and don't have the time to finish this project.

Here is the source if anyone wants to take a look at it. Keep in mind it is incomplete.

Note: There is a bug where players can change their model to whatever when they are a zombie. There is also the svc_bad error 'sometimes', I fixed it for the most part.

Note 2: Using the following cvars will lag some clients with poor computers but creates a very cool effect (could possibly strain some poor servers too).
sv_lightstyle = 0
sv_storm = 1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Zombie Disease"
#define VERSION "2.0"
#define AUTHOR "hlstriker"

// Sound Variables
#define ZOMBIE_THUNDER_1 "ambience/thunder_clap.wav"
#define ZOMBIE_THUNDER_2 "de_torn/torn_thndrstrike.wav"
#define ZOMBIE_RAIN "ambience/rain.wav"
#define ZOMBIE_RAIN_INSIDE "zombie-disease/raininside.wav"

#define ZOMBIE_MISS_NUM 2
new g_zombieMiss[ZOMBIE_MISS_NUM][] = { "zombie/claw_miss1.wav""zombie/claw_miss2.wav" };
#define ZOMBIE_HIT_NUM 3
new g_zombieHit[ZOMBIE_HIT_NUM][] = { "zombie/claw_strike1.wav""zombie/claw_strike2.wav""zombie/claw_strike3.wav" };
#define ZOMBIE_PAIN_NUM 2
new g_zombiePain[ZOMBIE_PAIN_NUM][] = { "zombie-disease/zombie_pain1.wav""zombie-disease/zombie_pain2.wav" };
#define ZOMBIE_DIE_NUM 5
new g_zombieDie[ZOMBIE_DIE_NUM][] = { "zombie-disease/zombie_die1.wav""zombie-disease/zombie_die2.wav""zombie-disease/zombie_die3.wav""zombie-disease/zombie_die4.wav""zombie-disease/zombie_die5.wav" };
#define HUMAN_PAIN_NUM 2
new g_humanPain[HUMAN_PAIN_NUM][] = { "zombie-disease/human_pain1.wav""zombie-disease/human_pain2.wav" };
#define ZOMBIE_INFECT_NUM 3
new g_zombieInfect[ZOMBIE_INFECT_NUM][] = { "zombie-disease/zombie_infec1.wav""zombie-disease/zombie_infec2.wav""zombie-disease/zombie_infec3.wav" };

// Model Variables
#define ZOMBIE_MODEL_CLAWS "models/zombie-disease/v_knife_zombie.mdl"
#define ZOMBIE_MODEL_1 "models/player/zombie_b2/zombie_b2.mdl"
#define ZOMBIE_MODEL_1_NICK "zombie_b2"

// Weather Variables
#define RAIN_INSIDE_DIST 150
new Float:g_nextRainSound[33];
new 
bool:g_newLocation[33];
new 
bool:g_oldLocation[33];
//new g_skyColors[3] = { 0, 1, 2 };
new g_lightStyleChar[3][] = { "a""b""c" };
new 
g_lightStyleNum;
new 
g_lightCounter;
new 
g_flashNum;
new 
bool:g_isFlashing;

// CT Win Variables controlling weather
new g_shouldRain true;
new 
g_weatherOff;
new 
g_lightningOff;

// Fake nightvision variables
#define ZOMBIE_LIGHT_RADIUS 165
#define HUMAN_LIGHT_RADIUS 140

// Dead regular nightvision variables
new Float:g_reUpdateDeadNV[33];
new 
bool:g_didDeadCheck[33];

// Count-down / Round time variables
#define COUNTDOWN_TIME 25.0
new Float:g_startCountDownTimeZombie;
new 
Float:g_startCountDownTimeRound;
new 
bool:g_showZombieTimeHud;
new 
bool:g_showRoundTimeHud;
new 
Float:g_totalTime;
new 
Float:g_roundTimeLeft;
new 
Float:g_timeTillZombie;
new 
Float:g_freezeTime;

// Round time variables
new bool:g_roundStarted;
new 
g_roundTime;

// Hud Text Variables
#define HUD_LIGHT_UPDATE_TIME 0.08
#define HUD_MSG_LEN 2048
#define HUDMSG_TIME 1.2
new bool:g_flashHealth[33];
new 
g_flashHealthCount[33];
new 
Float:g_nextHudMsg[33];
new 
g_healthHudMsg;
new 
g_countdownHudMsg;
new 
g_playerCountHudMsg;

// Custom buy menu variables
new bool:g_attackedZombie[33];
new 
Float:g_buyWaitTime[33];
new 
g_chooseMenu;
new 
g_buyMenu;
new 
g_handgunMenu;
new 
g_shotgunMenu;
new 
g_smgMenu;
new 
g_rifleMenu;
new 
g_machinegunMenu;
new 
g_equipmentMenu;

#define TOTAL_CHOOSE 3
new g_chooseMenuText[TOTAL_CHOOSE][] =
{
    
"New Weapons",
    
"Previous Setup",
    
"2+Don't show menu again"
};

#define TOTAL_BUY 6
new g_buyMenuText[TOTAL_BUY][] =
{
    
"Handgun",
    
"Shotgun",
    
"Sub-Machine Gun",
    
"Rifle",
    
"Machine Gun",
    
"Equipment"
};

#define TOTAL_HANDGUN 6
new g_handgunMenuText[TOTAL_HANDGUN][] =
{
    
"9X19mm Sidearm",
    
"K&M .45 Tactical",
    
"228 Compact",
    
"Night Hawk .50C",
    
"ES Five-Seven",
    
".40 Dual Elites"
}

#define TOTAL_SHOTGUN 2
new g_shotgunMenuText[TOTAL_SHOTGUN][] =
{
    
"Leone 12 Gauge Super",
    
"Leone YG1265 Auto Shotgun"
}

#define TOTAL_SMG 5
new g_smgMenuText[TOTAL_SMG][] =
{
    
"Schmidt Machine Pistol",
    
"K&M Sub-Machine Gun",
    
"K&M UMP45",
    
"ES C90",
    
"Ingram MAC-10"
}

#define TOTAL_RIFLE 10
new g_rifleMenuText[TOTAL_RIFLE][] =
{
    
"Clarion 5.56",
    
"IDF Defender",
    
"Maverick M4A1 Carbine",
    
"CV-47",
    
"Bullpup",
    
"Krieg 552 Commando",
    
"Schmidt Scout",
    
"Magnum Sniper Rifle",
    
"Krieg 550 Commando",
    
"D3/AU-1 Semi-Auto Sniper Rifle"
}

#define TOTAL_MACHINEGUN 1
new g_machinegunMenuText[TOTAL_MACHINEGUN][] =
{
    
"ES M249 Para"
}

#define TOTAL_EQUIPMENT 3
new g_equipmentMenuText[TOTAL_EQUIPMENT][] =
{
    
"Flashbang",
    
"HE Grenade",
    
"Smoke Grenade"
}

// Cvars variables
new mp_freezetime;
new 
sv_accelerate;
new 
sv_stopspeed;
new 
sv_lightstyle;
new 
sv_storm;

// Bomb variables
new g_hasBomb;

// Buy zone variables
new bool:g_buyzoneMade;

// Message variables
new g_msgHideWeapon;
new 
g_msgDeathMsg;
new 
g_msgScoreInfo;
new 
g_msgScoreAttrib;
new 
g_msgNVGToggle;
new 
g_msgTeamInfo;
//new g_msgFlashlight;
//new g_msgSetFOV;
//new g_msgTextMsg;

// Restart round variables
new bool:g_canRestart true;

// Think variables
new bool:g_isThinking;
new 
g_counterEnt;
new 
g_rainEnt;
new 
g_thunderEnt;

// Zombie Variables
#define ZOMBIE_HEALTH_MAIN 2500.0
#define ZOMBIE_HEALTH_AFTER 1000.0
#define ZOMBIE_ARMOR_MAIN 1000
#define ZOMBIE_ARMOR_AFTER 500
#define ZOMBIE_SPEED 270.0
new bool:g_isZombie[33];

// Player status variables
new bool:g_hasSpawned[33];
new 
g_humansLeft;
new 
g_zombiesLeft;


public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
// Create the thunder/lightning entity if weather is on
    
if(get_pcvar_num(sv_storm) == 1)
    {
        
g_thunderEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"ambient_generic"));
        if(
g_thunderEnt)
        {
            
dllfunc(DLLFunc_Thinkg_thunderEnt);
            
            
set_keyvalue(g_thunderEnt"message"ZOMBIE_THUNDER_1); // WAV name
            
set_keyvalue(g_thunderEnt"targetname""boom"); // Name
            
set_keyvalue(g_thunderEnt"pitchstart""100"); // Start Pitch
            
set_keyvalue(g_thunderEnt"pitch""100"); // Pitch (> 100 = higher)
            
set_keyvalue(g_thunderEnt"health""10"); // Volume (10 = loudest)
            
set_keyvalue(g_thunderEnt"spawnflags""49"); // Play Everywhere, Start Silent, Not Toggled
            
            
dllfunc(DLLFunc_Spawng_thunderEnt);
            
set_pev(g_thunderEntpev_nextthinkget_gametime() + 3.0);
        }
    }
    
    
// Create the timer entity
    
g_counterEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
    if(
g_counterEnt)
    {
        
dllfunc(DLLFunc_Thinkg_counterEnt);
        
dllfunc(DLLFunc_Spawng_counterEnt);
        
set_pev(g_counterEntpev_nextthinkget_gametime() + 3.0);
    }
    
    if(
get_pcvar_num(sv_lightstyle) == 0)
        
server_cmd("sv_skyname black");
    else
        
server_cmd("sv_skyname space");
    
server_cmd("mp_autoteambalance 0;mp_limitteams 0");
    
    
g_healthHudMsg CreateHudSyncObj();
    
g_countdownHudMsg CreateHudSyncObj();
    
g_playerCountHudMsg CreateHudSyncObj();
    
    
register_clcmd("jointeam""blockTeam");
    
register_clcmd("joinclass""blockTeam");
    
register_clcmd("chooseteam""blockCommand");
    
register_clcmd("fullupdate""blockCommand");
    
register_clcmd("drop""blockCommand");
    
register_clcmd("say /buy""openBuyMenu");
    
register_clcmd("say guns""openBuyMenu");
    
    if(!
g_isThinking)
        
register_forward(FM_Think"fwd_Think"1);
    
register_forward(FM_PlayerPreThink"fwd_PlayerPreThink");
    
register_forward(FM_EmitSound"fwd_EmitSound");
    
register_forward(FM_Touch"fwd_Touch");
    
register_forward(FM_ClientKill"fwd_ClientKill");
    
register_forward(FM_CVarSetFloat"fwd_CVarSetFloat")
    
register_forward(FM_AddToFullPack"fwd_AddToFullPack"1);
    
    
RegisterHam(Ham_TakeDamage"player""hook_TakeDamage");
    
    
g_msgDeathMsg get_user_msgid("DeathMsg");
    
g_msgHideWeapon get_user_msgid("HideWeapon");
    
g_msgScoreInfo get_user_msgid("ScoreInfo");
    
g_msgNVGToggle get_user_msgid("NVGToggle");
    
g_msgScoreAttrib get_user_msgid("ScoreAttrib");
    
g_msgTeamInfo get_user_msgid("TeamInfo");
    
    
register_logevent("logevent_round_start"2"1=Round_Start");
    
register_message(get_user_msgid("RoundTime"), "msg_RoundTime");
    
register_message(g_msgDeathMsg"msg_DeathMsg");
    
register_message(get_user_msgid("TextMsg"), "msg_TextMsg");
    
register_message(get_user_msgid("SendAudio"), "msg_SendAudio");
    
    
register_event("ResetHUD""hook_ResetHUD""be");
    
register_event("CurWeapon""hook_CurWeapon""be""1=1");
    
register_event("HLTV""hook_HLTV""a""1=0""2=0");
    
register_event("WeapPickup""hook_WeapPickup""be""1=6");
    
    
sv_accelerate register_cvar("sv_accelerate""8.0");
    
sv_stopspeed register_cvar("sv_stopspeed""90.0");
    
mp_freezetime register_cvar("mp_freezetime""3.0");
    
register_cvar("zombie_disease"VERSION);
    
    
create_menus();
}

public 
plugin_precache()
{
    
sv_lightstyle register_cvar("sv_lightstyle""4");
    
sv_storm register_cvar("sv_storm""1");
    
    
register_forward(FM_KeyValue"fwd_KeyValue"1);
    
    
// Create the rain entity if weather is on
    
if(get_pcvar_num(sv_storm) == 1)
    {
        
g_rainEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"));
        if(
g_rainEnt)
        {
            
g_isThinking true;
            
register_forward(FM_Think"fwd_Think"1);
            
set_pev(g_rainEntpev_nextthinkget_gametime() + 3.0);
        }
    }
    
    new 
i;
    for(
i=0i<ZOMBIE_MISS_NUMi++)
        
precache_sound(g_zombieMiss[i]);
    for(
i=0i<ZOMBIE_HIT_NUMi++)
        
precache_sound(g_zombieHit[i]);
    for(
i=0i<ZOMBIE_PAIN_NUMi++)
        
precache_sound(g_zombiePain[i]);
    for(
i=0i<HUMAN_PAIN_NUMi++)
        
precache_sound(g_humanPain[i]);
    for(
i=0i<ZOMBIE_INFECT_NUMi++)
        
precache_sound(g_zombieInfect[i]);
    for(
i=0i<ZOMBIE_DIE_NUMi++)
        
precache_sound(g_zombieDie[i]);
    
    
precache_model(ZOMBIE_MODEL_1);
    
precache_model(ZOMBIE_MODEL_CLAWS);
    
    
precache_sound(ZOMBIE_RAIN);
    
precache_sound(ZOMBIE_RAIN_INSIDE);
    
precache_sound(ZOMBIE_THUNDER_1);
    
precache_sound(ZOMBIE_THUNDER_2);
}

public 
client_authorized(id)
{
    
g_hasSpawned[id] = false;
    
g_isZombie[id] = false;
}

public 
client_disconnect(id)
{
    if(
is_user_alive(id))
    {
        if(
g_isZombie[id])
        {
            
g_zombiesLeft -= 1;
            if(!
g_zombiesLeft)
            {
                
// No zombies are left, select a new one
                
g_showRoundTimeHud false;
                
set_task(0.1"task_chooseZombie");
            }
        }
        else
            
g_humansLeft -= 1;
    }
    
set_task(0.2"task_checkPlayerCount");
}

////////////////////////////////////////////////////////////
/* START Menus */
////////////////////////////////////////////////////////////
public chooseMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    switch(
key)
    {
        case 
0:
        {
            
// Open the buy menu
            
menu_display(idg_buyMenu);
        }
        case 
1:
        {
            
// Use previous setup
            
client_print(idprint_chat"The mod is not complete, rebuying is not ready yet.");
            
menu_display(idg_buyMenu);
        }
        case 
2:
        {
            
// Use previous setup until "guns" is typed
            
client_print(idprint_chat"The mod is not complete, rebuying is not ready yet.");
            
menu_display(idg_buyMenu);
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
buyMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    static 
Float:gametime;
    
gametime get_gametime();
    if(
g_buyWaitTime[id] > gametime)
    {
        
client_print(idprint_center"You cannot buy so fast.");
        
menu_display(idg_buyMenu);
        return 
FMRES_HANDLED;
    }
    
g_buyWaitTime[id] = gametime 0.5;
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    switch(
key)
    {
        case 
0:
        {
            
// Handgun
            
menu_display(idg_handgunMenu);
        }
        case 
1:
        {
            
// Shotgun
            
menu_display(idg_shotgunMenu);
        }
        case 
2:
        {
            
// Sub-Machine Gun
            
menu_display(idg_smgMenu);
        }
        case 
3:
        {
            
// Rifle
            //menu_display(id, rifleMenu);
            
client_print(idprint_chat"The mod is not complete, you cannot get a rifle.");
            
menu_display(idg_buyMenu);
        }
        case 
4:
        {
            
// Machine Gun
            //menu_display(id, machinegunMenu);
            
client_print(idprint_chat"The mod is not complete, you cannot get a machine gun.");
            
menu_display(idg_buyMenu);
        }
        case 
5:
        {
            
// Equipment
            //menu_display(id, equipmentMenu);
            
client_print(idprint_chat"The mod is not complete, you cannot get equipment.");
            
menu_display(idg_buyMenu);
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
handgunMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    
menu_display(idg_buyMenu);
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    
remove_weapon(id2);
    
remove_weapon(id2);
    
    switch(
key)
    {
        case 
0:
        {
            
// 9X19mm Sidearm
            
fm_give_item(id"weapon_glock18");
        }
        case 
1:
        {
            
// K&M .45 Tactical
            
fm_give_item(id"weapon_usp");
        }
        case 
2:
        {
            
// 228 Compact
            
fm_give_item(id"weapon_p228");
        }
        case 
3:
        {
            
// Night Hawk .50C
            
fm_give_item(id"weapon_deagle");
        }
        case 
4:
        {
            
// ES Five-Seven
            
fm_give_item(id"weapon_fiveseven");
        }
        case 
5:
        {
            
// .40 Dual Elites
            
fm_give_item(id"weapon_elite");
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
shotgunMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    
menu_display(idg_buyMenu);
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    
remove_weapon(id1);
    
remove_weapon(id1);
    
    switch(
key)
    {
        case 
0:
        {
            
// Leone 12 Gauge Super
            
fm_give_item(id"weapon_m3");
        }
        case 
1:
        {
            
// Leone YG1265 Auto Shotgun
            
fm_give_item(id"weapon_xm1014");
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
smgMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    
menu_display(idg_buyMenu);
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    
remove_weapon(id1);
    
remove_weapon(id1);
    
    switch(
key)
    {
        case 
0:
        {
            
// Schmidt Machine Pistol
            
fm_give_item(id"weapon_tmp");
        }
        case 
1:
        {
            
// K&M Sub-Machine Gun
            
fm_give_item(id"weapon_mp5navy");
        }
        case 
2:
        {
            
// K&M UMP45
            
fm_give_item(id"weapon_ump45");
        }
        case 
3:
        {
            
// ES C90
            
fm_give_item(id"weapon_p90");
        }
        case 
4:
        {
            
// Ingram MAC-10
            
fm_give_item(id"weapon_mac10");
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
rifleMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    
menu_display(idg_buyMenu);
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    
remove_weapon(id1);
    
remove_weapon(id1);
    
    switch(
key)
    {
        case 
0:
        {
            
// Clarion 5.56
            
fm_give_item(id"weapon_famas");
        }
        case 
1:
        {
            
// IDF Defender
            
fm_give_item(id"weapon_galil");
        }
        case 
2:
        {
            
// Maverick M4A1 Carbine
            
fm_give_item(id"weapon_m4a1");
        }
        case 
3:
        {
            
// CV-47
            
fm_give_item(id"weapon_ak47");
        }
        case 
4:
        {
            
// Bullpup
            
fm_give_item(id"weapon_aug");
        }
        case 
5:
        {
            
// Krieg 552 Commando
            
fm_give_item(id"weapon_sg552");
        }
        case 
6:
        {
            
// Schmidt Scout
            
fm_give_item(id"weapon_scout");
        }
        case 
7:
        {
            
// Magnum Sniper Rifle
            
fm_give_item(id"weapon_awp");
        }
        case 
8:
        {
            
// Krieg 550 Commando
            
fm_give_item(id"weapon_sg550");
        }
        case 
9:
        {
            
// D3/AU-1 Semi-Auto Sniper Rifle
            
fm_give_item(id"weapon_g3sg1");
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
machinegunMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    
menu_display(idg_buyMenu);
    
    if(
key == MENU_EXIT)
        return 
FMRES_HANDLED;
    
    
remove_weapon(id1);
    
remove_weapon(id1);
    
    switch(
key)
    {
        case 
0:
        {
            
// ES M249 Para
            
fm_give_item(id"weapon_m249");
        }
    }
    
    return 
FMRES_HANDLED;
}

public 
equipmentMenu_handle(idmenukey)
{
    
//client_print(id, print_chat, "%i", key);
    
    
if(buy_check(id))
        return 
FMRES_HANDLED;
    
    if(
key == MENU_EXIT)
    {
        
menu_display(idg_buyMenu);
        return 
FMRES_HANDLED;
    }
    else
        
menu_display(idg_equipmentMenu);
    
    switch(
key)
    {
        case 
0:
        {
            
// Flashbang
            
fm_give_item(id"weapon_flashbang");
        }
        case 
1:
        {
            
// HE Grenade
            
fm_give_item(id"weapon_hegrenade");
        }
        case 
2:
        {
            
// Smoke Grenade
            
fm_give_item(id"weapon_smokegrenade");
        }
    }
    
    return 
FMRES_HANDLED;
}

stock buy_check(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You must be alive to buy.");
        return 
1;
    }
    else if(
g_isZombie[id])
    {
        
client_print(idprint_chat"You cannot buy since you are a zombie.");
        return 
1;
    }
    else if(
g_attackedZombie[id])
    {
        
client_print(idprint_chat"You cannot buy since you already attacked a zombie.");
        return 
1;
    }
    return 
0;
}

public 
create_menus()
{
    static 
i;
    
    
// Choose Menu
    
g_chooseMenu menu_create("Weapon Select""chooseMenu_handle");
    for(
i=0i<TOTAL_CHOOSEi++)
        
menu_additem(g_chooseMenug_chooseMenuText[i]);
    
menu_setprop(g_chooseMenuMPROP_EXITMEXIT_NEVER);
    
    
// Buy Menu
    
g_buyMenu menu_create("Weapon Select""buyMenu_handle");
    
/*
    for(i=0; i<TOTAL_BUY; i++)
    {
        if(i == 5)
            menu_addblank(g_buyMenu, 0);
        menu_additem(g_buyMenu, buyMenuText[i]);
    }
    */
    
for(i=0i<3i++)
    {
        if(
== 5)
            
menu_addblank(g_buyMenu0);
        
menu_additem(g_buyMenug_buyMenuText[i]);
    }
    
menu_setprop(g_buyMenuMPROP_PERPAGE3);
    
    
    
// Handgun Menu
    
g_handgunMenu menu_create("Choose Handgun""handgunMenu_handle");
    for(
i=0i<TOTAL_HANDGUNi++)
        
menu_additem(g_handgunMenug_handgunMenuText[i]);
    
    
// Shotgun Menu
    
g_shotgunMenu menu_create("Choose Shotgun""shotgunMenu_handle");
    for(
i=0i<TOTAL_SHOTGUNi++)
        
menu_additem(g_shotgunMenug_shotgunMenuText[i]);
    
    
// SMG Menu
    
g_smgMenu menu_create("Choose SMG""smgMenu_handle");
    for(
i=0i<TOTAL_SMGi++)
        
menu_additem(g_smgMenug_smgMenuText[i]);
    
    
// Rifle Menu
    
g_rifleMenu menu_create("Choose Rifle""rifleMenu_handle");
    for(
i=0i<TOTAL_RIFLEi++)
        
menu_additem(g_rifleMenug_rifleMenuText[i]);
    
    
// Machine Gun Menu
    
g_machinegunMenu menu_create("Choose Machine Gun""machinegunMenu_handle");
    for(
i=0i<TOTAL_MACHINEGUNi++)
        
menu_additem(g_machinegunMenug_machinegunMenuText[i]);
    
    
// Equipment Menu
    
g_equipmentMenu menu_create("Choose Equipment""equipmentMenu_handle");
    for(
i=0i<TOTAL_EQUIPMENTi++)
        
menu_additem(g_equipmentMenug_equipmentMenuText[i]);
}
////////////////////////////////////////////////////////////
/* END Menus */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Client Command Hooks */
////////////////////////////////////////////////////////////
public openBuyMenu(id)
{
    if(
is_user_alive(id) && !g_isZombie[id])
        
menu_display(idg_buyMenu);
}

public 
blockTeam(id)
{
    if(
g_hasSpawned[id])
        return 
FMRES_IGNORED;
    return 
PLUGIN_CONTINUE;
}

public 
blockCommand(id)
    return 
FMRES_IGNORED;
////////////////////////////////////////////////////////////
/* END Client Command Hooks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Message Hooks */
////////////////////////////////////////////////////////////
public msg_SendAudio()
{
    static 
audio[65];
    
get_msg_arg_string(2audio64);
    
    if(
equali(audio"%!MRAD_ctwin"))
        return 
FMRES_OVERRIDE;
    else if(
equali(audio"%!MRAD_terwin"))
        return 
FMRES_OVERRIDE;
    else if(
equali(audio"%!MRAD_rounddraw"))
        return 
FMRES_OVERRIDE;
    
    return 
FMRES_HANDLED;
}

public 
msg_TextMsg(msgIddestent)
{
    static 
message[65];
    
get_msg_arg_string(2message64);
    
    
// Get end round messages
    
if(equali(message"#CTs_Win") || equali(message"#Target_Saved"))
    {
        
round_ended();
        
set_msg_arg_string(2"Human Race Survives!");
        return 
FMRES_HANDLED;
    }
    else if(
equali(message"#Terrorists_Win"))
    {
        
round_ended();
        
set_msg_arg_string(2"Zombis Take Over The World!");
        return 
FMRES_HANDLED;
    }
    else if(
equali(message"#Round_Draw"))
    {
        
round_ended();
        
set_msg_arg_string(2"Need More Players!");
        return 
FMRES_HANDLED;
    }
    else if(
equali(message"#Command_Not_Available"))
        return 
FMRES_IGNORED;
    
    return 
FMRES_HANDLED;
}

public 
msg_DeathMsg(msgIddestent)
{
    static 
killervictim;
    
killer get_msg_arg_int(1);
    
victim get_msg_arg_int(2);
    
    if(
g_isZombie[victim])
    {
        
g_isZombie[victim] = false;
        
cs_reset_user_model(victim);
    }
    
    
set_task(0.2"task_preCheckTeamsDeath");
    
    if(
killer == victim)
        return 
FMRES_IGNORED;
    
    if(
g_isZombie[killer])
    {
        
g_humansLeft -= 1;
        
message_begin(MSG_ALLg_msgDeathMsg);
        
write_byte(killer);
        
write_byte(victim);
        
write_byte(0);
        
write_string("Zombie Disease");
        
message_end();
        return 
FMRES_IGNORED;
    }
    else
        
g_zombiesLeft -= 1;
    
    return 
PLUGIN_CONTINUE;
}

public 
msg_RoundTime()
{
    if(
g_roundStarted)
        
g_roundStarted false;
    else
        return 
FMRES_IGNORED;
    
    
g_roundTime get_msg_arg_int(1);
    return 
FMRES_HANDLED;
}

public 
logevent_round_start()
    
g_roundStarted true;
////////////////////////////////////////////////////////////
/* START Message Hooks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Ham Hooks */
////////////////////////////////////////////////////////////
public hook_TakeDamage(ididinflictoridattackerFloat:damagedamagebits)
{
    
// Allow fall Damage
    
if(damagebits == DMG_FALL)
    {
        if(
g_isZombie[id])
            return 
PLUGIN_CONTINUE;
        
        
damage /= 5;
        
SetHamParamFloat(4damage)
        return 
HAM_HANDLED;
    }
    
    
// Do player vs player damage
    
if(is_user_connected(idattacker))
    {
        
// Zombie is attacking human
        
if(g_isZombie[idattacker] && !g_isZombie[id])
        {
            if(
g_humansLeft <= 1)
                return 
PLUGIN_CONTINUE
            
else
            {
                
g_humansLeft -= 1;
                
set_punchangle(id);
                
set_zombie(id0idattacker);
                
fm_set_user_frags(idattackerget_user_frags(idattacker)+1);
            }
        }
        
        
// Human is attacking zombie
        
else if(!g_isZombie[idattacker] && g_isZombie[id])
        {
            
g_flashHealth[id] = true;
            
g_attackedZombie[idattacker] = true;
            
engfunc(EngFunc_SetClientMaxspeedidZOMBIE_SPEED);
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
HAM_SUPERCEDE;
}
////////////////////////////////////////////////////////////
/* END Ham Hooks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Event Hooks */
////////////////////////////////////////////////////////////
public hook_WeapPickup(id)
    
g_hasBomb id;

public 
hook_HLTV()
{
    
// This identifies a new round
    
g_startCountDownTimeZombie get_gametime();
    
g_showRoundTimeHud false;
    
g_showZombieTimeHud true;
    
    
// Weather variables
    
g_shouldRain true;
    
g_weatherOff false;
    
g_lightningOff false;
    if(
get_pcvar_num(sv_lightstyle) == 0)
        
engfunc(EngFunc_LightStyle0g_lightStyleChar[0]);
    
    
g_humansLeft 0;
    
g_zombiesLeft 0;
}

public 
hook_CurWeapon(id)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
// Set unlimited backpack ammo
    
static weaponclipwpnName[33];
    
weapon read_data(2);
    
clip read_data(3);
    
get_weaponname(weaponwpnName32);
    
    if(
clip && !equal(wpnName"weapon_knife"))
        
cs_set_user_bpammo(idweapon200);
    
    return 
FMRES_HANDLED;
}

public 
hook_ResetHUD(id)
{
    if(!
g_hasSpawned[id])
        
g_hasSpawned[id] = true;
    
    
// If player joins terrorist when there is a zombie, set to CT
    
if(g_zombiesLeft && fm_get_user_team(id) == 1)
        
set_user_team(id2);
    
    
set_lightstyle(get_pcvar_num(sv_lightstyle));
    
    
g_isZombie[id] = false;
    
g_attackedZombie[id] = false;
    
set_task(0.7"task_afterSpawn"id);
}

public 
task_afterSpawn(id)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
message_begin(MSG_ONEg_msgNVGToggle_id);
    
write_byte(0);
    
message_end();
    
    if(
get_playersnum(1) == && g_canRestart)
    {
        
server_cmd("sv_restart 1");
        
g_canRestart false;
        return 
FMRES_HANDLED;
    }
    
    if(
g_hasBomb == id)
    {
        
fm_strip_user_weapons(id);
        
fm_give_item(id"weapon_knife");
    }
    
    
menu_cancel(id);
    
menu_display(idg_buyMenu);
    
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgHideWeapon_id);
    
write_byte((1<<3) | (1<<4) | (1<<5));
    
message_end();
    
    
g_humansLeft += 1;
    
    return 
FMRES_HANDLED;
}
////////////////////////////////////////////////////////////
/* END Event Hooks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Forward Hooks */
////////////////////////////////////////////////////////////
public fwd_AddToFullPack(es_handleeidhosthostflagsplayerpSet)
{
    if(!
player || !is_user_alive(id) || !is_user_alive(host) || g_isZombie[host] || id == host || g_weatherOff || get_pcvar_num(sv_lightstyle) > 0)
        return 
FMRES_IGNORED;
    
    static 
orgID[3], orgHost[3], distancetransparency;
    
get_user_origin(idorgID);
    
get_user_origin(hostorgHost);
    
distance get_distance(orgIDorgHost);
    switch(
distance)
    {
        case 
.. 860:
        {
            
transparency floatround((289.0 - (float(distance) / 3.0)));
            
set_es(es_handleES_RenderModekRenderTransTexture);
            
set_es(es_handleES_RenderAmttransparency);
            
//client_print(0, print_chat, "[ID = %i]  [Host = %i]  [Dis = %i]  -  %i", id, host, distance, transparency);
        
}
        default:
        {
            if(
g_isFlashing)
            {
                
// Make everyones transparency set amount if it's lightning
                
set_es(es_handleES_RenderModekRenderTransTexture);
                
set_es(es_handleES_RenderAmt25);
                return 
FMRES_IGNORED;
            }
            else
            {
                
set_es(es_handleES_RenderModekRenderTransTexture);
                
set_es(es_handleES_RenderAmt0);
            }
            
//client_print(0, print_chat, "[ID = %i]  [Host = %i]  [Dis = %i]  -  0", id, host, distance);
        
}
    }
    
    return 
FMRES_IGNORED;
}

public 
fwd_CVarSetFloat(const name[], Float:value)
{
    if(
equali(name"sv_accelerate"))
    {
        static 
Float:accelerate;
        
accelerate get_pcvar_float(sv_accelerate);
        
set_cvar_float("sv_accelerate"accelerate);
        return 
FMRES_SUPERCEDE;
    }
    else if(
equali(name"sv_stopspeed"))
    {
        static 
Float:stopspeed;
        
stopspeed get_pcvar_float(sv_stopspeed);
        
set_cvar_float("sv_stopspeed"stopspeed);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_HANDLED;
}

public 
fwd_ClientKill(id)
    return 
FMRES_SUPERCEDE;

public 
fwd_Touch(entid)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    static 
className[32];
    
pev(entpev_classnameclassName31);
    
    if(
containi(className"weaponbox") != -&& g_isZombie[id])
        return 
FMRES_SUPERCEDE;
    
    return 
FMRES_HANDLED;
}

public 
fwd_EmitSound(idchannel, const sound[], Float:volumeFloat:attenuationflagspitch)
{
    if(!
is_user_connected(id))
        return 
FMRES_IGNORED;
    
    
// client_print(id, print_chat, "[Chan=%d] [Sound=%s] [Vol=%f] [Att=%f] [Flags=%d] [Pitch=%d]", channel, sound, volume, attenuation, flags, pitch);
    
    // Play death sounds
    
if(containi(sound"die") != -|| containi(sound"death") != -1)
    {
        if(
g_isZombie[id])
        {
            
engfunc(EngFunc_EmitSoundidchannelg_zombieDie[random_num(0ZOMBIE_DIE_NUM-1)], volumeattenuationflagspitch);
            return 
FMRES_SUPERCEDE;
        }
    }
    
    
// Play pain sounds
    
if(containi(sound"bhit") != -1)
    {
        if(
g_isZombie[id])
            
engfunc(EngFunc_EmitSoundidchannelg_zombiePain[random_num(0ZOMBIE_PAIN_NUM-1)], volumeattenuationflagspitch);
        else
            
engfunc(EngFunc_EmitSoundidchannelg_humanPain[random_num(0HUMAN_PAIN_NUM-1)], volumeattenuationflagspitch);
        return 
FMRES_SUPERCEDE;
    }
    
    
// Knife slash sounds to claw swipes
    
if(containi(sound"knife_slash") != -1)
    {
        if(
g_isZombie[id])
        {
            
// Play claw swipe
            
engfunc(EngFunc_EmitSoundidchannelg_zombieMiss[random_num(0ZOMBIE_MISS_NUM-1)], volumeattenuationflagspitch);
            return 
FMRES_SUPERCEDE;
        }
    }
    
    
// Knife hit sounds to claw hit
    
if(containi(sound"knife_hit") != -1)
    {
        if(
g_isZombie[id])
        {
            
// Play claw hit
            
engfunc(EngFunc_EmitSoundidchannelg_zombieHit[random_num(0ZOMBIE_HIT_NUM-1)], volumeattenuationflagspitch);
            return 
FMRES_SUPERCEDE;
        }
    }
    
    if(
containi(sound"gunpickup2") != -|| containi(sound"knife_deploy") != -1)
    {
        if(
g_isZombie[id])
            return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
fwd_PlayerPreThink(id)
{
    static 
Float:gametime;
    
gametime get_gametime();
    
    if(!
is_user_alive(id))
    {
        
// Update nightvision
        
static lightStyle;
        
lightStyle get_pcvar_num(sv_lightstyle);
        if(
lightStyle == || lightStyle == 1)
        {
            if(
g_reUpdateDeadNV[id] < gametime)
            {
                
g_didDeadCheck[id] = false;
                
g_reUpdateDeadNV[id] = gametime 5.0;
            }
            
            if(
is_user_connected(id) && !g_didDeadCheck[id])
            {
                
// Set nightvision
                
g_didDeadCheck[id] = true;
                
message_begin(MSG_ONE_UNRELIABLEg_msgNVGToggle_id);
                
write_byte(1);
                
message_end();
            }
            else if(
is_user_connected(id) && g_didDeadCheck[id] && g_weatherOff)
            {
                
message_begin(MSG_ONE_UNRELIABLEg_msgNVGToggle_id);
                
write_byte(0);
                
message_end();
            }
        }
        
        
// Show round time to dead players
        
if(g_nextHudMsg[id] < gametime)
        {
            
// Show countdown after round start till zombie
            
if(g_showZombieTimeHud)
            {
                
set_hudmessage(25500, -1.00.2000.0HUDMSG_TIME0.00.0);
                if(
g_timeTillZombie >= COUNTDOWN_TIME g_freezeTime)
                    
ShowSyncHudMsg(idg_countdownHudMsg"Selecting Zombie: %i^nFreeze Time: %i"floatround(g_timeTillZombie), floatround(g_timeTillZombie - (COUNTDOWN_TIME g_freezeTime)));
                else
                    
ShowSyncHudMsg(idg_countdownHudMsg"Selecting Zombie: %i"floatround(g_timeTillZombie));
            }
            
// Show round time count down
            
else if(g_showRoundTimeHud)
            {
                
set_hudmessage(25500, -1.00.2000.0HUDMSG_TIME0.00.0);
                
ShowSyncHudMsg(idg_countdownHudMsg"Round Time Left: %i"floatround(g_roundTimeLeft));
            }
            
            
g_nextHudMsg[id] = gametime HUDMSG_TIME 0.1;
        }
        
        return 
FMRES_IGNORED;
    }
    
    
// Show the hud messages for during round
    
if(g_nextHudMsg[id] < gametime)
    {
        static 
text[HUD_MSG_LEN], ln;
        
ln 0;
        
        
// Show health hud message
        
static statustype[2][] = { "Zombie""Human" };
        static 
armortype[2][] = { "Skin""Armor" };
        static 
type;
        
        if(
g_isZombie[id])
            
type 0;
        else
            
type 1;
        
        
ln += format(text[ln], HUD_MSG_LEN-1-ln"Status: %s^n"statustype[type]);
        
ln += format(text[ln], HUD_MSG_LEN-1-ln"Health: %i^n"pev(idpev_health));
        
ln += format(text[ln], HUD_MSG_LEN-1-ln"%s: %i"armortype[type], get_user_armor(id));
        
        if(
g_flashHealth[id])
        {
            if(
g_isZombie[id] && get_pcvar_num(sv_lightstyle) != 0)
                
set_hudmessage(255000.020.8810.0HUDMSG_TIME0.00.0);
            else
                
set_hudmessage(025500.020.8810.0HUDMSG_TIME0.00.0);
            
            
g_flashHealthCount[id] += 1;
            if(
g_flashHealthCount[id] == 3)
            {
                
g_flashHealth[id] = false;
                
g_flashHealthCount[id] = 0;
            }
        }
        else
        {
            if(
g_isZombie[id] && get_pcvar_num(sv_lightstyle) != 0)
                
set_hudmessage(255000.020.8800.0HUDMSG_TIME0.00.0);
            else
                
set_hudmessage(025500.020.8800.0HUDMSG_TIME0.00.0);
        }
        
ShowSyncHudMsg(idg_healthHudMsgtext);
        
        
// Show player count hud message
        
if(g_zombiesLeft || g_humansLeft)
        {
            if(
g_isZombie[id] && get_pcvar_num(sv_lightstyle) != 0)
                
set_hudmessage(255000.830.5000.0HUDMSG_TIME0.00.0);
            else
                
set_hudmessage(025500.830.5000.0HUDMSG_TIME0.00.0);
            
ShowSyncHudMsg(idg_playerCountHudMsg"Zombies Left: %i^nHumans Left: %i"g_zombiesLeftg_humansLeft);
        }
        
        
// Show countdown after round start till zombie
        
if(g_showZombieTimeHud)
        {
            
set_hudmessage(02550, -1.00.0200.0HUDMSG_TIME0.00.0);
            if(
g_timeTillZombie >= COUNTDOWN_TIME g_freezeTime)
                
ShowSyncHudMsg(idg_countdownHudMsg"Selecting Zombie: %i^nFreeze Time: %i"floatround(g_timeTillZombie), floatround(g_timeTillZombie - (COUNTDOWN_TIME g_freezeTime)));
            else
                
ShowSyncHudMsg(idg_countdownHudMsg"Selecting Zombie: %i"floatround(g_timeTillZombie));
        }
        
// Show round time count down
        
else if(g_showRoundTimeHud)
        {
            if(
g_isZombie[id] && get_pcvar_num(sv_lightstyle) != 0)
                
set_hudmessage(25500, -1.00.0200.0HUDMSG_TIME0.00.0);
            else
                
set_hudmessage(02550, -1.00.0200.0HUDMSG_TIME0.00.0);
            
ShowSyncHudMsg(idg_countdownHudMsg"Round Time Left: %i"floatround(g_roundTimeLeft));
        }
        
        
g_nextHudMsg[id] = gametime HUDMSG_TIME 0.1;
    }
    
    return 
FMRES_HANDLED;
}

public 
fwd_Think(entId)
{
    if(!
pev_valid(entId))
        return 
FMRES_IGNORED;
    
    
// Counter
    
if(entId == g_counterEnt)
    {
        
// Do the Huds
        
if(g_showZombieTimeHud)
        {
            
g_totalTime get_gametime() - g_startCountDownTimeZombie// Counts up, 1,2,3,4,5,etc
            
g_timeTillZombie COUNTDOWN_TIME g_totalTime// Counts down, 15,14,13,etc...
            
g_freezeTime get_pcvar_float(mp_freezetime);
            
            if(
g_timeTillZombie >= COUNTDOWN_TIME g_freezeTime)
            {
                if(
g_timeTillZombie - (COUNTDOWN_TIME g_freezeTime) < 0.1)
                    
g_startCountDownTimeRound get_gametime();
            }
            else
            {
                if(
g_timeTillZombie 0.1)
                {
                    
g_showZombieTimeHud false;
                    
set_task(0.1"task_chooseZombie");
                }
            }
        }
        else if(
g_showRoundTimeHud)
        {
            
g_totalTime get_gametime() - g_startCountDownTimeRound;
            
g_roundTimeLeft g_roundTime - (g_roundTime - (g_roundTime g_totalTime));
            
            if(
g_roundTimeLeft 8.5 && g_roundTimeLeft 8.3 && get_pcvar_num(sv_storm) == 1)
                
set_pev(g_thunderEntpev_nextthinkget_gametime() + 9999.0);
            else if(
g_roundTimeLeft 0.2)
                
g_showRoundTimeHud false;
            else if(
g_roundTimeLeft 1.0 && get_pcvar_num(sv_storm) == 1)
            {
                if(
g_shouldRain)
                {
                    
g_shouldRain false;
                    
set_pev(g_thunderEntpev_nextthinkget_gametime() + 0.4);
                }
            }
        }
        
        
// Do the nightvision for players if lightlevel is 0
        
if(!get_pcvar_num(sv_lightstyle))
        {
            static 
Players[32], playerCountiidorigin[3];
            
get_players(PlayersplayerCount"ach");
            for(
i=0i<playerCounti++)
            {
                
id Players[i];
                
                
get_user_origin(idorigin);
                if(
g_isZombie[id])
                {
                    
// Zombie
                    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id);
                    
write_byte(TE_DLIGHT); // 27
                    
write_coord(origin[0]);
                    
write_coord(origin[1]);
                    
write_coord(origin[2]);
                    
write_byte(ZOMBIE_LIGHT_RADIUS); // radius
                    
write_byte(255); // r
                    
write_byte(1); // g
                    
write_byte(1); // b
                    
write_byte(2); // life in 10's
                    
write_byte(1); // decay rate in 10's
                    
message_end();
                }
                else
                {
                    
// Human
                    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id);
                    
write_byte(TE_DLIGHT); // 27
                    
write_coord(origin[0]);
                    
write_coord(origin[1]);
                    
write_coord(origin[2]);
                    
write_byte(HUMAN_LIGHT_RADIUS); // radius
                    
write_byte(1); // r
                    
write_byte(1); // g
                    
write_byte(1); // b
                    
write_byte(2); // life in 10's
                    
write_byte(1); // decay rate in 10's
                    
message_end();
                }
            }
        }
        
        
set_pev(entIdpev_nextthinkget_gametime() + HUD_LIGHT_UPDATE_TIME);
    }
    
// Thunder / Lightning
    
else if(entId == g_thunderEnt)
    {
        if(
g_shouldRain)
        {
            static 
thinkReturn;
            if(!
g_isFlashing)
            {
                if(
random_num(01))
                    
set_pev(entIdpev_messageZOMBIE_THUNDER_1);
                else
                    
set_pev(entIdpev_messageZOMBIE_THUNDER_2);
                
g_isFlashing true;
                
g_flashNum random_num(13);
                
dllfunc(DLLFunc_UseentId0);
            }
            
            if(
get_pcvar_num(sv_lightstyle) == 0)
                
thinkReturn lightning();
            
            if(
thinkReturn)
                
set_pev(entIdpev_nextthinkget_gametime() + random_float(5.515.5));
            else
                
set_pev(entIdpev_nextthinkget_gametime() + 0.1);
        }
        else
        {
            if(!
g_lightningOff)
            {
                
// Make it turn to daylight
                
static thinkReturn;
                if(!
g_isFlashing)
                {
                    
g_isFlashing true;
                    
g_flashNum 4;
                }
                
                if(
get_pcvar_num(sv_lightstyle) == 0)
                    
thinkReturn lightning();
                
                if(
thinkReturn)
                {
                    
g_lightningOff true;
                    
set_pev(entIdpev_nextthinkget_gametime() + random_float(2.512.5));
                }
                else
                    
set_pev(entIdpev_nextthinkget_gametime() + 0.1);
            }
            else
                
set_pev(entIdpev_nextthinkget_gametime() + random_float(2.512.5));
        }
    }
    
// Rain
    
else if(entId == g_rainEnt)
    {
        if(
g_shouldRain)
        {
            static 
Players[32], playerCountplayeriFloat:gametime;
            
gametime get_gametime();
            
            
get_players(PlayersplayerCount"ch");
            for(
i=0i<playerCounti++)
            {
                
player Players[i];
                
                if(
is_user_outside(player))
                {
                    
g_newLocation[player] = true;
                    if(
g_nextRainSound[player] < gametime && g_oldLocation[player] == g_newLocation[player])
                    {
                        
g_oldLocation[player] = true;
                        
client_cmd(player"speak %s;cl_weather 1"ZOMBIE_RAIN);
                        
g_nextRainSound[player] = gametime 2.0;
                    }
                    else if(
g_oldLocation[player] != g_newLocation[player])
                    {
                        
g_oldLocation[player] = true;
                        
client_cmd(player"speak %s;cl_weather 1"ZOMBIE_RAIN);
                    }
                }
                else
                {
                    
g_newLocation[player] = false;
                    if(
g_nextRainSound[player] < gametime && g_oldLocation[player] == g_newLocation[player])
                    {
                        
g_oldLocation[player] = false;
                        
client_cmd(player"speak %s;cl_weather 1"ZOMBIE_RAIN_INSIDE);
                        
g_nextRainSound[player] = gametime 2.0;
                    }
                    else if(
g_oldLocation[player] != g_newLocation[player])
                    {
                        
g_oldLocation[player] = false;
                        
client_cmd(player"speak %s;cl_weather 1"ZOMBIE_RAIN_INSIDE);
                    }
                }
            }
        }
        else
        {
            if(!
g_weatherOff)
            {
                
g_weatherOff true;
                static 
Players[32], playerCountplayeri;
                
get_players(PlayersplayerCount"ch");
                for(
i=0i<playerCounti++)
                {
                    
player Players[i];
                    
client_cmd(player"speak NULL;cl_weather 0");
                }
            }
        }
        
        
set_pev(entIdpev_nextthinkget_gametime() + 0.3);
    }
    
    return 
FMRES_HANDLED;
}

public 
fwd_KeyValue(entIdkvd_id)
{
    if(!
pev_valid(entId))
        return 
FMRES_IGNORED;
    
    static 
className[64];
    
get_kvd(kvd_idKV_ClassNameclassName63);
    
    if(!
g_buyzoneMade)
    {
        
g_buyzoneMade true;
        
        
// Make the buyzone
        
new buy engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_buyzone"));
        
engfunc(EngFunc_SetOriginbuyFloat:{0.0,0.0,-55000.0});
        
engfunc(EngFunc_SetSizebuyFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0});
        
set_keyvalue(buy"team""0");
        
dllfunc(DLLFunc_Spawnbuy);
        
        
// Make the bomb stuff
        
new bomb engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_bomb_target"));
        
engfunc(EngFunc_SetOriginbombFloat:{0.0,0.0,-55100.0});
        
engfunc(EngFunc_SetSizebombFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0});
        
dllfunc(DLLFunc_Spawnbomb);
    }
    
    if(
containi(className"func_bomb_target") != -1
    
|| containi(className"info_bomb_target") != -1
    
|| containi(className"hostage_entity") != -1
    
|| containi(className"monster_scientist") != -1
    
|| containi(className"func_hostage_rescue") != -1
    
|| containi(className"info_hostage_rescue") != -1
    
|| containi(className"info_vip_start") != -1
    
|| containi(className"func_vip_safetyzone") != -1
    
|| containi(className"func_escapezone") != -1
    
|| containi(className"func_buyzone") != -1)
        
engfunc(EngFunc_RemoveEntityentId);
    
    return 
FMRES_HANDLED;
}
////////////////////////////////////////////////////////////
/* END Forward Hooks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Tasks */
////////////////////////////////////////////////////////////
public task_preCheckTeamsDeath(id)
    
check_teams(0);

public 
task_preCheckTeams(id)
    
check_teams(13337);

public 
task_checkPlayerCount()
{
    if(
get_playersnum(0) == 0)
        
g_canRestart true;
}

public 
task_chooseZombie()
{
    static 
Players[32], playerCountiidplayername[33];
    
g_humansLeft 0;
    
g_zombiesLeft 0;
    
get_players(PlayersplayerCount"ah");
    switch(
playerCount)
    {
        case 
0: return FMRES_HANDLED;
        case 
1:
        {
            
id Players[0];
            
g_zombiesLeft 1;
        }
        default:
        {
            
// Choose Zombie and set zombie amount to 1
            
id Players[random(playerCount)];
            
g_zombiesLeft 1;
            
            
// Set everyone else humans and get the human amount
            
for(i=0i<playerCounti++)
            {
                
player Players[i];
                if(
player != id)
                {
                    
g_humansLeft += 1;
                    
set_human(player);
                }
            }
        }
    }
    
    
get_user_name(idname32);
    
set_zombie(id10);
    
    
set_hudmessage(02550, -1.00.0220.066.00.050.03);
    
ShowSyncHudMsg(0g_countdownHudMsg"Watch Out!^n%s is the zombie!"name);
    
    
set_task(6.5"task_setRoundTimeHud");
    
    return 
FMRES_HANDLED;
}

public 
task_setRoundTimeHud()
    
g_showRoundTimeHud true;
////////////////////////////////////////////////////////////
/* END Tasks */
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/* START Stocks */
////////////////////////////////////////////////////////////
stock fm_get_user_team(id)
    return 
get_pdata_int(id114);

stock round_ended()
{
    static 
PlayersAll[32], playerCountiid;
    
    
// Set the humans and zombies amount left for the hud
    
g_humansLeft 0;
    
g_zombiesLeft 0;
    
    
get_players(PlayersAllplayerCount"h");
    
    
// Remove players zombie status if they have it
    
for(i=0i<playerCounti++)
    {
        
id PlayersAll[i];
        
        if(
g_isZombie[id])
        {
            
g_isZombie[id] = false;
            
            
// Remove zombie arms
            
static weaponweaponName[33];
            
weapon get_user_weapon(id);
            
get_weaponname(weaponweaponName32);
            if(
equal(weaponName"weapon_knife"))
            {
                
set_pev(idpev_viewmodel2"models/v_knife.mdl");
                
set_pev(idpev_weaponmodel2"models/p_knife.mdl");
            }
            
            
cs_reset_user_model(id);
        }
    }
    
    
set_task(0.2"task_preCheckTeams");
}

stock check_teams(type)
{
    
// Type 0 = Regular check
    // Type 13337 = Last round check
    
    
static PlayersAll[32], PlayersCT[32], PlayersT[32], playerCountpCountCTpCountTiidunevenunevenby;
    
    
get_players(PlayersAllplayerCount"h");
    
    
// Get Terrorists
    
pCountT 0;
    for(
i=0i<playerCounti++)
    {
        
id PlayersAll[i];
        
        if(
fm_get_user_team(id) != 1)
            continue;
        
        
PlayersT[i] = id;
        
pCountT += 1;
    }
    
    
// Get Counter-Terrorists
    
pCountCT 0;
    for(
i=0i<playerCounti++)
    {
        
id PlayersAll[i];
        
        if(
fm_get_user_team(id) != 2)
            continue;
        
        
PlayersCT[i] = id;
        
pCountCT += 1;
    }
    
    
// Balance the teams
    
uneven abs(pCountT pCountCT) / 2;
    
    if(
type 0)
    {
        
unevenby 0;
        if(
pCountT pCountCT)
            
unevenby pCountT pCountCT;
        else if(
pCountCT pCountT)
            
unevenby pCountCT pCountT;
        
        if(
uneven 1)
            
client_print(0print_chat"[ZD] The teams are uneven by %i [%i on T] [%i on CT]. Switching %i players."unevenbypCountTpCountCTuneven-1);
        else
            
client_print(0print_chat"[ZD] The teams are uneven by %i [%i on T] [%i on CT]. Teams are fine."unevenbypCountTpCountCT);
    }
    
    for(
i=0i<playerCounti++)
    {
        
id PlayersAll[i];
        if(
uneven 1)
        {
            if(
pCountT pCountCT)
            {
                
// There are more T than CT
                
if(!type)
                {
                    if(
fm_get_user_team(id) == && !is_user_alive(id))
                    {
                        
// Move this player to CT
                        
set_user_team(id2);
                        
uneven -= 1;
                    }
                }
                else
                {
                    if(
fm_get_user_team(id) == 1)
                    {
                        
// Move this player to CT
                        
set_user_team(id2);
                        
uneven -= 1;
                    }
                }
            }
            else
            {
                
// There are more CT than T
                
if(!type)
                {
                    if(
fm_get_user_team(id) == && !is_user_alive(id))
                    {
                        
// Move this player to T
                        
set_user_team(id1);
                        
uneven -= 1;
                    }
                }
                else
                {
                    if(
fm_get_user_team(id) == 2)
                    {
                        
// Move this player to T
                        
set_user_team(id1);
                        
uneven -= 1;
                    }
                }
            }
        }
        else
            break;
    }
    
    return 
FMRES_HANDLED;
}

stock set_lightstyle(num)
{
    switch(
num)
    {
        case 
1engfunc(EngFunc_LightStyle0"b");
        case 
2engfunc(EngFunc_LightStyle0"c");
        case 
3engfunc(EngFunc_LightStyle0"d");
        case 
4engfunc(EngFunc_LightStyle0"e");
        case 
5engfunc(EngFunc_LightStyle0"f");
        case 
6engfunc(EngFunc_LightStyle0"g");
        case 
7engfunc(EngFunc_LightStyle0"h");
        case 
8engfunc(EngFunc_LightStyle0"i");
        case 
9engfunc(EngFunc_LightStyle0"j");
        case 
10engfunc(EngFunc_LightStyle0"k");
        case 
11engfunc(EngFunc_LightStyle0"l");
        case 
12engfunc(EngFunc_LightStyle0"m");
        case 
13engfunc(EngFunc_LightStyle0"n");
        case 
14engfunc(EngFunc_LightStyle0"o");
        case 
15engfunc(EngFunc_LightStyle0"p");
        case 
16engfunc(EngFunc_LightStyle0"q");
        case 
17engfunc(EngFunc_LightStyle0"r");
        case 
18engfunc(EngFunc_LightStyle0"s");
        case 
19engfunc(EngFunc_LightStyle0"t");
        case 
20engfunc(EngFunc_LightStyle0"u");
        case 
21engfunc(EngFunc_LightStyle0"v");
        case 
22engfunc(EngFunc_LightStyle0"w");
        case 
23engfunc(EngFunc_LightStyle0"x");
        case 
24engfunc(EngFunc_LightStyle0"y");
        case 
25engfunc(EngFunc_LightStyle0"z");
        default: 
engfunc(EngFunc_LightStyle0"a");
    }
}

stock set_zombie(idtypeattacker)
{
    
g_isZombie[id] = true;
    
    if(
type)
    {
        
set_pev(idpev_healthZOMBIE_HEALTH_MAIN);
        
cs_set_user_armor(idZOMBIE_ARMOR_MAINCS_ARMOR_VESTHELM);
    }
    else
    {
        
set_pev(idpev_healthZOMBIE_HEALTH_AFTER);
        
cs_set_user_armor(idZOMBIE_ARMOR_AFTERCS_ARMOR_VESTHELM);
        
        
message_begin(MSG_ALLg_msgDeathMsg);
        
write_byte(attacker);
        
write_byte(id);
        
write_byte(0);
        
write_string("Zombie Disease");
        
message_end();
        
        
g_zombiesLeft += 1;
    }
    
    if(
fm_get_user_team(id) == 2)
        
set_user_team(id1);
    
    
cs_set_user_model(idZOMBIE_MODEL_1_NICK);
    
    
fm_strip_user_weapons(id);
    
fm_give_item(id"weapon_knife");
    
    if(
get_pcvar_num(sv_lightstyle) != 0)
    {
        
message_begin(MSG_ONEg_msgNVGToggle_id);
        
write_byte(1);
        
message_end();
    }
    
    
message_begin(MSG_ALLg_msgScoreAttrib);
    
write_byte(id);
    
write_byte(0);
    
message_end();
    
    
set_pev(idpev_viewmodel2ZOMBIE_MODEL_CLAWS); // Set to 1st person claws
    
set_pev(idpev_weaponmodel2""); // Set to nothing
    
    
engfunc(EngFunc_SetClientMaxspeedidZOMBIE_SPEED);
    
    
engfunc(EngFunc_EmitSoundidCHAN_AUTOg_zombieInfect[random_num(0ZOMBIE_INFECT_NUM-1)], 1.00.80100);
    
    
g_flashHealth[id] = true;
}

stock set_human(id)
{
    if(
fm_get_user_team(id) == 1)
        
set_user_team(id2);
}

stock set_user_team(idteam)
{
    switch(
team)
    {
        case 
1:
        {
            
// Terrorist
            
set_pdata_int(id1141);
            
message_begin(MSG_ALLg_msgTeamInfo);
            
write_byte(id);
            
write_string("TERRORIST");
            
message_end();
        }
        case 
2:
        {
            
// CT
            
set_pdata_int(id1142);
            
message_begin(MSG_ALLg_msgTeamInfo);
            
write_byte(id);
            
write_string("CT");
            
message_end();
        }
    }
}

stock set_punchangle(id)
{
    static 
Float:punchangle[3];
    
punchangle[0] = random_float(-50.050.0);
    
punchangle[1] = random_float(-50.050.0);
    
punchangle[2] = random_float(-50.050.0);
    
set_pev(idpev_punchanglepunchangle);
    return 
FMRES_HANDLED;
}

stock lightning()
{
    switch(
g_flashNum)
    {
        
// Flash 1 time
        
case 1:
        {
            
g_lightCounter += 1;
            switch(
g_lightCounter)
            {
                case 
1g_lightStyleNum 1;
                case 
2g_lightStyleNum 2;
                case 
3g_lightStyleNum 1;
                case 
4g_lightStyleNum 0;
            }
            
engfunc(EngFunc_LightStyle0g_lightStyleChar[g_lightStyleNum]);
            
            
// Set sky color to lightning brightness
            /*
            switch(g_lightStyleNum)
            {
                case 0: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[0], g_skyColors[0], g_skyColors[0]);
                case 1: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[1], g_skyColors[1], g_skyColors[1]);
                case 2: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[2], g_skyColors[2], g_skyColors[2]);
            }
            */
            
            
if(g_lightCounter == 4)
            {
                
g_lightCounter 0;
                
g_isFlashing false;
                return 
1;
            }
            else
                return 
0;
        }
        
// Flash 2 times
        
case 2:
        {
            
g_lightCounter += 1;
            switch(
g_lightCounter)
            {
                case 
1g_lightStyleNum 1;
                case 
2g_lightStyleNum 2;
                case 
3g_lightStyleNum 1;
                case 
4g_lightStyleNum 2;
                case 
5g_lightStyleNum 1;
                case 
6g_lightStyleNum 0;
            }
            
engfunc(EngFunc_LightStyle0g_lightStyleChar[g_lightStyleNum]);
            
            
// Set sky color to lightning brightness
            /*
            switch(g_lightStyleNum)
            {
                case 0: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[0], g_skyColors[0], g_skyColors[0]);
                case 1: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[1], g_skyColors[1], g_skyColors[1]);
                case 2: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[2], g_skyColors[2], g_skyColors[2]);
            }
            */
            
            
if(g_lightCounter == 6)
            {
                
g_lightCounter 0;
                
g_isFlashing false;
                return 
1;
            }
            else
                return 
0;
        }
        
// Flash 3 times
        
case 3:
        {
            
g_lightCounter += 1;
            switch(
g_lightCounter)
            {
                case 
1g_lightStyleNum 1;
                case 
2g_lightStyleNum 2;
                case 
3g_lightStyleNum 1;
                case 
4g_lightStyleNum 2;
                case 
5g_lightStyleNum 1;
                case 
6g_lightStyleNum 2;
                case 
7g_lightStyleNum 1;
                case 
8g_lightStyleNum 0;
            }
            
engfunc(EngFunc_LightStyle0g_lightStyleChar[g_lightStyleNum]);
            
            
// Set sky color to lightning brightness
            /*
            switch(g_lightStyleNum)
            {
                case 0: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[0], g_skyColors[0], g_skyColors[0]);
                case 1: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[1], g_skyColors[1], g_skyColors[1]);
                case 2: server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i", g_skyColors[2], g_skyColors[2], g_skyColors[2]);
            }
            */
            
            
if(g_lightCounter == 8)
            {
                
g_lightCounter 0;
                
g_isFlashing false;
                return 
1;
            }
            else
                return 
0;
        }
        
// Turn to daylight
        
case 4:
        {
            
g_lightCounter += 1;
            switch(
g_lightCounter)
            {
                case 
1:
                {
                    
engfunc(EngFunc_LightStyle0"b");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"202020);
                }
                case 
2:
                {
                    
engfunc(EngFunc_LightStyle0"c");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"303030);
                }
                case 
3:
                {
                    
engfunc(EngFunc_LightStyle0"d");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"404040);
                }
                case 
4:
                {
                    
engfunc(EngFunc_LightStyle0"e");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"505050);
                }
                case 
5:
                {
                    
engfunc(EngFunc_LightStyle0"f");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"606060);
                }
                case 
6:
                {
                    
engfunc(EngFunc_LightStyle0"g");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"757575);
                }
                case 
7:
                {
                    
engfunc(EngFunc_LightStyle0"h");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"909090);
                }
                case 
8:
                {
                    
engfunc(EngFunc_LightStyle0"i");
                    
server_cmd("sv_skycolor_r %i;sv_skycolor_g %i;sv_skycolor_b %i"105105105);
                }
            }
            
            if(
g_lightCounter == 8)
            {
                
g_lightCounter 0;
                
g_isFlashing false;
                return 
1;
            }
            else
                return 
0;
        }
    }
    return 
1;
}

stock bool:is_user_outside(id)
{
    static 
Float:origin[3], Float:savedOrg;
    
pev(idpev_originorigin);
    
savedOrg origin[2];
    
    
// Get org 1
    
origin[0] += RAIN_INSIDE_DIST 2;
    while(
engfunc(EngFunc_PointContentsorigin) == -1)
        
origin[2] += 5.0;
    
    if(
engfunc(EngFunc_PointContentsorigin) == -6)
        return 
true;
    
    
// Get org 2
    
origin[0] -= RAIN_INSIDE_DIST;
    
origin[2] = savedOrg;
    while(
engfunc(EngFunc_PointContentsorigin) == -1)
        
origin[2] += 5.0;
    
    if(
engfunc(EngFunc_PointContentsorigin) == -6)
        return 
true;
    
    
// Get org 3
    
origin[0] += RAIN_INSIDE_DIST 2;
    
origin[1] += RAIN_INSIDE_DIST 2;
    
origin[2] = savedOrg;
    while(
engfunc(EngFunc_PointContentsorigin) == -1)
        
origin[2] += 5.0;
    
    if(
engfunc(EngFunc_PointContentsorigin) == -6)
        return 
true;
    
    
// Get org 4
    
origin[1] -= RAIN_INSIDE_DIST;
    
origin[2] = savedOrg;
    while(
engfunc(EngFunc_PointContentsorigin) == -1)
        
origin[2] += 5.0;
    
    if(
engfunc(EngFunc_PointContentsorigin) == -6)
        return 
true;
    
    return 
false;
}

stock set_keyvalue(entkey[], value[])
{
    static 
classname[32];
    
    
pev(entpev_classnameclassname31);
    
set_kvd(0KV_ClassNameclassname);
    
set_kvd(0KV_KeyNamekey);
    
set_kvd(0KV_Valuevalue);
    
set_kvd(0KV_fHandled0);
    
    
dllfunc(DLLFunc_KeyValueent0);
}

stock fm_set_user_frags(indexfrags)
{
    
set_pev(indexpev_fragsfloat(frags));
    
    
message_begin(MSG_ALLg_msgScoreInfo);
    
write_byte(index);
    
write_short(frags);
    
write_short(cs_get_user_deaths(index));
    
write_short(0);
    
write_short(fm_get_user_team(index));
    
message_end();
    
    return 
1;
}

stock bool:fm_strip_user_gun(indexwid 0, const wname[] = "")
{
    new 
ent_class[32];
    if(!
wid && wname[0])
        
copy(ent_classsizeof ent_class 1wname);
    else
    {
        new 
weapon widclipammo;
        if(!
weapon && !(weapon get_user_weapon(indexclipammo)))
            return 
false;
        
        
get_weaponname(weaponent_classsizeof ent_class 1);
    }
    
    new 
ent_weap fm_find_ent_by_owner(-1ent_classindex)
    if(!
ent_weap)
        return 
false;
    
    
engclient_cmd(index"drop"ent_class);
    
    new 
ent_box pev(ent_weappev_owner);
    if(!
ent_box || ent_box == index)
        return 
false;
    
    
dllfunc(DLLFunc_Thinkent_box);
    
    return 
true;
}

stock fm_find_ent_by_owner(index, const classname[], ownerjghgtype 0)
{
    new 
strtype[11] = "classname"ent index;
    switch (
jghgtype)
    {
        case 
1strtype "target";
        case 
2strtype "targetname";
    }
    
    while((
ent engfunc(EngFunc_FindEntityByStringentstrtypeclassname)) && pev(entpev_owner) != owner) {}
    
    return 
ent;
}

stock fm_give_item(index, const item[])
{
    if (!
equal(item"weapon_"7) && !equal(item"ammo_"5) && !equal(item"item_"5) && !equal(item"tf_weapon_"10))
        return 
0
    
    
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    if (!
pev_valid(ent))
        return 
0
    
    
new Float:origin[3]
    
pev(indexpev_originorigin)
    
set_pev(entpev_originorigin)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    new 
save pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentindex)
    if (
pev(entpev_solid) != save)
        return 
ent
    
    engfunc
(EngFunc_RemoveEntityent)
    
    return -
1
}

stock remove_weapon(idtype)
{
    static 
Weapons[32], numWeaponsiweaponweaponName[33];
    
get_user_weapons(idWeaponsnumWeapons);
    for(
i=0i<numWeaponsi++)
    {
        
weapon Weapons[i];
        if(!
weapon)
            continue;
        
        
get_weaponname(weaponweaponName32);
        
        switch(
type)
        {
            case 
1:
            {
                if(
equal(weaponName"weapon_m3")
                || 
equal(weaponName"weapon_xm1014")
                || 
equal(weaponName"weapon_tmp")
                || 
equal(weaponName"weapon_mp5navy")
                || 
equal(weaponName"weapon_ump45")
                || 
equal(weaponName"weapon_p90")
                || 
equal(weaponName"weapon_mac10")
                || 
equal(weaponName"weapon_famas")
                || 
equal(weaponName"weapon_galil")
                || 
equal(weaponName"weapon_m4a1")
                || 
equal(weaponName"weapon_ak47")
                || 
equal(weaponName"weapon_aug")
                || 
equal(weaponName"weapon_sg552")
                || 
equal(weaponName"weapon_scout")
                || 
equal(weaponName"weapon_awp")
                || 
equal(weaponName"weapon_sg550")
                || 
equal(weaponName"weapon_g3sg1")
                || 
equal(weaponName"weapon_m249"))
                {
                    
fm_strip_user_gun(idweapon);
                    
//break;
                
}
            }
            case 
2:
            {
                if(
equal(weaponName"weapon_glock18")
                || 
equal(weaponName"weapon_usp")
                || 
equal(weaponName"weapon_p228")
                || 
equal(weaponName"weapon_deagle")
                || 
equal(weaponName"weapon_fiveseven")
                || 
equal(weaponName"weapon_elite"))
                {
                    
fm_strip_user_gun(idweapon);
                    
//break;
                
}
            }
            case 
3:
            {
                if(
equal(weaponName"weapon_knife"))
                {
                    
fm_strip_user_gun(idweapon);
                    
//break;
                
}
            }
            case 
4:
            {
                if(
equal(weaponName"weapon_flashbang")
                || 
equal(weaponName"weapon_hegrenade")
                || 
equal(weaponName"weapon_smokegrenade"))
                {
                    
fm_strip_user_gun(idweapon);
                    
//break;
                
}
            }
            case 
5:
            {
                if(
equal(weaponName"weapon_c4"))
                {
                    
fm_strip_user_gun(idweapon);
                    
//break;
                
}
            }
        }
    }
}

stock fm_strip_user_weapons(index)
{
    new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"));
    if (!
pev_valid(ent))
        return 
0
    
    dllfunc
(DLLFunc_Spawnent)
    
dllfunc(DLLFunc_Useentindex)
    
engfunc(EngFunc_RemoveEntityent)
    
    return 
1
}
////////////////////////////////////////////////////////////
/* END Stocks */
//////////////////////////////////////////////////////////// 
Sounds and models included (some sounds taken from other mods)...
Attached Files
File Type: zip models-sounds.zip (1.82 MB, 171 views)

Last edited by hlstriker; 02-25-2008 at 09:29.
hlstriker is offline
Dric Laar
BANNED
Join Date: Dec 2007
Old 02-24-2008 , 02:17   Re: Source to a zombie mod...
Reply With Quote #2

Woo, more zombie infection plugins...
Dric Laar is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode