Raised This Month: $ Target: $400
 0% 

Model not precached? *HELP*


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-05-2014 , 10:29   Re: Model not precached? *HELP*
Reply With Quote #7

You should save the knives in array like this:

PHP Code:
enum
{
    DEFAULT = 
0,
    
DESERT_BLADE,
    
BAYONET,
    
GOLDEN,
    
POCKET
}

new 
vModel[33], pModel[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Item_Deploy"weapon_knife""fwd_Deploy"1); // knife deploy
}

public 
fwd_Deploy(iEnt)
{
    static 
id;
    
id get_pdata_cbase(iEnt414); //41 is m_pPlayer offset 4 is linux offset
    
    
SetUserSkin(id, const p_model[], const v_model[], knife_model[id]);
}

public 
PressedVIPKnife(idkeyKnife)
{
    new 
ClipAmmoWeapon get_user_weapon(idClipAmmo)  
    if ( 
Weapon != CSW_KNIFE 
        return 
PLUGIN_HANDLED 
     
    
switch (key)
    {
        case 
0: { // 1 
            
format(vModel,32,"models/vip-models/v_desert.mdl"
            
format(pModel,32,"models/vip-models/p_desert.mdl"
            
SetUserSkin(idpModelvModelDESERT_BLADE);
        } 
        case 
1: { // 2 
            
format(vModel,32,"models/vip-models/v_m9.mdl"
            
format(pModel,32,"models/vip-models/p_m9.mdl"
            
SetUserSkin(idpModelvModelBAYONET);
        } 
        case 
2: { // 3 
            
format(vModel,32,"models/vip-models/v_golden.mdl"
            
format(pModel,32,"models/vip-models/p_golden.mdl"
            
SetUserSkin(idpModelvModelGOLDEN);
        } 
        case 
3: { // 4 
            
format(vModel,32,"models/vip-models/v_pocket.mdl"
            
format(pModel,32,"models/vip-models/p_pocket.mdl"
            
SetUserSkin(idpModelvModelPOCKET);
        } 
        case 
4: { // 5 
            
format(vModel,32,"models/v_knife.mdl"
            
format(pModel,32,"models/p_knife.mdl"
            
SetUserSkin(idpModelvModel, DEFAULT);
        } 
        case 
MENU_EXIT: { // 0 
        
        

    } 
    
entity_set_string(idEV_SZ_viewmodelvModel
    
entity_set_string(idEV_SZ_weaponmodelpModel
    
    return 
PLUGIN_HANDLED
}

SetUserSkin(id, const p_model[], const v_model[], knife)
{
    
entity_set_string(idEV_SZ_weaponmodelpModel);
    
entity_set_string(idEV_SZ_viewmodelvModel) ;
    
knife_model[id] = knife

I just figure out how it was ;)
__________________
What are you looking for here?
DavidJr 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 10:12.


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