AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Issue Playing MP3 Files on Client Command (https://forums.alliedmods.net/showthread.php?t=325600)

SweetDickWilly 06-28-2020 18:25

Issue Playing MP3 Files on Client Command
 
I am trying to write a basic script that will play music on a client's command. I am running into a wall because I am getting a console error `[Sound] S_StartSound(): Failed to load sound 'everything_she_wants.mp3'. File is missing from disk or is invalid.` Is anyone able to give me some insight into what I am doing wrong?


PHP Code:

public void OnPluginStart()
{
   
RegConsoleCmd("sm_wham"Wham"plays Wham");
}

public 
void OnMapStart()
{
   
AddFileToDownloadsTable("sound/everything_she_wants.mp3");
   
PrecacheSound("everything_she_wants.mp3"true);
}

public 
Action Wham(int clientint args)
{
    
EmitSoundToClient(client"everything_she_wants.mp3");
    return 
Plugin_Handled;


My mp3 file is in my csgo_server/csgo/sound directory, I have tried everything from putting a `#` before my sound paths, changing the name of the file, putting the file in my local csgo directory; I am not getting any results. I either get the "missing file" error or my server console will say that the song file is not precached. Please if anyone can help me solve this blocker I would much appreciate it.

Wyon 06-29-2020 19:18

Re: Issue Playing MP3 Files on Client Command
 
https://wiki.alliedmods.net/CSGO_Qui...client_command

SweetDickWilly 06-29-2020 22:40

Re: Issue Playing MP3 Files on Client Command
 
Sir I could kiss you on the mouth, thank you very much!


All times are GMT -4. The time now is 19:29.

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