knife menu errors

Installation Problems Support
Post Reply
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 431
Joined: 1 Year Ago
Has thanked: 15 times
Been thanked: 1 time
Contact:

knife menu errors

#1

Post by czirimbolo » 2 Weeks Ago

Can someone help me to fix this?

L 10/24/2018 - 19:47:42: Unhandled dynamic native error
L 10/24/2018 - 19:47:42: [AMXX] Displaying debug trace (plugin "ze_knife_menu.amxx", version "1.3")
L 10/24/2018 - 19:47:42: [AMXX] Run time error 10: native error (native "cs_set_player_view_model")
L 10/24/2018 - 19:47:42: [AMXX] [0] ze_knife_menu.sma::CurrentWeapon (line 972)

Code: Select all

#include <zombie_escape>
#include <engine>
#include <fun>
#include <ze_vip>
#include <ze_levels>

native ze_give_dsp(id)
native ze_remove_dsp(id)
 
// Models
new const Compat_Models[][] =
{
    "models/zombie_escape/v_combat_knife.mdl",
    "models/zombie_escape/p_combat_knife.mdl"
}
 
new const Strong_Models[][] =
{
    "models/zombie_escape/v_strong_knife.mdl",
    "models/zombie_escape/p_strong_knife.mdl"
}
 
new const Katana_Models[][] =
{
    "models/zombie_escape/v_katana_knife.mdl",
    "models/zombie_escape/p_katana_knife.mdl"
}
 
new const Hammer_Models[][] =
{
    "models/zombie_escape/v_hammer_knife.mdl",
    "models/zombie_escape/p_hammer_knife.mdl"
}
 
new const Turbulent9_Models[][] =
{
    "models/zombie_escape/v_turbulent9_knife.mdl",
    "models/zombie_escape/p_turbulent9_knife.mdl"
}
 
new const Bio_Models[][] =
{
    "models/zombie_escape/v_bio_knife.mdl",
    "models/zombie_escape/p_bio_knife.mdl"
}
 
new const Sabers_Models[][] =
{
    "models/zombie_escape/v_laser_knife.mdl",
    "models/zombie_escape/p_laser_knife.mdl"
}
 
new const Plasma_Models[][] =
{
    "models/zombie_escape/v_plasma_knife.mdl",
    "models/zombie_escape/p_plasma_knife.mdl"
}
 
new const Storm_Models[][] =
{
    "models/zombie_escape/v_storm_sword_knife.mdl",
    "models/zombie_escape/p_storm_sword_knife.mdl"
}
 
new const Laevateinn_Models[][] =
{
    "models/zombie_escape/v_laevateinn_knife.mdl",
    "models/zombie_escape/p_laevateinn_knife.mdl"
}
 
new const WarHammer_Dark_Knight_Models[][] =
{
    "models/zombie_escape/v_WarHammer_dark_knight_knife.mdl",
    "models/zombie_escape/p_WarHammer_dark_knight_knife.mdl"
}
 
new const Balrog_Kosa_Models[][] =
{
    "models/zombie_escape/v_balrog_kosa_knife.mdl",
    "models/zombie_escape/p_balrog_kosa_knife.mdl"
}
 
// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"
 
new const combat_sounds[][] =
{
    "zombie_escape/knife_menu/combat_deploy.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hitwall.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_stab.wav"
}
 
new const strong_sounds[][] =
{
    "zombie_escape/knife_menu/strong_deploy.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hitwall.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_stab.wav"
}
 
new const katana_sounds[][] =
{
    "zombie_escape/knife_menu/katana_deploy.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hitwall.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_stab.wav"
}
 
new const hammer_sounds[][] =
{
    "zombie_escape/knife_menu/hammer_deploy.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hitwall.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_stab.wav"
}
 
new const turbulent9_sounds[][] =
{
    "zombie_escape/knife_menu/turbulent9_deploy.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hitwall.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_stab.wav"
}
 
new const bio_sounds[][] =
{
    "zombie_escape/knife_menu/bio_deploy.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hitwall.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_stab.wav"
}
 
new const sabers_sounds[][] =
{
    "zombie_escape/knife_menu/laser_deploy.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hitwall.wav",
    "zombie_escape/knife_menu/laser_slash1.wav",
    "zombie_escape/knife_menu/laser_slash2.wav",
    "zombie_escape/knife_menu/laser_stab.wav"
}
 
new const plasma_sounds[][] =
{
    "zombie_escape/knife_menu/plasma_deploy.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hitwall.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_stab.wav"
}
 
new const storm_sounds[][] =
{
    "zombie_escape/knife_menu/storm_sword_deploy.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hitwall.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_stab.wav"
}
 
new const laevateinn_sounds[][] =
{
    "zombie_escape/knife_menu/laevateinn_deploy.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hitwall.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_stab.wav"
}
 
new const warhammer_dark_knight_sounds[][] =
{
    "zombie_escape/knife_menu/WarHammer_dark_knight_deploy.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hitwall.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_stab.wav"
}
 
new const balrog_kosa_sounds[][] =
{
    "zombie_escape/knife_menu/balrog_kosa_deploy.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hitwall.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_stab.wav"
}
 
new const oldknife_sounds[][] =
{
    "weapons/knife_deploy1.wav",
    "weapons/knife_hit1.wav",
    "weapons/knife_hit2.wav",
    "weapons/knife_hit3.wav",
    "weapons/knife_hit4.wav",
    "weapons/knife_hitwall1.wav",
    "weapons/knife_slash1.wav",
    "weapons/knife_slash2.wav",
    "weapons/knife_stab.wav"
}
 
new bool:g_bCompat[33], bool:g_bStrong[33], bool:g_bKatana[33], bool:g_bHammer[33], bool:g_bTurbulent9[33], bool:g_bBio[33], bool:g_bSabers[33], bool:g_bPlasma[33],
bool:g_bStorm[33], bool:g_bLaevateinn[33], bool:g_bWarHammer_Dark_Knight[33], bool:g_bBalrog_Kosa[33], bool:g_bDSP[33], bool:g_bNoSpeed, g_iUsedTimes[33], g_pCvarUseTimes
 
new cvar_speed_compat
new cvar_speed_strong
new cvar_speed_katana
new cvar_speed_hammer
new cvar_speed_turb
new cvar_speed_bio
new cvar_speed_sabers
new cvar_speed_plasma
new cvar_speed_storm
new cvar_speed_laevat
new cvar_speed_darknight
new cvar_speed_kosa
new cvar_speed_dsp
 
public plugin_precache()
{
    new i
 
    for (i = 0; i <= charsmax(Compat_Models); i++)
        precache_model(Compat_Models[i])
 
    for (i = 0; i <= charsmax(Hammer_Models); i++)
        precache_model(Hammer_Models[i])
 
    for (i = 0; i <= charsmax(Katana_Models); i++)
        precache_model(Katana_Models[i])
 
    for (i = 0; i <= charsmax(Strong_Models); i++)
        precache_model(Strong_Models[i])
 
    for (i = 0; i <= charsmax(Turbulent9_Models); i++)
        precache_model(Turbulent9_Models[i])
 
    for (i = 0; i <= charsmax(Bio_Models); i++)
        precache_model(Bio_Models[i])
 
    for (i = 0; i <= charsmax(Sabers_Models); i++)
        precache_model(Sabers_Models[i])
 
    for (i = 0; i <= charsmax(Plasma_Models); i++)
        precache_model(Plasma_Models[i])
 
    for (i = 0; i <= charsmax(Storm_Models); i++)
        precache_model(Storm_Models[i])
 
    for (i = 0; i <= charsmax(Laevateinn_Models); i++)
        precache_model(Laevateinn_Models[i])
 
    for (i = 0; i <= charsmax(WarHammer_Dark_Knight_Models); i++)
        precache_model(WarHammer_Dark_Knight_Models[i])
 
    for (i = 0; i <= charsmax(Balrog_Kosa_Models); i++)
        precache_model(Balrog_Kosa_Models[i])
 
    for (i = 0; i <= charsmax(combat_sounds); i++)
        precache_sound(combat_sounds[i])
 
    for (i = 0; i <= charsmax(strong_sounds); i++)
        precache_sound(strong_sounds[i])
 
    for (i = 0; i <= charsmax(katana_sounds); i++)
        precache_sound(katana_sounds[i])
 
    for (i = 0; i <= charsmax(hammer_sounds); i++)
        precache_sound(hammer_sounds[i])
 
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
        precache_sound(turbulent9_sounds[i])
 
    for (i = 0; i <= charsmax(bio_sounds); i++)
        precache_sound(bio_sounds[i])
 
    for (i = 0; i <= charsmax(sabers_sounds); i++)
        precache_sound(sabers_sounds[i])
 
    for (i = 0; i <= charsmax(plasma_sounds); i++)
        precache_sound(plasma_sounds[i])
 
    for (i = 0; i <= charsmax(storm_sounds); i++)
        precache_sound(storm_sounds[i])
 
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
        precache_sound(laevateinn_sounds[i])
 
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
        precache_sound(warhammer_dark_knight_sounds[i])
 
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
        precache_sound(balrog_kosa_sounds[i])
 
    precache_sound(g_sound_knife)
}
 
public plugin_natives()
{
    register_native("ze_open_knife_menu", "native_ze_open_knife_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Addon: Knife Menu", "1.3", "Mark")
 
    register_forward(FM_EmitSound, "fw_EmitSound")
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
 
    register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
    RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "Fw_RestMaxSpeed_Post", 1)
   
    g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1000")
 
    register_message(get_user_msgid("DeathMsg"), "DeathMsg")
 
    register_clcmd("say /km", "Show_Knife_Menu")
   
    cvar_speed_compat = register_cvar("ze_compat_speed", "275.0")
    cvar_speed_strong = register_cvar("ze_strong_speed", "275.0")
    cvar_speed_katana = register_cvar("ze_katana_speed", "275.0")
    cvar_speed_hammer = register_cvar("ze_hammer_speed", "275.0")
    cvar_speed_turb = register_cvar("ze_turb_speed", "280.0")    
    cvar_speed_bio = register_cvar("ze_bio_speed", "280.0")
    cvar_speed_sabers = register_cvar("ze_sabers_speed", "285.0")
    cvar_speed_plasma = register_cvar("ze_plasma_speed", "285.0")
    cvar_speed_storm = register_cvar("ze_storm_speed", "290.0")    
    cvar_speed_laevat = register_cvar("ze_laevat_speed", "290.0")  
    cvar_speed_darknight = register_cvar("ze_darknight_speed", "295.0")
    cvar_speed_kosa = register_cvar("ze_kosa_speed", "295.0")
	cvar_speed_dsp = register_cvar("ze_dsp_speed", "310.0")
}
 
public ze_user_humanized(id)
{
    g_iUsedTimes[id] = 0
}
 
/*public ze_user_infected(Victim)
{
    g_bCompat[Victim] = false
    g_bStrong[Victim] = false
    g_bKatana[Victim] = false
    g_bHammer[Victim] = false
    g_bTurbulent9[Victim] = false
    g_bBio[Victim] = false
    g_bSabers[Victim] = false
    g_bPlasma[Victim] = false
    g_bStorm[Victim] = false
    g_bLaevateinn[Victim] = false
    g_bWarHammer_Dark_Knight[Victim] = false
    g_bBalrog_Kosa[Victim] = false
    g_iUsedTimes[Victim] = 0
}*/
 
public client_putinserver(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}
 
public client_disconnected(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}

public ze_game_started()
{
    g_bNoSpeed = true
}
 
public ze_zombie_release()
{
    g_bNoSpeed = false
   
    // call the reset speed function ;)
    for(new id = 1; id <= 32; id++)
    {
        if (!is_user_alive(id))
            continue;
       
        rg_reset_maxspeed(id)
    }
}
 
public Show_Knife_Menu(id)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tZombies can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou can only open knife menu !y[!g%dx!y] per round!", get_pcvar_num(g_pCvarUseTimes))
        return PLUGIN_HANDLED
    }
 
    if (!is_user_alive(id))
    {
        ze_colored_print(id, "!tDead can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    Knife_Menu(id)
    return PLUGIN_CONTINUE
}
 
public Knife_Menu(id)
{
    new iMenu = menu_create("\rChoose Your Knife\w:^n^n- [ \ySpeed \rActivates \yon Zombie Release!\w ]^n\w- [ \r12 \yknives in Total!\w ] ^n-", "Menu_Handler")
    menu_additem(iMenu, "\yCombat \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yStrong \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yKatana \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yHammer \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yTurbulent9 \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yBio Hazard \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\ySabers \w[ \r285 Speed\w ]", "", 0)
    
    if (ze_get_vip_flags(id) & VIP_A)
    {
        menu_additem(iMenu, "\yPlasma \w[ \rVIP\w ] [ \r285 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yStorm \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yLaevateinn \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yWarHammer Dark Night \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yBalrog Kosa \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
    }
    
    if (ze_get_user_level(id) >= 35)
    {
        menu_additem(iMenu, "\yDSP \w[ \r310 Speed\w ]", "", 0)
    }

    menu_setprop(iMenu,MPROP_EXITNAME,"Close") 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL) 
    menu_display(id, iMenu, 0)
}
 
public Menu_Handler(id, iMenu, iKey)
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return PLUGIN_HANDLED
       
    switch(iKey)
    {
        case 0: // Compat
        {
            g_bCompat[id] = true
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //rg_reset_maxspeed(id)
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 1: // Strong
        {
            g_bCompat[id] = false
            g_bStrong[id] = true
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 2: // Katana
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = true
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 3: // Hammer
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = true
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 4: // Turbulent
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = true
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 5: // Bio
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = true
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 6: // Sabers
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = true
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 7: // Plasma
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = true
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 8: // Storm
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = true
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 9: // Laevateinn
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = true
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 10: // Warhammer Dark Night
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = true
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
       
        }
        case 11: // Balrog Kosa
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = true
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 12: // DSP
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = true
            g_iUsedTimes[id] = 0
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
    }

    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
 
public fw_EmitSound(id, channel, const sound[])
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return FMRES_IGNORED
       
    new i
    for (i = 0; i <= charsmax(combat_sounds); i++)
    for (i = 0; i <= charsmax(strong_sounds); i++)
    for (i = 0; i <= charsmax(katana_sounds); i++)
    for (i = 0; i <= charsmax(hammer_sounds); i++)
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
    for (i = 0; i <= charsmax(bio_sounds); i++)
    for (i = 0; i <= charsmax(sabers_sounds); i++)
    for (i = 0; i <= charsmax(plasma_sounds); i++)
    for (i = 0; i <= charsmax(storm_sounds); i++)
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
    {
        if(equal(sound, oldknife_sounds[i]))
        {
            if (g_bCompat[id])
            {
                emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bStrong[id])
            {
                emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bKatana[id])
            {
                emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bHammer[id])
            {
                emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bTurbulent9[id]))
            {
                emit_sound(id, channel, turbulent9_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBio[id]))
            {
                emit_sound(id, channel, bio_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bSabers[id]))
            {
                emit_sound(id, channel, sabers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, plasma_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, laevateinn_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (!g_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[id] || !g_bTurbulent9[id] || !g_bBio[id] || !g_bSabers[id] || !g_bPlasma[id] || !g_bStorm[id] || !g_bLaevateinn[id] || !g_bWarHammer_Dark_Knight[id] || !g_bBalrog_Kosa[id])
            {
                emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
        }
    }
    return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return
       
    if(get_user_weapon(id) & CSW_KNIFE)
    {
        if(g_bCompat[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Compat_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Compat_Models[1])
        }
        else if(g_bStrong[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Strong_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Strong_Models[1])
        }
        else if(g_bKatana[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Katana_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Katana_Models[1])
        }
        else if(g_bHammer[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Hammer_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Hammer_Models[1])
        }
        else if((g_bTurbulent9[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Turbulent9_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Turbulent9_Models[1])
        }
        else if((g_bBio[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Bio_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Bio_Models[1])
        }
        else if((g_bSabers[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Sabers_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Sabers_Models[1])
        }
        else if((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Plasma_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Plasma_Models[1])
        }
        else if((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Storm_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Storm_Models[1])
        }
        else if((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Laevateinn_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Laevateinn_Models[1])
        }
        else if((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[1])
        }
        else if((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Balrog_Kosa_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Balrog_Kosa_Models[1])
        }
        else if((g_bDSP[id]) && (ze_get_user_level(id) >= 35))
        {
            ze_give_dsp(id)
        }
        else
        {
            cs_reset_player_view_model(id, CSW_KNIFE)
            cs_reset_player_weap_model(id, CSW_KNIFE)
        }
    }
}
 
public Fw_RestMaxSpeed_Post(id)
{
    if (g_bNoSpeed)
        return
        
    set_task(0.1, "DelayLoad", id)
    
}
 
public DelayLoad(id)
{
    new iWpnId = (get_user_weapon(id))
    if (iWpnId == CSW_KNIFE && g_bCompat[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_compat))
    }
    if (iWpnId == CSW_KNIFE && g_bStrong[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_strong))
    }
    if (iWpnId == CSW_KNIFE && g_bKatana[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_katana))
    }
    if (iWpnId == CSW_KNIFE && g_bHammer[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammer))
    }
    if (iWpnId == CSW_KNIFE && g_bTurbulent9[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_turb))
    }
    if (iWpnId == CSW_KNIFE && g_bBio[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_bio))
    }
    if (iWpnId == CSW_KNIFE && g_bSabers[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_sabers))
    }
    if (iWpnId == CSW_KNIFE && g_bPlasma[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_plasma))
    }
    if (iWpnId == CSW_KNIFE && g_bStorm[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_storm))
    }
    if (iWpnId == CSW_KNIFE && g_bLaevateinn[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_laevat))
    }
    if (iWpnId == CSW_KNIFE && g_bWarHammer_Dark_Knight[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_darknight))
    }
    if (iWpnId == CSW_KNIFE && g_bBalrog_Kosa[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kosa))
    }
    if (iWpnId == CSW_KNIFE && g_bDSP[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_dsp))
    }
    
    return HC_CONTINUE
}
 
public DeathMsg(msg_id, msg_dest, id)
{
    static szTruncatedWeapon[33], iAttacker
    get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
    iAttacker = get_msg_arg_int(1)
   
    if(!is_user_alive(iAttacker) || iAttacker == get_msg_arg_int(2) || !is_user_alive(get_msg_arg_int(2))) // get_msg_arg_int(2) = iVictim
        return
   
    if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iAttacker) & CSW_KNIFE)
    {
        if(g_bCompat[id])
        {
            set_msg_arg_string(4, "Combat knife")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "Strong knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "Katana knife")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Ice knife")
        }
        else if(g_bTurbulent9[id])
        {
            set_msg_arg_string(4, "Turbulent9 knife")
        }
        else if(g_bBio[id])
        {
            set_msg_arg_string(4, "Biohazard knife")
        }
        else if(g_bSabers[id])
        {
            set_msg_arg_string(4, "Sabers knife")
        }
        else if(g_bPlasma[id])
        {
            set_msg_arg_string(4, "Plasma knife")
        }
        else if(g_bStorm[id])
        {
            set_msg_arg_string(4, "Storm knife")
        }
        else if(g_bLaevateinn[id])
        {
            set_msg_arg_string(4, "Laevateinn knife")
        }
        else if(g_bWarHammer_Dark_Knight[id])
        {
            set_msg_arg_string(4, "WarHammer Dark Knight knife")
        }
        else if(g_bBalrog_Kosa[id])
        {
            set_msg_arg_string(4, "Balrog Kosa Knife")
        }
    }
}
 
stock fm_set_user_maxspeed(index, Float:speed = -1.0)
{
        engfunc(EngFunc_SetClientMaxspeed, index, speed);
        set_pev(index, pev_maxspeed, speed);
 
        return 1;
}  
 
public native_ze_open_knife_menu(id)
{
    Show_Knife_Menu(id)
}
I had this error at the same time with this viewtopic.php?f=11&p=9016#p9016 and it crashed my server
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 501
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 39 times
Age: 18
Contact:

#2

Post by Jack GamePlay » 2 Weeks Ago

Try:

Code: Select all

#include <zombie_escape>
#include <engine>
#include <fun>
#include <ze_vip>
#include <ze_levels>

native ze_give_dsp(id)
native ze_remove_dsp(id)
 
// Models
new const Compat_Models[][] =
{
    "models/zombie_escape/v_combat_knife.mdl",
    "models/zombie_escape/p_combat_knife.mdl"
}
 
new const Strong_Models[][] =
{
    "models/zombie_escape/v_strong_knife.mdl",
    "models/zombie_escape/p_strong_knife.mdl"
}
 
new const Katana_Models[][] =
{
    "models/zombie_escape/v_katana_knife.mdl",
    "models/zombie_escape/p_katana_knife.mdl"
}
 
new const Hammer_Models[][] =
{
    "models/zombie_escape/v_hammer_knife.mdl",
    "models/zombie_escape/p_hammer_knife.mdl"
}
 
new const Turbulent9_Models[][] =
{
    "models/zombie_escape/v_turbulent9_knife.mdl",
    "models/zombie_escape/p_turbulent9_knife.mdl"
}
 
new const Bio_Models[][] =
{
    "models/zombie_escape/v_bio_knife.mdl",
    "models/zombie_escape/p_bio_knife.mdl"
}
 
new const Sabers_Models[][] =
{
    "models/zombie_escape/v_laser_knife.mdl",
    "models/zombie_escape/p_laser_knife.mdl"
}
 
new const Plasma_Models[][] =
{
    "models/zombie_escape/v_plasma_knife.mdl",
    "models/zombie_escape/p_plasma_knife.mdl"
}
 
new const Storm_Models[][] =
{
    "models/zombie_escape/v_storm_sword_knife.mdl",
    "models/zombie_escape/p_storm_sword_knife.mdl"
}
 
new const Laevateinn_Models[][] =
{
    "models/zombie_escape/v_laevateinn_knife.mdl",
    "models/zombie_escape/p_laevateinn_knife.mdl"
}
 
new const WarHammer_Dark_Knight_Models[][] =
{
    "models/zombie_escape/v_WarHammer_dark_knight_knife.mdl",
    "models/zombie_escape/p_WarHammer_dark_knight_knife.mdl"
}
 
new const Balrog_Kosa_Models[][] =
{
    "models/zombie_escape/v_balrog_kosa_knife.mdl",
    "models/zombie_escape/p_balrog_kosa_knife.mdl"
}
 
// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"
 
new const combat_sounds[][] =
{
    "zombie_escape/knife_menu/combat_deploy.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hitwall.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_stab.wav"
}
 
new const strong_sounds[][] =
{
    "zombie_escape/knife_menu/strong_deploy.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hitwall.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_stab.wav"
}
 
new const katana_sounds[][] =
{
    "zombie_escape/knife_menu/katana_deploy.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hitwall.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_stab.wav"
}
 
new const hammer_sounds[][] =
{
    "zombie_escape/knife_menu/hammer_deploy.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hitwall.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_stab.wav"
}
 
new const turbulent9_sounds[][] =
{
    "zombie_escape/knife_menu/turbulent9_deploy.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hitwall.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_stab.wav"
}
 
new const bio_sounds[][] =
{
    "zombie_escape/knife_menu/bio_deploy.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hitwall.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_stab.wav"
}
 
new const sabers_sounds[][] =
{
    "zombie_escape/knife_menu/laser_deploy.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hitwall.wav",
    "zombie_escape/knife_menu/laser_slash1.wav",
    "zombie_escape/knife_menu/laser_slash2.wav",
    "zombie_escape/knife_menu/laser_stab.wav"
}
 
new const plasma_sounds[][] =
{
    "zombie_escape/knife_menu/plasma_deploy.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hitwall.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_stab.wav"
}
 
new const storm_sounds[][] =
{
    "zombie_escape/knife_menu/storm_sword_deploy.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hitwall.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_stab.wav"
}
 
new const laevateinn_sounds[][] =
{
    "zombie_escape/knife_menu/laevateinn_deploy.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hitwall.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_stab.wav"
}
 
new const warhammer_dark_knight_sounds[][] =
{
    "zombie_escape/knife_menu/WarHammer_dark_knight_deploy.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hitwall.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_stab.wav"
}
 
new const balrog_kosa_sounds[][] =
{
    "zombie_escape/knife_menu/balrog_kosa_deploy.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hitwall.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_stab.wav"
}
 
new const oldknife_sounds[][] =
{
    "weapons/knife_deploy1.wav",
    "weapons/knife_hit1.wav",
    "weapons/knife_hit2.wav",
    "weapons/knife_hit3.wav",
    "weapons/knife_hit4.wav",
    "weapons/knife_hitwall1.wav",
    "weapons/knife_slash1.wav",
    "weapons/knife_slash2.wav",
    "weapons/knife_stab.wav"
}
 
new bool:g_bCompat[33], bool:g_bStrong[33], bool:g_bKatana[33], bool:g_bHammer[33], bool:g_bTurbulent9[33], bool:g_bBio[33], bool:g_bSabers[33], bool:g_bPlasma[33],
bool:g_bStorm[33], bool:g_bLaevateinn[33], bool:g_bWarHammer_Dark_Knight[33], bool:g_bBalrog_Kosa[33], bool:g_bDSP[33], bool:g_bNoSpeed, g_iUsedTimes[33], g_pCvarUseTimes
 
new cvar_speed_compat
new cvar_speed_strong
new cvar_speed_katana
new cvar_speed_hammer
new cvar_speed_turb
new cvar_speed_bio
new cvar_speed_sabers
new cvar_speed_plasma
new cvar_speed_storm
new cvar_speed_laevat
new cvar_speed_darknight
new cvar_speed_kosa
new cvar_speed_dsp
 
public plugin_precache()
{
    new i
 
    for (i = 0; i <= charsmax(Compat_Models); i++)
        precache_model(Compat_Models[i])
 
    for (i = 0; i <= charsmax(Hammer_Models); i++)
        precache_model(Hammer_Models[i])
 
    for (i = 0; i <= charsmax(Katana_Models); i++)
        precache_model(Katana_Models[i])
 
    for (i = 0; i <= charsmax(Strong_Models); i++)
        precache_model(Strong_Models[i])
 
    for (i = 0; i <= charsmax(Turbulent9_Models); i++)
        precache_model(Turbulent9_Models[i])
 
    for (i = 0; i <= charsmax(Bio_Models); i++)
        precache_model(Bio_Models[i])
 
    for (i = 0; i <= charsmax(Sabers_Models); i++)
        precache_model(Sabers_Models[i])
 
    for (i = 0; i <= charsmax(Plasma_Models); i++)
        precache_model(Plasma_Models[i])
 
    for (i = 0; i <= charsmax(Storm_Models); i++)
        precache_model(Storm_Models[i])
 
    for (i = 0; i <= charsmax(Laevateinn_Models); i++)
        precache_model(Laevateinn_Models[i])
 
    for (i = 0; i <= charsmax(WarHammer_Dark_Knight_Models); i++)
        precache_model(WarHammer_Dark_Knight_Models[i])
 
    for (i = 0; i <= charsmax(Balrog_Kosa_Models); i++)
        precache_model(Balrog_Kosa_Models[i])
 
    for (i = 0; i <= charsmax(combat_sounds); i++)
        precache_sound(combat_sounds[i])
 
    for (i = 0; i <= charsmax(strong_sounds); i++)
        precache_sound(strong_sounds[i])
 
    for (i = 0; i <= charsmax(katana_sounds); i++)
        precache_sound(katana_sounds[i])
 
    for (i = 0; i <= charsmax(hammer_sounds); i++)
        precache_sound(hammer_sounds[i])
 
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
        precache_sound(turbulent9_sounds[i])
 
    for (i = 0; i <= charsmax(bio_sounds); i++)
        precache_sound(bio_sounds[i])
 
    for (i = 0; i <= charsmax(sabers_sounds); i++)
        precache_sound(sabers_sounds[i])
 
    for (i = 0; i <= charsmax(plasma_sounds); i++)
        precache_sound(plasma_sounds[i])
 
    for (i = 0; i <= charsmax(storm_sounds); i++)
        precache_sound(storm_sounds[i])
 
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
        precache_sound(laevateinn_sounds[i])
 
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
        precache_sound(warhammer_dark_knight_sounds[i])
 
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
        precache_sound(balrog_kosa_sounds[i])
 
    precache_sound(g_sound_knife)
}
 
public plugin_natives()
{
    register_native("ze_open_knife_menu", "native_ze_open_knife_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Addon: Knife Menu", "1.3", "Mark")
 
    register_forward(FM_EmitSound, "fw_EmitSound")
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
 
    register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
    RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "Fw_RestMaxSpeed_Post", 1)
   
    g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1000")
 
    register_message(get_user_msgid("DeathMsg"), "DeathMsg")
 
    register_clcmd("say /km", "Show_Knife_Menu")
   
    cvar_speed_compat = register_cvar("ze_compat_speed", "275.0")
    cvar_speed_strong = register_cvar("ze_strong_speed", "275.0")
    cvar_speed_katana = register_cvar("ze_katana_speed", "275.0")
    cvar_speed_hammer = register_cvar("ze_hammer_speed", "275.0")
    cvar_speed_turb = register_cvar("ze_turb_speed", "280.0")    
    cvar_speed_bio = register_cvar("ze_bio_speed", "280.0")
    cvar_speed_sabers = register_cvar("ze_sabers_speed", "285.0")
    cvar_speed_plasma = register_cvar("ze_plasma_speed", "285.0")
    cvar_speed_storm = register_cvar("ze_storm_speed", "290.0")    
    cvar_speed_laevat = register_cvar("ze_laevat_speed", "290.0")  
    cvar_speed_darknight = register_cvar("ze_darknight_speed", "295.0")
    cvar_speed_kosa = register_cvar("ze_kosa_speed", "295.0")
	cvar_speed_dsp = register_cvar("ze_dsp_speed", "310.0")
}
 
public ze_user_humanized(id)
{
    g_iUsedTimes[id] = 0
}
 
/*public ze_user_infected(Victim)
{
    g_bCompat[Victim] = false
    g_bStrong[Victim] = false
    g_bKatana[Victim] = false
    g_bHammer[Victim] = false
    g_bTurbulent9[Victim] = false
    g_bBio[Victim] = false
    g_bSabers[Victim] = false
    g_bPlasma[Victim] = false
    g_bStorm[Victim] = false
    g_bLaevateinn[Victim] = false
    g_bWarHammer_Dark_Knight[Victim] = false
    g_bBalrog_Kosa[Victim] = false
    g_iUsedTimes[Victim] = 0
}*/
 
public client_putinserver(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}
 
public client_disconnected(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}

public ze_game_started()
{
    g_bNoSpeed = true
}
 
public ze_zombie_release()
{
    g_bNoSpeed = false
   
    // call the reset speed function ;)
    for(new id = 1; id <= 32; id++)
    {
        if (!is_user_alive(id))
            continue;
       
        rg_reset_maxspeed(id)
    }
}
 
public Show_Knife_Menu(id)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tZombies can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou can only open knife menu !y[!g%dx!y] per round!", get_pcvar_num(g_pCvarUseTimes))
        return PLUGIN_HANDLED
    }
 
    if (!is_user_alive(id))
    {
        ze_colored_print(id, "!tDead can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    Knife_Menu(id)
    return PLUGIN_CONTINUE
}
 
public Knife_Menu(id)
{
    new iMenu = menu_create("\rChoose Your Knife\w:^n^n- [ \ySpeed \rActivates \yon Zombie Release!\w ]^n\w- [ \r12 \yknives in Total!\w ] ^n-", "Menu_Handler")
    menu_additem(iMenu, "\yCombat \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yStrong \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yKatana \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yHammer \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yTurbulent9 \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yBio Hazard \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\ySabers \w[ \r285 Speed\w ]", "", 0)
    
    if (ze_get_vip_flags(id) & VIP_A)
    {
        menu_additem(iMenu, "\yPlasma \w[ \rVIP\w ] [ \r285 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yStorm \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yLaevateinn \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yWarHammer Dark Night \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yBalrog Kosa \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
    }
    
    if (ze_get_user_level(id) >= 35)
    {
        menu_additem(iMenu, "\yDSP \w[ \r310 Speed\w ]", "", 0)
    }

    menu_setprop(iMenu,MPROP_EXITNAME,"Close") 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL) 
    menu_display(id, iMenu, 0)
}
 
public Menu_Handler(id, iMenu, iKey)
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return PLUGIN_HANDLED
       
    switch(iKey)
    {
        case 0: // Compat
        {
            g_bCompat[id] = true
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //rg_reset_maxspeed(id)
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 1: // Strong
        {
            g_bCompat[id] = false
            g_bStrong[id] = true
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 2: // Katana
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = true
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 3: // Hammer
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = true
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 4: // Turbulent
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = true
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 5: // Bio
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = true
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 6: // Sabers
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = true
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 7: // Plasma
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = true
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 8: // Storm
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = true
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 9: // Laevateinn
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = true
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 10: // Warhammer Dark Night
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = true
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
       
        }
        case 11: // Balrog Kosa
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = true
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 12: // DSP
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
            g_bDSP[id] = true
            g_iUsedTimes[id] = 0
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
    }

    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
 
public fw_EmitSound(id, channel, const sound[])
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return FMRES_IGNORED
       
    new i
    for (i = 0; i <= charsmax(combat_sounds); i++)
    for (i = 0; i <= charsmax(strong_sounds); i++)
    for (i = 0; i <= charsmax(katana_sounds); i++)
    for (i = 0; i <= charsmax(hammer_sounds); i++)
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
    for (i = 0; i <= charsmax(bio_sounds); i++)
    for (i = 0; i <= charsmax(sabers_sounds); i++)
    for (i = 0; i <= charsmax(plasma_sounds); i++)
    for (i = 0; i <= charsmax(storm_sounds); i++)
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
    {
        if(equal(sound, oldknife_sounds[i]))
        {
            if (g_bCompat[id])
            {
                emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bStrong[id])
            {
                emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bKatana[id])
            {
                emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bHammer[id])
            {
                emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bTurbulent9[id]))
            {
                emit_sound(id, channel, turbulent9_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBio[id]))
            {
                emit_sound(id, channel, bio_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bSabers[id]))
            {
                emit_sound(id, channel, sabers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, plasma_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, laevateinn_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (!g_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[id] || !g_bTurbulent9[id] || !g_bBio[id] || !g_bSabers[id] || !g_bPlasma[id] || !g_bStorm[id] || !g_bLaevateinn[id] || !g_bWarHammer_Dark_Knight[id] || !g_bBalrog_Kosa[id])
            {
                emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
        }
    }
    return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
    if(get_user_weapon(id) == CSW_KNIFE && is_user_alive(id) && !ze_is_user_zombie(id))
    {
        if(g_bCompat[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Compat_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Compat_Models[1])
        }
        else if(g_bStrong[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Strong_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Strong_Models[1])
        }
        else if(g_bKatana[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Katana_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Katana_Models[1])
        }
        else if(g_bHammer[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Hammer_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Hammer_Models[1])
        }
        else if((g_bTurbulent9[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Turbulent9_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Turbulent9_Models[1])
        }
        else if((g_bBio[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Bio_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Bio_Models[1])
        }
        else if((g_bSabers[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Sabers_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Sabers_Models[1])
        }
        else if((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Plasma_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Plasma_Models[1])
        }
        else if((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Storm_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Storm_Models[1])
        }
        else if((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Laevateinn_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Laevateinn_Models[1])
        }
        else if((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[1])
        }
        else if((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Balrog_Kosa_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Balrog_Kosa_Models[1])
        }
        else if((g_bDSP[id]) && (ze_get_user_level(id) >= 35))
        {
            ze_give_dsp(id)
        }
        else
        {
            cs_reset_player_view_model(id, CSW_KNIFE)
            cs_reset_player_weap_model(id, CSW_KNIFE)
        }
    }
}
 
public Fw_RestMaxSpeed_Post(id)
{
    if (g_bNoSpeed)
        return
        
    set_task(0.1, "DelayLoad", id)
    
}
 
public DelayLoad(id)
{
    new iWpnId = (get_user_weapon(id))
    if (iWpnId == CSW_KNIFE && g_bCompat[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_compat))
    }
    if (iWpnId == CSW_KNIFE && g_bStrong[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_strong))
    }
    if (iWpnId == CSW_KNIFE && g_bKatana[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_katana))
    }
    if (iWpnId == CSW_KNIFE && g_bHammer[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammer))
    }
    if (iWpnId == CSW_KNIFE && g_bTurbulent9[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_turb))
    }
    if (iWpnId == CSW_KNIFE && g_bBio[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_bio))
    }
    if (iWpnId == CSW_KNIFE && g_bSabers[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_sabers))
    }
    if (iWpnId == CSW_KNIFE && g_bPlasma[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_plasma))
    }
    if (iWpnId == CSW_KNIFE && g_bStorm[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_storm))
    }
    if (iWpnId == CSW_KNIFE && g_bLaevateinn[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_laevat))
    }
    if (iWpnId == CSW_KNIFE && g_bWarHammer_Dark_Knight[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_darknight))
    }
    if (iWpnId == CSW_KNIFE && g_bBalrog_Kosa[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kosa))
    }
    if (iWpnId == CSW_KNIFE && g_bDSP[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_dsp))
    }
    
    return HC_CONTINUE
}
 
public DeathMsg(msg_id, msg_dest, id)
{
    static szTruncatedWeapon[33], iAttacker
    get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
    iAttacker = get_msg_arg_int(1)
   
    if(!is_user_alive(iAttacker) || iAttacker == get_msg_arg_int(2) || !is_user_alive(get_msg_arg_int(2))) // get_msg_arg_int(2) = iVictim
        return
   
    if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iAttacker) & CSW_KNIFE)
    {
        if(g_bCompat[id])
        {
            set_msg_arg_string(4, "Combat knife")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "Strong knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "Katana knife")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Ice knife")
        }
        else if(g_bTurbulent9[id])
        {
            set_msg_arg_string(4, "Turbulent9 knife")
        }
        else if(g_bBio[id])
        {
            set_msg_arg_string(4, "Biohazard knife")
        }
        else if(g_bSabers[id])
        {
            set_msg_arg_string(4, "Sabers knife")
        }
        else if(g_bPlasma[id])
        {
            set_msg_arg_string(4, "Plasma knife")
        }
        else if(g_bStorm[id])
        {
            set_msg_arg_string(4, "Storm knife")
        }
        else if(g_bLaevateinn[id])
        {
            set_msg_arg_string(4, "Laevateinn knife")
        }
        else if(g_bWarHammer_Dark_Knight[id])
        {
            set_msg_arg_string(4, "WarHammer Dark Knight knife")
        }
        else if(g_bBalrog_Kosa[id])
        {
            set_msg_arg_string(4, "Balrog Kosa Knife")
        }
    }
}
 
stock fm_set_user_maxspeed(index, Float:speed = -1.0)
{
        engfunc(EngFunc_SetClientMaxspeed, index, speed);
        set_pev(index, pev_maxspeed, speed);
 
        return 1;
}  
 
public native_ze_open_knife_menu(id)
{
    Show_Knife_Menu(id)
}
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 431
Joined: 1 Year Ago
Has thanked: 15 times
Been thanked: 1 time
Contact:

#3

Post by czirimbolo » 1 Week Ago

ok I have another errors:

Code: Select all

#include <zombie_escape>
#include <engine>
#include <fun>
#include <ze_vip>
#include <ze_levels>

native ze_give_dsp(id)
native ze_remove_dsp(id)
native ze_give_swd(id)
native ze_remove_swd(id)
 
// Models
new const Compat_Models[][] =
{
    "models/zombie_escape/v_combat_knife.mdl",
    "models/zombie_escape/p_combat_knife.mdl"
}
 
new const Strong_Models[][] =
{
    "models/zombie_escape/v_strong_knife.mdl",
    "models/zombie_escape/p_strong_knife.mdl"
}
 
new const Katana_Models[][] =
{
    "models/zombie_escape/v_katana_knife.mdl",
    "models/zombie_escape/p_katana_knife.mdl"
}
 
new const Hammer_Models[][] =
{
    "models/zombie_escape/v_hammer_knife.mdl",
    "models/zombie_escape/p_hammer_knife.mdl"
}
 
new const Turbulent9_Models[][] =
{
    "models/zombie_escape/v_turbulent9_knife.mdl",
    "models/zombie_escape/p_turbulent9_knife.mdl"
}
 
new const Bio_Models[][] =
{
    "models/zombie_escape/v_bio_knife.mdl",
    "models/zombie_escape/p_bio_knife.mdl"
}
 
new const Sabers_Models[][] =
{
    "models/zombie_escape/v_laser_knife.mdl",
    "models/zombie_escape/p_laser_knife.mdl"
}
 
new const Plasma_Models[][] =
{
    "models/zombie_escape/v_plasma_knife.mdl",
    "models/zombie_escape/p_plasma_knife.mdl"
}
 
new const Storm_Models[][] =
{
    "models/zombie_escape/v_storm_sword_knife.mdl",
    "models/zombie_escape/p_storm_sword_knife.mdl"
}
 
new const Laevateinn_Models[][] =
{
    "models/zombie_escape/v_laevateinn_knife.mdl",
    "models/zombie_escape/p_laevateinn_knife.mdl"
}
 
new const WarHammer_Dark_Knight_Models[][] =
{
    "models/zombie_escape/v_WarHammer_dark_knight_knife.mdl",
    "models/zombie_escape/p_WarHammer_dark_knight_knife.mdl"
}
 
new const Balrog_Kosa_Models[][] =
{
    "models/zombie_escape/v_balrog_kosa_knife.mdl",
    "models/zombie_escape/p_balrog_kosa_knife.mdl"
}
 
// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"
 
new const combat_sounds[][] =
{
    "zombie_escape/knife_menu/combat_deploy.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hit.wav",
    "zombie_escape/knife_menu/combat_hitwall.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_slash.wav",
    "zombie_escape/knife_menu/combat_stab.wav"
}
 
new const strong_sounds[][] =
{
    "zombie_escape/knife_menu/strong_deploy.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hit.wav",
    "zombie_escape/knife_menu/strong_hitwall.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_slash.wav",
    "zombie_escape/knife_menu/strong_stab.wav"
}
 
new const katana_sounds[][] =
{
    "zombie_escape/knife_menu/katana_deploy.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hit.wav",
    "zombie_escape/knife_menu/katana_hitwall.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_slash.wav",
    "zombie_escape/knife_menu/katana_stab.wav"
}
 
new const hammer_sounds[][] =
{
    "zombie_escape/knife_menu/hammer_deploy.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hit.wav",
    "zombie_escape/knife_menu/hammer_hitwall.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_slash.wav",
    "zombie_escape/knife_menu/hammer_stab.wav"
}
 
new const turbulent9_sounds[][] =
{
    "zombie_escape/knife_menu/turbulent9_deploy.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hit.wav",
    "zombie_escape/knife_menu/turbulent9_hitwall.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_slash.wav",
    "zombie_escape/knife_menu/turbulent9_stab.wav"
}
 
new const bio_sounds[][] =
{
    "zombie_escape/knife_menu/bio_deploy.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hit.wav",
    "zombie_escape/knife_menu/bio_hitwall.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_slash.wav",
    "zombie_escape/knife_menu/bio_stab.wav"
}
 
new const sabers_sounds[][] =
{
    "zombie_escape/knife_menu/laser_deploy.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hit.wav",
    "zombie_escape/knife_menu/laser_hitwall.wav",
    "zombie_escape/knife_menu/laser_slash1.wav",
    "zombie_escape/knife_menu/laser_slash2.wav",
    "zombie_escape/knife_menu/laser_stab.wav"
}
 
new const plasma_sounds[][] =
{
    "zombie_escape/knife_menu/plasma_deploy.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hit.wav",
    "zombie_escape/knife_menu/plasma_hitwall.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_slash.wav",
    "zombie_escape/knife_menu/plasma_stab.wav"
}
 
new const storm_sounds[][] =
{
    "zombie_escape/knife_menu/storm_sword_deploy.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hit.wav",
    "zombie_escape/knife_menu/storm_sword_hitwall.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_slash.wav",
    "zombie_escape/knife_menu/storm_sword_stab.wav"
}
 
new const laevateinn_sounds[][] =
{
    "zombie_escape/knife_menu/laevateinn_deploy.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hit.wav",
    "zombie_escape/knife_menu/laevateinn_hitwall.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_slash.wav",
    "zombie_escape/knife_menu/laevateinn_stab.wav"
}
 
new const warhammer_dark_knight_sounds[][] =
{
    "zombie_escape/knife_menu/WarHammer_dark_knight_deploy.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_hitwall.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
    "zombie_escape/knife_menu/WarHammer_dark_knight_stab.wav"
}
 
new const balrog_kosa_sounds[][] =
{
    "zombie_escape/knife_menu/balrog_kosa_deploy.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hit.wav",
    "zombie_escape/knife_menu/balrog_kosa_hitwall.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_slash.wav",
    "zombie_escape/knife_menu/balrog_kosa_stab.wav"
}
 
new const oldknife_sounds[][] =
{
    "weapons/knife_deploy1.wav",
    "weapons/knife_hit1.wav",
    "weapons/knife_hit2.wav",
    "weapons/knife_hit3.wav",
    "weapons/knife_hit4.wav",
    "weapons/knife_hitwall1.wav",
    "weapons/knife_slash1.wav",
    "weapons/knife_slash2.wav",
    "weapons/knife_stab.wav"
}
 
new bool:g_bCompat[33], bool:g_bStrong[33], bool:g_bKatana[33], bool:g_bHammer[33], bool:g_bTurbulent9[33], bool:g_bBio[33], bool:g_bSabers[33], bool:g_bPlasma[33],
bool:g_bStorm[33], bool:g_bLaevateinn[33], bool:g_bWarHammer_Dark_Knight[33], bool:g_bBalrog_Kosa[33], bool:g_bHoly_Sword[33], bool:g_bDSP[33], bool:g_bNoSpeed, g_iUsedTimes[33], g_pCvarUseTimes
 
new cvar_speed_compat
new cvar_speed_strong
new cvar_speed_katana
new cvar_speed_hammer
new cvar_speed_turb
new cvar_speed_bio
new cvar_speed_sabers
new cvar_speed_plasma
new cvar_speed_storm
new cvar_speed_laevat
new cvar_speed_darknight
new cvar_speed_kosa
new cvar_speed_dsp
new cvar_speed_swd
 
public plugin_precache()
{
    new i
 
    for (i = 0; i <= charsmax(Compat_Models); i++)
        precache_model(Compat_Models[i])
 
    for (i = 0; i <= charsmax(Hammer_Models); i++)
        precache_model(Hammer_Models[i])
 
    for (i = 0; i <= charsmax(Katana_Models); i++)
        precache_model(Katana_Models[i])
 
    for (i = 0; i <= charsmax(Strong_Models); i++)
        precache_model(Strong_Models[i])
 
    for (i = 0; i <= charsmax(Turbulent9_Models); i++)
        precache_model(Turbulent9_Models[i])
 
    for (i = 0; i <= charsmax(Bio_Models); i++)
        precache_model(Bio_Models[i])
 
    for (i = 0; i <= charsmax(Sabers_Models); i++)
        precache_model(Sabers_Models[i])
 
    for (i = 0; i <= charsmax(Plasma_Models); i++)
        precache_model(Plasma_Models[i])
 
    for (i = 0; i <= charsmax(Storm_Models); i++)
        precache_model(Storm_Models[i])
 
    for (i = 0; i <= charsmax(Laevateinn_Models); i++)
        precache_model(Laevateinn_Models[i])
 
    for (i = 0; i <= charsmax(WarHammer_Dark_Knight_Models); i++)
        precache_model(WarHammer_Dark_Knight_Models[i])
 
    for (i = 0; i <= charsmax(Balrog_Kosa_Models); i++)
        precache_model(Balrog_Kosa_Models[i])
 
    for (i = 0; i <= charsmax(combat_sounds); i++)
        precache_sound(combat_sounds[i])
 
    for (i = 0; i <= charsmax(strong_sounds); i++)
        precache_sound(strong_sounds[i])
 
    for (i = 0; i <= charsmax(katana_sounds); i++)
        precache_sound(katana_sounds[i])
 
    for (i = 0; i <= charsmax(hammer_sounds); i++)
        precache_sound(hammer_sounds[i])
 
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
        precache_sound(turbulent9_sounds[i])
 
    for (i = 0; i <= charsmax(bio_sounds); i++)
        precache_sound(bio_sounds[i])
 
    for (i = 0; i <= charsmax(sabers_sounds); i++)
        precache_sound(sabers_sounds[i])
 
    for (i = 0; i <= charsmax(plasma_sounds); i++)
        precache_sound(plasma_sounds[i])
 
    for (i = 0; i <= charsmax(storm_sounds); i++)
        precache_sound(storm_sounds[i])
 
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
        precache_sound(laevateinn_sounds[i])
 
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
        precache_sound(warhammer_dark_knight_sounds[i])
 
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
        precache_sound(balrog_kosa_sounds[i])
 
    precache_sound(g_sound_knife)
}
 
public plugin_natives()
{
    register_native("ze_open_knife_menu", "native_ze_open_knife_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Addon: Knife Menu", "1.3", "Mark")
 
    register_forward(FM_EmitSound, "fw_EmitSound")
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
 
    register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
    RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "Fw_RestMaxSpeed_Post", 1)
   
    g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1000")
 
    register_message(get_user_msgid("DeathMsg"), "DeathMsg")
 
    register_clcmd("say /km", "Show_Knife_Menu")
   
    cvar_speed_compat = register_cvar("ze_compat_speed", "275.0")
    cvar_speed_strong = register_cvar("ze_strong_speed", "275.0")
    cvar_speed_katana = register_cvar("ze_katana_speed", "275.0")
    cvar_speed_hammer = register_cvar("ze_hammer_speed", "275.0")
    cvar_speed_turb = register_cvar("ze_turb_speed", "280.0")    
    cvar_speed_bio = register_cvar("ze_bio_speed", "280.0")
    cvar_speed_sabers = register_cvar("ze_sabers_speed", "285.0")
    cvar_speed_plasma = register_cvar("ze_plasma_speed", "285.0")
    cvar_speed_storm = register_cvar("ze_storm_speed", "290.0")    
    cvar_speed_laevat = register_cvar("ze_laevat_speed", "290.0")  
    cvar_speed_darknight = register_cvar("ze_darknight_speed", "295.0")
    cvar_speed_kosa = register_cvar("ze_kosa_speed", "295.0")
	cvar_speed_dsp = register_cvar("ze_dsp_speed", "345.0")
	cvar_speed_swd = register_cvar("ze_swd_speed", "320.0")
}
 
public ze_user_humanized(id)
{
    g_iUsedTimes[id] = 0
}
 
/*public ze_user_infected(Victim)
{
    g_bCompat[Victim] = false
    g_bStrong[Victim] = false
    g_bKatana[Victim] = false
    g_bHammer[Victim] = false
    g_bTurbulent9[Victim] = false
    g_bBio[Victim] = false
    g_bSabers[Victim] = false
    g_bPlasma[Victim] = false
    g_bStorm[Victim] = false
    g_bLaevateinn[Victim] = false
    g_bWarHammer_Dark_Knight[Victim] = false
    g_bBalrog_Kosa[Victim] = false
    g_iUsedTimes[Victim] = 0
}*/
 
public client_putinserver(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
	g_bHoly_Sword[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}
 
public client_disconnected(id)
{
    g_bCompat[id] = false
    g_bStrong[id] = false
    g_bKatana[id] = false
    g_bHammer[id] = false
    g_bTurbulent9[id] = false
    g_bBio[id] = false
    g_bSabers[id] = false
    g_bPlasma[id] = false
    g_bStorm[id] = false
    g_bLaevateinn[id] = false
    g_bWarHammer_Dark_Knight[id] = false
    g_bBalrog_Kosa[id] = false
	g_bHoly_Sword[id] = false
    g_bDSP[id] = false
    g_iUsedTimes[id] = 0
}

public ze_game_started()
{
    g_bNoSpeed = true
}
 
public ze_zombie_release()
{
    g_bNoSpeed = false
   
    // call the reset speed function ;)
    for(new id = 1; id <= 32; id++)
    {
        if (!is_user_alive(id))
            continue;
       
        rg_reset_maxspeed(id)
    }
}
 
public Show_Knife_Menu(id)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tZombies can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou can only open knife menu !y[!g%dx!y] per round!", get_pcvar_num(g_pCvarUseTimes))
        return PLUGIN_HANDLED
    }
 
    if (!is_user_alive(id))
    {
        ze_colored_print(id, "!tDead can't open knife menu!y.")
        return PLUGIN_HANDLED
    }
 
    Knife_Menu(id)
    return PLUGIN_CONTINUE
}
 
public Knife_Menu(id)
{
    new iMenu = menu_create("\rChoose Your Knife\w:^n^n- [ \ySpeed \rActivates \yon Zombie Release!\w ]^n\w- [ \r12 \yknives in Total!\w ] ^n-", "Menu_Handler")
    menu_additem(iMenu, "\yCombat \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yStrong \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yKatana \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yHammer \w[ \r275 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yTurbulent9 \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\yBio Hazard \w[ \r280 Speed\w ]", "", 0)
    menu_additem(iMenu, "\ySabers \w[ \r285 Speed\w ]", "", 0)
    
    if (ze_get_vip_flags(id) & VIP_A)
    {
        menu_additem(iMenu, "\yPlasma \w[ \rVIP\w ] [ \r285 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yStorm \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yLaevateinn \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yWarHammer Dark Night \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
        menu_additem(iMenu, "\yBalrog Kosa \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
    }
    
    if (ze_get_user_level(id) >= 35)
    {
        menu_additem(iMenu, "\yHoly_Sword \w[ \r320 Speed\w ]", "", 0)
    }
	
	if (ze_get_user_level(id) >= 43)
    {
        menu_additem(iMenu, "\yDSP \w[ \r345 Speed\w ]", "", 0)
    }

    menu_setprop(iMenu,MPROP_EXITNAME,"Close") 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL) 
    menu_display(id, iMenu, 0)
}
 
public Menu_Handler(id, iMenu, iKey)
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return PLUGIN_HANDLED
       
    switch(iKey)
    {
        case 0: // Compat
        {
            g_bCompat[id] = true
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //rg_reset_maxspeed(id)
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 1: // Strong
        {
            g_bCompat[id] = false
            g_bStrong[id] = true
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 2: // Katana
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = true
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 3: // Hammer
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = true
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
        }
        case 4: // Turbulent
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = true
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 5: // Bio
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = true
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 6: // Sabers
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = true
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 7: // Plasma
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = true
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 8: // Storm
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = true
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 9: // Laevateinn
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = true
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/

        }
        case 10: // Warhammer Dark Night
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = true
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
       
        }
        case 11: // Balrog Kosa
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = true
			g_bHoly_Sword[id] = false
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
		case 12: // Holy_Sword
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = true
            g_bDSP[id] = false
            g_iUsedTimes[id] = 0
			ze_remove_dsp(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
        case 13: // DSP
        {
            g_bCompat[id] = false
            g_bStrong[id] = false
            g_bKatana[id] = false
            g_bHammer[id] = false
            g_bTurbulent9[id] = false
            g_bBio[id] = false
            g_bSabers[id] = false
            g_bPlasma[id] = false
            g_bStorm[id] = false
            g_bLaevateinn[id] = false
            g_bWarHammer_Dark_Knight[id] = false
            g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
            g_bDSP[id] = true
            g_iUsedTimes[id] = 0
			ze_remove_swd(id)
            rg_remove_item(id, "weapon_knife")
            rg_give_item(id, "weapon_knife", GT_APPEND)
            //engclient_cmd(id, "weapon_knife")
            //g_iUsedTimes[id]++
            //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
            
        }
    }

    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
 
public fw_EmitSound(id, channel, const sound[])
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return FMRES_IGNORED
       
    new i
    for (i = 0; i <= charsmax(combat_sounds); i++)
    for (i = 0; i <= charsmax(strong_sounds); i++)
    for (i = 0; i <= charsmax(katana_sounds); i++)
    for (i = 0; i <= charsmax(hammer_sounds); i++)
    for (i = 0; i <= charsmax(turbulent9_sounds); i++)
    for (i = 0; i <= charsmax(bio_sounds); i++)
    for (i = 0; i <= charsmax(sabers_sounds); i++)
    for (i = 0; i <= charsmax(plasma_sounds); i++)
    for (i = 0; i <= charsmax(storm_sounds); i++)
    for (i = 0; i <= charsmax(laevateinn_sounds); i++)
    for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
    for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
    {
        if(equal(sound, oldknife_sounds[i]))
        {
            if (g_bCompat[id])
            {
                emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bStrong[id])
            {
                emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bKatana[id])
            {
                emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (g_bHammer[id])
            {
                emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bTurbulent9[id]))
            {
                emit_sound(id, channel, turbulent9_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBio[id]))
            {
                emit_sound(id, channel, bio_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bSabers[id]))
            {
                emit_sound(id, channel, sabers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, plasma_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, laevateinn_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if ((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
            {
                emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
            else if (!g_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[id] || !g_bTurbulent9[id] || !g_bBio[id] || !g_bSabers[id] || !g_bPlasma[id] || !g_bStorm[id] || !g_bLaevateinn[id] || !g_bWarHammer_Dark_Knight[id] || !g_bBalrog_Kosa[id])
            {
                emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return FMRES_SUPERCEDE
            }
        }
    }
    return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
    if(!is_user_alive(id) || ze_is_user_zombie(id))
        return
       
    if(get_user_weapon(id) & CSW_KNIFE)
    {
        if(g_bCompat[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Compat_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Compat_Models[1])
        }
        else if(g_bStrong[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Strong_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Strong_Models[1])
        }
        else if(g_bKatana[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Katana_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Katana_Models[1])
        }
        else if(g_bHammer[id])
        {
            cs_set_player_view_model(id, CSW_KNIFE, Hammer_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Hammer_Models[1])
        }
        else if((g_bTurbulent9[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Turbulent9_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Turbulent9_Models[1])
        }
        else if((g_bBio[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Bio_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Bio_Models[1])
        }
        else if((g_bSabers[id]))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Sabers_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Sabers_Models[1])
        }
        else if((g_bPlasma[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Plasma_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Plasma_Models[1])
        }
        else if((g_bStorm[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Storm_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Storm_Models[1])
        }
        else if((g_bLaevateinn[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Laevateinn_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Laevateinn_Models[1])
        }
        else if((g_bWarHammer_Dark_Knight[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[1])
        }
        else if((g_bBalrog_Kosa[id]) && (ze_get_vip_flags(id) & VIP_A))
        {
            cs_set_player_view_model(id, CSW_KNIFE, Balrog_Kosa_Models[0])
            cs_set_player_weap_model(id, CSW_KNIFE, Balrog_Kosa_Models[1])
        }
         else if((g_bHoly_Sword[id]) && (ze_get_user_level(id) >= 35))
        {
            ze_give_swd(id)
       
            cs_reset_player_view_model(id, CSW_KNIFE)
            cs_reset_player_weap_model(id, CSW_KNIFE)
        }
		else if((g_bDSP[id]) && (ze_get_user_level(id) >= 43))
        {
            ze_give_dsp(id)
        
            cs_reset_player_view_model(id, CSW_KNIFE)
            cs_reset_player_weap_model(id, CSW_KNIFE)
        }
    }
}
 
public Fw_RestMaxSpeed_Post(id)
{
    if (g_bNoSpeed)
        return
        
    set_task(0.1, "DelayLoad", id)
    
}
 
public DelayLoad(id)
{
    new iWpnId = (get_user_weapon(id))
    if (iWpnId == CSW_KNIFE && g_bCompat[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_compat))
    }
    if (iWpnId == CSW_KNIFE && g_bStrong[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_strong))
    }
    if (iWpnId == CSW_KNIFE && g_bKatana[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_katana))
    }
    if (iWpnId == CSW_KNIFE && g_bHammer[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammer))
    }
    if (iWpnId == CSW_KNIFE && g_bTurbulent9[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_turb))
    }
    if (iWpnId == CSW_KNIFE && g_bBio[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_bio))
    }
    if (iWpnId == CSW_KNIFE && g_bSabers[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_sabers))
    }
    if (iWpnId == CSW_KNIFE && g_bPlasma[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_plasma))
    }
    if (iWpnId == CSW_KNIFE && g_bStorm[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_storm))
    }
    if (iWpnId == CSW_KNIFE && g_bLaevateinn[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_laevat))
    }
    if (iWpnId == CSW_KNIFE && g_bWarHammer_Dark_Knight[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_darknight))
    }
    if (iWpnId == CSW_KNIFE && g_bBalrog_Kosa[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kosa))
    }
	if (iWpnId == CSW_KNIFE && g_bHoly_Sword[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_swd))
    }
    if (iWpnId == CSW_KNIFE && g_bDSP[id])
    {
        if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
        {
            new iFlags = get_entvar(id, var_flags);
            new iWaterlvl = get_entvar(id, var_waterlevel)
           
            if (!(iFlags & FL_ONGROUND))
                return HC_CONTINUE
 
            if (iFlags & FL_WATERJUMP)
                return HAM_IGNORED
 
            if (iWaterlvl > 1)
                return HAM_IGNORED
           
            new Float:flVelocity[3]
            get_entvar(id , var_velocity , flVelocity)
 
            flVelocity[2] += 325
 
            set_entvar(id , var_velocity , flVelocity)
 
            set_entvar(id, var_gaitsequence, 6)
        }
       
        set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_dsp))
    }
    
    return HC_CONTINUE
}
 
public DeathMsg(msg_id, msg_dest, id)
{
    static szTruncatedWeapon[33], iAttacker
    get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
    iAttacker = get_msg_arg_int(1)
   
    if(!is_user_alive(iAttacker) || iAttacker == get_msg_arg_int(2) || !is_user_alive(get_msg_arg_int(2))) // get_msg_arg_int(2) = iVictim
        return
   
    if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iAttacker) & CSW_KNIFE)
    {
        if(g_bCompat[id])
        {
            set_msg_arg_string(4, "Combat knife")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "Strong knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "Katana knife")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Ice knife")
        }
        else if(g_bTurbulent9[id])
        {
            set_msg_arg_string(4, "Turbulent9 knife")
        }
        else if(g_bBio[id])
        {
            set_msg_arg_string(4, "Biohazard knife")
        }
        else if(g_bSabers[id])
        {
            set_msg_arg_string(4, "Sabers knife")
        }
        else if(g_bPlasma[id])
        {
            set_msg_arg_string(4, "Plasma knife")
        }
        else if(g_bStorm[id])
        {
            set_msg_arg_string(4, "Storm knife")
        }
        else if(g_bLaevateinn[id])
        {
            set_msg_arg_string(4, "Laevateinn knife")
        }
        else if(g_bWarHammer_Dark_Knight[id])
        {
            set_msg_arg_string(4, "WarHammer Dark Knight knife")
        }
        else if(g_bBalrog_Kosa[id])
        {
            set_msg_arg_string(4, "Balrog Kosa Knife")
        }
    }
}
 
stock fm_set_user_maxspeed(index, Float:speed = -1.0)
{
        engfunc(EngFunc_SetClientMaxspeed, index, speed);
        set_pev(index, pev_maxspeed, speed);
 
        return 1;
}  
 
public native_ze_open_knife_menu(id)
{
    Show_Knife_Menu(id)
}
When I chose HolySword, I can't use my knive. When I switch to knife, its automatically switches to secondary weapon
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 501
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 39 times
Age: 18
Contact:

#4

Post by Jack GamePlay » 1 Week Ago

Code: Select all

#include <zombie_escape>
#include <engine>
#include <fun>
#include <ze_vip>
#include <ze_levels>

native ze_give_dsp(id)
native ze_remove_dsp(id)
native ze_give_swd(id)
native ze_remove_swd(id)
 
// Models
new const Compat_Models[][] =
{
	"models/zombie_escape/v_combat_knife.mdl",
	"models/zombie_escape/p_combat_knife.mdl"
}
 
new const Strong_Models[][] =
{
	"models/zombie_escape/v_strong_knife.mdl",
	"models/zombie_escape/p_strong_knife.mdl"
}
 
new const Katana_Models[][] =
{
	"models/zombie_escape/v_katana_knife.mdl",
	"models/zombie_escape/p_katana_knife.mdl"
}
 
new const Hammer_Models[][] =
{
	"models/zombie_escape/v_hammer_knife.mdl",
	"models/zombie_escape/p_hammer_knife.mdl"
}
 
new const Turbulent9_Models[][] =
{
	"models/zombie_escape/v_turbulent9_knife.mdl",
	"models/zombie_escape/p_turbulent9_knife.mdl"
}
 
new const Bio_Models[][] =
{
	"models/zombie_escape/v_bio_knife.mdl",
	"models/zombie_escape/p_bio_knife.mdl"
}
 
new const Sabers_Models[][] =
{
	"models/zombie_escape/v_laser_knife.mdl",
	"models/zombie_escape/p_laser_knife.mdl"
}
 
new const Plasma_Models[][] =
{
	"models/zombie_escape/v_plasma_knife.mdl",
	"models/zombie_escape/p_plasma_knife.mdl"
}
 
new const Storm_Models[][] =
{
	"models/zombie_escape/v_storm_sword_knife.mdl",
	"models/zombie_escape/p_storm_sword_knife.mdl"
}
 
new const Laevateinn_Models[][] =
{
	"models/zombie_escape/v_laevateinn_knife.mdl",
	"models/zombie_escape/p_laevateinn_knife.mdl"
}
 
new const WarHammer_Dark_Knight_Models[][] =
{
	"models/zombie_escape/v_WarHammer_dark_knight_knife.mdl",
	"models/zombie_escape/p_WarHammer_dark_knight_knife.mdl"
}
 
new const Balrog_Kosa_Models[][] =
{
	"models/zombie_escape/v_balrog_kosa_knife.mdl",
	"models/zombie_escape/p_balrog_kosa_knife.mdl"
}
 
// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"
 
new const combat_sounds[][] =
{
	"zombie_escape/knife_menu/combat_deploy.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hitwall.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_stab.wav"
}
 
new const strong_sounds[][] =
{
	"zombie_escape/knife_menu/strong_deploy.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hitwall.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_stab.wav"
}
 
new const katana_sounds[][] =
{
	"zombie_escape/knife_menu/katana_deploy.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hitwall.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_stab.wav"
}
 
new const hammer_sounds[][] =
{
	"zombie_escape/knife_menu/hammer_deploy.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hitwall.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_stab.wav"
}
 
new const turbulent9_sounds[][] =
{
	"zombie_escape/knife_menu/turbulent9_deploy.wav",
	"zombie_escape/knife_menu/turbulent9_hit.wav",
	"zombie_escape/knife_menu/turbulent9_hit.wav",
	"zombie_escape/knife_menu/turbulent9_hit.wav",
	"zombie_escape/knife_menu/turbulent9_hit.wav",
	"zombie_escape/knife_menu/turbulent9_hitwall.wav",
	"zombie_escape/knife_menu/turbulent9_slash.wav",
	"zombie_escape/knife_menu/turbulent9_slash.wav",
	"zombie_escape/knife_menu/turbulent9_stab.wav"
}
 
new const bio_sounds[][] =
{
	"zombie_escape/knife_menu/bio_deploy.wav",
	"zombie_escape/knife_menu/bio_hit.wav",
	"zombie_escape/knife_menu/bio_hit.wav",
	"zombie_escape/knife_menu/bio_hit.wav",
	"zombie_escape/knife_menu/bio_hit.wav",
	"zombie_escape/knife_menu/bio_hitwall.wav",
	"zombie_escape/knife_menu/bio_slash.wav",
	"zombie_escape/knife_menu/bio_slash.wav",
	"zombie_escape/knife_menu/bio_stab.wav"
}
 
new const sabers_sounds[][] =
{
	"zombie_escape/knife_menu/laser_deploy.wav",
	"zombie_escape/knife_menu/laser_hit.wav",
	"zombie_escape/knife_menu/laser_hit.wav",
	"zombie_escape/knife_menu/laser_hit.wav",
	"zombie_escape/knife_menu/laser_hit.wav",
	"zombie_escape/knife_menu/laser_hitwall.wav",
	"zombie_escape/knife_menu/laser_slash1.wav",
	"zombie_escape/knife_menu/laser_slash2.wav",
	"zombie_escape/knife_menu/laser_stab.wav"
}
 
new const plasma_sounds[][] =
{
	"zombie_escape/knife_menu/plasma_deploy.wav",
	"zombie_escape/knife_menu/plasma_hit.wav",
	"zombie_escape/knife_menu/plasma_hit.wav",
	"zombie_escape/knife_menu/plasma_hit.wav",
	"zombie_escape/knife_menu/plasma_hit.wav",
	"zombie_escape/knife_menu/plasma_hitwall.wav",
	"zombie_escape/knife_menu/plasma_slash.wav",
	"zombie_escape/knife_menu/plasma_slash.wav",
	"zombie_escape/knife_menu/plasma_stab.wav"
}
 
new const storm_sounds[][] =
{
	"zombie_escape/knife_menu/storm_sword_deploy.wav",
	"zombie_escape/knife_menu/storm_sword_hit.wav",
	"zombie_escape/knife_menu/storm_sword_hit.wav",
	"zombie_escape/knife_menu/storm_sword_hit.wav",
	"zombie_escape/knife_menu/storm_sword_hit.wav",
	"zombie_escape/knife_menu/storm_sword_hitwall.wav",
	"zombie_escape/knife_menu/storm_sword_slash.wav",
	"zombie_escape/knife_menu/storm_sword_slash.wav",
	"zombie_escape/knife_menu/storm_sword_stab.wav"
}
 
new const laevateinn_sounds[][] =
{
	"zombie_escape/knife_menu/laevateinn_deploy.wav",
	"zombie_escape/knife_menu/laevateinn_hit.wav",
	"zombie_escape/knife_menu/laevateinn_hit.wav",
	"zombie_escape/knife_menu/laevateinn_hit.wav",
	"zombie_escape/knife_menu/laevateinn_hit.wav",
	"zombie_escape/knife_menu/laevateinn_hitwall.wav",
	"zombie_escape/knife_menu/laevateinn_slash.wav",
	"zombie_escape/knife_menu/laevateinn_slash.wav",
	"zombie_escape/knife_menu/laevateinn_stab.wav"
}
 
new const warhammer_dark_knight_sounds[][] =
{
	"zombie_escape/knife_menu/WarHammer_dark_knight_deploy.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_hitwall.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
	"zombie_escape/knife_menu/WarHammer_dark_knight_stab.wav"
}
 
new const balrog_kosa_sounds[][] =
{
	"zombie_escape/knife_menu/balrog_kosa_deploy.wav",
	"zombie_escape/knife_menu/balrog_kosa_hit.wav",
	"zombie_escape/knife_menu/balrog_kosa_hit.wav",
	"zombie_escape/knife_menu/balrog_kosa_hit.wav",
	"zombie_escape/knife_menu/balrog_kosa_hit.wav",
	"zombie_escape/knife_menu/balrog_kosa_hitwall.wav",
	"zombie_escape/knife_menu/balrog_kosa_slash.wav",
	"zombie_escape/knife_menu/balrog_kosa_slash.wav",
	"zombie_escape/knife_menu/balrog_kosa_stab.wav"
}
 
new const oldknife_sounds[][] =
{
	"weapons/knife_deploy1.wav",
	"weapons/knife_hit1.wav",
	"weapons/knife_hit2.wav",
	"weapons/knife_hit3.wav",
	"weapons/knife_hit4.wav",
	"weapons/knife_hitwall1.wav",
	"weapons/knife_slash1.wav",
	"weapons/knife_slash2.wav",
	"weapons/knife_stab.wav"
}
 
new bool:g_bCompat[33], bool:g_bStrong[33], bool:g_bKatana[33], bool:g_bHammer[33], bool:g_bTurbulent9[33], bool:g_bBio[33], bool:g_bSabers[33], bool:g_bPlasma[33],
bool:g_bStorm[33], bool:g_bLaevateinn[33], bool:g_bWarHammer_Dark_Knight[33], bool:g_bBalrog_Kosa[33], bool:g_bHoly_Sword[33], bool:g_bDSP[33], bool:g_bNoSpeed, g_iUsedTimes[33], g_pCvarUseTimes
 
new cvar_speed_compat
new cvar_speed_strong
new cvar_speed_katana
new cvar_speed_hammer
new cvar_speed_turb
new cvar_speed_bio
new cvar_speed_sabers
new cvar_speed_plasma
new cvar_speed_storm
new cvar_speed_laevat
new cvar_speed_darknight
new cvar_speed_kosa
new cvar_speed_dsp
new cvar_speed_swd
 
public plugin_precache()
{
	new i
 
	for (i = 0; i <= charsmax(Compat_Models); i++)
		precache_model(Compat_Models[i])
 
	for (i = 0; i <= charsmax(Hammer_Models); i++)
		precache_model(Hammer_Models[i])
 
	for (i = 0; i <= charsmax(Katana_Models); i++)
		precache_model(Katana_Models[i])
 
	for (i = 0; i <= charsmax(Strong_Models); i++)
		precache_model(Strong_Models[i])
 
	for (i = 0; i <= charsmax(Turbulent9_Models); i++)
		precache_model(Turbulent9_Models[i])
 
	for (i = 0; i <= charsmax(Bio_Models); i++)
		precache_model(Bio_Models[i])
 
	for (i = 0; i <= charsmax(Sabers_Models); i++)
		precache_model(Sabers_Models[i])
 
	for (i = 0; i <= charsmax(Plasma_Models); i++)
		precache_model(Plasma_Models[i])
 
	for (i = 0; i <= charsmax(Storm_Models); i++)
		precache_model(Storm_Models[i])
 
	for (i = 0; i <= charsmax(Laevateinn_Models); i++)
		precache_model(Laevateinn_Models[i])
 
	for (i = 0; i <= charsmax(WarHammer_Dark_Knight_Models); i++)
		precache_model(WarHammer_Dark_Knight_Models[i])
 
	for (i = 0; i <= charsmax(Balrog_Kosa_Models); i++)
		precache_model(Balrog_Kosa_Models[i])
 
	for (i = 0; i <= charsmax(combat_sounds); i++)
		precache_sound(combat_sounds[i])
 
	for (i = 0; i <= charsmax(strong_sounds); i++)
		precache_sound(strong_sounds[i])
 
	for (i = 0; i <= charsmax(katana_sounds); i++)
		precache_sound(katana_sounds[i])
 
	for (i = 0; i <= charsmax(hammer_sounds); i++)
		precache_sound(hammer_sounds[i])
 
	for (i = 0; i <= charsmax(turbulent9_sounds); i++)
		precache_sound(turbulent9_sounds[i])
 
	for (i = 0; i <= charsmax(bio_sounds); i++)
		precache_sound(bio_sounds[i])
 
	for (i = 0; i <= charsmax(sabers_sounds); i++)
		precache_sound(sabers_sounds[i])
 
	for (i = 0; i <= charsmax(plasma_sounds); i++)
		precache_sound(plasma_sounds[i])
 
	for (i = 0; i <= charsmax(storm_sounds); i++)
		precache_sound(storm_sounds[i])
 
	for (i = 0; i <= charsmax(laevateinn_sounds); i++)
		precache_sound(laevateinn_sounds[i])
 
	for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
		precache_sound(warhammer_dark_knight_sounds[i])
 
	for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
		precache_sound(balrog_kosa_sounds[i])
 
	precache_sound(g_sound_knife)
}
 
public plugin_natives()
{
	register_native("ze_open_knife_menu", "native_ze_open_knife_menu", 1)
}
 
public plugin_init()
{
	register_plugin("[ZE] Addon: Knife Menu", "1.3", "Mark")
 
	register_forward(FM_EmitSound, "fw_EmitSound")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
 
	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
	RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "Fw_RestMaxSpeed_Post", 1)
   
	g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1000")
 
	register_message(get_user_msgid("DeathMsg"), "DeathMsg")
 
	register_clcmd("say /km", "Show_Knife_Menu")
   
	cvar_speed_compat = register_cvar("ze_compat_speed", "275.0")
	cvar_speed_strong = register_cvar("ze_strong_speed", "275.0")
	cvar_speed_katana = register_cvar("ze_katana_speed", "275.0")
	cvar_speed_hammer = register_cvar("ze_hammer_speed", "275.0")
	cvar_speed_turb = register_cvar("ze_turb_speed", "280.0")    
	cvar_speed_bio = register_cvar("ze_bio_speed", "280.0")
	cvar_speed_sabers = register_cvar("ze_sabers_speed", "285.0")
	cvar_speed_plasma = register_cvar("ze_plasma_speed", "285.0")
	cvar_speed_storm = register_cvar("ze_storm_speed", "290.0")    
	cvar_speed_laevat = register_cvar("ze_laevat_speed", "290.0")  
	cvar_speed_darknight = register_cvar("ze_darknight_speed", "295.0")
	cvar_speed_kosa = register_cvar("ze_kosa_speed", "295.0")
	cvar_speed_dsp = register_cvar("ze_dsp_speed", "345.0")
	cvar_speed_swd = register_cvar("ze_swd_speed", "320.0")
}
 
public ze_user_humanized(id)
{
	g_iUsedTimes[id] = 0
}
 
/*public ze_user_infected(Victim)
{
	g_bCompat[Victim] = false
	g_bStrong[Victim] = false
	g_bKatana[Victim] = false
	g_bHammer[Victim] = false
	g_bTurbulent9[Victim] = false
	g_bBio[Victim] = false
	g_bSabers[Victim] = false
	g_bPlasma[Victim] = false
	g_bStorm[Victim] = false
	g_bLaevateinn[Victim] = false
	g_bWarHammer_Dark_Knight[Victim] = false
	g_bBalrog_Kosa[Victim] = false
	g_iUsedTimes[Victim] = 0
}*/
 
public client_putinserver(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[id] = false
	g_bTurbulent9[id] = false
	g_bBio[id] = false
	g_bSabers[id] = false
	g_bPlasma[id] = false
	g_bStorm[id] = false
	g_bLaevateinn[id] = false
	g_bWarHammer_Dark_Knight[id] = false
	g_bBalrog_Kosa[id] = false
	g_bHoly_Sword[id] = false
	g_bDSP[id] = false
	g_iUsedTimes[id] = 0
}
 
public client_disconnected(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[id] = false
	g_bTurbulent9[id] = false
	g_bBio[id] = false
	g_bSabers[id] = false
	g_bPlasma[id] = false
	g_bStorm[id] = false
	g_bLaevateinn[id] = false
	g_bWarHammer_Dark_Knight[id] = false
	g_bBalrog_Kosa[id] = false
	g_bHoly_Sword[id] = false
	g_bDSP[id] = false
	g_iUsedTimes[id] = 0
}

public ze_game_started()
{
	g_bNoSpeed = true
}
 
public ze_zombie_release()
{
	g_bNoSpeed = false
   
	// call the reset speed function ;)
	for(new id = 1; id <= 32; id++)
	{
		if (!is_user_alive(id))
			continue;
	   
		rg_reset_maxspeed(id)
	}
}
 
public Show_Knife_Menu(id)
{
	if (!is_user_connected(id))
		return PLUGIN_CONTINUE
 
	if (ze_is_user_zombie(id))
	{
		ze_colored_print(id, "!tZombies can't open knife menu!y.")
		return PLUGIN_HANDLED
	}
 
	if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
	{
		ze_colored_print(id, "!tYou can only open knife menu !y[!g%dx!y] per round!", get_pcvar_num(g_pCvarUseTimes))
		return PLUGIN_HANDLED
	}
 
	if (!is_user_alive(id))
	{
		ze_colored_print(id, "!tDead can't open knife menu!y.")
		return PLUGIN_HANDLED
	}
 
	Knife_Menu(id)
	return PLUGIN_CONTINUE
}
 
public Knife_Menu(id)
{
	new iMenu = menu_create("\rChoose Your Knife\w:^n^n- [ \ySpeed \rActivates \yon Zombie Release!\w ]^n\w- [ \r12 \yknives in Total!\w ] ^n-", "Menu_Handler")
	menu_additem(iMenu, "\yCombat \w[ \r275 Speed\w ]", "", 0)
	menu_additem(iMenu, "\yStrong \w[ \r275 Speed\w ]", "", 0)
	menu_additem(iMenu, "\yKatana \w[ \r275 Speed\w ]", "", 0)
	menu_additem(iMenu, "\yHammer \w[ \r275 Speed\w ]", "", 0)
	menu_additem(iMenu, "\yTurbulent9 \w[ \r280 Speed\w ]", "", 0)
	menu_additem(iMenu, "\yBio Hazard \w[ \r280 Speed\w ]", "", 0)
	menu_additem(iMenu, "\ySabers \w[ \r285 Speed\w ]", "", 0)
	
	if (ze_get_vip_flags(id) & VIP_A)
	{
		menu_additem(iMenu, "\yPlasma \w[ \rVIP\w ] [ \r285 Speed\w ]", "", 0)
		menu_additem(iMenu, "\yStorm \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
		menu_additem(iMenu, "\yLaevateinn \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
		menu_additem(iMenu, "\yWarHammer Dark Night \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
		menu_additem(iMenu, "\yBalrog Kosa \w[ \rVIP\w ] [ \r290 Speed\w ]", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dPlasma [ VIP ] [ 285 Speed ]", "", 0)
		menu_additem(iMenu, "\dStorm [ VIP ] [ 290 Speed ]", "", 0)
		menu_additem(iMenu, "\dLaevateinn [ VIP ] [ 290 Speed ]", "", 0)
		menu_additem(iMenu, "\dWarHammer Dark Night [ VIP ] [ 290 Speed ]", "", 0)
		menu_additem(iMenu, "\dBalrog Kosa [ VIP ] [ 290 Speed ]", "", 0)
	}
	
	if (ze_get_user_level(id) >= 35)
	{
		menu_additem(iMenu, "\yHoly_Sword \w[ \r320 Speed\w ]", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dHoly_Sword [ 320 Speed ]", "", 0)
	}
	
	if (ze_get_user_level(id) >= 43)
	{
		menu_additem(iMenu, "\yDSP \w[ \r345 Speed\w ]", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dDSP [ 345 Speed ]", "", 0)
	}

	menu_setprop(iMenu,MPROP_EXITNAME,"Close") 
	menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL) 
	menu_display(id, iMenu, 0)
}
 
public Menu_Handler(id, iMenu, iKey)
{
	if(!is_user_alive(id) || ze_is_user_zombie(id))
		return PLUGIN_HANDLED
	   
	switch(iKey)
	{
		case 0: // Compat
		{
			g_bCompat[id] = true
			g_bStrong[id] = false
			g_bKatana[id] = false
			g_bHammer[id] = false
			g_bTurbulent9[id] = false
			g_bBio[id] = false
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//rg_reset_maxspeed(id)
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
		}
		case 1: // Strong
		{
			g_bCompat[id] = false
			g_bStrong[id] = true
			g_bKatana[id] = false
			g_bHammer[id] = false
			g_bTurbulent9[id] = false
			g_bBio[id] = false
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
		}
		case 2: // Katana
		{
			g_bCompat[id] = false
			g_bStrong[id] = false
			g_bKatana[id] = true
			g_bHammer[id] = false
			g_bTurbulent9[id] = false
			g_bBio[id] = false
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
		}
		case 3: // Hammer
		{
			g_bCompat[id] = false
			g_bStrong[id] = false
			g_bKatana[id] = false
			g_bHammer[id] = true
			g_bTurbulent9[id] = false
			g_bBio[id] = false
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
		}
		case 4: // Turbulent
		{
			g_bCompat[id] = false
			g_bStrong[id] = false
			g_bKatana[id] = false
			g_bHammer[id] = false
			g_bTurbulent9[id] = true
			g_bBio[id] = false
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			
		}
		case 5: // Bio
		{
			g_bCompat[id] = false
			g_bStrong[id] = false
			g_bKatana[id] = false
			g_bHammer[id] = false
			g_bTurbulent9[id] = false
			g_bBio[id] = true
			g_bSabers[id] = false
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			
		}
		case 6: // Sabers
		{
			g_bCompat[id] = false
			g_bStrong[id] = false
			g_bKatana[id] = false
			g_bHammer[id] = false
			g_bTurbulent9[id] = false
			g_bBio[id] = false
			g_bSabers[id] = true
			g_bPlasma[id] = false
			g_bStorm[id] = false
			g_bLaevateinn[id] = false
			g_bWarHammer_Dark_Knight[id] = false
			g_bBalrog_Kosa[id] = false
			g_bHoly_Sword[id] = false
			g_bDSP[id] = false
			g_iUsedTimes[id] = 0
			ze_remove_swd(id)
			ze_remove_dsp(id)
			rg_remove_item(id, "weapon_knife")
			rg_give_item(id, "weapon_knife", GT_APPEND)
			//engclient_cmd(id, "weapon_knife")
			//g_iUsedTimes[id]++
			//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			
		}
		case 7: // Plasma
		{
			if (ze_get_vip_flags(id) & VIP_A)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = true
				g_bStorm[id] = false
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = false
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 8: // Storm
		{
			if (ze_get_vip_flags(id) & VIP_A)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = true
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = false
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 9: // Laevateinn
		{
			if (ze_get_vip_flags(id) & VIP_A)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = false
				g_bLaevateinn[id] = true
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = false
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 10: // Warhammer Dark Night
		{
			if (ze_get_vip_flags(id) & VIP_A)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = false
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = true
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = false
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 11: // Balrog Kosa
		{
			if (ze_get_vip_flags(id) & VIP_A)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = false
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = true
				g_bHoly_Sword[id] = false
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 12: // Holy_Sword
		{
			if (ze_get_user_level(id) >= 35)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = false
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = true
				g_bDSP[id] = false
				g_iUsedTimes[id] = 0
				ze_remove_dsp(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNot enough level!y.")
			}
		}
		case 13: // DSP
		{
			if (ze_get_user_level(id) >= 43)
			{
				g_bCompat[id] = false
				g_bStrong[id] = false
				g_bKatana[id] = false
				g_bHammer[id] = false
				g_bTurbulent9[id] = false
				g_bBio[id] = false
				g_bSabers[id] = false
				g_bPlasma[id] = false
				g_bStorm[id] = false
				g_bLaevateinn[id] = false
				g_bWarHammer_Dark_Knight[id] = false
				g_bBalrog_Kosa[id] = false
				g_bHoly_Sword[id] = false
				g_bDSP[id] = true
				g_iUsedTimes[id] = 0
				ze_remove_swd(id)
				rg_remove_item(id, "weapon_knife")
				rg_give_item(id, "weapon_knife", GT_APPEND)
				//engclient_cmd(id, "weapon_knife")
				//g_iUsedTimes[id]++
				//emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
			}
			else
			{
				ze_colored_print(id, "!tNot enough level!y.")
			}
		}
	}

	menu_destroy(iMenu)
	return PLUGIN_HANDLED
}
 
public fw_EmitSound(id, channel, const sound[])
{
	if(!is_user_alive(id) || ze_is_user_zombie(id))
		return FMRES_IGNORED
	   
	new i
	for (i = 0; i <= charsmax(combat_sounds); i++)
	for (i = 0; i <= charsmax(strong_sounds); i++)
	for (i = 0; i <= charsmax(katana_sounds); i++)
	for (i = 0; i <= charsmax(hammer_sounds); i++)
	for (i = 0; i <= charsmax(turbulent9_sounds); i++)
	for (i = 0; i <= charsmax(bio_sounds); i++)
	for (i = 0; i <= charsmax(sabers_sounds); i++)
	for (i = 0; i <= charsmax(plasma_sounds); i++)
	for (i = 0; i <= charsmax(storm_sounds); i++)
	for (i = 0; i <= charsmax(laevateinn_sounds); i++)
	for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
	for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
	{
		if (equal(sound, oldknife_sounds[i]))
		{
			if (g_bCompat[id])
			{
				emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bStrong[id])
			{
				emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bKatana[id])
			{
				emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bHammer[id])
			{
				emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bTurbulent9[id])
			{
				emit_sound(id, channel, turbulent9_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bBio[id])
			{
				emit_sound(id, channel, bio_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bSabers[id])
			{
				emit_sound(id, channel, sabers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bPlasma[id])
			{
				emit_sound(id, channel, plasma_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bStorm[id])
			{
				emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bLaevateinn[id])
			{
				emit_sound(id, channel, laevateinn_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bWarHammer_Dark_Knight[id])
			{
				emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (g_bBalrog_Kosa[id])
			{
				emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
			else if (!g_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[id] || !g_bTurbulent9[id] || !g_bBio[id] || !g_bSabers[id] || !g_bPlasma[id] || !g_bStorm[id] || !g_bLaevateinn[id] || !g_bWarHammer_Dark_Knight[id] || !g_bBalrog_Kosa[id])
			{
				emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
				return FMRES_SUPERCEDE
			}
		}
	}
	return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
	if(!is_user_alive(id) || ze_is_user_zombie(id))
		return
	   
	if(get_user_weapon(id) & CSW_KNIFE)
	{
		if(g_bCompat[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Compat_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Compat_Models[1])
		}
		else if(g_bStrong[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Strong_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Strong_Models[1])
		}
		else if(g_bKatana[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Katana_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Katana_Models[1])
		}
		else if(g_bHammer[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Hammer_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Hammer_Models[1])
		}
		else if(g_bTurbulent9[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Turbulent9_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Turbulent9_Models[1])
		}
		else if(g_bBio[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Bio_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Bio_Models[1])
		}
		else if(g_bSabers[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Sabers_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Sabers_Models[1])
		}
		else if(g_bPlasma[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Plasma_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Plasma_Models[1])
		}
		else if(g_bStorm[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Storm_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Storm_Models[1])
		}
		else if(g_bLaevateinn[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Laevateinn_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Laevateinn_Models[1])
		}
		else if(g_bWarHammer_Dark_Knight[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[1])
		}
		else if(g_bBalrog_Kosa[id])
		{
			cs_set_player_view_model(id, CSW_KNIFE, Balrog_Kosa_Models[0])
			cs_set_player_weap_model(id, CSW_KNIFE, Balrog_Kosa_Models[1])
		}
		 else if(g_bHoly_Sword[id])
		{
			ze_give_swd(id)
	   
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
		else if(g_bDSP[id])
		{
			ze_give_dsp(id)
		
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
	}
}
 
public Fw_RestMaxSpeed_Post(id)
{
	if (g_bNoSpeed)
		return
		
	set_task(0.1, "DelayLoad", id)
	
}
 
public DelayLoad(id)
{
	new iWpnId = (get_user_weapon(id))
	if (iWpnId == CSW_KNIFE && g_bCompat[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_compat))
	}
	if (iWpnId == CSW_KNIFE && g_bStrong[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_strong))
	}
	if (iWpnId == CSW_KNIFE && g_bKatana[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_katana))
	}
	if (iWpnId == CSW_KNIFE && g_bHammer[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammer))
	}
	if (iWpnId == CSW_KNIFE && g_bTurbulent9[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_turb))
	}
	if (iWpnId == CSW_KNIFE && g_bBio[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_bio))
	}
	if (iWpnId == CSW_KNIFE && g_bSabers[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_sabers))
	}
	if (iWpnId == CSW_KNIFE && g_bPlasma[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_plasma))
	}
	if (iWpnId == CSW_KNIFE && g_bStorm[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_storm))
	}
	if (iWpnId == CSW_KNIFE && g_bLaevateinn[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_laevat))
	}
	if (iWpnId == CSW_KNIFE && g_bWarHammer_Dark_Knight[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_darknight))
	}
	if (iWpnId == CSW_KNIFE && g_bBalrog_Kosa[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kosa))
	}
	if (iWpnId == CSW_KNIFE && g_bHoly_Sword[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_swd))
	}
	if (iWpnId == CSW_KNIFE && g_bDSP[id])
	{
		if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
		{
			new iFlags = get_entvar(id, var_flags);
			new iWaterlvl = get_entvar(id, var_waterlevel)
		   
			if (!(iFlags & FL_ONGROUND))
				return HC_CONTINUE
 
			if (iFlags & FL_WATERJUMP)
				return HAM_IGNORED
 
			if (iWaterlvl > 1)
				return HAM_IGNORED
		   
			new Float:flVelocity[3]
			get_entvar(id , var_velocity , flVelocity)
 
			flVelocity[2] += 325
 
			set_entvar(id , var_velocity , flVelocity)
 
			set_entvar(id, var_gaitsequence, 6)
		}
	   
		set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_dsp))
	}
	
	return HC_CONTINUE
}
 
public DeathMsg(msg_id, msg_dest, id)
{
	static szTruncatedWeapon[33], iAttacker
	get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
	iAttacker = get_msg_arg_int(1)
   
	if(!is_user_alive(iAttacker) || iAttacker == get_msg_arg_int(2) || !is_user_alive(get_msg_arg_int(2))) // get_msg_arg_int(2) = iVictim
		return
   
	if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iAttacker) & CSW_KNIFE)
	{
		if(g_bCompat[id])
		{
			set_msg_arg_string(4, "Combat knife")
		}
		else if(g_bStrong[id])
		{
			set_msg_arg_string(4, "Strong knife")
		}
		else if(g_bKatana[id])
		{
			set_msg_arg_string(4, "Katana knife")
		}
		else if(g_bHammer[id])
		{
			set_msg_arg_string(4, "Ice knife")
		}
		else if(g_bTurbulent9[id])
		{
			set_msg_arg_string(4, "Turbulent9 knife")
		}
		else if(g_bBio[id])
		{
			set_msg_arg_string(4, "Biohazard knife")
		}
		else if(g_bSabers[id])
		{
			set_msg_arg_string(4, "Sabers knife")
		}
		else if(g_bPlasma[id])
		{
			set_msg_arg_string(4, "Plasma knife")
		}
		else if(g_bStorm[id])
		{
			set_msg_arg_string(4, "Storm knife")
		}
		else if(g_bLaevateinn[id])
		{
			set_msg_arg_string(4, "Laevateinn knife")
		}
		else if(g_bWarHammer_Dark_Knight[id])
		{
			set_msg_arg_string(4, "WarHammer Dark Knight knife")
		}
		else if(g_bBalrog_Kosa[id])
		{
			set_msg_arg_string(4, "Balrog Kosa Knife")
		}
	}
}
 
stock fm_set_user_maxspeed(index, Float:speed = -1.0)
{
		engfunc(EngFunc_SetClientMaxspeed, index, speed);
		set_pev(index, pev_maxspeed, speed);
 
		return 1;
}  
 
public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest