Raised This Month: $ Target: $400
 0% 

[SOLVED]change weapon model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-07-2009 , 10:59   [SOLVED]change weapon model
Reply With Quote #1

Hi.

first i dont like to use any plugin. i need this code & tried to find out how, but ...

i just wanna to change the model of knife. i just need a mini code to add it in my mod.
__________________

Last edited by One; 06-18-2009 at 07:46.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-07-2009 , 11:03   Re: change weapon model
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=40822
__________________
Bugsy is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-07-2009 , 11:05   Re: change weapon model
Reply With Quote #3

PHP Code:
// IN PLUGIN INIT!!! //
register_event("CurWeapon","ev_CurWeapon""be""1=1")

public 
ev_CurWeapon(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id)) 
    {
        return 
PLUGIN_HANDLED;
    }
           new 
Weapon_Id read_data(2)

           if(
Weapon_Id == CSW_KNIFE 
    {
                     
set_pev(idpev_viewmodel2"models/v_knife_your.mdl")
           }
           return 
PLUGIN_CONTINUE;

xbatista is offline
Send a message via Skype™ to xbatista
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-07-2009 , 15:15   Re: change weapon model
Reply With Quote #4

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

#define m_pPlayer    41

new const CUSTOM_KNIFE_MODEL[] =  "models/v_knife_r.mdl"

public plugin_precache()
{
    
precache_model(CUSTOM_KNIFE_MODEL)
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Item_Deploy"weapon_knife""Knife_Deploy"1)
}

public 
Knife_DeployiKnife )
{
    new 
id get_pdata_cbase(iKnifem_pPlayer4)
    
set_pev(idpev_viewmodel2CUSTOM_KNIFE_MODEL)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-08-2009 , 09:45   Re: change weapon model
Reply With Quote #5

TY but error :

PHP Code:
SV_ModelIndexmodels/CM/v_BEER.mdl not precached
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-08-2009 , 09:47   Re: change weapon model
Reply With Quote #6

you heard about precache?
PHP Code:
public plugin_precache()
    
precache_model"models/CM/v_BEER.mdl" ); 
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-18-2009 , 07:41   Re: change weapon model
Reply With Quote #7

PHP Code:
new const CUSTOM_SCOUT_MODEL[] =  "models/v_shooter.mdl"
new const CUSTOM_SCOUT_P[] = "models/p_shooter.mdl"

RegisterHam    (Ham_Item_Deploy"weapon_scout""model_dep"1)

public 
model_depid )
{
    new 
id get_pdata_cbase(id414)
    
set_pev(idpev_viewmodelCUSTOM_SCOUT_MODEL)
    
set_pev(idpev_viewmodel CUSTOM_SCOUT_P)


this should work too or not?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-18-2009 , 07:43   Re: change weapon model
Reply With Quote #8

Change this
PHP Code:
public model_depid )
{
    new 
id get_pdata_cbase(id414)
    
set_pev(idpev_viewmodelCUSTOM_SCOUT_MODEL)
    
set_pev(idpev_viewmodel CUSTOM_SCOUT_P)

To this :
PHP Code:
public model_depiEnt )
{
    new 
id get_pdata_cbase(iEnt414)
    
set_pev(idpev_viewmodelCUSTOM_SCOUT_MODEL)
    
set_pev(idpev_weaponmodel2CUSTOM_SCOUT_P)


Last edited by xbatista; 06-18-2009 at 07:48.
xbatista is offline
Send a message via Skype™ to xbatista
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-18-2009 , 07:46   Re: change weapon model
Reply With Quote #9

hihi ma bad.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-18-2009 , 07:47   Re: [SOLVED]change weapon model
Reply With Quote #10

I've updated my post check again
xbatista is offline
Send a message via Skype™ to xbatista
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 02:23.


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