Raised This Month: $51 Target: $400
 12% 

Help with knives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
INJAC
Member
Join Date: Sep 2011
Old 01-16-2012 , 19:05   Help with knives
Reply With Quote #1

I manage to create my own plugin for knives where i want to get a menu with options to choose a diffrent knife skin by saying /knife , but having a problem while compiling this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Nozevi"
#define VERSION "1.0"
#define AUTHOR "Milan Injac (Hoss Delgado)"

new knife_model[33
new 
g_Menu

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_clcmd("say /noz","knifemenu")
    
g_Menu register_menuid("Knife Mod")
    
register_menucmd(g_Menu1023"knifemenu")


public 
plugin_precache() { 
    
precache_model("models/knife/p_desert_blade_2.mdl"
    
precache_model("models/knife/v_desert_blade_2.mdl"
    
precache_model("models/knife/p_khanjar.mdl")
    
precache_model("models/knife/v_khanjar.mdl")
    
precache_model("models/knife/p_machete.mdl")
    
precache_model("models/knife/v_machete.mdl")
    
precache_model("models/knife/p_pocket.mdl")
    
precache_model("models/knife/v_pocket.mdl")
    
precache_model("models/knife/p_bak.mdl"
    
precache_model("models/knife/v_bak.mdl")
    
precache_model("models/knife/p_nautilus.mdl"
    
precache_model("models/knife/v_nautilus.mdl")


public 
display_knife(id) {
    new 
menuBody[512]
    
add(menuBody511"\Knife Mod\^n^n")
    
add(menuBody511"1. Machete^n")
    
add(menuBody511"2. Bak Knife^n")
    
add(menuBody511"3. Pocket Knife^n")
    
add(menuBody511"4. Butcher Knife^n")
    
add(menuBody511"5. Default Knife^n^n")
    
add(menuBody511"5. Default Knife^n^n")
    
add(menuBody511"0. Exit^n")
    
    new 
keys = ( 1<<1<<1<<1<<1<<1<<1<<)
    
show_menu(idkeysmenuBody, -1"Knife Mod")
}

public 
knifemenu(idkey) {
    switch(
key
    {
        case 
0SetKnife(id 5)
        case 
1SetKnife(id 4)
        case 
2SetKnife(id 3)
        case 
3SetKnife(id 2)
        case 
4SetKnife(id 1)
        case 
5SetKnife(id 0)
        default: return 
PLUGIN_HANDLED
    
}
    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/knife/v_desert_blade_2.mdl")
            
format(pModel,55,"models/knife/p_desert_blade_2.mdl")
        }
        case 
1: {
            
format(vModel,55,"models/knife/v_khanjar.mdl")
            
format(pModel,55,"models/knife/p_khanjar.mdl")
        }
        case 
2: {
            
format(vModel,55,"models/knife/v_machete.mdl")
            
format(pModel,55,"models/knife/p_machete.mdl")
        }
        case 
3: {
            
format(vModel,55,"models/knife/v_pocket.mdl")
            
format(pModel,55,"models/knife/p_pocket.mdl")
        }
        case 
4: {
            
format(vModel,55,"models/knife/v_bak.mdl")
            
format(pModel,55,"models/knife/p_bak.mdl")
        }
        case 
5: {
            
format(vModel,55,"models/knife/v_nautilus.mdl")
            
format(pModel,55,"models/knife/p_nautilus.mdl")
        }
                
    }
    
menu_destroy(menu);
    return 
PLUGIN_CONTINUE

Errors:

error 017 : undefined symbol "menu"
error 088: number of arguments does not match defenition

Just dont give me the already finished plugins i want this one as simple as it
can get.

Otherwise i took half of this script from one plugin, a third from other and the rest is my work so if someone can help mi resolve these problems and so this plugin could work thanks in advance
INJAC is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-16-2012 , 19:32   Re: Help with knives
Reply With Quote #2

PHP Code:
menu_destroy(menu);
return 
PLUGIN_CONTINUE 

PHP Code:
menu_destroy(g_Menu);
return 
PLUGIN_CONTINUE 
You should be able to compile it now, but it still wont work.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
INJAC
Member
Join Date: Sep 2011
Old 01-16-2012 , 20:11   Re: Help with knives
Reply With Quote #3

well can you help me make it work?
INJAC is offline
Old 01-16-2012, 20:55
drekes
This message has been deleted by drekes. Reason: Old style menu's. Not sure if i'm right...
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-17-2012 , 01:21   Re: Help with knives
Reply With Quote #4

destroy_menu is only for new menus that are kept in memory, just remove that line.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 20:17.


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