Raised This Month: $ Target: $400
 0% 

Host_Error: PF_precache_generic_I: Bad string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 09-16-2013 , 00:55   Host_Error: PF_precache_generic_I: Bad string
Reply With Quote #1

Hello,

Turn off my server with the reason:
Code:
FATAL ERROR (shutting down): Host_Error: PF_precache_generic_I: Bad string 'name'
FATAL ERROR (shutting down): Host_Error: PF_precache_generic_I: Bad string
The code looks like this:
Code:
new szFile[127], szStringFile[100][256];
public plugin_precache() {
	format(szFile, 126, "addons/amxmodx/configs/roundsound.ini");
	new fHandle = fopen(szFile, "rt");

	if(!fHandle) return 0;

	new szBuffer[256], pos[256], iLines;
	while(!feof(fHandle)) {
		fgets(fHandle, szBuffer, 255);
		if(szBuffer[0] == ';') continue;

		szStringFile[iLines++] = szBuffer;
	}
	fclose(fHandle);

	for(new i; i < iLines; i++) {
		parse(szStringFile[i], pos, 255);
		precache_generic(pos);
	}
	return 0;
}
roundsound.ini file looks like this:
Code:
"sound/topmasters_fun/3.mp3" "Mega Dance - A ja wole Coca-Cole" "15"
"sound/topmasters_fun/4.mp3" "Benny G. And BBX - Feel It Way Down (TAITO Remix)" "16"
"sound/topmasters_fun/5.mp3" "DJ Trademark - Hard To Stop (Vicetone x Ne-Yo x Daft Punk)" "16"

Last edited by OnePL; 09-16-2013 at 00:55.
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-16-2013 , 13:22   Re: Host_Error: PF_precache_generic_I: Bad string
Reply With Quote #2

Try to :

use trim to remove spaces and end of line
use parse so you only keep the sound path instead of path + description

Code:
new szFile[127], szStringFile[100][256]; public plugin_precache() {     format(szFile, 126, "addons/amxmodx/configs/roundsound.ini");     new fHandle = fopen(szFile, "rt");     if(!fHandle) return 0;     new szBuffer[256], szSound[256], iLines;     while(!feof(fHandle)) {         fgets(fHandle, szBuffer, 255);         trim(szBuffer);         if(szBuffer[0] == ';') continue;         // szStringFile[iLines++] = szBuffer;         parse(szBuffer, szStringFile[iLines++], charsmax(szStringFile[]));     }     fclose(fHandle);     for(new i; i < iLines; i++) {         // parse(szStringFile[i], pos, 255);         // precache_generic(pos);         precache_generic(szStringFile[i]);     }     return 0; }
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-16-2013 at 13:22.
ConnorMcLeod is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 09-16-2013 , 14:17   Re: Host_Error: PF_precache_generic_I: Bad string
Reply With Quote #3

It did not help

Code:
Host_Error: PF_precache_sound_I: Bad string 'ďťżtopmasters_fun/rs/3.mp3'
FATAL ERROR (shutting down): Host_Error: PF_precache_sound_I: Bad string 'ďťżtopmasters_fun/rs/3.mp3'
I replaced precache_generic to precache_sound
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-16-2013 , 16:06   Re: Host_Error: PF_precache_generic_I: Bad string
Reply With Quote #4

Is the file formatted as ANSI or UTF-8?
I only get the error when trying to precache nothing (an empty line). Otherwise it works like it should...
__________________

Last edited by Black Rose; 09-16-2013 at 16:16.
Black Rose is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 09-16-2013 , 16:31   Re: Host_Error: PF_precache_generic_I: Bad string
Reply With Quote #5

Thanks! I changed the file encoding from UTF-8 to ANSI and working properly.
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
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 19:09.


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