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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Mitchell
~lick~
Join Date: Mar 2010
Old 03-12-2015 , 15:21   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #31

Quote:
Originally Posted by iGANGNAM View Post
Can you give me example of StopSoundAny?
It basically works like SM's StopSound() which will stop the sound playing to a client matching the exact sound name.
if you emit a sound of "bot/hate.wav" you can use StopSound to with "bot/hate.wav"
Mitchell is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 03-13-2015 , 03:09   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #32

so it's something like that?

StopSoundAny(entity, _, "music/l4d/tank/1.mp3");

Last edited by iGANGNAM; 03-13-2015 at 03:10.
iGANGNAM is offline
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 05-10-2015 , 10:22   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #33

Hi, I am working with someone else's plugin, trying to make it use this include. Here's what I've got:

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <emitsoundany>

#pragma semicolon 1
#define MAX_FILE_LEN 80
new Handle:g_CvarSoundName INVALID_HANDLE;
new 
String:g_soundName[MAX_FILE_LEN];

#define PLUGIN_VERSION "1.0"
public Plugin:myinfo 
{
    
name "CS:GO Sound",
    
author "Team-Secretforce.com",
    
description "Join Sound on your CS:GO Server",
    
version PLUGIN_VERSION,
    
url "http://www.Team-Secretforce.com/"
};
public 
OnPluginStart()
{
    
// Create the rest of the cvar's
CreateConVar("sm_welcome_snd_version"PLUGIN_VERSION"CS:GO Sound Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_CvarSoundName CreateConVar("sm_start_sound""natalya/server/moon-join-server.mp3""Welcome sound");
}
public 
OnConfigsExecuted()
{
    
GetConVarString(g_CvarSoundNameg_soundNameMAX_FILE_LEN);
    
decl String:buffer[MAX_FILE_LEN];
    
PrecacheSound(g_soundNametrue);
    
Format(buffersizeof(buffer), "sound/%s"g_soundName);
    
AddFileToDownloadsTable(buffer);
}
public 
OnClientPostAdminCheck(client)
{
    
EmitSoundToClientAny(clientg_soundName);

I'm not hearing anything, am I using this right? Or maybe I should play it later when the client gets spawned and then have like a boolean that gets set to true on first spawn and when true it won't play anymore or something like that.
__________________
Talk to me on Steam: natalyaaf
See my website for downloads: www.lady-natalya.info

Natalya: killing someone while they make a plugin
Natalya: perfect analogy
Natalya: for the mayan apocalypse

Last edited by NatalyaAF; 05-10-2015 at 10:23.
NatalyaAF is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-10-2015 , 11:22   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #34

Quote:
Originally Posted by NatalyaAF View Post
Hi, I am working with someone else's plugin, trying to make it use this include. Here's what I've got:

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <emitsoundany>

#pragma semicolon 1
#define MAX_FILE_LEN 80
new Handle:g_CvarSoundName INVALID_HANDLE;
new 
String:g_soundName[MAX_FILE_LEN];

#define PLUGIN_VERSION "1.0"
public Plugin:myinfo 
{
    
name "CS:GO Sound",
    
author "Team-Secretforce.com",
    
description "Join Sound on your CS:GO Server",
    
version PLUGIN_VERSION,
    
url "http://www.Team-Secretforce.com/"
};
public 
OnPluginStart()
{
    
// Create the rest of the cvar's
CreateConVar("sm_welcome_snd_version"PLUGIN_VERSION"CS:GO Sound Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_CvarSoundName CreateConVar("sm_start_sound""natalya/server/moon-join-server.mp3""Welcome sound");
}
public 
OnConfigsExecuted()
{
    
GetConVarString(g_CvarSoundNameg_soundNameMAX_FILE_LEN);
    
decl String:buffer[MAX_FILE_LEN];
    
PrecacheSound(g_soundNametrue);
    
Format(buffersizeof(buffer), "sound/%s"g_soundName);
    
AddFileToDownloadsTable(buffer);
}
public 
OnClientPostAdminCheck(client)
{
    
EmitSoundToClientAny(clientg_soundName);

I'm not hearing anything, am I using this right? Or maybe I should play it later when the client gets spawned and then have like a boolean that gets set to true on first spawn and when true it won't play anymore or something like that.
Instead of using PrecacheSound, use PrecacheSoundAny.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 05-10-2015 , 13:40   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #35

Thanks, that got it working!!
__________________
Talk to me on Steam: natalyaaf
See my website for downloads: www.lady-natalya.info

Natalya: killing someone while they make a plugin
Natalya: perfect analogy
Natalya: for the mayan apocalypse
NatalyaAF is offline
DabuDos
Junior Member
Join Date: Feb 2015
Location: Germany
Old 05-30-2015 , 19:45   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #36

Could it be that this is not needed anymore? When I'm using this the sounds are not working, using standard sourcemod EmitSound works again.
DabuDos is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 08-06-2015 , 10:13   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #37

I've found a "bug".

Code:
stock EmitAmbientSoundAny(const String:name[],
                        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(szSound, sizeof(szSound), "*%s", sample);
    }
    else
    {
        strcopy(szSound, sizeof(szSound), sample);
    }
    
    EmitAmbientSound(szSound, pos, entity, level, flags, vol, pitch, delay);
}
name is never used and sample is a undefined symbol ;)
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-06-2015 , 10:27   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #38

Quote:
Originally Posted by Bara View Post
I've found a "bug".

Code:
stock EmitAmbientSoundAny(const String:name[],
                        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(szSound, sizeof(szSound), "*%s", sample);
    }
    else
    {
        strcopy(szSound, sizeof(szSound), sample);
    }
    
    EmitAmbientSound(szSound, pos, entity, level, flags, vol, pitch, delay);
}
name is never used and sample is a undefined symbol ;)
As you probably guessed it should be sample and not name in the function header. Whoops.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 06-01-2016 , 18:18   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #39

ok, he deleted in second of my post
so...


Still works for me.
https://github.com/shanapu/MyJailbre...tSoundToAllAny
__________________
coding & free software

Last edited by shanapu; 06-01-2016 at 18:19.
shanapu is offline
Kruzi
Senior Member
Join Date: Dec 2014
Location: Kyiv, Ukraine
Old 06-10-2016 , 14:05   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #40

I have this sound: EmitAmbientSoundAny(GRAB_PATH, vec);
How to stop it?
I tryed StopSoundAny(SOUND_FROM_WORLD,SNDCHAN_AUTO, GRAB_PATH);
but it don't works help me please

Last edited by Kruzi; 06-11-2016 at 07:12.
Kruzi 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 10:20.


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