PDA

View Full Version : [CSGO] - EmitSoundtoWTF


klin34970
10-05-2014, 07:36
decl String:bufferString[PLATFORM_MAX_PATH];
Format(bufferString, PLATFORM_MAX_PATH, "sound/%s", S_track_bomb_way_sound[max_map][max_direction][i]);

if(FileExists(bufferString,true))
{
AddToStringTable(FindStringTable("soundprecache"), S_track_bomb_way_sound[max_map][max_direction][i]);
AddFileToDownloadsTable(bufferString);

if(B_active_track_bomb_csgo_dev)
{
LogMessage("AddToStringTable: %s | AddFileToDownloadsTable: %s", S_track_bomb_way_sound[max_map][max_direction][i], bufferString);
}
}

Log :
AddToStringTable: elite-unit/track_bomb/prepare.mp3 | AddFileToDownloadsTable: sound/elite-unit/track_bomb/prepare.mp3

EmitSoundToClient(c, S_track_bomb_way[p][i][w],_,_,_,_,1.0);

I'm trying to play a sound on CSGO, but impossible to play and no error console/ingame.
Server is sendind the mp3 to client, I check folder and sound everything works.

floube
10-05-2014, 07:42
Try using EmitSoundAny (https://forums.alliedmods.net/showthread.php?t=237045), it is made to work for CS:GO.

klin34970
10-05-2014, 08:24
I checked the code of Quake Sounds v3. It's the same like me.

xf117
10-05-2014, 09:37
don't you need a * when you add sound to string table or play it?
The end string for stringtable and emitsound:
*elite-unit/track_bomb/prepare.mp3
The end string for download table is the same:
sound/elite-unit/track_bomb/prepare.mp3

klin34970
10-05-2014, 10:59
Oh right, I will test, THX.

klin34970
10-05-2014, 11:52
Ok, I was missing this * just like you said.