Raised This Month: $ Target: $400
 0% 

Offset MODELINDEX


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 10-20-2009 , 14:31   Offset MODELINDEX
Reply With Quote #1

So I saw how in zplague is setting modelindex offset , I set in my plugin too, is this correct?
PHP Code:
// Other
#define MAX_CLASSES 4

new const ZOMBIE_CLASSES[MAX_CLASSES][]= {
    
"zombieap1"// Player Model of hunter
    
"panic"// Player Model of boomer
    
"mummy"// Player Model of smoker
    
"zombieap4" // Player Model of tank


new 
PlayerClass[33];

new Array:
g_modelindex_zombie;

// plugin_precache
g_modelindex_zombie ArrayCreate(11);

new 
modelpath_human[100];
for(new 
0MAX_CLASSESi++)
{
    
formatex(modelpath_humansizeof modelpath_human 1"models/player/%s/%s.mdl"ZOMBIE_CLASSES[i], ZOMBIE_CLASSES[i])
    if( !
file_existsmodelpath_human ) )
    {
        return 
0;
    }

    
ArrayPushCell(g_modelindex_zombieengfunc(EngFunc_PrecacheModelmodelpath_human))

    
formatex(modelpath_humansizeof modelpath_human 1"models/player/%s/%st.mdl"ZOMBIE_CLASSES[i], ZOMBIE_CLASSES[i])
    if ( 
file_existsmodelpath_human ) )
    {
        
engfunc(EngFunc_PrecacheModelmodelpath_human);

        return 
1;
    }

    
formatex(modelpath_humansizeof modelpath_human 1"models/player/%s/%sT.mdl"ZOMBIE_CLASSES[i], ZOMBIE_CLASSES[i])
    if ( 
file_existsmodelpath_human ) )
    {
        
engfunc(EngFunc_PrecacheModelmodelpath_human);

        return 
1;
    }
}
// Ham Spawn Post
PlayerClass[id] = random_num(03)

fm_cs_set_user_model_index(idArrayGetCell(g_modelindex_zombiePlayerClass[id]))

// Stock
// Set the precached model index (updates hitboxes server side)
stock fm_cs_set_user_model_index(idvalue)
{
    
set_pdata_int(id491value5)

Btw I don't know anything about Arrays... But I learned a bit from zplague.
I'm just confused...
__________________

Last edited by xbatista; 10-20-2009 at 14:39.
xbatista is offline
Send a message via Skype™ to xbatista
 



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:37.


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