Raised This Month: $ Target: $400
 0% 

Changing weapons model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-09-2011 , 14:57   Re: Changing weapons model
Reply With Quote #4

Found the script -
PHP Code:
#include <amxmodx> 
#include <engine> 
#include <fakemeta> 
new VIEW_MODEL[]    = "models/v_newKnife.mdl" 
new PLAYER_MODEL[]    = "models/p_newKnife.mdl" 
new WORLD_MODEL[]    = "models/w_knife.mdl"
new OLDWORLD_MODEL[]    = "models/w_knife.mdl"
new PLUGIN_NAME[]        = "Custom Knife Model" 
new PLUGIN_AUTHOR[]    = "Cheap_Suit" 
new PLUGIN_VERSION[]     = "1.0" 
public plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)     
    
register_event("CurWeapon""Event_CurWeapon""be","1=1")
    
register_forward(FM_SetModel"fw_SetModel")

public 
plugin_precache() 
{    
    
precache_model(VIEW_MODEL)     
    
precache_model(PLAYER_MODEL
    
precache_model(WORLD_MODEL)

public 
Event_CurWeapon(id
{     
    new 
weaponID read_data(2
    if(
weaponID != CSW_KNIFE)
        return 
PLUGIN_CONTINUE
    set_pev
(idpev_viewmodel2VIEW_MODEL)
    
set_pev(idpev_weaponmodel2PLAYER_MODEL)
    
    return 
PLUGIN_CONTINUE 
}
public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity)) 
        return 
FMRES_IGNORED
    
if(!equali(modelOLDWORLD_MODEL)) 
        return 
FMRES_IGNORED
    
new className[33]
    
entity_get_string(entityEV_SZ_classnameclassName32)
    
    if(
equal(className"weaponbox") || equal(className"armoury_entity") || equal(className"grenade"))
    {
        
engfunc(EngFunc_SetModelentityWORLD_MODEL)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

Now how can I make it to change the knife model only when I write a command in chat and at a new round to reset back to the normal knife model?
dreamedward 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 09:12.


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