Raised This Month: $ Target: $400
 0% 

[HELP]Change weapon model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2009 , 22:37   Re: [HELP]Change weapon model
Reply With Quote #4

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

#define VERSION "0.0.1"

#define EXTRAOFFSET_WEAPON 4
#define m_pPlayer 41

public plugin_init()
{
    
register_plugin("Ultra Nade"VERSION"Author")

    
RegisterHam(Ham_Item_Deploy"weapon_hegrenade""HeGrenade_Deploy"1)
    
register_forward(FM_SetModel"SetModel")
}

public 
plugin_precache()
{
    
precache_model("models/v_ultranade.mdl")
    
precache_model("models/p_ultranade.mdl")
    
precache_model("models/w_ultranade.mdl")
}

public 
HeGrenade_Deploy(const iEntity)
{
    new 
iOwner get_pdata_cbase(iEntitym_pPlayerEXTRAOFFSET_WEAPON)
    if( 
iOwner )
    {
        
set_pev(iOwnerpev_viewmodel2"models/v_ultranade.mdl")
        
set_pev(iOwnerpev_weaponmodel2"models/p_ultranade.mdl")
    }
}

public 
SetModel(const iEntity, const szModel[])
{
    if( 
pev_valid(iEntity) && equal(szModel"models/w_hegrenade.mdl") )
    {
        
engfunc(EngFunc_SetModeliEntity"models/w_ultranade.mdl")
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-10-2009 at 05:37.
ConnorMcLeod is offline
 



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 17:41.


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