AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [CS GO] EmitSoundToAll dont work (https://forums.alliedmods.net/showthread.php?t=308911)

Dr.Mohammad 07-07-2018 23:07

[CS GO] EmitSoundToAll dont work
 
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]); 


LenHard 07-08-2018 03:51

Re: [CS GO] EmitSoundToAll dont work
 
Change

Code:

S_sound_noscope[1]
To

Code:

S_sound_noscope[0]
Arrays start from 0

headline 07-08-2018 04:14

Re: [CS GO] EmitSoundToAll dont work
 
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",
}; 


Dr.Mohammad 07-08-2018 05:45

Re: [CS GO] EmitSoundToAll dont work
 
Quote:

Originally Posted by LenHard (Post 2601850)
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"); 


Facksy 07-08-2018 08:58

Re: [CS GO] EmitSoundToAll dont work
 
Code:

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

EmitSoundToAll("noscope/countdown.mp3");


Ilusion9 07-09-2018 14:48

Re: [CS GO] EmitSoundToAll dont work
 
PHP Code:


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



LenHard 07-09-2018 19:35

Re: [CS GO] EmitSoundToAll dont work
 
Quote:

Originally Posted by Ilusion9 (Post 2602397)
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.

Dr.Mohammad 01-14-2019 12:31

Re: [CS GO] EmitSoundToAll dont work
 
Quote:

Originally Posted by Facksy (Post 2601940)
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 :((

Facksy 01-14-2019 15:58

Re: [CS GO] EmitSoundToAll dont work
 
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

Indarello 01-14-2019 16:59

Re: [CS GO] EmitSoundToAll dont work
 
Also csgo require * in path when you precache or play sound that you download on client, but not for standart sounds


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

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