[HELP] The plugin will not open menu!
The plugin does not come up with any errors.
- but the plugin wont open the menu for knifes..
- but the plugin wont open the menu for knifes..
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <vault>
#include <fun>
new knife_model[33]
new g_Menu
public plugin_init()
{
register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
g_Menu = register_menuid("Knife Mod")
register_menucmd(g_Menu, 1023, "knifemenu")
register_clcmd("say /knife", "display_knife")
}
public plugin_precache()
{
precache_model("models/HB_Blockmaker2/Misc/v_katana.mdl")
precache_model("models/HB_Blockmaker2/Misc/p_katana.mdl")
precache_model("models/HB_Blockmaker2/Misc/v_light.mdl")
precache_model("models/HB_Blockmaker2/Misc/p_light.mdl")
precache_model("models/HB_Blockmaker2/Misc/v_proff.mdl")
precache_model("models/HB_Blockmaker2/Misc/p_proff.mdl")
precache_model("models/HB_Blockmaker2/Misc/v_moto.mdl")
precache_model("models/HB_Blockmaker2/Misc/p_moto.mdl")
precache_model("models/v_knife.mdl")
precache_model("models/p_knife.mdl")
}
public display_knife(id)
{
new menuBody[512]
add(menuBody, 511, "\w[HB] Knife Menu^nBy: \yfLaXXiE\w^n^n")
add(menuBody, 511, "1. Ninja Sword \w(\yMembers Only\w)^n", ADMIN_VOTE)
add(menuBody, 511, "2. Chainsaw \w(\yMembers Only\w)^n", ADMIN_VOTE)
add(menuBody, 511, "3. Lightsaber \w(\yMembers Only\w)^n", ADMIN_VOTE)
add(menuBody, 511, "4. Pro Knife \w(\yMembers Only\w)^n", ADMIN_VOTE)
add(menuBody, 511, "5. Starter Knife\w^n^n")
add(menuBody, 511, "0. Exit^n")
new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
show_menu(id, keys, menuBody, -1, "Knife Mod")
}
public knifemenu(id, key)
{
switch(key)
{
case 0: SetKnife(id , 4)
case 1: SetKnife(id , 2)
case 2: SetKnife(id , 3)
case 3: SetKnife(id , 1)
case 4: SetKnife(id , 0)
default: return PLUGIN_HANDLED
}
SaveData(id)
return PLUGIN_HANDLED
}
public SetKnife(id , Knife)
{
knife_model[id] = Knife
new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
if ( Weapon != CSW_KNIFE )
return PLUGIN_HANDLED
new vModel[56],pModel[56]
switch(Knife)
{
case 0: {
format(vModel,55,"models/v_knife.mdl")
format(pModel,55,"models/p_knife.mdl")
}
case 1: {
format(vModel,55,"models/HB_Blockmaker2/Misc/v_proff.mdl")
format(pModel,55,"models/HB_Blockmaker2/Misc/p_proff.mdl")
}
case 2: {
format(vModel,55,"models/HB_Blockmaker2/Misc/v_moto.mdl")
format(pModel,55,"models/HB_Blockmaker2/Misc/p_moto.mdl")
}
case 3: {
format(vModel,55,"models/HB_Blockmaker2/Misc/v_light.mdl")
format(pModel,55,"models/HB_Blockmaker2/Misc/p_light.mdl")
}
case 4: {
format(vModel,55,"models/HB_Blockmaker2/Misc/v_katana.mdl")
format(pModel,55,"models/HB_Blockmaker2/Misc/p_katana.mdl")
}
}
entity_set_string(id, EV_SZ_viewmodel, vModel)
entity_set_string(id, EV_SZ_weaponmodel, pModel)
return PLUGIN_HANDLED;
}
public CurWeapon(id)
{
new Weapon = read_data(2)
SetKnife(id, knife_model[id])
return PLUGIN_HANDLED
}
stock log_kill(killer, victim, weapon[],headshot)
{
user_silentkill( victim );
message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = get_user_frags( killer );
set_user_frags( killer, kfrags++ );
new vfrags = get_user_frags( victim );
set_user_frags( victim, vfrags++ );
return PLUGIN_CONTINUE
}
public client_authorized(id)
{
LoadData(id)
}
SaveData(id)
{
new authid[32]
get_user_authid(id, authid, 31)
new vaultkey[64]
new vaultdata[64]
format(vaultkey, 63, "KMOD_%s", authid)
format(vaultdata, 63, "%d", knife_model[id])
set_vaultdata(vaultkey, vaultdata)
}
LoadData(id)
{
new authid[32]
get_user_authid(id,authid,31)
new vaultkey[64], vaultdata[64]
format(vaultkey, 63, "KMOD_%s", authid)
get_vaultdata(vaultkey, vaultdata, 63)
knife_model[id] = str_to_num(vaultdata)
}
Orignal From: [HELP] The plugin will not open menu!
Post a Comment