AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-19) (https://forums.alliedmods.net/showthread.php?t=237045)

rodpod 12-28-2014 14:02

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
do I still need to force clients to download custom content from server? i.e. from folder sound/music/MYOWNFOLDER/*.* using separate plugin?

Powerlord 12-29-2014 10:30

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by rodpod (Post 2241069)
do I still need to force clients to download custom content from server? i.e. from folder sound/music/MYOWNFOLDER/*.* using separate plugin?

Yes, something needs to make the user download the files.

Having said that, this is only a plugin fragment intended to be included in other plugins that need to be able to play sounds on both CS:GO and older games (like CS:S).

apocalyptic 02-21-2015 23:32

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by Pohearts (Post 2205650)
Somehow the compiler crashed when i compile it :/
possibly i'm using SM 1.7..
i will have to go for traditional way to EmitSound for csgo then ..

yes, i got the same problem here. sourcemod 5155 cannot fix it.

vanbka9 02-22-2015 11:05

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
PHP Code:

stock EmitAmbientSoundAny(const String:name[], // switch to "sample" 
                        
const Float:pos[3],
                        
entity SOUND_FROM_WORLD,
                        
level SNDLEVEL_NORMAL,
                        
flags SND_NOFLAGS,
                        
Float:vol SNDVOL_NORMAL,
                        
pitch SNDPITCH_NORMAL,
                        
Float:delay 0.0)
{
    
decl String:szSound[PLATFORM_MAX_PATH];
    
    if (
g_bNeedsFakePrecache)
    {
        
Format(szSoundsizeof(szSound), "*%s"sample); // cuz here "sample"
    
}
    else
    {
        
strcopy(szSoundsizeof(szSound), sample);
    }
    
    
EmitAmbientSound(szSoundposentitylevelflagsvolpitchdelay);



Powerlord 02-22-2015 14:56

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by apocalyptic (Post 2265076)
yes, i got the same problem here. sourcemod 5155 cannot fix it.

I'm not sure what to tell you. I can even compile a new-style test plugin and it doesn't crash.

Having said that, I've noticed I can't compiler the EmitSoundAny version of MapChooser Extended Sounds under 1.7. The errors it spits don't seem to make sense either.

I'll have to look into that.

Quote:

Originally Posted by vanbka9 (Post 2265267)
PHP Code:

stock EmitAmbientSoundAny(const String:name[], // switch to "sample" 
                        
const Float:pos[3],
                        
entity SOUND_FROM_WORLD,
                        
level SNDLEVEL_NORMAL,
                        
flags SND_NOFLAGS,
                        
Float:vol SNDVOL_NORMAL,
                        
pitch SNDPITCH_NORMAL,
                        
Float:delay 0.0)
{
    
decl String:szSound[PLATFORM_MAX_PATH];
    
    if (
g_bNeedsFakePrecache)
    {
        
Format(szSoundsizeof(szSound), "*%s"sample); // cuz here "sample"
    
}
    else
    {
        
strcopy(szSoundsizeof(szSound), sample);
    }
    
    
EmitAmbientSound(szSoundposentitylevelflagsvolpitchdelay);



Yes, this is definitely a bug.

apocalyptic 02-25-2015 02:04

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by vanbka9 (Post 2265267)
PHP Code:

stock EmitAmbientSoundAny(const String:name[], // switch to "sample" 


modify emitsoundany.inc, replace name with sample, then everything will be good.
remember: source engine may not support wav sounds, you can use mp3 sounds.

Powerlord 02-26-2015 14:07

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by apocalyptic (Post 2266324)
modify emitsoundany.inc, replace name with sample, then everything will be good.
remember: source engine may not support wav sounds, you can use mp3 sounds.

I've already modified it, I just wanted to wait to get any other bugs out of the way before replacing the version in the first post with it... but as I said, I can (and have) compiled plugins using SM 1.7 with it and haven't run into a problem with PrecacheSoundAny. EmitSoundAnyToClient, EmitSoundAnyToAll, and EmitSoundAny.

DabuDos 03-03-2015 04:44

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Quote:

Originally Posted by Powerlord (Post 2266877)
I've already modified it, I just wanted to wait to get any other bugs out of the way before replacing the version in the first post with it... but as I said, I can (and have) compiled plugins using SM 1.7 with it and haven't run into a problem with PrecacheSoundAny. EmitSoundAnyToClient, EmitSoundAnyToAll, and EmitSoundAny.

They are working, yes. But I allways have to change the map one time before it works. Otherwise "Sound is not Precached".

Totenfluch 03-07-2015 15:37

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Hey, I tried using your .include with my Sound plugin but the Sound didn't play and I also didn't get any Error either the Client console and Server console.

My Code looks like the following:

Code:

public OnMapStart()
{
    AddFileToDownloadsTable(..);
    PrecacheSoundAny(..);
}
public EventRoundEnd(...) {
    for( new client = 1; client < MAXPLAYERS-2; client++){
                        if(IsValidClient(client)){
                        EmitSoundToClientAny(client, "music/TPlayer/xlol.mp3", _, _, _, _, 1.0);
                        }
      }
}

Any clues what I may have done wrong?

iGANGNAM 03-12-2015 14:06

Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
 
Can you give me example of StopSoundAny?


All times are GMT -4. The time now is 17:21.

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