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

file probably missing from disk/repository


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NC.svtrade
Senior Member
Join Date: Nov 2015
Old 06-10-2019 , 23:17   file probably missing from disk/repository
Reply With Quote #1

@ OnPluginStart
PHP Code:
RegConsoleCmd("say"Cmd_Say);
RegConsoleCmd("say_team"Cmd_Say); 
@ OnMapStart
PHP Code:
PrintToChatAll("%d %d"PrecacheSound("ql/chat.wav"true), FileExists("sound/ql/chat.wav"));
AddFileToDownloadsTable("sound/ql/chat.wav");
PrecacheSound("ql/env/welcome.wav"true);
AddFileToDownloadsTable("sound/ql/env/welcome.wav"); 
@ say command
PHP Code:
public Action:Cmd_Say(clientArguments)
{
    
    if(
client != && !IsFakeClient(client)) {
        
        
EmitSoundToAll("ql/chat.wav");
    }
    
    return 
Plugin_Continue;

I put the server file right, I put the ftp server's dir right.
But I have this error.

https://imgur.com/a/4P9nDYM

any solutions?

Last edited by NC.svtrade; 06-10-2019 at 23:17.
NC.svtrade is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 06-11-2019 , 02:02   Re: file probably missing from disk/repository
Reply With Quote #2

Do you know if the file downloaded? check to make sure the file exists in your tf2 directory in /downloads/sound/ folder. If it dosen't exist then you may have a restriction on your client. Make sure cl_allowdownload is set to 1 and cl_downloadfilter is set to all. Also make sure the sound file is uploaded to your fastdownloads server if the server is using a sv_downloadurl. Try playing the sound manually in your console with "play ql/chat.wav". Also note if you attempted to play the sound before it was downloaded via the plugin or yourself in console. the sound file is cached in memory so it wont have to load it from disk. If the sound was missing it will cache that the file is missing and not play until you restart your game client.

EmitSoundToAll emits a sound from a given entity/position. If none is supplied like in your example then it may play at world position of (0, 0, 0), or some other undefined behaviour. Clients will hear the sound based on the distance from that object it is emiting from.

If you want to play the sound so all clients can hear it at equal volume you can use the following:

PHP Code:
public PlaySound(String:soundpath[])
{
    
decl String:buffer[150];
    for(new 
1<= GetMaxClients(); i++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i))
        {
            
Format(buffersizeof(buffer), "playgamesound %s"soundpath);
            
ClientCommand(ibuffer);
        }
    }

if "playgamesound" dosen't exist in tf2 you can use the "play" command instead.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
NC.svtrade
Senior Member
Join Date: Nov 2015
Old 06-13-2019 , 23:47   Re: file probably missing from disk/repository
Reply With Quote #3

Quote:
Originally Posted by 1337norway View Post
Do you know if the file downloaded? check to make sure the file exists in your tf2 directory in /downloads/sound/ folder. If it dosen't exist then you may have a restriction on your client. Make sure cl_allowdownload is set to 1 and cl_downloadfilter is set to all. Also make sure the sound file is uploaded to your fastdownloads server if the server is using a sv_downloadurl. Try playing the sound manually in your console with "play ql/chat.wav". Also note if you attempted to play the sound before it was downloaded via the plugin or yourself in console. the sound file is cached in memory so it wont have to load it from disk. If the sound was missing it will cache that the file is missing and not play until you restart your game client.

EmitSoundToAll emits a sound from a given entity/position. If none is supplied like in your example then it may play at world position of (0, 0, 0), or some other undefined behaviour. Clients will hear the sound based on the distance from that object it is emiting from.

If you want to play the sound so all clients can hear it at equal volume you can use the following:

PHP Code:
public PlaySound(String:soundpath[])
{
    
decl String:buffer[150];
    for(new 
1<= GetMaxClients(); i++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i))
        {
            
Format(buffersizeof(buffer), "playgamesound %s"soundpath);
            
ClientCommand(ibuffer);
        }
    }

if "playgamesound" dosen't exist in tf2 you can use the "play" command instead.
so I researched more, and I know that sound files which have the length shorter than 1 seconds cause that error for some reason..
NC.svtrade 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:08.


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