AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prechace_generic Bad String (https://forums.alliedmods.net/showthread.php?t=220019)

UchihaSkills 07-05-2013 21:18

Prechace_generic Bad String
 
PHP Code:

Host_ErrorPF_precache_generic_IBad string '////////////////////////////////////////////////////////////'
FATAL ERROR (shutting down): Host_ErrorPF_precache_generic_IBad string 

Hey can someone tell me what that is? And how to fix it?
.. I think that a Plugin cause this Error and i think its my Jailmod.amxx but i dont know how to fix it.

Serkan Kischa 07-06-2013 04:23

Re: Prechace_generic Bad String
 
Im sure its because you use the newest HLDS

UchihaSkills 07-06-2013 04:31

Re: Prechace_generic Bad String
 
Well the Error comes up on Mapchange. It doenst come on every mapchange only on FEW maps.

ConnorMcLeod 07-06-2013 04:37

Re: Prechace_generic Bad String
 
Run this once :

PHP Code:

#include < amxmodx >

// #pragma semicolon 1

#define PLUGIN "17b Res utf BOM remover"
#define VERSION "0.0.1"

new Trie:g_tDefaultRes

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );
    
g_tDefaultRes TrieCreate()
    
TrieSetCellg_tDefaultRes "de_storm.res"1);
    
TrieSetCellg_tDefaultRes "default.res"1);

    
set_task(10.0"Clean_Res_Files");
}

public 
Clean_Res_Files()
{
    new 
szMapsFolder[] = "maps";
    new const 
szResExt[] = ".res";
    new 
szResFile[64], iLen;
    new 
dp open_dir(szMapsFolderszResFilecharsmax(szResFile));
    
    if( !
dp )
    {
        return;
    }

    
// server_print("Opening %s folder (%s)", szMapsFolder, szResFile)
    
new szFullPathFileName[128];
    do
    {
        
// server_print("Proceeding %s", szResFile)
        
iLen strlen(szResFile)
        if( 
iLen && equali(szResFile[iLen-4], szResExt) )
        {
            if( 
TrieKeyExists(g_tDefaultResszResFile) )
            {
                
// server_print("Default %s file, continuing...", szResFile)
                
continue
            }
            
            
formatex(szFullPathFileNamecharsmax(szFullPathFileName), "%s/%s"szMapsFolderszResFile)
            
write_file(szFullPathFileName"/////////////////////////////////////////////////////////////^n"0);
            
server_print("Proceeded %s"szResFile);
        }
    }
    while( 
next_file(dpszResFilecharsmax(szResFile)) )
    
    
close_dir(dp)



UchihaSkills 07-06-2013 04:41

Re: Prechace_generic Bad String
 
Thanks i will test it now.

UchihaSkills 07-06-2013 04:47

Re: Prechace_generic Bad String
 
Wow Conor im suprised it works...

Arkshine 07-06-2013 05:27

Re: Prechace_generic Bad String
 
There is nothing surprising. It's because .res files made by 17buddies site are in the UTF-8 format (with BOM) and since the latest hlds update you have to use a format wihtout BOM. You get Bad String because the engine doesn't like the extra bytes put at the top of file. What does the plugin is to loop on all .res files, and replacing first line by the same string which removes first bytes.

UchihaSkills 07-06-2013 05:32

Re: Prechace_generic Bad String
 
Well im suprised about that a Plugin can fix this Error.
And arkshine thanks i understand the error now :)
And btw i just noticed this "MonsterAI (Paused)" What is that? ^^

Arkshine 07-06-2013 05:54

Re: Prechace_generic Bad String
 
Something like an improved version of MonsterMod but with a complete API and ability to customize easily things. Purpose is originally to have full control on a monster to do what you want with it from a pawn plugin or module.

UchihaSkills 07-06-2013 05:57

Re: Prechace_generic Bad String
 
Sounds great. API is always good ;D


All times are GMT -4. The time now is 06:26.

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