Knife Menu!

Unpaid Requests, Public Plugins
User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 144
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

Knife Menu!

#1

Post by Luxurious » 4 Months Ago

I have Some Problem in My Knife Menu ... Its When Some one Using Knife From Menu is getting Normal Knife Next Round .

Code: Select all

#include <zombie_escape>
 
// Models
new const Compat_Models[][] =
{
	"models/v_kniferzz.mdl",
	"models/p_kniferzz.mdl"
}

new const Strong_Models[][] =
{
	"models/v_knife1.mdl",
	"models/p_knife1.mdl"
}

new const Katana_Models[][] =
{
	"models/v_knife3.mdl",
	"models/p_knife3.mdl"
}

new const Hammer_Models[][] =
{
	"models/v_Gold_Katana.mdl",
	"models/p_Gold_Katana.mdl" 
}

// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"

new const combat_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 const strong_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 const katana_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 const hammer_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 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],
g_iUsedTimes[33], g_pCvarUseTimes

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(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])

	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.2", "Jack GamePlay")

	register_forward(FM_EmitSound, "fw_EmitSound")

	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")

	g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1")

	register_message(get_user_msgid("DeathMsg"), "DeathMsg")

	register_clcmd("say /k", "Show_Knife_Menu")
}
 
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_iUsedTimes[Victim] = 0
}

public client_putinserver(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[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_iUsedTimes[id] = 0
}

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, "!tMaximum have been reached !y[!g%d!y]!", 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:", "Menu_Handler")
	menu_additem(iMenu, "\yKniferzz", "", 0)
	menu_additem(iMenu, "\yDraGonS", "", 0)
	menu_additem(iMenu, "\yWar\w-\yHammer", "", 0)
	menu_additem(iMenu, "\yGold\w-\yKataNa", "", 0)
	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
			/*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 1: // Strong
		{
			g_bCompat[id] = false
			g_bStrong[id] = true
			g_bKatana[id] = false
			g_bHammer[id] = false
			/*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
			/*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_iUsedTimes[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)*/
		}
	}

	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++)
    {
        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_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[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
		{
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
    }
}

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, "Kniferzz")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "DraGonS Knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "War Hammer")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Gold KataNa")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
DragonsXtreme Zombie-Escape V1.4
IP : 81.2.247.149:27015

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 144
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#2

Post by Luxurious » 4 Months Ago

up
DragonsXtreme Zombie-Escape V1.4
IP : 81.2.247.149:27015

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 1 Year Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#3

Post by Mark » 4 Months Ago

Luxurious wrote:
4 Months Ago
I have Some Problem in My Knife Menu ... Its When Some one Using Knife From Menu is getting Normal Knife Next Round .

Code: Select all

#include <zombie_escape>
 
// Models
new const Compat_Models[][] =
{
	"models/v_kniferzz.mdl",
	"models/p_kniferzz.mdl"
}

new const Strong_Models[][] =
{
	"models/v_knife1.mdl",
	"models/p_knife1.mdl"
}

new const Katana_Models[][] =
{
	"models/v_knife3.mdl",
	"models/p_knife3.mdl"
}

new const Hammer_Models[][] =
{
	"models/v_Gold_Katana.mdl",
	"models/p_Gold_Katana.mdl" 
}

// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"

new const combat_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 const strong_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 const katana_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 const hammer_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 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],
g_iUsedTimes[33], g_pCvarUseTimes

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(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])

	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.2", "Jack GamePlay")

	register_forward(FM_EmitSound, "fw_EmitSound")

	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")

	g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1")

	register_message(get_user_msgid("DeathMsg"), "DeathMsg")

	register_clcmd("say /k", "Show_Knife_Menu")
}
 
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_iUsedTimes[Victim] = 0
}

public client_putinserver(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[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_iUsedTimes[id] = 0
}

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, "!tMaximum have been reached !y[!g%d!y]!", 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:", "Menu_Handler")
	menu_additem(iMenu, "\yKniferzz", "", 0)
	menu_additem(iMenu, "\yDraGonS", "", 0)
	menu_additem(iMenu, "\yWar\w-\yHammer", "", 0)
	menu_additem(iMenu, "\yGold\w-\yKataNa", "", 0)
	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
			/*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 1: // Strong
		{
			g_bCompat[id] = false
			g_bStrong[id] = true
			g_bKatana[id] = false
			g_bHammer[id] = false
			/*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
			/*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_iUsedTimes[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)*/
		}
	}

	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++)
    {
        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_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[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
		{
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
    }
}

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, "Kniferzz")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "DraGonS Knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "War Hammer")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Gold KataNa")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
Here the custom one i made for my server you can look here..
ze_knife_menu.sma
(62.82 KiB) Downloaded 18 times
ze_knife_menu.sma
(62.82 KiB) Downloaded 18 times
If you cant figure it out ill fix yours tonight.

Remove this you are telling the plugin on infect set the knife to false when you want it to stay true.
  1. public ze_user_infected(Victim)
  2. {
  3.     g_bCompat[Victim] = false
  4.     g_bStrong[Victim] = false
  5.     g_bKatana[Victim] = false
  6.     g_bHammer[Victim] = false
  7.     g_iUsedTimes[Victim] = 0
  8. }

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 144
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#4

Post by Luxurious » 4 Months Ago

Mark wrote:
4 Months Ago
Luxurious wrote:
4 Months Ago
I have Some Problem in My Knife Menu ... Its When Some one Using Knife From Menu is getting Normal Knife Next Round .

Code: Select all

#include <zombie_escape>
 
// Models
new const Compat_Models[][] =
{
	"models/v_kniferzz.mdl",
	"models/p_kniferzz.mdl"
}

new const Strong_Models[][] =
{
	"models/v_knife1.mdl",
	"models/p_knife1.mdl"
}

new const Katana_Models[][] =
{
	"models/v_knife3.mdl",
	"models/p_knife3.mdl"
}

new const Hammer_Models[][] =
{
	"models/v_Gold_Katana.mdl",
	"models/p_Gold_Katana.mdl" 
}

// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"

new const combat_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 const strong_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 const katana_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 const hammer_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 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],
g_iUsedTimes[33], g_pCvarUseTimes

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(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])

	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.2", "Jack GamePlay")

	register_forward(FM_EmitSound, "fw_EmitSound")

	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")

	g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1")

	register_message(get_user_msgid("DeathMsg"), "DeathMsg")

	register_clcmd("say /k", "Show_Knife_Menu")
}
 
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_iUsedTimes[Victim] = 0
}

public client_putinserver(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[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_iUsedTimes[id] = 0
}

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, "!tMaximum have been reached !y[!g%d!y]!", 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:", "Menu_Handler")
	menu_additem(iMenu, "\yKniferzz", "", 0)
	menu_additem(iMenu, "\yDraGonS", "", 0)
	menu_additem(iMenu, "\yWar\w-\yHammer", "", 0)
	menu_additem(iMenu, "\yGold\w-\yKataNa", "", 0)
	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
			/*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 1: // Strong
		{
			g_bCompat[id] = false
			g_bStrong[id] = true
			g_bKatana[id] = false
			g_bHammer[id] = false
			/*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
			/*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_iUsedTimes[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)*/
		}
	}

	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++)
    {
        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_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[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
		{
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
    }
}

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, "Kniferzz")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "DraGonS Knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "War Hammer")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Gold KataNa")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
Here the custom one i made for my server you can look here..

ze_knife_menu.sma

If you cant figure it out ill fix yours tonight.

Remove this you are telling the plugin on infect set the knife to false when you want it to stay true.
  1. public ze_user_infected(Victim)
  2. {
  3.     g_bCompat[Victim] = false
  4.     g_bStrong[Victim] = false
  5.     g_bKatana[Victim] = false
  6.     g_bHammer[Victim] = false
  7.     g_iUsedTimes[Victim] = 0
  8. }

Can u give me the models too if can ?!
DragonsXtreme Zombie-Escape V1.4
IP : 81.2.247.149:27015

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 1 Year Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#5

Post by Mark » 4 Months Ago

Luxurious wrote:
4 Months Ago
Mark wrote:
4 Months Ago
Luxurious wrote:
4 Months Ago
I have Some Problem in My Knife Menu ... Its When Some one Using Knife From Menu is getting Normal Knife Next Round .

Code: Select all

#include <zombie_escape>
 
// Models
new const Compat_Models[][] =
{
	"models/v_kniferzz.mdl",
	"models/p_kniferzz.mdl"
}

new const Strong_Models[][] =
{
	"models/v_knife1.mdl",
	"models/p_knife1.mdl"
}

new const Katana_Models[][] =
{
	"models/v_knife3.mdl",
	"models/p_knife3.mdl"
}

new const Hammer_Models[][] =
{
	"models/v_Gold_Katana.mdl",
	"models/p_Gold_Katana.mdl" 
}

// Sounds
new const g_sound_knife[] = "items/gunpickup2.wav"

new const combat_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 const strong_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 const katana_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 const hammer_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 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],
g_iUsedTimes[33], g_pCvarUseTimes

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(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])

	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.2", "Jack GamePlay")

	register_forward(FM_EmitSound, "fw_EmitSound")

	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")

	g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "1")

	register_message(get_user_msgid("DeathMsg"), "DeathMsg")

	register_clcmd("say /k", "Show_Knife_Menu")
}
 
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_iUsedTimes[Victim] = 0
}

public client_putinserver(id)
{
	g_bCompat[id] = false
	g_bStrong[id] = false
	g_bKatana[id] = false
	g_bHammer[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_iUsedTimes[id] = 0
}

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, "!tMaximum have been reached !y[!g%d!y]!", 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:", "Menu_Handler")
	menu_additem(iMenu, "\yKniferzz", "", 0)
	menu_additem(iMenu, "\yDraGonS", "", 0)
	menu_additem(iMenu, "\yWar\w-\yHammer", "", 0)
	menu_additem(iMenu, "\yGold\w-\yKataNa", "", 0)
	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
			/*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 1: // Strong
		{
			g_bCompat[id] = false
			g_bStrong[id] = true
			g_bKatana[id] = false
			g_bHammer[id] = false
			/*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
			/*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_iUsedTimes[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)*/
		}
	}

	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++)
    {
        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_bCompat[id] || !g_bStrong[id] || !g_bKatana[id] || !g_bHammer[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
		{
			cs_reset_player_view_model(id, CSW_KNIFE)
			cs_reset_player_weap_model(id, CSW_KNIFE)
		}
    }
}

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, "Kniferzz")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "DraGonS Knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "War Hammer")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Gold KataNa")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
Here the custom one i made for my server you can look here..

ze_knife_menu.sma

If you cant figure it out ill fix yours tonight.

Remove this you are telling the plugin on infect set the knife to false when you want it to stay true.
  1. public ze_user_infected(Victim)
  2. {
  3.     g_bCompat[Victim] = false
  4.     g_bStrong[Victim] = false
  5.     g_bKatana[Victim] = false
  6.     g_bHammer[Victim] = false
  7.     g_iUsedTimes[Victim] = 0
  8. }

Can u give me the models too if can ?!


I think all is here let me know if something is missing i pulled them from my fast download server.
Knife Menu Models.zip
(15.68 MiB) Downloaded 19 times
Knife Menu Models.zip
(15.68 MiB) Downloaded 19 times

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 144
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#6

Post by Luxurious » 4 Months Ago

Mark wrote:
4 Months Ago


Here the custom one i made for my server you can look here..

ze_knife_menu.sma

If you cant figure it out ill fix yours tonight.

Remove this you are telling the plugin on infect set the knife to false when you want it to stay true.
  1. public ze_user_infected(Victim)
  2. {
  3.     g_bCompat[Victim] = false
  4.     g_bStrong[Victim] = false
  5.     g_bKatana[Victim] = false
  6.     g_bHammer[Victim] = false
  7.     g_iUsedTimes[Victim] = 0
  8. }

Can u give me the models too if can ?!
[/quote]



I think all is here let me know if something is missing i pulled them from my fast download server.

Knife Menu Models.zip
[/quote]
i have got this problem

Code: Select all

 Load fails: Plugin uses an unknown function (name "ze_remove_dsp") - check your modules.ini.
DragonsXtreme Zombie-Escape V1.4
IP : 81.2.247.149:27015

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 1 Year Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#7

Post by Mark » 4 Months Ago

Luxurious wrote:
4 Months Ago
Mark wrote:
4 Months Ago


Here the custom one i made for my server you can look here..

ze_knife_menu.sma

If you cant figure it out ill fix yours tonight.

Remove this you are telling the plugin on infect set the knife to false when you want it to stay true.
  1. public ze_user_infected(Victim)
  2. {
  3.     g_bCompat[Victim] = false
  4.     g_bStrong[Victim] = false
  5.     g_bKatana[Victim] = false
  6.     g_bHammer[Victim] = false
  7.     g_iUsedTimes[Victim] = 0
  8. }

Can u give me the models too if can ?!


I think all is here let me know if something is missing i pulled them from my fast download server.

Knife Menu Models.zip
[/quote]
i have got this problem

Code: Select all

 Load fails: Plugin uses an unknown function (name "ze_remove_dsp") - check your modules.ini.
[/quote]

Here Try this!

  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fun>
  4.  
  5.  
  6. // Models
  7. new const Compat_Models[][] =
  8. {
  9.     "models/zombie_escape/v_combat_knife.mdl",
  10.     "models/zombie_escape/p_combat_knife.mdl"
  11. }
  12.  
  13. new const Strong_Models[][] =
  14. {
  15.     "models/zombie_escape/v_strong_knife.mdl",
  16.     "models/zombie_escape/p_strong_knife.mdl"
  17. }
  18.  
  19. new const Katana_Models[][] =
  20. {
  21.     "models/zombie_escape/v_katana_knife.mdl",
  22.     "models/zombie_escape/p_katana_knife.mdl"
  23. }
  24.  
  25. new const Hammer_Models[][] =
  26. {
  27.     "models/zombie_escape/v_hammer_knife.mdl",
  28.     "models/zombie_escape/p_hammer_knife.mdl"
  29. }
  30.  
  31. new const Turbulent9_Models[][] =
  32. {
  33.     "models/zombie_escape/v_turbulent9_knife.mdl",
  34.     "models/zombie_escape/p_turbulent9_knife.mdl"
  35. }
  36.  
  37. new const Bio_Models[][] =
  38. {
  39.     "models/zombie_escape/v_bio_knife.mdl",
  40.     "models/zombie_escape/p_bio_knife.mdl"
  41. }
  42.  
  43. new const Sabers_Models[][] =
  44. {
  45.     "models/zombie_escape/v_laser_knife.mdl",
  46.     "models/zombie_escape/p_laser_knife.mdl"
  47. }
  48.  
  49. new const Plasma_Models[][] =
  50. {
  51.     "models/zombie_escape/v_plasma_knife.mdl",
  52.     "models/zombie_escape/p_plasma_knife.mdl"
  53. }
  54.  
  55. new const Storm_Models[][] =
  56. {
  57.     "models/zombie_escape/v_storm_sword_knife.mdl",
  58.     "models/zombie_escape/p_storm_sword_knife.mdl"
  59. }
  60.  
  61. new const Laevateinn_Models[][] =
  62. {
  63.     "models/zombie_escape/v_laevateinn_knife.mdl",
  64.     "models/zombie_escape/p_laevateinn_knife.mdl"
  65. }
  66.  
  67. new const WarHammer_Dark_Knight_Models[][] =
  68. {
  69.     "models/zombie_escape/v_WarHammer_dark_knight_knife.mdl",
  70.     "models/zombie_escape/p_WarHammer_dark_knight_knife.mdl"
  71. }
  72.  
  73. new const Balrog_Kosa_Models[][] =
  74. {
  75.     "models/zombie_escape/v_balrog_kosa_knife.mdl",
  76.     "models/zombie_escape/p_balrog_kosa_knife.mdl"
  77. }
  78.  
  79. new const WereWolf_Models[][] =
  80. {
  81.     "models/zombie_escape/v_axe_werewolf.mdl",
  82.     "models/zombie_escape/p_axe_werewolf.mdl"
  83. }
  84.  
  85. new const DeadMaster_Models[][] =
  86. {
  87.     "models/zombie_escape/v_deadmaster_scythe.mdl",
  88.     "models/zombie_escape/p_deadmaster_scythe.mdl"
  89. }
  90.  
  91. new const HammerChain_Models[][] =
  92. {
  93.     "models/zombie_escape/v_hammer_chain.mdl",
  94.     "models/zombie_escape/p_hammer_chain.mdl"
  95. }
  96.  
  97. new const Kataha_Models[][] =
  98. {
  99.     "models/zombie_escape/v_kataha.mdl",
  100.     "models/zombie_escape/p_kataha.mdl"
  101. }
  102.  
  103. new const Ranger_Models[][] =
  104. {
  105.     "models/zombie_escape/v_warhammer-ranger.mdl",
  106.     "models/zombie_escape/p_warhammer-ranger.mdl"
  107. }
  108.  
  109. // Sounds
  110. new const g_sound_knife[] = "items/gunpickup2.wav"
  111.  
  112. new const combat_sounds[][] =
  113. {
  114.     "zombie_escape/knife_menu/combat_deploy.wav",
  115.     "zombie_escape/knife_menu/combat_hit.wav",
  116.     "zombie_escape/knife_menu/combat_hit.wav",
  117.     "zombie_escape/knife_menu/combat_hit.wav",
  118.     "zombie_escape/knife_menu/combat_hit.wav",
  119.     "zombie_escape/knife_menu/combat_hitwall.wav",
  120.     "zombie_escape/knife_menu/combat_slash.wav",
  121.     "zombie_escape/knife_menu/combat_slash.wav",
  122.     "zombie_escape/knife_menu/combat_stab.wav"
  123. }
  124.  
  125. new const strong_sounds[][] =
  126. {
  127.     "zombie_escape/knife_menu/strong_deploy.wav",
  128.     "zombie_escape/knife_menu/strong_hit.wav",
  129.     "zombie_escape/knife_menu/strong_hit.wav",
  130.     "zombie_escape/knife_menu/strong_hit.wav",
  131.     "zombie_escape/knife_menu/strong_hit.wav",
  132.     "zombie_escape/knife_menu/strong_hitwall.wav",
  133.     "zombie_escape/knife_menu/strong_slash.wav",
  134.     "zombie_escape/knife_menu/strong_slash.wav",
  135.     "zombie_escape/knife_menu/strong_stab.wav"
  136. }
  137.  
  138. new const katana_sounds[][] =
  139. {
  140.     "zombie_escape/knife_menu/katana_deploy.wav",
  141.     "zombie_escape/knife_menu/katana_hit.wav",
  142.     "zombie_escape/knife_menu/katana_hit.wav",
  143.     "zombie_escape/knife_menu/katana_hit.wav",
  144.     "zombie_escape/knife_menu/katana_hit.wav",
  145.     "zombie_escape/knife_menu/katana_hitwall.wav",
  146.     "zombie_escape/knife_menu/katana_slash.wav",
  147.     "zombie_escape/knife_menu/katana_slash.wav",
  148.     "zombie_escape/knife_menu/katana_stab.wav"
  149. }
  150.  
  151. new const hammer_sounds[][] =
  152. {
  153.     "zombie_escape/knife_menu/hammer_deploy.wav",
  154.     "zombie_escape/knife_menu/hammer_hit.wav",
  155.     "zombie_escape/knife_menu/hammer_hit.wav",
  156.     "zombie_escape/knife_menu/hammer_hit.wav",
  157.     "zombie_escape/knife_menu/hammer_hit.wav",
  158.     "zombie_escape/knife_menu/hammer_hitwall.wav",
  159.     "zombie_escape/knife_menu/hammer_slash.wav",
  160.     "zombie_escape/knife_menu/hammer_slash.wav",
  161.     "zombie_escape/knife_menu/hammer_stab.wav"
  162. }
  163.  
  164. new const turbulent9_sounds[][] =
  165. {
  166.     "zombie_escape/knife_menu/turbulent9_deploy.wav",
  167.     "zombie_escape/knife_menu/turbulent9_hit.wav",
  168.     "zombie_escape/knife_menu/turbulent9_hit.wav",
  169.     "zombie_escape/knife_menu/turbulent9_hit.wav",
  170.     "zombie_escape/knife_menu/turbulent9_hit.wav",
  171.     "zombie_escape/knife_menu/turbulent9_hitwall.wav",
  172.     "zombie_escape/knife_menu/turbulent9_slash.wav",
  173.     "zombie_escape/knife_menu/turbulent9_slash.wav",
  174.     "zombie_escape/knife_menu/turbulent9_stab.wav"
  175. }
  176.  
  177. new const bio_sounds[][] =
  178. {
  179.     "zombie_escape/knife_menu/bio_deploy.wav",
  180.     "zombie_escape/knife_menu/bio_hit.wav",
  181.     "zombie_escape/knife_menu/bio_hit.wav",
  182.     "zombie_escape/knife_menu/bio_hit.wav",
  183.     "zombie_escape/knife_menu/bio_hit.wav",
  184.     "zombie_escape/knife_menu/bio_hitwall.wav",
  185.     "zombie_escape/knife_menu/bio_slash.wav",
  186.     "zombie_escape/knife_menu/bio_slash.wav",
  187.     "zombie_escape/knife_menu/bio_stab.wav"
  188. }
  189.  
  190. new const sabers_sounds[][] =
  191. {
  192.     "zombie_escape/knife_menu/laser_deploy.wav",
  193.     "zombie_escape/knife_menu/laser_hit.wav",
  194.     "zombie_escape/knife_menu/laser_hit.wav",
  195.     "zombie_escape/knife_menu/laser_hit.wav",
  196.     "zombie_escape/knife_menu/laser_hit.wav",
  197.     "zombie_escape/knife_menu/laser_hitwall.wav",
  198.     "zombie_escape/knife_menu/laser_slash1.wav",
  199.     "zombie_escape/knife_menu/laser_slash2.wav",
  200.     "zombie_escape/knife_menu/laser_stab.wav"
  201. }
  202.  
  203. new const plasma_sounds[][] =
  204. {
  205.     "zombie_escape/knife_menu/plasma_deploy.wav",
  206.     "zombie_escape/knife_menu/plasma_hit.wav",
  207.     "zombie_escape/knife_menu/plasma_hit.wav",
  208.     "zombie_escape/knife_menu/plasma_hit.wav",
  209.     "zombie_escape/knife_menu/plasma_hit.wav",
  210.     "zombie_escape/knife_menu/plasma_hitwall.wav",
  211.     "zombie_escape/knife_menu/plasma_slash.wav",
  212.     "zombie_escape/knife_menu/plasma_slash.wav",
  213.     "zombie_escape/knife_menu/plasma_stab.wav"
  214. }
  215.  
  216. new const storm_sounds[][] =
  217. {
  218.     "zombie_escape/knife_menu/storm_sword_deploy.wav",
  219.     "zombie_escape/knife_menu/storm_sword_hit.wav",
  220.     "zombie_escape/knife_menu/storm_sword_hit.wav",
  221.     "zombie_escape/knife_menu/storm_sword_hit.wav",
  222.     "zombie_escape/knife_menu/storm_sword_hit.wav",
  223.     "zombie_escape/knife_menu/storm_sword_hitwall.wav",
  224.     "zombie_escape/knife_menu/storm_sword_slash.wav",
  225.     "zombie_escape/knife_menu/storm_sword_slash.wav",
  226.     "zombie_escape/knife_menu/storm_sword_stab.wav"
  227. }
  228.  
  229. new const laevateinn_sounds[][] =
  230. {
  231.     "zombie_escape/knife_menu/laevateinn_deploy.wav",
  232.     "zombie_escape/knife_menu/laevateinn_hit.wav",
  233.     "zombie_escape/knife_menu/laevateinn_hit.wav",
  234.     "zombie_escape/knife_menu/laevateinn_hit.wav",
  235.     "zombie_escape/knife_menu/laevateinn_hit.wav",
  236.     "zombie_escape/knife_menu/laevateinn_hitwall.wav",
  237.     "zombie_escape/knife_menu/laevateinn_slash.wav",
  238.     "zombie_escape/knife_menu/laevateinn_slash.wav",
  239.     "zombie_escape/knife_menu/laevateinn_stab.wav"
  240. }
  241.  
  242. new const warhammer_dark_knight_sounds[][] =
  243. {
  244.     "zombie_escape/knife_menu/WarHammer_dark_knight_deploy.wav",
  245.     "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
  246.     "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
  247.     "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
  248.     "zombie_escape/knife_menu/WarHammer_dark_knight_hit.wav",
  249.     "zombie_escape/knife_menu/WarHammer_dark_knight_hitwall.wav",
  250.     "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
  251.     "zombie_escape/knife_menu/WarHammer_dark_knight_slash.wav",
  252.     "zombie_escape/knife_menu/WarHammer_dark_knight_stab.wav"
  253. }
  254.  
  255. new const balrog_kosa_sounds[][] =
  256. {
  257.     "zombie_escape/knife_menu/balrog_kosa_deploy.wav",
  258.     "zombie_escape/knife_menu/balrog_kosa_hit.wav",
  259.     "zombie_escape/knife_menu/balrog_kosa_hit.wav",
  260.     "zombie_escape/knife_menu/balrog_kosa_hit.wav",
  261.     "zombie_escape/knife_menu/balrog_kosa_hit.wav",
  262.     "zombie_escape/knife_menu/balrog_kosa_hitwall.wav",
  263.     "zombie_escape/knife_menu/balrog_kosa_slash.wav",
  264.     "zombie_escape/knife_menu/balrog_kosa_slash.wav",
  265.     "zombie_escape/knife_menu/balrog_kosa_stab.wav"
  266. }
  267.  
  268. new const oldknife_sounds[][] =
  269. {
  270.     "weapons/knife_deploy1.wav",
  271.     "weapons/knife_hit1.wav",
  272.     "weapons/knife_hit2.wav",
  273.     "weapons/knife_hit3.wav",
  274.     "weapons/knife_hit4.wav",
  275.     "weapons/knife_hitwall1.wav",
  276.     "weapons/knife_slash1.wav",
  277.     "weapons/knife_slash2.wav",
  278.     "weapons/knife_stab.wav"
  279. }
  280.  
  281. 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],
  282. bool:g_bStorm[33], bool:g_bLaevateinn[33], bool:g_bWarHammer_Dark_Knight[33], bool:g_bBalrog_Kosa[33], bool:g_bWereWolf[33], bool:g_bDeadMaster[33], bool:g_bHammerChain[33],
  283. bool:g_bKataha[33], bool:g_bRanger[33], bool:g_bNoSpeed, g_iUsedTimes[33], g_pCvarUseTimes
  284.  
  285. new cvar_speed_compat
  286. new cvar_speed_strong
  287. new cvar_speed_katana
  288. new cvar_speed_hammer
  289. new cvar_speed_turb
  290. new cvar_speed_bio
  291. new cvar_speed_sabers
  292. new cvar_speed_plasma
  293. new cvar_speed_storm
  294. new cvar_speed_laevat
  295. new cvar_speed_darknight
  296. new cvar_speed_kosa
  297. new cvar_speed_werewolf
  298. new cvar_speed_deadmaster
  299. new cvar_speed_hammerchain
  300. new cvar_speed_kataha
  301. new cvar_speed_ranger
  302.  
  303. public plugin_precache()
  304. {
  305.     new i
  306.  
  307.     for (i = 0; i <= charsmax(Compat_Models); i++)
  308.         precache_model(Compat_Models[i])
  309.  
  310.     for (i = 0; i <= charsmax(Hammer_Models); i++)
  311.         precache_model(Hammer_Models[i])
  312.  
  313.     for (i = 0; i <= charsmax(Katana_Models); i++)
  314.         precache_model(Katana_Models[i])
  315.  
  316.     for (i = 0; i <= charsmax(Strong_Models); i++)
  317.         precache_model(Strong_Models[i])
  318.  
  319.     for (i = 0; i <= charsmax(Turbulent9_Models); i++)
  320.         precache_model(Turbulent9_Models[i])
  321.  
  322.     for (i = 0; i <= charsmax(Bio_Models); i++)
  323.         precache_model(Bio_Models[i])
  324.  
  325.     for (i = 0; i <= charsmax(Sabers_Models); i++)
  326.         precache_model(Sabers_Models[i])
  327.  
  328.     for (i = 0; i <= charsmax(Plasma_Models); i++)
  329.         precache_model(Plasma_Models[i])
  330.  
  331.     for (i = 0; i <= charsmax(Storm_Models); i++)
  332.         precache_model(Storm_Models[i])
  333.  
  334.     for (i = 0; i <= charsmax(Laevateinn_Models); i++)
  335.         precache_model(Laevateinn_Models[i])
  336.  
  337.     for (i = 0; i <= charsmax(WarHammer_Dark_Knight_Models); i++)
  338.         precache_model(WarHammer_Dark_Knight_Models[i])
  339.  
  340.     for (i = 0; i <= charsmax(Balrog_Kosa_Models); i++)
  341.         precache_model(Balrog_Kosa_Models[i])
  342.        
  343.     for (i = 0; i <= charsmax(WereWolf_Models); i++)
  344.         precache_model(WereWolf_Models[i])
  345.  
  346.     for (i = 0; i <= charsmax(DeadMaster_Models); i++)
  347.         precache_model(DeadMaster_Models[i])
  348.  
  349.     for (i = 0; i <= charsmax(HammerChain_Models); i++)
  350.         precache_model(HammerChain_Models[i])
  351.  
  352.     for (i = 0; i <= charsmax(Kataha_Models); i++)
  353.         precache_model(Kataha_Models[i])
  354.  
  355.     for (i = 0; i <= charsmax(Ranger_Models); i++)
  356.         precache_model(Ranger_Models[i])
  357.  
  358.     for (i = 0; i <= charsmax(combat_sounds); i++)
  359.         precache_sound(combat_sounds[i])
  360.  
  361.     for (i = 0; i <= charsmax(strong_sounds); i++)
  362.         precache_sound(strong_sounds[i])
  363.  
  364.     for (i = 0; i <= charsmax(katana_sounds); i++)
  365.         precache_sound(katana_sounds[i])
  366.  
  367.     for (i = 0; i <= charsmax(hammer_sounds); i++)
  368.         precache_sound(hammer_sounds[i])
  369.  
  370.     for (i = 0; i <= charsmax(turbulent9_sounds); i++)
  371.         precache_sound(turbulent9_sounds[i])
  372.  
  373.     for (i = 0; i <= charsmax(bio_sounds); i++)
  374.         precache_sound(bio_sounds[i])
  375.  
  376.     for (i = 0; i <= charsmax(sabers_sounds); i++)
  377.         precache_sound(sabers_sounds[i])
  378.  
  379.     for (i = 0; i <= charsmax(plasma_sounds); i++)
  380.         precache_sound(plasma_sounds[i])
  381.  
  382.     for (i = 0; i <= charsmax(storm_sounds); i++)
  383.         precache_sound(storm_sounds[i])
  384.  
  385.     for (i = 0; i <= charsmax(laevateinn_sounds); i++)
  386.         precache_sound(laevateinn_sounds[i])
  387.  
  388.     for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
  389.         precache_sound(warhammer_dark_knight_sounds[i])
  390.  
  391.     for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
  392.         precache_sound(balrog_kosa_sounds[i])
  393.  
  394.     precache_sound(g_sound_knife)
  395. }
  396.  
  397. public plugin_natives()
  398. {
  399.     register_native("ze_open_knife_menu", "native_ze_open_knife_menu", 1)
  400. }
  401.  
  402. public plugin_init()
  403. {
  404.     register_plugin("[ZE] Addon: Knife Menu", "1.3", "Mark")
  405.  
  406.     register_forward(FM_EmitSound, "fw_EmitSound")
  407.     register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
  408.  
  409.     register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
  410.     RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "Fw_RestMaxSpeed_Post", 1)
  411.    
  412.     g_pCvarUseTimes = register_cvar("ze_knife_menu_use_times", "2")
  413.  
  414.     register_message(get_user_msgid("DeathMsg"), "DeathMsg")
  415.  
  416.     register_clcmd("say /k", "Show_Knife_Menu")
  417.    
  418.     cvar_speed_compat = register_cvar("ze_compat_speed", "275.0")
  419.     cvar_speed_strong = register_cvar("ze_strong_speed", "275.0")
  420.     cvar_speed_katana = register_cvar("ze_katana_speed", "275.0")
  421.     cvar_speed_hammer = register_cvar("ze_hammer_speed", "275.0")
  422.     cvar_speed_turb = register_cvar("ze_turb_speed", "280.0")    
  423.     cvar_speed_bio = register_cvar("ze_bio_speed", "280.0")
  424.     cvar_speed_sabers = register_cvar("ze_sabers_speed", "285.0")
  425.     cvar_speed_plasma = register_cvar("ze_plasma_speed", "285.0")
  426.     cvar_speed_storm = register_cvar("ze_storm_speed", "290.0")    
  427.     cvar_speed_laevat = register_cvar("ze_laevat_speed", "290.0")  
  428.     cvar_speed_darknight = register_cvar("ze_darknight_speed", "295.0")
  429.     cvar_speed_kosa = register_cvar("ze_kosa_speed", "295.0")
  430.     cvar_speed_werewolf = register_cvar("ze_werewolf_speed", "310.0")
  431.     cvar_speed_deadmaster = register_cvar("ze_deadmaster_speed", "310.0")    
  432.     cvar_speed_hammerchain = register_cvar("ze_hammerchain_speed", "310.0")  
  433.     cvar_speed_kataha = register_cvar("ze_kataha_speed", "310.0")
  434.     cvar_speed_ranger = register_cvar("ze_ranger_speed", "310.0")
  435. }
  436.  
  437. public ze_user_humanized(id)
  438. {
  439.     g_iUsedTimes[id] = 0
  440. }
  441.  
  442. /*public ze_user_infected(Victim)
  443. {
  444.     g_bCompat[Victim] = false
  445.     g_bStrong[Victim] = false
  446.     g_bKatana[Victim] = false
  447.     g_bHammer[Victim] = false
  448.     g_bTurbulent9[Victim] = false
  449.     g_bBio[Victim] = false
  450.     g_bSabers[Victim] = false
  451.     g_bPlasma[Victim] = false
  452.     g_bStorm[Victim] = false
  453.     g_bLaevateinn[Victim] = false
  454.     g_bWarHammer_Dark_Knight[Victim] = false
  455.     g_bBalrog_Kosa[Victim] = false
  456.     g_iUsedTimes[Victim] = 0
  457. }*/
  458.  
  459. public client_putinserver(id)
  460. {
  461.     g_bCompat[id] = false
  462.     g_bStrong[id] = false
  463.     g_bKatana[id] = false
  464.     g_bHammer[id] = false
  465.     g_bTurbulent9[id] = false
  466.     g_bBio[id] = false
  467.     g_bSabers[id] = false
  468.     g_bPlasma[id] = false
  469.     g_bStorm[id] = false
  470.     g_bLaevateinn[id] = false
  471.     g_bWarHammer_Dark_Knight[id] = false
  472.     g_bBalrog_Kosa[id] = false
  473.     g_bWereWolf[id] = false
  474.     g_bDeadMaster[id] = false
  475.     g_bHammerChain[id] = false
  476.     g_bKataha[id] = false
  477.     g_bRanger[id] = false
  478.     g_iUsedTimes[id] = 0
  479. }
  480.  
  481. public client_disconnected(id)
  482. {
  483.     g_bCompat[id] = false
  484.     g_bStrong[id] = false
  485.     g_bKatana[id] = false
  486.     g_bHammer[id] = false
  487.     g_bTurbulent9[id] = false
  488.     g_bBio[id] = false
  489.     g_bSabers[id] = false
  490.     g_bPlasma[id] = false
  491.     g_bStorm[id] = false
  492.     g_bLaevateinn[id] = false
  493.     g_bWarHammer_Dark_Knight[id] = false
  494.     g_bBalrog_Kosa[id] = false
  495.     g_bWereWolf[id] = false
  496.     g_bDeadMaster[id] = false
  497.     g_bHammerChain[id] = false
  498.     g_bKataha[id] = false
  499.     g_bRanger[id] = false
  500.     g_iUsedTimes[id] = 0
  501. }
  502.  
  503. public ze_game_started()
  504. {
  505.     g_bNoSpeed = true
  506. }
  507.  
  508. public ze_zombie_release()
  509. {
  510.     g_bNoSpeed = false
  511.    
  512.     // call the reset speed function ;)
  513.     for(new id = 1; id <= 32; id++)
  514.     {
  515.         if (!is_user_alive(id))
  516.             continue;
  517.        
  518.         rg_reset_maxspeed(id)
  519.     }
  520. }
  521.  
  522. public Show_Knife_Menu(id)
  523. {
  524.     if (!is_user_connected(id))
  525.         return PLUGIN_CONTINUE
  526.  
  527.     if (ze_is_user_zombie(id))
  528.     {
  529.         ze_colored_print(id, "!tZombies can't open knife menu!y.")
  530.         return PLUGIN_HANDLED
  531.     }
  532.  
  533.     if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
  534.     {
  535.         ze_colored_print(id, "!tYou can only open knife menu !y[!g%dx!y] per round!", get_pcvar_num(g_pCvarUseTimes))
  536.         return PLUGIN_HANDLED
  537.     }
  538.  
  539.     if (!is_user_alive(id))
  540.     {
  541.         ze_colored_print(id, "!tDead can't open knife menu!y.")
  542.         return PLUGIN_HANDLED
  543.     }
  544.  
  545.     Knife_Menu(id)
  546.     return PLUGIN_CONTINUE
  547. }
  548.  
  549. public Knife_Menu(id)
  550. {
  551.     new iMenu = menu_create("\rChoose Your Knife\w:^n^n- [ \ySpeed \rActivates \yon Zombie Release!\w ]^n-", "Menu_Handler")
  552.     menu_additem(iMenu, "\yCombat \w[ \r275 Speed\w ]", "", 0)
  553.     menu_additem(iMenu, "\yStrong \w[ \r275 Speed\w ]", "", 0)
  554.     menu_additem(iMenu, "\yKatana \w[ \r275 Speed\w ]", "", 0)
  555.     menu_additem(iMenu, "\yHammer \w[ \r275 Speed\w ]", "", 0)
  556.     menu_additem(iMenu, "\yTurbulent9 \w[ \r280 Speed\w ]", "", 0)
  557.     menu_additem(iMenu, "\yBio Hazard \w[ \r280 Speed\w ]", "", 0)
  558.     menu_additem(iMenu, "\ySabers \w[ \r285 Speed\w ]", "", 0)
  559.     menu_additem(iMenu, "\yPlasma \w[ \r285 Speed\w ]", "", 0)
  560.     menu_additem(iMenu, "\yStorm \w[ \r290 Speed\w ]", "", 0)
  561.     menu_additem(iMenu, "\yLaevateinn \w[ \r290 Speed\w ]", "", 0)
  562.     menu_additem(iMenu, "\yWarHammer Dark Night \w [ \r290 Speed\w ]", "", 0)
  563.     menu_additem(iMenu, "\yBalrog Kosa \w[ \r290 Speed\w ]", "", 0)
  564.     menu_additem(iMenu, "\yWere Wolf \w[ \r310 Speed\w ]", "", 0)
  565.     menu_additem(iMenu, "\yDead Master \w[ \r310 Speed\w ]", "", 0)
  566.     menu_additem(iMenu, "\yHammer Chain \w[ \r310 Speed\w ]", "", 0)
  567.     menu_additem(iMenu, "\yKataha \w[ \r310 Speed\w ]", "", 0)
  568.     menu_additem(iMenu, "\yWarHammer Ranger \w[ \r310 Speed\w ]", "", 0)
  569.     menu_setprop(iMenu,MPROP_PERPAGE, 6)
  570.     menu_setprop(iMenu,MPROP_EXITNAME,"\rClose")
  571.     menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
  572.     menu_display(id, iMenu, 0)
  573. }
  574.  
  575. public Menu_Handler(id, iMenu, iKey)
  576. {
  577.     if(!is_user_alive(id) || ze_is_user_zombie(id))
  578.         return PLUGIN_HANDLED
  579.        
  580.     switch(iKey)
  581.     {
  582.         case 0: // Compat
  583.         {
  584.             g_bCompat[id] = true
  585.             g_bStrong[id] = false
  586.             g_bKatana[id] = false
  587.             g_bHammer[id] = false
  588.             g_bTurbulent9[id] = false
  589.             g_bBio[id] = false
  590.             g_bSabers[id] = false
  591.             g_bPlasma[id] = false
  592.             g_bStorm[id] = false
  593.             g_bLaevateinn[id] = false
  594.             g_bWarHammer_Dark_Knight[id] = false
  595.             g_bBalrog_Kosa[id] = false
  596.             g_bWereWolf[id] = false
  597.             g_bDeadMaster[id] = false
  598.             g_bHammerChain[id] = false
  599.             g_bKataha[id] = false
  600.             g_bRanger[id] = false
  601.             g_iUsedTimes[id]++
  602.             rg_remove_item(id, "weapon_knife")
  603.             rg_give_item(id, "weapon_knife", GT_APPEND)
  604.             //engclient_cmd(id, "weapon_knife")
  605.             //rg_reset_maxspeed(id)
  606.             //g_iUsedTimes[id]++
  607.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
  608.         }
  609.         case 1: // Strong
  610.         {
  611.             g_bCompat[id] = false
  612.             g_bStrong[id] = true
  613.             g_bKatana[id] = false
  614.             g_bHammer[id] = false
  615.             g_bTurbulent9[id] = false
  616.             g_bBio[id] = false
  617.             g_bSabers[id] = false
  618.             g_bPlasma[id] = false
  619.             g_bStorm[id] = false
  620.             g_bLaevateinn[id] = false
  621.             g_bWarHammer_Dark_Knight[id] = false
  622.             g_bBalrog_Kosa[id] = false
  623.             g_bWereWolf[id] = false
  624.             g_bDeadMaster[id] = false
  625.             g_bHammerChain[id] = false
  626.             g_bKataha[id] = false
  627.             g_bRanger[id] = false
  628.             g_iUsedTimes[id]++
  629.             rg_remove_item(id, "weapon_knife")
  630.             rg_give_item(id, "weapon_knife", GT_APPEND)
  631.             //engclient_cmd(id, "weapon_knife")
  632.             //g_iUsedTimes[id]++
  633.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
  634.         }
  635.         case 2: // Katana
  636.         {
  637.             g_bCompat[id] = false
  638.             g_bStrong[id] = false
  639.             g_bKatana[id] = true
  640.             g_bHammer[id] = false
  641.             g_bTurbulent9[id] = false
  642.             g_bBio[id] = false
  643.             g_bSabers[id] = false
  644.             g_bPlasma[id] = false
  645.             g_bStorm[id] = false
  646.             g_bLaevateinn[id] = false
  647.             g_bWarHammer_Dark_Knight[id] = false
  648.             g_bBalrog_Kosa[id] = false
  649.             g_bWereWolf[id] = false
  650.             g_bDeadMaster[id] = false
  651.             g_bHammerChain[id] = false
  652.             g_bKataha[id] = false
  653.             g_bRanger[id] = false
  654.             g_iUsedTimes[id]++
  655.             rg_remove_item(id, "weapon_knife")
  656.             rg_give_item(id, "weapon_knife", GT_APPEND)
  657.             //engclient_cmd(id, "weapon_knife")
  658.             //g_iUsedTimes[id]++
  659.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  660.         }
  661.         case 3: // Hammer
  662.         {
  663.             g_bCompat[id] = false
  664.             g_bStrong[id] = false
  665.             g_bKatana[id] = false
  666.             g_bHammer[id] = true
  667.             g_bTurbulent9[id] = false
  668.             g_bBio[id] = false
  669.             g_bSabers[id] = false
  670.             g_bPlasma[id] = false
  671.             g_bStorm[id] = false
  672.             g_bLaevateinn[id] = false
  673.             g_bWarHammer_Dark_Knight[id] = false
  674.             g_bBalrog_Kosa[id] = false
  675.             g_bWereWolf[id] = false
  676.             g_bDeadMaster[id] = false
  677.             g_bHammerChain[id] = false
  678.             g_bKataha[id] = false
  679.             g_bRanger[id] = false
  680.             g_iUsedTimes[id]++
  681.             rg_remove_item(id, "weapon_knife")
  682.             rg_give_item(id, "weapon_knife", GT_APPEND)
  683.             //engclient_cmd(id, "weapon_knife")
  684.             //g_iUsedTimes[id]++
  685.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  686.         }
  687.         case 4: // Turbulent
  688.         {
  689.  
  690.             g_bCompat[id] = false
  691.             g_bStrong[id] = false
  692.             g_bKatana[id] = false
  693.             g_bHammer[id] = false
  694.             g_bTurbulent9[id] = true
  695.             g_bBio[id] = false
  696.             g_bSabers[id] = false
  697.             g_bPlasma[id] = false
  698.             g_bStorm[id] = false
  699.             g_bLaevateinn[id] = false
  700.             g_bWarHammer_Dark_Knight[id] = false
  701.             g_bBalrog_Kosa[id] = false
  702.             g_bWereWolf[id] = false
  703.             g_bDeadMaster[id] = false
  704.             g_bHammerChain[id] = false
  705.             g_bKataha[id] = false
  706.             g_bRanger[id] = false
  707.             g_iUsedTimes[id]++
  708.             rg_remove_item(id, "weapon_knife")
  709.             rg_give_item(id, "weapon_knife", GT_APPEND)
  710.             //engclient_cmd(id, "weapon_knife")
  711.             //g_iUsedTimes[id]++
  712.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  713.            
  714.         }
  715.         case 5: // Bio
  716.         {
  717.  
  718.             g_bCompat[id] = false
  719.             g_bStrong[id] = false
  720.             g_bKatana[id] = false
  721.             g_bHammer[id] = false
  722.             g_bTurbulent9[id] = false
  723.             g_bBio[id] = true
  724.             g_bSabers[id] = false
  725.             g_bPlasma[id] = false
  726.             g_bStorm[id] = false
  727.             g_bLaevateinn[id] = false
  728.             g_bWarHammer_Dark_Knight[id] = false
  729.             g_bBalrog_Kosa[id] = false
  730.             g_bWereWolf[id] = false
  731.             g_bDeadMaster[id] = false
  732.             g_bHammerChain[id] = false
  733.             g_bKataha[id] = false
  734.             g_bRanger[id] = false
  735.             g_iUsedTimes[id]++
  736.             rg_remove_item(id, "weapon_knife")
  737.             rg_give_item(id, "weapon_knife", GT_APPEND)
  738.             //engclient_cmd(id, "weapon_knife")
  739.             //g_iUsedTimes[id]++
  740.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  741.            
  742.         }
  743.         case 6: // Sabers
  744.         {
  745.  
  746.             g_bCompat[id] = false
  747.             g_bStrong[id] = false
  748.             g_bKatana[id] = false
  749.             g_bHammer[id] = false
  750.             g_bTurbulent9[id] = false
  751.             g_bBio[id] = false
  752.             g_bSabers[id] = true
  753.             g_bPlasma[id] = false
  754.             g_bStorm[id] = false
  755.             g_bLaevateinn[id] = false
  756.             g_bWarHammer_Dark_Knight[id] = false
  757.             g_bBalrog_Kosa[id] = false
  758.             g_bWereWolf[id] = false
  759.             g_bDeadMaster[id] = false
  760.             g_bHammerChain[id] = false
  761.             g_bKataha[id] = false
  762.             g_bRanger[id] = false
  763.             g_iUsedTimes[id]++
  764.             rg_remove_item(id, "weapon_knife")
  765.             rg_give_item(id, "weapon_knife", GT_APPEND)
  766.             //engclient_cmd(id, "weapon_knife")
  767.             //g_iUsedTimes[id]++
  768.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  769.            
  770.         }
  771.         case 7: // Plasma
  772.         {
  773.  
  774.             g_bCompat[id] = false
  775.             g_bStrong[id] = false
  776.             g_bKatana[id] = false
  777.             g_bHammer[id] = false
  778.             g_bTurbulent9[id] = false
  779.             g_bBio[id] = false
  780.             g_bSabers[id] = false
  781.             g_bPlasma[id] = true
  782.             g_bStorm[id] = false
  783.             g_bLaevateinn[id] = false
  784.             g_bWarHammer_Dark_Knight[id] = false
  785.             g_bBalrog_Kosa[id] = false
  786.             g_bWereWolf[id] = false
  787.             g_bDeadMaster[id] = false
  788.             g_bHammerChain[id] = false
  789.             g_bKataha[id] = false
  790.             g_bRanger[id] = false
  791.             g_iUsedTimes[id]++
  792.             rg_remove_item(id, "weapon_knife")
  793.             rg_give_item(id, "weapon_knife", GT_APPEND)
  794.             //engclient_cmd(id, "weapon_knife")
  795.             //g_iUsedTimes[id]++
  796.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  797.            
  798.         }
  799.         case 8: // Storm
  800.         {
  801.  
  802.             g_bCompat[id] = false
  803.             g_bStrong[id] = false
  804.             g_bKatana[id] = false
  805.             g_bHammer[id] = false
  806.             g_bTurbulent9[id] = false
  807.             g_bBio[id] = false
  808.             g_bSabers[id] = false
  809.             g_bPlasma[id] = false
  810.             g_bStorm[id] = true
  811.             g_bLaevateinn[id] = false
  812.             g_bWarHammer_Dark_Knight[id] = false
  813.             g_bBalrog_Kosa[id] = false
  814.             g_bWereWolf[id] = false
  815.             g_bDeadMaster[id] = false
  816.             g_bHammerChain[id] = false
  817.             g_bKataha[id] = false
  818.             g_bRanger[id] = false
  819.             g_iUsedTimes[id]++
  820.             rg_remove_item(id, "weapon_knife")
  821.             rg_give_item(id, "weapon_knife", GT_APPEND)
  822.             //engclient_cmd(id, "weapon_knife")
  823.             //g_iUsedTimes[id]++
  824.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  825.  
  826.         }
  827.         case 9: // Laevateinn
  828.         {
  829.  
  830.             g_bCompat[id] = false
  831.             g_bStrong[id] = false
  832.             g_bKatana[id] = false
  833.             g_bHammer[id] = false
  834.             g_bTurbulent9[id] = false
  835.             g_bBio[id] = false
  836.             g_bSabers[id] = false
  837.             g_bPlasma[id] = false
  838.             g_bStorm[id] = false
  839.             g_bLaevateinn[id] = true
  840.             g_bWarHammer_Dark_Knight[id] = false
  841.             g_bBalrog_Kosa[id] = false
  842.             g_bWereWolf[id] = false
  843.             g_bDeadMaster[id] = false
  844.             g_bHammerChain[id] = false
  845.             g_bKataha[id] = false
  846.             g_bRanger[id] = false
  847.             g_iUsedTimes[id]++
  848.             rg_remove_item(id, "weapon_knife")
  849.             rg_give_item(id, "weapon_knife", GT_APPEND)
  850.             //engclient_cmd(id, "weapon_knife")
  851.             //g_iUsedTimes[id]++
  852.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  853.  
  854.         }
  855.         case 10: // Warhammer Dark Night
  856.         {
  857.  
  858.             g_bCompat[id] = false
  859.             g_bStrong[id] = false
  860.             g_bKatana[id] = false
  861.             g_bHammer[id] = false
  862.             g_bTurbulent9[id] = false
  863.             g_bBio[id] = false
  864.             g_bSabers[id] = false
  865.             g_bPlasma[id] = false
  866.             g_bStorm[id] = false
  867.             g_bLaevateinn[id] = false
  868.             g_bWarHammer_Dark_Knight[id] = true
  869.             g_bBalrog_Kosa[id] = false
  870.             g_bWereWolf[id] = false
  871.             g_bDeadMaster[id] = false
  872.             g_bHammerChain[id] = false
  873.             g_bKataha[id] = false
  874.             g_bRanger[id] = false
  875.             g_iUsedTimes[id]++
  876.             rg_remove_item(id, "weapon_knife")
  877.             rg_give_item(id, "weapon_knife", GT_APPEND)
  878.             //engclient_cmd(id, "weapon_knife")
  879.             //g_iUsedTimes[id]++
  880.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  881.        
  882.         }
  883.         case 11: // Balrog Kosa
  884.         {
  885.  
  886.             g_bCompat[id] = false
  887.             g_bStrong[id] = false
  888.             g_bKatana[id] = false
  889.             g_bHammer[id] = false
  890.             g_bTurbulent9[id] = false
  891.             g_bBio[id] = false
  892.             g_bSabers[id] = false
  893.             g_bPlasma[id] = false
  894.             g_bStorm[id] = false
  895.             g_bLaevateinn[id] = false
  896.             g_bWarHammer_Dark_Knight[id] = false
  897.             g_bBalrog_Kosa[id] = true
  898.             g_bWereWolf[id] = false
  899.             g_bDeadMaster[id] = false
  900.             g_bHammerChain[id] = false
  901.             g_bKataha[id] = false
  902.             g_bRanger[id] = false
  903.             g_iUsedTimes[id]++
  904.             rg_remove_item(id, "weapon_knife")
  905.             rg_give_item(id, "weapon_knife", GT_APPEND)
  906.             //engclient_cmd(id, "weapon_knife")
  907.             //g_iUsedTimes[id]++
  908.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  909.            
  910.         }
  911.         case 12: // Were Wolf
  912.         {
  913.  
  914.             g_bCompat[id] = false
  915.             g_bStrong[id] = false
  916.             g_bKatana[id] = false
  917.             g_bHammer[id] = false
  918.             g_bTurbulent9[id] = false
  919.             g_bBio[id] = false
  920.             g_bSabers[id] = false
  921.             g_bPlasma[id] = false
  922.             g_bStorm[id] = false
  923.             g_bLaevateinn[id] = false
  924.             g_bWarHammer_Dark_Knight[id] = false
  925.             g_bBalrog_Kosa[id] = false
  926.             g_bWereWolf[id] = true
  927.             g_bDeadMaster[id] = false
  928.             g_bHammerChain[id] = false
  929.             g_bKataha[id] = false
  930.             g_bRanger[id] = false
  931.             g_iUsedTimes[id]++
  932.             rg_remove_item(id, "weapon_knife")
  933.             rg_give_item(id, "weapon_knife", GT_APPEND)
  934.             //engclient_cmd(id, "weapon_knife")
  935.             //g_iUsedTimes[id]++
  936.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  937.            
  938.         }
  939.         case 13: // Dead Master
  940.         {
  941.  
  942.             g_bCompat[id] = false
  943.             g_bStrong[id] = false
  944.             g_bKatana[id] = false
  945.             g_bHammer[id] = false
  946.             g_bTurbulent9[id] = false
  947.             g_bBio[id] = false
  948.             g_bSabers[id] = false
  949.             g_bPlasma[id] = false
  950.             g_bStorm[id] = false
  951.             g_bLaevateinn[id] = false
  952.             g_bWarHammer_Dark_Knight[id] = false
  953.             g_bBalrog_Kosa[id] = false
  954.             g_bWereWolf[id] = false
  955.             g_bDeadMaster[id] = true
  956.             g_bHammerChain[id] = false
  957.             g_bKataha[id] = false
  958.             g_bRanger[id] = false
  959.             g_iUsedTimes[id]++
  960.             rg_remove_item(id, "weapon_knife")
  961.             rg_give_item(id, "weapon_knife", GT_APPEND)
  962.             //engclient_cmd(id, "weapon_knife")
  963.             //g_iUsedTimes[id]++
  964.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  965.            
  966.         }
  967.         case 14: // Hammer Chain
  968.         {
  969.  
  970.             g_bCompat[id] = false
  971.             g_bStrong[id] = false
  972.             g_bKatana[id] = false
  973.             g_bHammer[id] = false
  974.             g_bTurbulent9[id] = false
  975.             g_bBio[id] = false
  976.             g_bSabers[id] = false
  977.             g_bPlasma[id] = false
  978.             g_bStorm[id] = false
  979.             g_bLaevateinn[id] = false
  980.             g_bWarHammer_Dark_Knight[id] = false
  981.             g_bBalrog_Kosa[id] = false
  982.             g_bWereWolf[id] = false
  983.             g_bDeadMaster[id] = false
  984.             g_bHammerChain[id] = true
  985.             g_bKataha[id] = false
  986.             g_bRanger[id] = false
  987.             g_iUsedTimes[id]++
  988.             rg_remove_item(id, "weapon_knife")
  989.             rg_give_item(id, "weapon_knife", GT_APPEND)
  990.             //engclient_cmd(id, "weapon_knife")
  991.             //g_iUsedTimes[id]++
  992.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  993.            
  994.         }
  995.         case 15: // Kataha
  996.         {
  997.  
  998.             g_bCompat[id] = false
  999.             g_bStrong[id] = false
  1000.             g_bKatana[id] = false
  1001.             g_bHammer[id] = false
  1002.             g_bTurbulent9[id] = false
  1003.             g_bBio[id] = false
  1004.             g_bSabers[id] = false
  1005.             g_bPlasma[id] = false
  1006.             g_bStorm[id] = false
  1007.             g_bLaevateinn[id] = false
  1008.             g_bWarHammer_Dark_Knight[id] = false
  1009.             g_bBalrog_Kosa[id] = false
  1010.             g_bWereWolf[id] = false
  1011.             g_bDeadMaster[id] = false
  1012.             g_bHammerChain[id] = false
  1013.             g_bKataha[id] = true
  1014.             g_bRanger[id] = false
  1015.             g_iUsedTimes[id]++
  1016.             rg_remove_item(id, "weapon_knife")
  1017.             rg_give_item(id, "weapon_knife", GT_APPEND)
  1018.             //engclient_cmd(id, "weapon_knife")
  1019.             //g_iUsedTimes[id]++
  1020.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  1021.            
  1022.         }      
  1023.         case 16: // WarHammer Ranger
  1024.         {
  1025.             g_bCompat[id] = false
  1026.             g_bStrong[id] = false
  1027.             g_bKatana[id] = false
  1028.             g_bHammer[id] = false
  1029.             g_bTurbulent9[id] = false
  1030.             g_bBio[id] = false
  1031.             g_bSabers[id] = false
  1032.             g_bPlasma[id] = false
  1033.             g_bStorm[id] = false
  1034.             g_bLaevateinn[id] = false
  1035.             g_bWarHammer_Dark_Knight[id] = false
  1036.             g_bBalrog_Kosa[id] = false
  1037.             g_bWereWolf[id] = false
  1038.             g_bDeadMaster[id] = false
  1039.             g_bHammerChain[id] = false
  1040.             g_bKataha[id] = false
  1041.             g_bRanger[id] = true
  1042.             g_iUsedTimes[id]++
  1043.             rg_remove_item(id, "weapon_knife")
  1044.             rg_give_item(id, "weapon_knife", GT_APPEND)
  1045.             //engclient_cmd(id, "weapon_knife")
  1046.             //g_iUsedTimes[id]++
  1047.             //emit_sound(id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)*/
  1048.            
  1049.         }
  1050.     }
  1051.  
  1052.     menu_destroy(iMenu)
  1053.     return PLUGIN_HANDLED
  1054. }
  1055.  
  1056. public fw_EmitSound(id, channel, const sound[])
  1057. {
  1058.     if(!is_user_alive(id) || ze_is_user_zombie(id))
  1059.         return FMRES_IGNORED
  1060.        
  1061.     new i
  1062.     for (i = 0; i <= charsmax(combat_sounds); i++)
  1063.     for (i = 0; i <= charsmax(strong_sounds); i++)
  1064.     for (i = 0; i <= charsmax(katana_sounds); i++)
  1065.     for (i = 0; i <= charsmax(hammer_sounds); i++)
  1066.     for (i = 0; i <= charsmax(turbulent9_sounds); i++)
  1067.     for (i = 0; i <= charsmax(bio_sounds); i++)
  1068.     for (i = 0; i <= charsmax(sabers_sounds); i++)
  1069.     for (i = 0; i <= charsmax(plasma_sounds); i++)
  1070.     for (i = 0; i <= charsmax(storm_sounds); i++)
  1071.     for (i = 0; i <= charsmax(laevateinn_sounds); i++)
  1072.     for (i = 0; i <= charsmax(warhammer_dark_knight_sounds); i++)
  1073.     for (i = 0; i <= charsmax(balrog_kosa_sounds); i++)
  1074.     {
  1075.         if(equal(sound, oldknife_sounds[i]))
  1076.         {
  1077.             if (g_bCompat[id])
  1078.             {
  1079.                 emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1080.                 return FMRES_SUPERCEDE
  1081.             }
  1082.             else if (g_bStrong[id])
  1083.             {
  1084.                 emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1085.                 return FMRES_SUPERCEDE
  1086.             }
  1087.             else if (g_bKatana[id])
  1088.             {
  1089.                 emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1090.                 return FMRES_SUPERCEDE
  1091.             }
  1092.             else if (g_bHammer[id])
  1093.             {
  1094.                 emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1095.                 return FMRES_SUPERCEDE
  1096.             }
  1097.             else if (g_bTurbulent9[id])
  1098.             {
  1099.                 emit_sound(id, channel, turbulent9_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1100.                 return FMRES_SUPERCEDE
  1101.             }
  1102.             else if (g_bBio[id])
  1103.             {
  1104.                 emit_sound(id, channel, bio_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1105.                 return FMRES_SUPERCEDE
  1106.             }
  1107.             else if (g_bSabers[id])
  1108.             {
  1109.                 emit_sound(id, channel, sabers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1110.                 return FMRES_SUPERCEDE
  1111.             }
  1112.             else if (g_bPlasma[id])
  1113.             {
  1114.                 emit_sound(id, channel, plasma_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1115.                 return FMRES_SUPERCEDE
  1116.             }
  1117.             else if (g_bStorm[id])
  1118.             {
  1119.                 emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1120.                 return FMRES_SUPERCEDE
  1121.             }
  1122.             else if (g_bLaevateinn[id])
  1123.             {
  1124.                 emit_sound(id, channel, laevateinn_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1125.                 return FMRES_SUPERCEDE
  1126.             }
  1127.             else if (g_bWarHammer_Dark_Knight[id])
  1128.             {
  1129.                 emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1130.                 return FMRES_SUPERCEDE
  1131.             }
  1132.             else if (g_bBalrog_Kosa[id])
  1133.             {
  1134.                 emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1135.                 return FMRES_SUPERCEDE
  1136.             }
  1137.             else if (g_bWereWolf[id])
  1138.             {
  1139.                 emit_sound(id, channel, storm_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1140.                 return FMRES_SUPERCEDE
  1141.             }
  1142.             else if (g_bDeadMaster[id])
  1143.             {
  1144.                 emit_sound(id, channel, balrog_kosa_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1145.                 return FMRES_SUPERCEDE
  1146.             }
  1147.             else if (g_bHammerChain[id])
  1148.             {
  1149.                 emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1150.                 return FMRES_SUPERCEDE
  1151.             }
  1152.             else if (g_bKataha[id])
  1153.             {
  1154.                 emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1155.                 return FMRES_SUPERCEDE
  1156.             }
  1157.             else if (g_bRanger[id])
  1158.             {
  1159.                 emit_sound(id, channel, warhammer_dark_knight_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1160.                 return FMRES_SUPERCEDE
  1161.             }
  1162.             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])
  1163.             {
  1164.                 emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1165.                 return FMRES_SUPERCEDE
  1166.             }
  1167.         }
  1168.     }
  1169.     return FMRES_IGNORED
  1170. }
  1171.  
  1172. public CurrentWeapon(id)
  1173. {
  1174.     if(!is_user_alive(id) || ze_is_user_zombie(id))
  1175.         return
  1176.        
  1177.     if(get_user_weapon(id) & CSW_KNIFE)
  1178.     {
  1179.         if(g_bCompat[id])
  1180.         {
  1181.             cs_set_player_view_model(id, CSW_KNIFE, Compat_Models[0])
  1182.             cs_set_player_weap_model(id, CSW_KNIFE, Compat_Models[1])
  1183.         }
  1184.         else if(g_bStrong[id])
  1185.         {
  1186.             cs_set_player_view_model(id, CSW_KNIFE, Strong_Models[0])
  1187.             cs_set_player_weap_model(id, CSW_KNIFE, Strong_Models[1])
  1188.         }
  1189.         else if(g_bKatana[id])
  1190.         {
  1191.             cs_set_player_view_model(id, CSW_KNIFE, Katana_Models[0])
  1192.             cs_set_player_weap_model(id, CSW_KNIFE, Katana_Models[1])
  1193.         }
  1194.         else if(g_bHammer[id])
  1195.         {
  1196.             cs_set_player_view_model(id, CSW_KNIFE, Hammer_Models[0])
  1197.             cs_set_player_weap_model(id, CSW_KNIFE, Hammer_Models[1])
  1198.         }
  1199.         else if(g_bTurbulent9[id])
  1200.         {
  1201.             cs_set_player_view_model(id, CSW_KNIFE, Turbulent9_Models[0])
  1202.             cs_set_player_weap_model(id, CSW_KNIFE, Turbulent9_Models[1])
  1203.         }
  1204.         else if(g_bBio[id])
  1205.         {
  1206.             cs_set_player_view_model(id, CSW_KNIFE, Bio_Models[0])
  1207.             cs_set_player_weap_model(id, CSW_KNIFE, Bio_Models[1])
  1208.         }
  1209.         else if(g_bSabers[id])
  1210.         {
  1211.             cs_set_player_view_model(id, CSW_KNIFE, Sabers_Models[0])
  1212.             cs_set_player_weap_model(id, CSW_KNIFE, Sabers_Models[1])
  1213.         }
  1214.         else if(g_bPlasma[id])
  1215.         {
  1216.             cs_set_player_view_model(id, CSW_KNIFE, Plasma_Models[0])
  1217.             cs_set_player_weap_model(id, CSW_KNIFE, Plasma_Models[1])
  1218.         }
  1219.         else if(g_bStorm[id])
  1220.         {
  1221.             cs_set_player_view_model(id, CSW_KNIFE, Storm_Models[0])
  1222.             cs_set_player_weap_model(id, CSW_KNIFE, Storm_Models[1])
  1223.         }
  1224.         else if(g_bLaevateinn[id])
  1225.         {
  1226.             cs_set_player_view_model(id, CSW_KNIFE, Laevateinn_Models[0])
  1227.             cs_set_player_weap_model(id, CSW_KNIFE, Laevateinn_Models[1])
  1228.         }
  1229.         else if(g_bWarHammer_Dark_Knight[id])
  1230.         {
  1231.             cs_set_player_view_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[0])
  1232.             cs_set_player_weap_model(id, CSW_KNIFE, WarHammer_Dark_Knight_Models[1])
  1233.         }
  1234.         else if(g_bBalrog_Kosa[id])
  1235.         {
  1236.             cs_set_player_view_model(id, CSW_KNIFE, Balrog_Kosa_Models[0])
  1237.             cs_set_player_weap_model(id, CSW_KNIFE, Balrog_Kosa_Models[1])
  1238.         }
  1239.         else if(g_bWereWolf[id])
  1240.         {
  1241.             cs_set_player_view_model(id, CSW_KNIFE, WereWolf_Models[0])
  1242.             cs_set_player_weap_model(id, CSW_KNIFE, WereWolf_Models[1])
  1243.         }
  1244.         else if(g_bDeadMaster[id])
  1245.         {
  1246.             cs_set_player_view_model(id, CSW_KNIFE, DeadMaster_Models[0])
  1247.             cs_set_player_weap_model(id, CSW_KNIFE, DeadMaster_Models[1])
  1248.         }
  1249.         else if(g_bHammerChain[id])
  1250.         {
  1251.             cs_set_player_view_model(id, CSW_KNIFE, HammerChain_Models[0])
  1252.             cs_set_player_weap_model(id, CSW_KNIFE, HammerChain_Models[1])
  1253.         }
  1254.         else if(g_bKataha[id])
  1255.         {
  1256.             cs_set_player_view_model(id, CSW_KNIFE, Kataha_Models[0])
  1257.             cs_set_player_weap_model(id, CSW_KNIFE, Kataha_Models[1])
  1258.         }
  1259.         else if(g_bRanger[id])
  1260.         {
  1261.             cs_set_player_view_model(id, CSW_KNIFE, Ranger_Models[0])
  1262.             cs_set_player_weap_model(id, CSW_KNIFE, Ranger_Models[1])
  1263.         }
  1264.         else
  1265.         {
  1266.             cs_reset_player_view_model(id, CSW_KNIFE)
  1267.             cs_reset_player_weap_model(id, CSW_KNIFE)
  1268.         }
  1269.     }
  1270. }
  1271.  
  1272. public Fw_RestMaxSpeed_Post(id)
  1273. {
  1274.     if (g_bNoSpeed)
  1275.         return
  1276.        
  1277.     set_task(0.1, "DelayLoad", id)
  1278.    
  1279. }
  1280.  
  1281. public DelayLoad(id)
  1282. {
  1283.     new iWpnId = (get_user_weapon(id))
  1284.     if (iWpnId == CSW_KNIFE && g_bCompat[id])
  1285.     {
  1286.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1287.         {
  1288.             new iFlags = get_entvar(id, var_flags);
  1289.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1290.            
  1291.             if (!(iFlags & FL_ONGROUND))
  1292.                 return HC_CONTINUE
  1293.  
  1294.             if (iFlags & FL_WATERJUMP)
  1295.                 return HAM_IGNORED
  1296.  
  1297.             if (iWaterlvl > 1)
  1298.                 return HAM_IGNORED
  1299.            
  1300.             new Float:flVelocity[3]
  1301.             get_entvar(id , var_velocity , flVelocity)
  1302.  
  1303.             flVelocity[2] += 325
  1304.  
  1305.             set_entvar(id , var_velocity , flVelocity)
  1306.  
  1307.             set_entvar(id, var_gaitsequence, 6)
  1308.         }
  1309.        
  1310.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_compat))
  1311.     }
  1312.     if (iWpnId == CSW_KNIFE && g_bStrong[id])
  1313.     {
  1314.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1315.         {
  1316.             new iFlags = get_entvar(id, var_flags);
  1317.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1318.            
  1319.             if (!(iFlags & FL_ONGROUND))
  1320.                 return HC_CONTINUE
  1321.  
  1322.             if (iFlags & FL_WATERJUMP)
  1323.                 return HAM_IGNORED
  1324.  
  1325.             if (iWaterlvl > 1)
  1326.                 return HAM_IGNORED
  1327.            
  1328.             new Float:flVelocity[3]
  1329.             get_entvar(id , var_velocity , flVelocity)
  1330.  
  1331.             flVelocity[2] += 325
  1332.  
  1333.             set_entvar(id , var_velocity , flVelocity)
  1334.  
  1335.             set_entvar(id, var_gaitsequence, 6)
  1336.         }
  1337.        
  1338.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_strong))
  1339.     }
  1340.     if (iWpnId == CSW_KNIFE && g_bKatana[id])
  1341.     {
  1342.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1343.         {
  1344.             new iFlags = get_entvar(id, var_flags);
  1345.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1346.            
  1347.             if (!(iFlags & FL_ONGROUND))
  1348.                 return HC_CONTINUE
  1349.  
  1350.             if (iFlags & FL_WATERJUMP)
  1351.                 return HAM_IGNORED
  1352.  
  1353.             if (iWaterlvl > 1)
  1354.                 return HAM_IGNORED
  1355.            
  1356.             new Float:flVelocity[3]
  1357.             get_entvar(id , var_velocity , flVelocity)
  1358.  
  1359.             flVelocity[2] += 325
  1360.  
  1361.             set_entvar(id , var_velocity , flVelocity)
  1362.  
  1363.             set_entvar(id, var_gaitsequence, 6)
  1364.         }
  1365.        
  1366.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_katana))
  1367.     }
  1368.     if (iWpnId == CSW_KNIFE && g_bHammer[id])
  1369.     {
  1370.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1371.         {
  1372.             new iFlags = get_entvar(id, var_flags);
  1373.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1374.            
  1375.             if (!(iFlags & FL_ONGROUND))
  1376.                 return HC_CONTINUE
  1377.  
  1378.             if (iFlags & FL_WATERJUMP)
  1379.                 return HAM_IGNORED
  1380.  
  1381.             if (iWaterlvl > 1)
  1382.                 return HAM_IGNORED
  1383.            
  1384.             new Float:flVelocity[3]
  1385.             get_entvar(id , var_velocity , flVelocity)
  1386.  
  1387.             flVelocity[2] += 325
  1388.  
  1389.             set_entvar(id , var_velocity , flVelocity)
  1390.  
  1391.             set_entvar(id, var_gaitsequence, 6)
  1392.         }
  1393.        
  1394.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammer))
  1395.     }
  1396.     if (iWpnId == CSW_KNIFE && g_bTurbulent9[id])
  1397.     {
  1398.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1399.         {
  1400.             new iFlags = get_entvar(id, var_flags);
  1401.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1402.            
  1403.             if (!(iFlags & FL_ONGROUND))
  1404.                 return HC_CONTINUE
  1405.  
  1406.             if (iFlags & FL_WATERJUMP)
  1407.                 return HAM_IGNORED
  1408.  
  1409.             if (iWaterlvl > 1)
  1410.                 return HAM_IGNORED
  1411.            
  1412.             new Float:flVelocity[3]
  1413.             get_entvar(id , var_velocity , flVelocity)
  1414.  
  1415.             flVelocity[2] += 325
  1416.  
  1417.             set_entvar(id , var_velocity , flVelocity)
  1418.  
  1419.             set_entvar(id, var_gaitsequence, 6)
  1420.         }
  1421.        
  1422.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_turb))
  1423.     }
  1424.     if (iWpnId == CSW_KNIFE && g_bBio[id])
  1425.     {
  1426.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1427.         {
  1428.             new iFlags = get_entvar(id, var_flags);
  1429.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1430.            
  1431.             if (!(iFlags & FL_ONGROUND))
  1432.                 return HC_CONTINUE
  1433.  
  1434.             if (iFlags & FL_WATERJUMP)
  1435.                 return HAM_IGNORED
  1436.  
  1437.             if (iWaterlvl > 1)
  1438.                 return HAM_IGNORED
  1439.            
  1440.             new Float:flVelocity[3]
  1441.             get_entvar(id , var_velocity , flVelocity)
  1442.  
  1443.             flVelocity[2] += 325
  1444.  
  1445.             set_entvar(id , var_velocity , flVelocity)
  1446.  
  1447.             set_entvar(id, var_gaitsequence, 6)
  1448.         }
  1449.        
  1450.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_bio))
  1451.     }
  1452.     if (iWpnId == CSW_KNIFE && g_bSabers[id])
  1453.     {
  1454.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1455.         {
  1456.             new iFlags = get_entvar(id, var_flags);
  1457.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1458.            
  1459.             if (!(iFlags & FL_ONGROUND))
  1460.                 return HC_CONTINUE
  1461.  
  1462.             if (iFlags & FL_WATERJUMP)
  1463.                 return HAM_IGNORED
  1464.  
  1465.             if (iWaterlvl > 1)
  1466.                 return HAM_IGNORED
  1467.            
  1468.             new Float:flVelocity[3]
  1469.             get_entvar(id , var_velocity , flVelocity)
  1470.  
  1471.             flVelocity[2] += 325
  1472.  
  1473.             set_entvar(id , var_velocity , flVelocity)
  1474.  
  1475.             set_entvar(id, var_gaitsequence, 6)
  1476.         }
  1477.        
  1478.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_sabers))
  1479.     }
  1480.     if (iWpnId == CSW_KNIFE && g_bPlasma[id])
  1481.     {
  1482.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1483.         {
  1484.             new iFlags = get_entvar(id, var_flags);
  1485.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1486.            
  1487.             if (!(iFlags & FL_ONGROUND))
  1488.                 return HC_CONTINUE
  1489.  
  1490.             if (iFlags & FL_WATERJUMP)
  1491.                 return HAM_IGNORED
  1492.  
  1493.             if (iWaterlvl > 1)
  1494.                 return HAM_IGNORED
  1495.            
  1496.             new Float:flVelocity[3]
  1497.             get_entvar(id , var_velocity , flVelocity)
  1498.  
  1499.             flVelocity[2] += 325
  1500.  
  1501.             set_entvar(id , var_velocity , flVelocity)
  1502.  
  1503.             set_entvar(id, var_gaitsequence, 6)
  1504.         }
  1505.        
  1506.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_plasma))
  1507.     }
  1508.     if (iWpnId == CSW_KNIFE && g_bStorm[id])
  1509.     {
  1510.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1511.         {
  1512.             new iFlags = get_entvar(id, var_flags);
  1513.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1514.            
  1515.             if (!(iFlags & FL_ONGROUND))
  1516.                 return HC_CONTINUE
  1517.  
  1518.             if (iFlags & FL_WATERJUMP)
  1519.                 return HAM_IGNORED
  1520.  
  1521.             if (iWaterlvl > 1)
  1522.                 return HAM_IGNORED
  1523.            
  1524.             new Float:flVelocity[3]
  1525.             get_entvar(id , var_velocity , flVelocity)
  1526.  
  1527.             flVelocity[2] += 325
  1528.  
  1529.             set_entvar(id , var_velocity , flVelocity)
  1530.  
  1531.             set_entvar(id, var_gaitsequence, 6)
  1532.         }
  1533.        
  1534.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_storm))
  1535.     }
  1536.     if (iWpnId == CSW_KNIFE && g_bLaevateinn[id])
  1537.     {
  1538.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1539.         {
  1540.             new iFlags = get_entvar(id, var_flags);
  1541.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1542.            
  1543.             if (!(iFlags & FL_ONGROUND))
  1544.                 return HC_CONTINUE
  1545.  
  1546.             if (iFlags & FL_WATERJUMP)
  1547.                 return HAM_IGNORED
  1548.  
  1549.             if (iWaterlvl > 1)
  1550.                 return HAM_IGNORED
  1551.            
  1552.             new Float:flVelocity[3]
  1553.             get_entvar(id , var_velocity , flVelocity)
  1554.  
  1555.             flVelocity[2] += 325
  1556.  
  1557.             set_entvar(id , var_velocity , flVelocity)
  1558.  
  1559.             set_entvar(id, var_gaitsequence, 6)
  1560.         }
  1561.        
  1562.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_laevat))
  1563.     }
  1564.     if (iWpnId == CSW_KNIFE && g_bWarHammer_Dark_Knight[id])
  1565.     {
  1566.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1567.         {
  1568.             new iFlags = get_entvar(id, var_flags);
  1569.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1570.            
  1571.             if (!(iFlags & FL_ONGROUND))
  1572.                 return HC_CONTINUE
  1573.  
  1574.             if (iFlags & FL_WATERJUMP)
  1575.                 return HAM_IGNORED
  1576.  
  1577.             if (iWaterlvl > 1)
  1578.                 return HAM_IGNORED
  1579.            
  1580.             new Float:flVelocity[3]
  1581.             get_entvar(id , var_velocity , flVelocity)
  1582.  
  1583.             flVelocity[2] += 325
  1584.  
  1585.             set_entvar(id , var_velocity , flVelocity)
  1586.  
  1587.             set_entvar(id, var_gaitsequence, 6)
  1588.         }
  1589.        
  1590.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_darknight))
  1591.     }
  1592.     if (iWpnId == CSW_KNIFE && g_bBalrog_Kosa[id])
  1593.     {
  1594.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1595.         {
  1596.             new iFlags = get_entvar(id, var_flags);
  1597.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1598.            
  1599.             if (!(iFlags & FL_ONGROUND))
  1600.                 return HC_CONTINUE
  1601.  
  1602.             if (iFlags & FL_WATERJUMP)
  1603.                 return HAM_IGNORED
  1604.  
  1605.             if (iWaterlvl > 1)
  1606.                 return HAM_IGNORED
  1607.            
  1608.             new Float:flVelocity[3]
  1609.             get_entvar(id , var_velocity , flVelocity)
  1610.  
  1611.             flVelocity[2] += 325
  1612.  
  1613.             set_entvar(id , var_velocity , flVelocity)
  1614.  
  1615.             set_entvar(id, var_gaitsequence, 6)
  1616.         }
  1617.        
  1618.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kosa))
  1619.     }
  1620.     if (iWpnId == CSW_KNIFE && g_bWereWolf[id])
  1621.     {
  1622.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1623.         {
  1624.             new iFlags = get_entvar(id, var_flags);
  1625.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1626.            
  1627.             if (!(iFlags & FL_ONGROUND))
  1628.                 return HC_CONTINUE
  1629.  
  1630.             if (iFlags & FL_WATERJUMP)
  1631.                 return HAM_IGNORED
  1632.  
  1633.             if (iWaterlvl > 1)
  1634.                 return HAM_IGNORED
  1635.            
  1636.             new Float:flVelocity[3]
  1637.             get_entvar(id , var_velocity , flVelocity)
  1638.  
  1639.             flVelocity[2] += 325
  1640.  
  1641.             set_entvar(id , var_velocity , flVelocity)
  1642.  
  1643.             set_entvar(id, var_gaitsequence, 6)
  1644.         }
  1645.        
  1646.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_werewolf))
  1647.     }
  1648.     if (iWpnId == CSW_KNIFE && g_bDeadMaster[id])
  1649.     {
  1650.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1651.         {
  1652.             new iFlags = get_entvar(id, var_flags);
  1653.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1654.            
  1655.             if (!(iFlags & FL_ONGROUND))
  1656.                 return HC_CONTINUE
  1657.  
  1658.             if (iFlags & FL_WATERJUMP)
  1659.                 return HAM_IGNORED
  1660.  
  1661.             if (iWaterlvl > 1)
  1662.                 return HAM_IGNORED
  1663.            
  1664.             new Float:flVelocity[3]
  1665.             get_entvar(id , var_velocity , flVelocity)
  1666.  
  1667.             flVelocity[2] += 325
  1668.  
  1669.             set_entvar(id , var_velocity , flVelocity)
  1670.  
  1671.             set_entvar(id, var_gaitsequence, 6)
  1672.         }
  1673.        
  1674.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_deadmaster))
  1675.     }
  1676.     if (iWpnId == CSW_KNIFE && g_bHammerChain[id])
  1677.     {
  1678.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1679.         {
  1680.             new iFlags = get_entvar(id, var_flags);
  1681.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1682.            
  1683.             if (!(iFlags & FL_ONGROUND))
  1684.                 return HC_CONTINUE
  1685.  
  1686.             if (iFlags & FL_WATERJUMP)
  1687.                 return HAM_IGNORED
  1688.  
  1689.             if (iWaterlvl > 1)
  1690.                 return HAM_IGNORED
  1691.            
  1692.             new Float:flVelocity[3]
  1693.             get_entvar(id , var_velocity , flVelocity)
  1694.  
  1695.             flVelocity[2] += 325
  1696.  
  1697.             set_entvar(id , var_velocity , flVelocity)
  1698.  
  1699.             set_entvar(id, var_gaitsequence, 6)
  1700.         }
  1701.        
  1702.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_hammerchain))
  1703.     }
  1704.     if (iWpnId == CSW_KNIFE && g_bKataha[id])
  1705.     {
  1706.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1707.         {
  1708.             new iFlags = get_entvar(id, var_flags);
  1709.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1710.            
  1711.             if (!(iFlags & FL_ONGROUND))
  1712.                 return HC_CONTINUE
  1713.  
  1714.             if (iFlags & FL_WATERJUMP)
  1715.                 return HAM_IGNORED
  1716.  
  1717.             if (iWaterlvl > 1)
  1718.                 return HAM_IGNORED
  1719.            
  1720.             new Float:flVelocity[3]
  1721.             get_entvar(id , var_velocity , flVelocity)
  1722.  
  1723.             flVelocity[2] += 325
  1724.  
  1725.             set_entvar(id , var_velocity , flVelocity)
  1726.  
  1727.             set_entvar(id, var_gaitsequence, 6)
  1728.         }
  1729.        
  1730.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_kataha))
  1731.     }
  1732.     if (iWpnId == CSW_KNIFE && g_bRanger[id])
  1733.     {
  1734.         if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP))
  1735.         {
  1736.             new iFlags = get_entvar(id, var_flags);
  1737.             new iWaterlvl = get_entvar(id, var_waterlevel)
  1738.            
  1739.             if (!(iFlags & FL_ONGROUND))
  1740.                 return HC_CONTINUE
  1741.  
  1742.             if (iFlags & FL_WATERJUMP)
  1743.                 return HAM_IGNORED
  1744.  
  1745.             if (iWaterlvl > 1)
  1746.                 return HAM_IGNORED
  1747.            
  1748.             new Float:flVelocity[3]
  1749.             get_entvar(id , var_velocity , flVelocity)
  1750.  
  1751.             flVelocity[2] += 325
  1752.  
  1753.             set_entvar(id , var_velocity , flVelocity)
  1754.  
  1755.             set_entvar(id, var_gaitsequence, 6)
  1756.         }
  1757.        
  1758.         set_entvar(id, var_maxspeed, get_pcvar_float(cvar_speed_ranger))
  1759.     }
  1760.    
  1761.     return HC_CONTINUE
  1762. }
  1763.  
  1764. public DeathMsg(msg_id, msg_dest, id)
  1765. {
  1766.     static szTruncatedWeapon[33], iAttacker
  1767.     get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
  1768.     iAttacker = get_msg_arg_int(1)
  1769.    
  1770.     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
  1771.         return
  1772.    
  1773.     if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iAttacker) & CSW_KNIFE)
  1774.     {
  1775.         if(g_bCompat[id])
  1776.         {
  1777.             set_msg_arg_string(4, "Combat knife")
  1778.         }
  1779.         else if(g_bStrong[id])
  1780.         {
  1781.             set_msg_arg_string(4, "Strong knife")
  1782.         }
  1783.         else if(g_bKatana[id])
  1784.         {
  1785.             set_msg_arg_string(4, "Katana knife")
  1786.         }
  1787.         else if(g_bHammer[id])
  1788.         {
  1789.             set_msg_arg_string(4, "Ice knife")
  1790.         }
  1791.         else if(g_bTurbulent9[id])
  1792.         {
  1793.             set_msg_arg_string(4, "Turbulent9 knife")
  1794.         }
  1795.         else if(g_bBio[id])
  1796.         {
  1797.             set_msg_arg_string(4, "Biohazard knife")
  1798.         }
  1799.         else if(g_bSabers[id])
  1800.         {
  1801.             set_msg_arg_string(4, "Sabers knife")
  1802.         }
  1803.         else if(g_bPlasma[id])
  1804.         {
  1805.             set_msg_arg_string(4, "Plasma knife")
  1806.         }
  1807.         else if(g_bStorm[id])
  1808.         {
  1809.             set_msg_arg_string(4, "Storm knife")
  1810.         }
  1811.         else if(g_bLaevateinn[id])
  1812.         {
  1813.             set_msg_arg_string(4, "Laevateinn knife")
  1814.         }
  1815.         else if(g_bWarHammer_Dark_Knight[id])
  1816.         {
  1817.             set_msg_arg_string(4, "WarHammer Dark Knight knife")
  1818.         }
  1819.         else if(g_bBalrog_Kosa[id])
  1820.         {
  1821.             set_msg_arg_string(4, "Balrog Kosa Knife")
  1822.         }
  1823.        
  1824.         else if(g_bWereWolf[id])
  1825.         {
  1826.             set_msg_arg_string(4, "Were Wolf knife")
  1827.         }
  1828.         else if(g_bDeadMaster[id])
  1829.         {
  1830.             set_msg_arg_string(4, "Dead Master knife")
  1831.         }
  1832.         else if(g_bHammerChain[id])
  1833.         {
  1834.             set_msg_arg_string(4, "Hammer Chain knife")
  1835.         }
  1836.         else if(g_bKataha[id])
  1837.         {
  1838.             set_msg_arg_string(4, "Kataha knife")
  1839.         }
  1840.         else if(g_bRanger[id])
  1841.         {
  1842.             set_msg_arg_string(4, "Ranger Knife")
  1843.         }
  1844.     }
  1845. }
  1846.  
  1847. stock fm_set_user_maxspeed(index, Float:speed = -1.0)
  1848. {
  1849.         engfunc(EngFunc_SetClientMaxspeed, index, speed);
  1850.         set_pev(index, pev_maxspeed, speed);
  1851.  
  1852.         return 1;
  1853. }  
  1854.  
  1855. public native_ze_open_knife_menu(id)
  1856. {
  1857.     Show_Knife_Menu(id)
  1858. }

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 1 Year Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#8

Post by Mark » 4 Months Ago

Is your problem solved?

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 144
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#9

Post by Luxurious » 3 Months Ago

Mark wrote:
4 Months Ago
Is your problem solved?
sorry for late ... i tried it today and it working but can u make 5 knifes free and more knives make access for it ...
DragonsXtreme Zombie-Escape V1.4
IP : 81.2.247.149:27015

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 1 Year Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#10

Post by Mark » 3 Months Ago

Luxurious wrote:
3 Months Ago
Mark wrote:
4 Months Ago
Is your problem solved?
sorry for late ... i tried it today and it working but can u make 5 knifes free and more knives make access for it ...
I would need to know what Knives you want for VIP first.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests