AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Radio sounds (https://forums.alliedmods.net/showthread.php?t=187460)

Backstabnoob 06-13-2012 12:40

Radio sounds
 
Are default CS radio sounds precached and if they are, can they be unprecached?

Arkshine 06-13-2012 13:24

Re: Radio sounds
 
Yes, they are precached otherwise you would not be able to hear them, because if a sound played with EmitSound and not precached, the server will crash. And yes, if you block the menu/command and hook some forward (try FM_PrecacheSound), you can block the precache, but be aware if a plugin emits the sound and the sound is not precached, you server will die.

Backstabnoob 06-13-2012 13:28

Re: Radio sounds
 
I know it will crash, I just wanted to know if they are precached and if I am able to unprecache them.

AFAIK sounds don't have to be precached if you're going to execute 'spk' command on the client. But that probably applies only to plugins. Thank you, that's some nice space under the precache limit for me.

bibu 06-13-2012 15:44

Re: Radio sounds
 
I thought unprecached sounds would not crash, but would give more like an error message in the console, or is that false?

Backstabnoob 06-13-2012 15:45

Re: Radio sounds
 
false :)

Exolent[jNr] 06-13-2012 16:08

Re: Radio sounds
 
Quote:

Originally Posted by bibu (Post 1728178)
I thought unprecached sounds would not crash, but would give more like an error message in the console, or is that false?

If using with "spk" command, an error will be in player's console saying it doesn't exist.
It won't crash the server since the command is client-side only.

If using with emit_sound(), then it will crash the server if it is not precached.
This is because the sound is played server-side.

GuskiS 07-09-2014 09:55

Re: Radio sounds
 
Did you ever succeed to unpreacache them? I'm trying but no success.

claudiuhks 07-09-2014 16:46

Re: Radio sounds
 
PHP Code:

// Sound Precache Forward
public fw_PrecacheSound(const sound[])
{
 
// Block all those unneeeded hostage sounds
 
if (equal(sound"hostage"7))
  return 
FMRES_SUPERCEDE;
 
 return 
FMRES_IGNORED;


Code by MeRcyLeZZ.

GuskiS 07-09-2014 16:55

Re: Radio sounds
 
I tried this code: https://forums.alliedmods.net/showthread.php?t=209421
But when I debug in precache radio commands, there are only some of the sound, none of them from radio1-4 commands.


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

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