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

Solved Knife model not make change for the model.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obada8
Junior Member
Join Date: May 2016
Old 01-21-2018 , 06:31   Knife model not make change for the model.
Reply With Quote #1

Hell guys,

I'm tried to use this plugin which i got it from here

https://forums.alliedmods.net/showthread.php?t=120568


the plugin code is:

PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >

new knife_mode33 ];

new const 
gszKnifeModel_default[] = ""
new const 
gszKnifeModel_wooden[] = "";
new const 
gszKnifeModel_butcher[] = "";

public 
plugin_init() 
{
    
register_plugin"Knife Model Selection""1.0""Juice" );
    
    
register_clcmd"say /knife""CmdKnife" );
    
register_menucmdregister_menuid("KnifeMenu"), 1023"handleKnifeMenu" );
    
    
RegisterHamHam_Item_Deploy"weapon_knife""Ham_KnifeDeployPost");
}

public 
plugin_precache()
{
    
precache_modelgszKnifeModel_default );
    
precache_modelgszKnifeModel_wooden );
    
precache_modelgszKnifeModel_butcher );
}

public 
client_putinserver(id
{
    
knife_mode[id] = 1;
}

public 
CmdKnifeid )
{
    
ShowKnifeMenuid );
    return 
PLUGIN_HANDLED;
}

public 
ShowKnifeMenu(id
{
    new 
MenuBody[512], lenkeys;
    
    
len format(MenuBody511"\ySelect Your Knife\r:");
    
len += format(MenuBody[len], 511-len"^n\r1. \wDefault");
    
len += format(MenuBody[len], 511-len"^n\r2. \wWooden Knife");
    
len += format(MenuBody[len], 511-len"^n\r3. \wButcher Knife");
    
len += format(MenuBody[len], 511-len"^n\r0. \wExit");

    
keys |= ( 1<<1<<1<<1<<);

    
show_menu(idkeysMenuBody, -1"KnifeMenu");
}

public 
handleKnifeMenuidkey )
{
    switch(
key 1)
    {
        case 
1:    knife_mode[id] = 1;
        case 
2:    knife_mode[id] = 2;
        case 
3:    knife_mode[id] = 3;
    }
}

public 
Ham_KnifeDeployPostiEnt 
{
    new 
id get_pdata_cbaseiEnt41 ); // m_pPlayer = 41
    
switch( knife_mode[id] )
    {
        case 
1entity_set_stringidEV_SZ_viewmodelgszKnifeModel_default); // default model here
        
case 2entity_set_stringidEV_SZ_viewmodelgszKnifeModel_wooden );
        case 
3entity_set_stringidEV_SZ_viewmodelgszKnifeModel_butcher );
    }


But actually nothing change !!

Last edited by Obada8; 01-22-2018 at 06:08.
Obada8 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-21-2018 , 08:12   Re: Knife model not make change for the model.
Reply With Quote #2

7 years later since that link, an actual working plugin was made - https://forums.alliedmods.net/showthread.php?t=293632
__________________

Last edited by OciXCrom; 01-21-2018 at 08:12.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Obada8
Junior Member
Join Date: May 2016
Old 01-22-2018 , 00:42   Re: Knife model not make change for the model.
Reply With Quote #3

Thanks a lot i see the deference is

Quote:
set_pev(id, pev_viewmodel2, knife)
And it work.
Obada8 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-22-2018 , 07:46   Re: Knife model not make change for the model.
Reply With Quote #4

I mean you can use my plugin - it does the same job, only better. Yours uses the old menu style + the models are hardcoded - you'll have to edit the .sma file and recompile every time you want to change something. Also the code is bad.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-22-2018 , 09:54   Re: Knife model not make change for the model.
Reply With Quote #5

There is nothing wrong about "old" menus. In fact, "old" menus aren't "old" and the "new" menus shouldn't be called "new". The "new" menus are simply an easy way to make simple menus. You can still do more complex menus with the "old" menus.
__________________
fysiks 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 10:45.


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