Raised This Month: $32 Target: $400
 8% 

Help with EmitSoundToAll


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
McD0n3ld
Junior Member
Join Date: Feb 2011
Old 02-13-2011 , 19:21   Help with EmitSoundToAll
Reply With Quote #1

Hello. I am new on this, so I do not know almost anything about what I am doing. I just copy and paste pieces of code. My problem is about EmitSoundToall function.

I have read this but I did not get anything: http://forums.alliedmods.net/showthread.php?t=94535

My sound is custom, so I have to make players to download it from my server. I have done that and precached sound, but still not working... Any idea?
Here I post what I think is relevant:


Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <sdktools_sound>
Code:
public OnPluginStart()
{
    //deleted not needed stuff
    AddFileToDownloadsTable("sound/jihad/jihad.wav");
    PrecacheSound("jihad/jihad.wav", true);
}
Code:
public OnMapStart()
{
    AddFileToDownloadsTable("sound/jihad/jihad.wav");
    PrecacheSound("sound/jihad/jihad.wav", true);
}
Code:
if blablalbalba
{
    EmitSoundToAll("jihad/jihad.wav", client, SNDCHAN_AUTO, SNDLEVEL_MINIBIKE);
}
else
                ...
I missed something? Did something wrong?
Place in mind that this code is about copy pasting from other codes

Hopeto get into a solution soon,
Thanks,
McD0n3ld
McD0n3ld is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 02-13-2011 , 22:07   Re: Help with EmitSoundToAll
Reply With Quote #2

Consider EmitAmbientSound for a localized affect. First, troubleshoot that the server is downloading this correctly by deleting your jihad file on your local PC and reconnecting to the server. Then try playing it from the console using the play command.

It looks like you may have tried to use NatalyaAF's code here. Good start. Now you should go to
http://docs.sourcemod.net/api/
And look up all the function calls you are using. See if they make sense. Pay special attention to EmitSoundToAll.

Also, where did you copy #include <sdktoos_sound> from?
__________________
databomb is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-14-2011 , 02:07   Re: Help with EmitSoundToAll
Reply With Quote #3

I suggest to use PrecacheSound during "OnMapStart()".

And also, the "sound/" part of your sound path is not necessary.
honorcode23 is offline
McD0n3ld
Junior Member
Join Date: Feb 2011
Old 02-14-2011 , 04:54   Re: Help with EmitSoundToAll
Reply With Quote #4

Quote:
Originally Posted by databomb View Post
Consider EmitAmbientSound for a localized affect. First, troubleshoot that the server is downloading this correctly by deleting your jihad file on your local PC and reconnecting to the server. Then try playing it from the console using the play command.

[...]

Also, where did you copy #include <sdktools_sound> from?
Yeah, the problem was the file. Not converted
and sdktools_sound library was my own aportation, already deleted it

Now it is working. Thanks again databomb

Quote:
Originally Posted by honorcode23 View Post
I suggest to use PrecacheSound during "OnMapStart()".

And also, the "sound/" part of your sound path is not necessary.
Done! and the sound/ part on AddFileToDownloadsTable was necessary. If not, it does not find dir

Thanks both,my script is running perfectly on my local server, let's see in gameserver
McD0n3ld 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 07:58.


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