Plugin Available Help me in this request please

Unpaid Requests, Public Plugins
ZombieEscape
Member
Member
Posts: 8
Joined: 1 Month Ago
Has thanked: 2 times
Been thanked: 0
Contact:

Help me in this request please

#1

Post by ZombieEscape » 1 Month Ago

hello i want anyone to edit this knife menu plugin
viewtopic.php?f=15&t=88
and make the second 2. knife only for vips with vip access and the last 2 knives 3. + 4. with admin accesses for example (ADMIN_BAN + ADMIN_KICK) only these knives can choose it who have the access of it , hope anyone help me on it i am really in need of it and thank you all.

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

#2

Post by Jack GamePlay » 1 Month Ago

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
#define VIP_ACCESS VIP_A
#define ADMIN_ACCESS ADMIN_LEVEL_H

// Models
new const Compat_Models[][] =
{
	"models/zombie_escape/v_combat_knife.mdl",
	"models/zombie_escape/p_combat_knife.mdl"
}

new const Strong_Models[][] =
{
	"models/zombie_escape/v_strong_knife.mdl",
	"models/zombie_escape/p_strong_knife.mdl"
}

new const Katana_Models[][] =
{
	"models/zombie_escape/v_katana_knife.mdl",
	"models/zombie_escape/p_katana_knife.mdl"
}

new const Hammer_Models[][] =
{
	"models/zombie_escape/v_hammer_knife.mdl",
	"models/zombie_escape/p_hammer_knife.mdl" 
}

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

new const combat_sounds[][] =
{
	"zombie_escape/knife_menu/combat_deploy.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hitwall.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_stab.wav"
}

new const strong_sounds[][] =
{
	"zombie_escape/knife_menu/strong_deploy.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hitwall.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_stab.wav"
}

new const katana_sounds[][] =
{
	"zombie_escape/knife_menu/katana_deploy.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hitwall.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_stab.wav"
}

new const hammer_sounds[][] =
{
	"zombie_escape/knife_menu/hammer_deploy.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hitwall.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_stab.wav"
}

new const 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, "\yCombat", "", 0)
	if (ze_get_vip_flags(id) & VIP_ACCESS)
	{
		menu_additem(iMenu, "\yStrong", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dStrong", "", 0)
	}

	if (get_user_flags(id) & ADMIN_ACCESS)
	{
		menu_additem(iMenu, "\yKatana", "", 0)
		menu_additem(iMenu, "\yHammer", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dKatana", "", 0)
		menu_additem(iMenu, "\dHammer", "", 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))
	{
		menu_destroy(iMenu)
		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
		{
			if (ze_get_vip_flags(id) & VIP_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 2: // Katana
		{
			if (get_user_flags(id) & ADMIN_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 3: // Hammer
		{
			if (get_user_flags(id) & ADMIN_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
	}

	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)
	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, "Combat knife")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "Strong knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "Katana knife")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Ice knife")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
These users thanked the author Jack GamePlay for the post:
ZombieEscape (1 Month Ago)
Image

ZombieEscape
Member
Member
Posts: 8
Joined: 1 Month Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#3

Post by ZombieEscape » 1 Month Ago

Jack GamePlay wrote:
1 Month Ago

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
#define VIP_ACCESS VIP_A
#define ADMIN_ACCESS ADMIN_LEVEL_H

// Models
new const Compat_Models[][] =
{
	"models/zombie_escape/v_combat_knife.mdl",
	"models/zombie_escape/p_combat_knife.mdl"
}

new const Strong_Models[][] =
{
	"models/zombie_escape/v_strong_knife.mdl",
	"models/zombie_escape/p_strong_knife.mdl"
}

new const Katana_Models[][] =
{
	"models/zombie_escape/v_katana_knife.mdl",
	"models/zombie_escape/p_katana_knife.mdl"
}

new const Hammer_Models[][] =
{
	"models/zombie_escape/v_hammer_knife.mdl",
	"models/zombie_escape/p_hammer_knife.mdl" 
}

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

new const combat_sounds[][] =
{
	"zombie_escape/knife_menu/combat_deploy.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hit.wav",
	"zombie_escape/knife_menu/combat_hitwall.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_slash.wav",
	"zombie_escape/knife_menu/combat_stab.wav"
}

new const strong_sounds[][] =
{
	"zombie_escape/knife_menu/strong_deploy.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hit.wav",
	"zombie_escape/knife_menu/strong_hitwall.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_slash.wav",
	"zombie_escape/knife_menu/strong_stab.wav"
}

new const katana_sounds[][] =
{
	"zombie_escape/knife_menu/katana_deploy.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hit.wav",
	"zombie_escape/knife_menu/katana_hitwall.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_slash.wav",
	"zombie_escape/knife_menu/katana_stab.wav"
}

new const hammer_sounds[][] =
{
	"zombie_escape/knife_menu/hammer_deploy.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hit.wav",
	"zombie_escape/knife_menu/hammer_hitwall.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_slash.wav",
	"zombie_escape/knife_menu/hammer_stab.wav"
}

new const 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, "\yCombat", "", 0)
	if (ze_get_vip_flags(id) & VIP_ACCESS)
	{
		menu_additem(iMenu, "\yStrong", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dStrong", "", 0)
	}

	if (get_user_flags(id) & ADMIN_ACCESS)
	{
		menu_additem(iMenu, "\yKatana", "", 0)
		menu_additem(iMenu, "\yHammer", "", 0)
	}
	else
	{
		menu_additem(iMenu, "\dKatana", "", 0)
		menu_additem(iMenu, "\dHammer", "", 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))
	{
		menu_destroy(iMenu)
		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
		{
			if (ze_get_vip_flags(id) & VIP_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 2: // Katana
		{
			if (get_user_flags(id) & ADMIN_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
		case 3: // Hammer
		{
			if (get_user_flags(id) & ADMIN_ACCESS)
			{
				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)*/
			}
			else
			{
				ze_colored_print(id, "!tNo access!y.")
			}
		}
	}

	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)
	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, "Combat knife")
        }
        else if(g_bStrong[id])
        {
            set_msg_arg_string(4, "Strong knife")
        }
        else if(g_bKatana[id])
        {
            set_msg_arg_string(4, "Katana knife")
        }
        else if(g_bHammer[id])
        {
            set_msg_arg_string(4, "Ice knife")
        }
    }
}

public native_ze_open_knife_menu(id)
{
	Show_Knife_Menu(id)
}
Hello,
Thanks a lot Jack it worked and i followed your method to make all with access and it's OK :)
Just there is problem with your plugin if you can fix it, if i chose knife from menu and got infected to zombie at new round will see that my knife got reset to cs1.6 knife so can we fix this and make the knife be with human which chose it all the map however he got infected or not? also again i thank you :)

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

#4

Post by Jack GamePlay » 1 Month Ago

Remove this part:

Code: Select all

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
}

[ Post made via Android ]
These users thanked the author Jack GamePlay for the post:
ZombieEscape (1 Month Ago)
Image

ZombieEscape
Member
Member
Posts: 8
Joined: 1 Month Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#5

Post by ZombieEscape » 1 Month Ago

Jack GamePlay wrote:
1 Month Ago
Remove this part:

Code: Select all

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
}
Thanks a lot it's working fine now, i just have last request can you please include in knife_main_menu (Unstuck) because i tried the tutorial that Raheem made it like about 3 hours and failed, so if you can do it for me?
I would be thankful in all cases thanks anyway man :D

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

#6

Post by Jack GamePlay » 1 Month Ago

ZombieEscape wrote:
1 Month Ago
Thanks a lot it's working fine now, i just have last request can you please include in knife_main_menu (Unstuck) because i tried the tutorial that Raheem made it like about 3 hours and failed, so if you can do it for me?
I would be thankful in all cases thanks anyway man :D

?!

[ Post made via Android ]
Image

ZombieEscape
Member
Member
Posts: 8
Joined: 1 Month Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#7

Post by ZombieEscape » 1 Month Ago

Hello,
I mean can you add for me Unstuck in ze_main_menu plugin that you added in your Knife Menu plugin?
Because i failed to do it many times, hope you do it please i really in need it..
Thanks man.

User avatar
DarkZombie
Member
Member
Hungary
Posts: 68
Joined: 4 Months Ago
Donation: 1x donated in total €6.00
Has thanked: 16 times
Been thanked: 0
Contact:

#8

Post by DarkZombie » 1 Month Ago

I think that's what you mean: viewtopic.php?f=7&t=1971

ZombieEscape
Member
Member
Posts: 8
Joined: 1 Month Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#9

Post by ZombieEscape » 1 Month Ago

DarkZombie wrote:
1 Month Ago
I think that's what you mean: viewtopic.php?f=7&t=1971
Already tried it but failed, more than 3 hours trying and the result fail....
so if you can make it for me? as you have the full knowledge you will not lose anything?
Thanks anyway.

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

#10

Post by Jack GamePlay » 1 Month Ago

ZombieEscape wrote:
1 Month Ago
Hello,
I mean can you add for me Unstuck in ze_main_menu plugin that you added in your Knife Menu plugin?
Because i failed to do it many times, hope you do it please i really in need it..
Thanks man.
Provide the code you edited.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests