This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[HELP] The plugin will not open menu!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fLaXXiE
Member
Join Date: Apr 2011
Old 11-12-2011 , 03:31   [HELP] The plugin will not open menu!
Reply With Quote #1

The plugin does not come up with any errors.
- 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_Menu1023"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(menuBody511"\w[HB] Knife Menu^nBy: \yfLaXXiE\w^n^n")
    
add(menuBody511"1. Ninja Sword \w(\yMembers Only\w)^n"ADMIN_VOTE)
    
add(menuBody511"2. Chainsaw \w(\yMembers Only\w)^n"ADMIN_VOTE)
    
add(menuBody511"3. Lightsaber \w(\yMembers Only\w)^n"ADMIN_VOTE)
    
add(menuBody511"4. Pro Knife \w(\yMembers Only\w)^n"ADMIN_VOTE)
    
add(menuBody511"5. Starter Knife\w^n^n")
    
add(menuBody511"0. Exit^n")
    
    new 
keys = ( 1<<1<<1<<1<<1<<1<<)
    
show_menu(idkeysmenuBody, -1"Knife Mod")
}

public 
knifemenu(idkey)
{
    switch(
key
    {
        case 
0SetKnife(id 4)
        case 
1SetKnife(id 2)
        case 
2SetKnife(id 3)
        case 
3SetKnife(id 1)
        case 
4SetKnife(id 0)
        default: return 
PLUGIN_HANDLED
    
}
    
SaveData(id)
    return 
PLUGIN_HANDLED


public 
SetKnife(id Knife)
{
    
knife_model[id] = Knife
    
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    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(idEV_SZ_viewmodelvModel)
    
entity_set_string(idEV_SZ_weaponmodelpModel)
    
    return 
PLUGIN_HANDLED;  
}

public 
CurWeapon(id)
{
    new 
Weapon read_data(2)
    
    
SetKnife(idknife_model[id])
    
    return 
PLUGIN_HANDLED 
}

stock log_kill(killervictimweapon[],headshot)
{
    
user_silentkillvictim );
    
    
message_beginMSG_ALLget_user_msgid"DeathMsg" ), {0,0,0}, );
    
write_bytekiller );
    
write_bytevictim );
    
write_byteheadshot );
    
write_stringweapon );
    
message_end();
    
    new 
kfrags get_user_fragskiller );
    
set_user_fragskillerkfrags++ );
    new 
vfrags get_user_fragsvictim );
    
set_user_fragsvictimvfrags++ );
    
    return  
PLUGIN_CONTINUE


public 
client_authorized(id)
{
    
LoadData(id)
}

SaveData(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)
    
    new 
vaultkey[64]
    new 
vaultdata[64]
    
    
format(vaultkey63"KMOD_%s"authid)
    
format(vaultdata63"%d"knife_model[id])
    
set_vaultdata(vaultkeyvaultdata)
}

LoadData(id

    new 
authid[32
    
get_user_authid(id,authid,31)
    
    new 
vaultkey[64], vaultdata[64]
    
    
format(vaultkey63"KMOD_%s"authid)
    
get_vaultdata(vaultkeyvaultdata63)
    
knife_model[id] = str_to_num(vaultdata)

fLaXXiE is offline
Send a message via MSN to fLaXXiE Send a message via Skype™ to fLaXXiE
Reply



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

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

Forum Jump


All times are GMT -4. The time now is 19:29.


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