Raised This Month: $32 Target: $400
 8% 

Solved [CS GO] EmitSoundToAll dont work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-07-2018 , 23:07   [CS GO] EmitSoundToAll dont work
Reply With Quote #1

hi guys!

i searched on the forum and google but can not solve.
please help me.

PHP Code:
char S_sound_noscope[1][] =
{
    
"noscope/countdown.mp3",
};

EmitSoundToAll(S_sound_noscope[1]); 

Last edited by Dr.Mohammad; 01-15-2019 at 02:26.
Dr.Mohammad is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 07-08-2018 , 03:51   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #2

Change

Code:
S_sound_noscope[1]
To

Code:
S_sound_noscope[0]
Arrays start from 0
__________________
LenHard is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 07-08-2018 , 04:14   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #3

LenHard's response is correct, but as a tip: if you're declaring a 2d array as you are, you can leave out sizes and let the compiler handle it.

PHP Code:
char S_sound_noscope[][] =
{
    
"noscope/countdown.mp3",
}; 
headline is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-08-2018 , 05:45   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #4

Quote:
Originally Posted by LenHard View Post
Change

Code:
S_sound_noscope[1]
To

Code:
S_sound_noscope[0]
Arrays start from 0
i tested. do not work and do not play sound.

i have not any error th the server.

PHP Code:
EmitSoundToAll("noscope/countdown.mp3"); 

Last edited by Dr.Mohammad; 07-08-2018 at 05:46.
Dr.Mohammad is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 07-08-2018 , 08:58   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #5

Code:
OnMapStart()
{
	AddFileToDownloadTable("sound/noscope/countdown.mp3");
	PrecacheSound("noscope/countdown.mp3");
}

EmitSoundToAll("noscope/countdown.mp3");
__________________
My Steam I take private requests if related with TF2
My Plugins

Last edited by Facksy; 07-08-2018 at 09:00.
Facksy is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-09-2018 , 14:48   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #6

PHP Code:

for(int i 1<= MaxClientsi++)
{
      
ClientCommand(i"play noscope/countdown.mp3");

Ilusion9 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 07-09-2018 , 19:35   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #7

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

for(int i 1<= MaxClientsi++)
{
      
ClientCommand(i"play noscope/countdown.mp3");

Check if the players are in game, otherwise that would spit out many errors.
__________________
LenHard is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 01-14-2019 , 12:31   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #8

Quote:
Originally Posted by Facksy View Post
Code:
OnMapStart()
{
	AddFileToDownloadTable("sound/noscope/countdown.mp3");
	PrecacheSound("noscope/countdown.mp3");
}

EmitSoundToAll("noscope/countdown.mp3");
hi,
i used your cod!!
but dont work!!

error:
[Sound] S_StartSound(): Failed to load sound 'jailbreak\round\ambience1.mp3'. File is missing from disk or is invalid.

please help me.
i need (

Last edited by Dr.Mohammad; 01-14-2019 at 12:31.
Dr.Mohammad is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 01-14-2019 , 15:58   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #9

Code:
public void OnMapStart()
{
	AddFileToDownloadsTable("sound\jailbreak\round\ambience1.mp3");
	PrecacheSound("jailbreak\round\ambience1.mp3");
}

EmitSoundToAll("jailbreak\round\ambience1.mp3");
It should looks like that,
Your error say that you don't have downloaded the file, make sure the sound is exactly at its place, if you have a fastdl server, make sure the sound is on it too
__________________
My Steam I take private requests if related with TF2
My Plugins
Facksy is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 01-14-2019 , 16:59   Re: [CS GO] EmitSoundToAll dont work
Reply With Quote #10

Also csgo require * in path when you precache or play sound that you download on client, but not for standart sounds

Last edited by Indarello; 01-14-2019 at 17:00.
Indarello is offline
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 05:22.


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