Raised This Month: $ Target: $400
 0% 

[CSGO]EmitToSoundAll is not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fixt0n
Junior Member
Join Date: Jul 2014
Old 07-26-2014 , 20:10   [CSGO]EmitToSoundAll is not working
Reply With Quote #1

i need help, EmitToSoundAll is not working.

how to use EmitToSoundAll.
fixt0n is offline
sinsic
Senior Member
Join Date: May 2012
Old 07-26-2014 , 22:51   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #2

Its EmitSoundToAll()


Code:
/**
 * Wrapper to emit sound to all clients.
 *
 * @param sample        Sound file name relative to the "sounds" folder.
 * @param entity        Entity to emit from.
 * @param channel        Channel to emit with.
 * @param level            Sound level.
 * @param flags            Sound flags.
 * @param volume        Sound volume.
 * @param pitch            Sound pitch.
 * @param speakerentity    Unknown.
 * @param origin        Sound origin.
 * @param dir            Sound direction.
 * @param updatePos        Unknown (updates positions?)
 * @param soundtime        Alternate time to play sound for.
 * @noreturn
 * @error                Invalid client index.
 */
stock EmitSoundToAll(const String:sample[],
                 entity = SOUND_FROM_PLAYER,
                 channel = SNDCHAN_AUTO,
                 level = SNDLEVEL_NORMAL,
                 flags = SND_NOFLAGS,
                 Float:volume = SNDVOL_NORMAL,
                 pitch = SNDPITCH_NORMAL,
                 speakerentity = -1,
                 const Float:origin[3] = NULL_VECTOR,
                 const Float:dir[3] = NULL_VECTOR,
                 bool:updatePos = true,
                 Float:soundtime = 0.0)
__________________

Last edited by sinsic; 07-26-2014 at 22:52.
sinsic is offline
fixt0n
Junior Member
Join Date: Jul 2014
Old 07-27-2014 , 02:12   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #3

Quote:
Originally Posted by sinsic View Post
Its EmitSoundToAll()


Code:
/**
 * Wrapper to emit sound to all clients.
 *
 * @param sample        Sound file name relative to the "sounds" folder.
 * @param entity        Entity to emit from.
 * @param channel        Channel to emit with.
 * @param level            Sound level.
 * @param flags            Sound flags.
 * @param volume        Sound volume.
 * @param pitch            Sound pitch.
 * @param speakerentity    Unknown.
 * @param origin        Sound origin.
 * @param dir            Sound direction.
 * @param updatePos        Unknown (updates positions?)
 * @param soundtime        Alternate time to play sound for.
 * @noreturn
 * @error                Invalid client index.
 */
stock EmitSoundToAll(const String:sample[],
                 entity = SOUND_FROM_PLAYER,
                 channel = SNDCHAN_AUTO,
                 level = SNDLEVEL_NORMAL,
                 flags = SND_NOFLAGS,
                 Float:volume = SNDVOL_NORMAL,
                 pitch = SNDPITCH_NORMAL,
                 speakerentity = -1,
                 const Float:origin[3] = NULL_VECTOR,
                 const Float:dir[3] = NULL_VECTOR,
                 bool:updatePos = true,
                 Float:soundtime = 0.0)
thanks,so i used EmitSoundToAll.
but new problem,How do you play a sound without interrupting.

At the same, I am not good at English.
fixt0n is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-27-2014 , 11:32   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #4

Try playing it on a different channel.
bl4nk is offline
fixt0n
Junior Member
Join Date: Jul 2014
Old 07-28-2014 , 00:46   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #5

sorry,was not able to coding.
so please sample code.
fixt0n is offline
sinsic
Senior Member
Join Date: May 2012
Old 07-29-2014 , 01:17   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #6

He says you should use a different channel when emitting the sound
PHP Code:
 enum  {
 
SNDCHAN_REPLACE = -1,        /**< Unknown */
 
SNDCHAN_AUTO 0,            /**< Auto */
 
SNDCHAN_WEAPON 1,            /**< Weapons */
 
SNDCHAN_VOICE 2,            /**< Voices */
 
SNDCHAN_ITEM 3,            /**< Items */
 
SNDCHAN_BODY 4,            /**< Player? */
 
SNDCHAN_STREAM 5,            /**< "Stream channel from the static or dynamic area" */
 
SNDCHAN_STATIC 6,            /**< "Stream channel from the static area" */
 
SNDCHAN_VOICE_BASE 7,        /**< "Channel for network voice data" */
 
SNDCHAN_USER_BASE 135        /**< Anything >= this is allocated to game code */
 
}; 
for example: EmitSoundToAll("weapons/p228/p228-1.wav", entity, SNDCHAN_WEAPON);
__________________

Last edited by sinsic; 07-29-2014 at 01:21.
sinsic is offline
fixt0n
Junior Member
Join Date: Jul 2014
Old 07-29-2014 , 01:25   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #7

Quote:
Originally Posted by sinsic View Post
He says you should use a different channel when emitting the sound
PHP Code:
 enum  {
 
SNDCHAN_REPLACE = -1,        /**< Unknown */
 
SNDCHAN_AUTO 0,            /**< Auto */
 
SNDCHAN_WEAPON 1,            /**< Weapons */
 
SNDCHAN_VOICE 2,            /**< Voices */
 
SNDCHAN_ITEM 3,            /**< Items */
 
SNDCHAN_BODY 4,            /**< Player? */
 
SNDCHAN_STREAM 5,            /**< "Stream channel from the static or dynamic area" */
 
SNDCHAN_STATIC 6,            /**< "Stream channel from the static area" */
 
SNDCHAN_VOICE_BASE 7,        /**< "Channel for network voice data" */
 
SNDCHAN_USER_BASE 135        /**< Anything >= this is allocated to game code */
 
}; 
for example: EmitSoundToAll("weapons/p228/p228-1.wav", entity, SNDCHAN_WEAPON);

i used your code.
but new problem,config that is it must be given with the asterisk.
that is not pre-cache,method for solving a problem.
fixt0n is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-29-2014 , 02:19   Re: [CSGO]EmitToSoundAll is not working
Reply With Quote #8

Orange Box (and newer?) games use Channel 7 as the voice2 voice channel, bump voice_base to 8, and bump user_base to 136 (or SNDCHAN_VOICE_BASE + 128)

In TF2, voice2 is used for the Announcer voice.

As for the asterisk, the CS:GO Quirks page talks about why this is necessary.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-30-2014 at 14:06.
Powerlord 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 19:09.


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