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

Solved [CS:GO] EmitSound problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 05-06-2019 , 10:28   [CS:GO] EmitSound problems
Reply With Quote #1

Hello, I have a little problem. Whenever I play a sound, it is being stopped by other sounds that are emitted via EmitSound commands. Do you know how I could fix this? So the sound cannot be stopped at all? Only by StopSound?
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545

Last edited by cristian20042; 05-07-2019 at 11:54.
cristian20042 is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-06-2019 , 11:10   Re: [CS:GO] EmitSound problems
Reply With Quote #2

EmitSound has channels. it will stop current sound and play new on that channel.

Last edited by farawayf; 05-06-2019 at 11:10.
farawayf is offline
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 05-06-2019 , 11:29   Re: [CS:GO] EmitSound problems
Reply With Quote #3

I changed the channel, still being stopped by other sounds...
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545
cristian20042 is offline
blackdevil72
Member
Join Date: Jun 2010
Location: Bordeaux (France)
Old 05-06-2019 , 22:14   Re: [CS:GO] EmitSound problems
Reply With Quote #4

Hello,

In what context are you playing sound?
From what origin entity? etc.

I think if you told us that we could help you better. Also a little code snip could help.
__________________

blackdevil72 is offline
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 05-07-2019 , 11:54   Re: [CS:GO] EmitSound problems
Reply With Quote #5

Thank you for trying to help, I solved it by putting the sounds on the static channel (SNDCHAN_STATIC).
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545
cristian20042 is offline
Lawyn
Junior Member
Join Date: Jul 2020
Old 02-16-2021 , 12:42   Re: [CS:GO] EmitSound problems
Reply With Quote #6

Use this function

PHP Code:
void EmiteMelodia(const char[] url)
{
    for (
int i 1MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
AddFileToDownloadsTable(url);
            
PrecacheSound(urltrue);
            
ClientCommand(i"play %s"url);
        }
    }

You need to use like this
PHP Code:
EmiteMelodia("path/to/sound"
__________________
Lawyn 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 08:49.


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