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

[Solved]Failed to load sound "sinsic\getready.mp3", file probably missing from disk


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sinsic
Senior Member
Join Date: May 2012
Old 05-12-2015 , 10:04   [Solved]Failed to load sound "sinsic\getready.mp3", file probably missing from disk
Reply With Quote #1

Hi,
I feel dumb asking this but I did search and try everything I saw first. Couldn't get it working.

What I'm trying to do is simple, play a custom sound to all players.

Basically I check if it is the first death and if it is, restart the game and play the sound also after teams are swapped.

PHP Code:
.
.
.
public 
OnPluginStart()
{
    
sm_DMHTSwap_version CreateConVar("sm_DMHTSwap_version""1.0.5""DM Half Time Swap Version."FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
HookEvent("player_death"event_player_death);
    
PrecacheSound("sinsic/getready.mp3"true);
}

public 
OnConfigsExecuted()
{
    
AddFileToDownloadsTable("sound/sinsic/getready.mp3");
}

public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
g_bFirstDeath)
    {
        
ServerCommand("sm plugins reload sm_spawning");
        
ServerCommand("mp_restartgame 1");
        
g_bFirstDeath false;
        
EmitSoundToAll("sinsic/getready.mp3");
.
.

It downloads the sound to the client side but still prints to console "Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repository" when it should play.

File locations:
Server Side
cstrike/sound/sinsic/getready.mp3

Fast DL
steam/sound/sinsic/getready.mp3.bz2

And when client connects, file is downloaded to
cstrike\download\sound\sinsic\getready.mp3


I also tried
adding the sound at server side to cstrike/custom/my_custom_staff/sound/sinsic/getready.mp3
PreCaching at OnConfigsExecuted()
using wav instead of mp3

If you need the full plugin here it is:
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdktools_sound>

new Handle:sm_DMHTSwap_version;
new 
bool:g_bSwapped;
new 
bool:g_bFirstDeath;
public 
Plugin:myinfo 
    {
    
name "DM Half Time Swap",
    
author "Sinsic",
    
description "Half time team swap for DM Maps",
    
version "1.0.5",
    
url ""
};

public 
OnMapStart(){
    
g_bSwapped false;
    
g_bFirstDeath true;
}

public 
OnPluginStart()
{
    
sm_DMHTSwap_version CreateConVar("sm_DMHTSwap_version""1.0.5""DM Half Time Swap Version."FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
HookEvent("player_death"event_player_death);
    
PrecacheSound("sinsic/getready.mp3"true);
}

public 
OnConfigsExecuted()
{
    
AddFileToDownloadsTable("sound/sinsic/getready.mp3");
}

public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
g_bFirstDeath)
    {
        
ServerCommand("sm plugins reload sm_spawning");
        
ServerCommand("mp_restartgame 1");
        
g_bFirstDeath false;
        
EmitSoundToAll("sinsic/getready.mp3");
    }
    new 
timeleft;
    
GetMapTimeLeft(timeleft);
    new 
timelimit=GetConVarInt(FindConVar("mp_timelimit"));
    
    if (!
g_bSwapped)
    {
        new 
frag GetClientFrags(GetClientOfUserId(GetEventInt(event"attacker")));
        
frag = (frag 1) * 2;
        new 
fraglimit=GetConVarInt(FindConVar("mp_fraglimit"));
        if (    ((
frag >= fraglimit) && (fraglimit != 0))     ||     (((timeleft*2) < (timelimit*60)) && (timeleft 0))    )
        {
            
g_bSwapped true;
            for(new 
1<= MaxClients; ++i)
            {
                if(
IsClientInGame(i) && (!IsFakeClient(i)))
                {
                    if (
GetClientTeam(i) == 2)
                    {
                        
CS_SwitchTeam(i3);
                    } else if (
GetClientTeam(i) == 3){
                        
CS_SwitchTeam(i2);
                    }
                }
            }
            
ServerCommand("mp_restartgame 1");
            
EmitSoundToAll("sinsic/getready.mp3");
            new 
limitervalue;
            
limitervalue RoundToNearest(fraglimit 2.0);
            
CreateTimer(10.0fraglimiterdelaylimitervalue);
            
            
limitervalue RoundToNearest(timelimit 2.0);
            
CreateTimer(10.0timelimiterdelaylimitervalue);
        }
    } else if((
timeleft 1) && (timelimit 0)){
        
ServerCommand("mp_fraglimit 1");
    }
}

public 
Action:fraglimiterdelay(Handle:timerany:limitervalue){
    new 
String:limiter[64];
    
Format(limitersizeof(limiter), "mp_fraglimit %d"limitervalue);
    
ServerCommand(limiter);
}

public 
Action:timelimiterdelay(Handle:timerany:limitervalue){
    new 
String:limiter[64];
    
Format(limitersizeof(limiter), "mp_timelimit %d"limitervalue);
    
ServerCommand(limiter);

__________________

Last edited by sinsic; 05-13-2015 at 07:46.
sinsic is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-12-2015 , 10:08   Re: Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repos
Reply With Quote #2

If this is for CSGO, see the CSGO Quirks wiki page.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
sinsic
Senior Member
Join Date: May 2012
Old 05-12-2015 , 10:18   Re: Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repos
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
If this is for CSGO, see the CSGO Quirks wiki page.
Sorry for not telling, it is for Counter Strike Source.
__________________
sinsic is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-12-2015 , 10:40   Re: Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repos
Reply With Quote #4

Oh, something I missed before my last post:

Sounds need to be precached every map change.

As a general rule, I put my PrecacheSound / PrecacheSoundAny line right after the AddFileToDownloadsTable line.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
sinsic
Senior Member
Join Date: May 2012
Old 05-12-2015 , 10:56   Re: Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repos
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
Oh, something I missed before my last post:

Sounds need to be precached every map change.

As a general rule, I put my PrecacheSound / PrecacheSoundAny line right after the AddFileToDownloadsTable line.
Thanks for the reply, as I said at the first message I did try to precache the sound at OnConfigsExecuted(). Which was after AddFileToDownloadsTable. Same result.

When you say "Sounds need to be precached every map change." are you saying I should add another precache OnMapStart()?

Edit:
I tried this just to be sure, still same
PHP Code:
public OnMapStart(){
    
g_bSwapped false;
    
g_bFirstDeath true;
    
PrecacheSound("sinsic/getready.mp3"true);
}

public 
OnPluginStart()
{
    
sm_DMHTSwap_version CreateConVar("sm_DMHTSwap_version""1.0.5""DM Half Time Swap Version."FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
HookEvent("player_death"event_player_death);
    
PrecacheSound("sinsic/getready.mp3"true);
}

public 
OnConfigsExecuted()
{
    
AddFileToDownloadsTable("sound/sinsic/getready.mp3");
    
PrecacheSound("sinsic/getready.mp3"true);

__________________

Last edited by sinsic; 05-12-2015 at 10:59.
sinsic is offline
sinsic
Senior Member
Join Date: May 2012
Old 05-12-2015 , 12:26   Re: Failed to load sound "sinsic\getready.mp3", file probably missing from disk/repos
Reply With Quote #6

I have no idea why but adding
PHP Code:
#define Sound_GetReady "sinsic/getready.mp3" 
to the start and using
PHP Code:
EmitSoundToAll(Sound_GetReady); 
it now works perfectly :S
__________________

Last edited by sinsic; 05-12-2015 at 12:28.
sinsic is offline
sinsic
Senior Member
Join Date: May 2012
Old 05-13-2015 , 08:25   Re: [Solved]Failed to load sound "sinsic\getready.mp3", file probably missing from di
Reply With Quote #7

Also people who might stumble up on this thread. If the server is set to "sv_pure 2" or "sv_pure 1" and the file is not on whitelist, you see the same error.
__________________
sinsic 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 11:37.


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