This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Sv_startsound not precached(0)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-29-2017 , 12:30   Sv_startsound not precached(0)
Reply With Quote #1

Hello. I always get this error when I start my local server. Plugin is compiled without any problems. But when I start game it shows me:
sv_startsound zombie_plague/zombie_hit_01.wav not precached(0)
But I have precached all in my file. There is the function:
HTML Code:
new const g_ZmHitSounds[][]=
{
    "zombie_plague/zombie_hit_01.wav",
    "zombie_plague/zombie_hit_02.wav",
    "zombie_plague/zombie_hit_03.wav",
    "zombie_plague/zombie_hit_04.wav",
    "zombie_plague/zombie_hit_05.wav"
}
public plugin_precache
HTML Code:
for (i = 0; i < sizeof(g_ZmHitSounds); i++)
	{
		precache_sound( g_ZmHitSounds[ i ] );
	}
OR (Is the same I guess)
HTML Code:
precache_sound( "zombie_plague/zombie_hit_01.wav" );
	precache_sound( "zombie_plague/zombie_hit_02.wav" );
	precache_sound( "zombie_plague/zombie_hit_03.wav" );
	precache_sound( "zombie_plague/zombie_hit_04.wav" );
	precache_sound( "zombie_plague/zombie_hit_05.wav" );
Now this is where I set sound:
HTML Code:
emit_sound(id, channel, g_ZmHitSounds[random_num(0, sizeof g_ZmHitSounds -1)], volume, attn, flags, pitch)
Please I need your help
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 08-29-2017 , 12:45   Re: Sv_startsound not precached(0)
Reply With Quote #2

If it's running under linux, check that the server has permissions to access all the files

If not, replace the file with another one, the wave file might be corrupted or of a wrong format (though I can't remember if that would just stop it from playing) just to see if it will work.

You might also gather information by connecting to the server with "developer 3" on and looking for errors with the precaching of the file

I'm just naming possible causes, it might not be any of them
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-29-2017 , 13:55   Re: Sv_startsound not precached(0)
Reply With Quote #3

No it is local server and its windows. Fileas also are not corrupte bcs I tried on another function and it worked
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-30-2017 , 06:09   Re: Sv_startsound not precached(0)
Reply With Quote #4

Problem Solved!
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-30-2017 , 06:12   Re: Sv_startsound not precached(0)
Reply With Quote #5

Quote:
Originally Posted by Don Marlboro View Post
Problem Solved!
Post the solution so others can learn from it if they stumble upon the same problem.
klippy is offline
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-30-2017 , 12:22   Re: Sv_startsound not precached(0)
Reply With Quote #6

If you set to precache with one function do it. I used to precache resources without EngFunc while I set sounds with EngFunc. I made all the same and I dont have problems anymore regarding precaching. But now I have bigger problem. Server crashes and says that I have precached more than 512 resources. So thread is still opened for answers
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-30-2017 , 13:13   Re: Sv_startsound not precached(0)
Reply With Quote #7

Quote:
Originally Posted by Don Marlboro View Post
If you set to precache with one function do it. I used to precache resources without EngFunc while I set sounds with EngFunc. I made all the same and I dont have problems anymore regarding precaching. But now I have bigger problem. Server crashes and says that I have precached more than 512 resources. So thread is still opened for answers

Show the full code....
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-30-2017 , 14:31   Re: Sv_startsound not precached(0)
Reply With Quote #8

If you want I can send you in PM bcs is private
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 08-31-2017 , 07:33   Re: Sv_startsound not precached(0)
Reply With Quote #9

No need to show the code
All HLDS servers have a hard-coded 512 limit on resources

This includes all the standard stuff that is always loaded in CS, eg models and sounds for weapons, models for players, sounds for footsteps, models for hostages etc

If your number of resouces is just close to the limit, then it might only crash on resource intensive maps (models, sounds on maps count as well). If you're at the limit then it will crash on any map. There is no solution besides removing some of your precached content.


There are multiple unprecacher plugins or modules online that can remove some of the garbage HLDS precaches that you will probably never use (a lot of half life stuff for example). Removing those will allow some space for your resources.
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Don Marlboro
Junior Member
Join Date: Sep 2016
Location: Albania
Old 08-31-2017 , 10:52   Re: Sv_startsound not precached(0)
Reply With Quote #10

Solved!
I had declared many constants with a single resource and I had precached them multiple. I precached simple and I dont have that problem anymore!
Don Marlboro is offline
Send a message via Skype™ to Don Marlboro
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 12:13.


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