Raised This Month: $ Target: $400
 0% 

Help with Precache


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 04-22-2022 , 11:38   Help with Precache
Reply With Quote #1

Hi, i wanna like precache, all these models in a more simplified way?

PHP Code:
enum Knives 

    
NoKnifeSet = -1
    
Ace
    
Batman
    
Blade
    
Berserker,
    
BHammer,
    
Chucky
    
Copito,
    
DarthMaul,
    
Vader,
    
Diamond,
    
Dual,
    
Palpatine,
    
GHammer,
    
Guadana,
    
Guitarra,
    
Machetes,
    
Obiwan
    
PHammer,
    
PSpear,
    
Riddick,
    
Runeblade,
    
ThanosH,
    
Vampire,
    
Vulcan,
    
WHammer,
    
Wolf,
    
Wolv,
    
Yoda
}

enum KnifeModels 

    
ModelName64 ],
    
ViewModel64 
}

new const 
g_ModelData[Knives][KnifeModels] =  

    
// { "default"     ,       "models/v_knife.mdl" },
    
"Ace"     ,       "models/shmod/ace_v_knife.mdl" },  
    { 
"Batman"     ,      "models/shmod/batmanknife_v.mdl" },  
    { 
"Blade"     ,        "models/shmod/blade_knife_v.mdl" },  
    { 
"Berserker"     ,       "models/shmod/breyke_knife.mdl" },  
    { 
"BHammer"     ,      "models/shmod/v_crow_hammer.mdl" },  
    { 
"Chucky"     ,      "models/shmod/chucky_knife.mdl" },
    { 
"Copito"     ,      "models/shmod/v_copito.mdl" },
    { 
"DarthMaul"    ,     "models/shmod/darthmaul_knife.mdl" },
    { 
"Vader"     ,    "models/shmod/darth_saber_red_v.mdl" },
    { 
"Diamond"     ,      "models/shmod/v_diamond_sword.mdl" },
    { 
"Dual"     ,      "models/shmod/gold_parry.mdl" },
    { 
"Palpatine"    ,    "models/shmod/darth_saber_red_v.mdl" },
    { 
"GHammer"     ,      "models/shmod/v_gold_hammer.mdl" },
    { 
"Guadana"     ,      "models/shmod/hoz.mdl" },
    { 
"Guitarra"     ,      "models/shmod/guitarra.mdl" },
    { 
"Machetes"     ,      "models/shmod/v_machete.mdl" },
    { 
"Obiwan"     ,    "models/shmod/obiwan_saber_blu_v.mdl" },     
    { 
"PHammer"     ,      "models/shmod/v_paladin_hammer.mdl" },
    { 
"PSpear"     ,      "models/shmod/v_spear_paladin.mdl" },
    { 
"Riddick"     ,     "models/shmod/riddick_knife.mdl" },
    { 
"Runeblade"    ,    "models/shmod/v_runeblade.mdl" },
    { 
"ThanosH"    ,    "models/shmod/v_thanos_hands.mdl" },
    { 
"Vampire"    ,    "models/shmod/v_vampir_knife.mdl" },
    { 
"Vulcan"    ,    "models/shmod/v_vulcan_axe.mdl" },
    { 
"WHammer"    ,    "models/shmod/v_white_hammer.mdl" },
    { 
"Wolf"    ,    "models/shmod/v_wolf_sword.mdl" },
    { 
"Wolv"     ,    "models/shmod/wolv_knife.mdl" },
    { 
"Yoda"     ,        "models/shmod/yoda_v.mdl" }
}

new 
Knives:knife_model[SH_MAXSLOTS+1]; 

PHP Code:
public plugin_precache() 
{
precache_model("models/shmod/breyke_knife.mdl")    
    
precache_model("models/shmod/v_crow_hammer.mdl")    
    
precache_model("models/shmod/v_copito.mdl")            
    
precache_model("models/shmod/v_diamond_sword.mdl")    
    
precache_model("models/shmod/gold_parry.mdl")        
    
precache_model("models/shmod/v_gold_hammer.mdl")    
    
precache_model("models/shmod/hoz.mdl")            
    
precache_model("models/shmod/guitarra.mdl")            
    
precache_model("models/shmod/v_machete.mdl")        
    
precache_model("models/shmod/v_paladin_hammer.mdl")    
    
precache_model("models/shmod/v_spear_paladin.mdl")    
    
precache_model("models/shmod/v_runeblade.mdl")        
    
precache_model("models/shmod/v_thanos_hands.mdl")
    
precache_model("models/shmod/v_vampir_knife.mdl")
    
precache_model("models/shmod/v_vulcan_axe.mdl")
    
precache_model("models/shmod/v_white_hammer.mdl")
    
precache_model("models/shmod/v_wolf_sword.mdl")

I would like to write it something like this but this was wrong

PHP Code:
public plugin_precache() 
{
    
    new 
tempfile128 ]; 
    
    for ( new 
iModelIndex iModelIndex sizeofg_ModelData ) ; iModelIndex++ ) {
        
        
formatextempfile charsmaxtempfile ) , "%s"g_ModelData[0][iModelIndex]); 
        
precache_modeltempfile );
    }

Arje is offline
 


Thread Tools
Display Modes

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


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