Raised This Month: $51 Target: $400
 12% 

precache error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 11-25-2020 , 22:32   precache error
Reply With Quote #1

i get this error when i m selecting skin from a menu.

Code:
FATAL ERROR (shutting down): Host_Error: PF_setmodel_I: no precache: t_covid_black
PHP Code:
new g_szCovidModels[ ][ ] = {
    
"ct_covid_black",
    
"ct_covid_green",
    
"ct_covid_red",
    
"ct_covid_white",
    
"ct_covid_yellow",
    
"t_covid_black",
    
"t_covid_green",
    
"t_covid_red",
    
"t_covid_white",
    
"t_covid_yellow"
}


public 
plugin_precache(){


    static 
covidmodels[256];
    static 
i
    
    
for ( 0<= charsmax(g_szCovidModels); i++){
        
formatex(covidmodelscharsmax(covidmodels), "models/menuskin/%s.mdl"g_szCovidModels[i])
        
precache_model(covidmodels);
    }

what is wrong ?
lexzor is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-25-2020 , 22:53   Re: precache error
Reply With Quote #2

PHP Code:
for ( 0sizeof(g_szCovidModels); i++){ 
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Ndrs
New Member
Join Date: Nov 2020
Old 11-25-2020 , 22:54   Re: precache error
Reply With Quote #3

PHP Code:
new covidmodels[256], g_szCovidModels[ ][ ] = {
    
"ct_covid_black",
    
"ct_covid_green",
    
"ct_covid_red",
    
"ct_covid_white",
    
"ct_covid_yellow",
    
"t_covid_black",
    
"t_covid_green",
    
"t_covid_red",
    
"t_covid_white",
    
"t_covid_yellow"
}


public 
plugin_precache(){
    for (new 
isizeof g_szCovidModelsi++){
        
formatex(covidmodelscharsmax(covidmodels), "models/menuskin/%s.mdl"g_szCovidModels[i])
        
precache_model(covidmodels)
    }

Ndrs is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-25-2020 , 23:00   Re: precache error
Reply With Quote #4

And
PHP Code:
covidmodels[256
Can be
PHP Code:
covidmodels[20
it's enough.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
lexzor
Veteran Member
Join Date: Nov 2020
Old 11-26-2020 , 01:54   Re: precache error
Reply With Quote #5

PHP Code:
new models[256], player_models[ ][ ] = {
    
"sias",
    
"fbi",
    
"isis",
    
"alqaeda"
    
//"mercenar",
    //"jack"
}

new 
covidmodels[256], g_szCovidModels[ ][ ] = {
    
"ct_covid_black",
    
"ct_covid_green",
    
"ct_covid_red",
    
"ct_covid_white",
    
"ct_covid_yellow",
    
"t_covid_black",
    
"t_covid_green",
    
"t_covid_red",
    
"t_covid_white",
    
"t_covid_yellow"
}

public 
plugin_precache(){
    
precache_modelg_szHatModel[0] )
    
precache_modelg_szHatModel[1] )

    for ( new 
0sizeof(player_models)-1i++){
        
formatex(modelscharsmax(models), "models/player/%s/%s.mdl"player_models[i], player_models[i])
        
precache_model(models)
    }
    
    for ( new 
0sizeof(g_szCovidModels)-1i++){
        
formatex(covidmodelscharsmax(covidmodels), "models/menuskin/%s.mdl"g_szCovidModels[i])
        
precache_model(covidmodels);
    }

still same problem, but only for covidmodels
lexzor is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-26-2020 , 07:25   Re: precache error
Reply With Quote #6

Player models must obey the path "models/player/model_name/model_name.mdl".
You can't put them in a random forder like "menuskin".

My suggestion is to use this function with your current setup:

Code:
precache_player_model(const szModel[], &id = 0) {     new model[128]     formatex(model, charsmax(model), "models/player/%s/%sT.mdl", szModel, szModel)     if(file_exists(model))         id = precache_generic(model)     static const extension[] = "T.mdl"     #pragma unused extension     copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")     return precache_model(model) }

Code:
for(new i; i < sizeof(g_szCovidModels); i++) {     precache_player_model(g_szCovidModels[i]) }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



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 14:27.


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