Raised This Month: $51 Target: $400
 12% 

Solved Issue Playing MP3 Files on Client Command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweetDickWilly
Junior Member
Join Date: Nov 2018
Location: Las Vegas, 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
Wyon
Junior Member
Join Date: Mar 2018
Old 06-29-2020 , 19:18   Re: Issue Playing MP3 Files on Client Command
Reply With Quote #2

https://wiki.alliedmods.net/CSGO_Qui...client_command
Wyon is offline
SweetDickWilly
Junior Member
Join Date: Nov 2018
Location: Las Vegas, Nevada
Old 06-29-2020 , 22:40   Re: Issue Playing MP3 Files on Client Command
Reply With Quote #3

Sir I could kiss you on the mouth, thank you very much!
SweetDickWilly 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 13:31.


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