AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Precache fault (https://forums.alliedmods.net/showthread.php?t=146867)

bibu 01-02-2011 10:14

Precache fault
 
When I open the server, I get this log:

Quote:

L 01/02/2011 - 15:48:35: [hns_blockmaker.amxx] [BM] Precache called.
Host_Error: PF_precache_model_I: Bad string ' '
or sometimes
Quote:

Host_Error: no precache: models/blockmaker/bm_block_platform.mdl
Code:

PHP Code:

new const gszBlockModelPlatform[] = "models/blockmaker/bm_block_platform.mdl";

//global array of strings to store the paths and filenames to the block models
new gszBlockModels[1][256];

enum
{
    
BM_PLATFORM        //A
};

public 
plugin_precache()
{
    
log_amx("[BM] Precache called.");

    
//set block models to defaults
    
gszBlockModels[BM_PLATFORM] = gszBlockModelPlatform;

    
//precache blocks
    
for (new 01; ++i)
    {
        
precache_model(gszBlockModels[i]);
    }



Arkshine 01-02-2011 10:28

Re: Precache fault
 
Use copy(), and where is precache_model() ?

bibu 01-02-2011 10:39

Re: Precache fault
 
Sorry, I forgot to copy the precache_model part. Still the same.

Arkshine 01-02-2011 10:45

Re: Precache fault
 
PF_precache_model_I: Bad string ' ' = Your string passed is wrong, more null string, that's why you better use copy(). Something you could check yourself if your var holds well the expected value before precaching.

Host_Error: no precache: models/blockmaker/bm_block_platform.mdl = Your call a native which needs such model and this one is not precached.

So, the problem is probably the model is not precached properly from the start.

bibu 01-02-2011 10:58

Re: Precache fault
 
How I said, my log_amx gets called. And before it worked flawlessly without copy(), I messed around something now this issue is new. Gonna try now the simple precache_model.

joaquimandrade 01-02-2011 22:14

Re: Precache fault
 
PHP Code:

enum
{
    
BM_PLATFORM        //A
BM_TYPE;

new 
BlockModels[BM_TYPE][] = 
{
  
"bm_block_platform.mdl" //A
}

new 
BLOCK_MODEL_MAX_LENGTH 100
new BLOCK_MODEL_PREFIX[] = "models/blockmaker/"

public plugin_precache()
{
   new 
blockModelPath[charsmax(BLOCK_MODEL_PREFIX) + BLOCK_MODEL_MAX_LENGTH 1]

   
copy(blockModelPath,charsmax(BLOCK_MODEL_PREFIX),BLOCK_MODEL_PREFIX)

   for (new 
BM_TYPE:BM_TYPE:0BM_TYPE; ++i)
   {
       
copy(blockModelPath[charsmax(BLOCK_MODEL_PREFIX)],BLOCK_MODEL_MAX_LENGTH,BlockModels[i])
       
precache_model(blockModelPath)
   }




All times are GMT -4. The time now is 02:14.

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