Raised This Month: $ Target: $400
 0% 

Precache fault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 01-02-2011 , 10:14   Precache fault
Reply With Quote #1

When I open the server, I get this log:

Quote:
L 01/02/2011 - 15:485: [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]);
    }


Last edited by bibu; 01-02-2011 at 10:36.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-02-2011 , 10:28   Re: Precache fault
Reply With Quote #2

Use copy(), and where is precache_model() ?
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-02-2011 , 10:39   Re: Precache fault
Reply With Quote #3

Sorry, I forgot to copy the precache_model part. Still the same.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-02-2011 , 10:45   Re: Precache fault
Reply With Quote #4

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.
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-02-2011 , 10:58   Re: Precache fault
Reply With Quote #5

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.
bibu is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 01-02-2011 , 22:14   Re: Precache fault
Reply With Quote #6

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)
   }

__________________

Last edited by joaquimandrade; 01-02-2011 at 22:19.
joaquimandrade is offline
Reply


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


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