Raised This Month: $79 Target: $400
 19% 

Solved Issue Playing MP3 Files on Client Command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SweetDickWilly
Junior Member
Join Date: Nov 2018
Location: Paradise, Nevada
Old 06-28-2020 , 18:25   Issue Playing MP3 Files on Client Command
Reply With Quote #1

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.

Last edited by SweetDickWilly; 06-29-2020 at 22:39. Reason: Issue is solved
SweetDickWilly is offline
 


Thread Tools
Display Modes

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 00:04.


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