Raised This Month: $319 Target: $400
 79%   Almost there!

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


Post New Thread Reply   
 
Thread Tools Display Modes
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 01-20-2018 , 07:52   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #71

Quote:
Originally Posted by _GamerX View Post
How to stop sound from EmitAmbientSoundAny?
https://forums.alliedmods.net/showpo...7&postcount=16

PHP Code:
stock StopSoundAny(entitychannel, const String:name[]) 
__________________
free software
coding
shanapu is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 01-20-2018 , 09:20   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #72

for me not work sound still play if i use this function
__________________

Last edited by _GamerX; 01-20-2018 at 09:20.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Berva
Member
Join Date: Feb 2018
Old 02-27-2018 , 17:17   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #73

what do i do with that .inc? im kinda new into plugins
Berva is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-14-2018 , 16:40   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #74

To be fair, I'm not even sure if this include is necessary any more. I've heard a recent CS:GO update made it unnecessary.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 06-08-2018 , 10:58   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #75

since this update
http://blog.counter-strike.net/index.php/2018/04/20400/
sounds are not played. Before this update everything was working fine.

Code:
[Sound] S_StartSound(): Failed to load sound '*folder\sound.mp3'. File is missing from disk or is invalid.
the custom sound is precached but not played and located here:
csgo\sound\folder\sound.mp3
fragnichtnach is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 06-09-2018 , 05:42   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #76

The result of some researches:

Joining a server and downloading new *.mp3 will not make them working immidiately. You need to restart CS:GO. Probably something like "snd_rebuildaudiocache" (what has been removed some weeks ago) would help.

Is there a way to make it possible to play custom sounds directly after the are downloaded?

Here is the current code I am using:
Code:
#include <sourcemod>
#include <emitsoundany>

#define MAX_FILE_LEN 80

Handle g_CvarSound = INVALID_HANDLE;
char g_soundsound[MAX_FILE_LEN];

public void OnPluginStart() 
{
	SoundFilespluginStart();
	AutoExecConfig(true, "testsound");
	RegConsoleCmd("sm_testsound", Command_Sound);
}

public void SoundFilespluginStart() 
{
	g_CvarSound = CreateConVar("sound", "Sound.mp3", "Sound");
}

public void OnMapStart() 
{
    precache_sounds();
}

public void precache_sounds() 
{
    GetConVarString(g_CvarSound, g_soundsound, MAX_FILE_LEN);
    char buffer[MAX_FILE_LEN];
    PrecacheSoundAny(g_soundsound, true);
    Format(buffer, sizeof(buffer), "sound/%s", g_soundsound);
    AddFileToDownloadsTable(buffer);
}

public Action Command_Sound(int client, int args) 
{
	CreateTimer(0.1,PlaySound);
	return Plugin_Handled;
}

public Action PlaySound(Handle timer)
{
	float volume=0.3;
	for(int client=1; client<MAXPLAYERS; client++)
	{
		if(IsClientInGame(client) && !IsFakeClient(client))
			EmitSoundToClientAny(client,g_soundsound,SOUND_FROM_PLAYER, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, volume, SNDPITCH_NORMAL, -1, NULL_VECTOR, NULL_VECTOR, true,0.0);
	}
}

Last edited by fragnichtnach; 06-09-2018 at 05:43.
fragnichtnach is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-09-2018 , 06:23   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #77

@fragnichtnach, ...what I remember, there is differences with *.wav and *.mp3 files. *.wav files work immediatelly if I don't remember wrong.
Bacardi is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Rimini, Italy
Old 06-17-2018 , 14:55   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #78

Quote:
Originally Posted by Powerlord View Post
To be fair, I'm not even sure if this include is necessary any more. I've heard a recent CS:GO update made it unnecessary.
I've just ran some test and the results were that the sound got played even tough I haven't used emitsoundany but the "default" emitsound so I can confirm you tought

My test case:
PHP Code:
#define SOUND "sound/hexah/mafix.wav"
#define PLAY "hexah/mafix.wav"

public void OnPluginStart()
{
    
RegConsoleCmd("sm_playsound"Cmd_Play);
}

public 
void OnMapStart()
{
    
AddFileToDownloadsTable(SOUND);
    
PrecacheSound(PLAY);
}

public 
Action Cmd_Play(int clientint args)
{
    
float vPos[3];
    
GetClientAbsOrigin(clientvPos);
    
EmitAmbientSound(PLAYvPos);

I've tried both .mp3 & .wav

Quote:
Originally Posted by Bacardi View Post
@fragnichtnach, ...what I remember, there is differences with *.wav and *.mp3 files. *.wav files work immediatelly if I don't remember wrong.
Here works fine with both
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-08-2018 , 05:39   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #79

I can confirm you don't need anymore, now you can play more sound at one time, and map side-imported custom sounds is working well, like in css.
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 07-08-2018 at 05:39.
PeEzZ is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 06-14-2021 , 14:17   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #80

Could someone help me, I'm trying to use the following native for the spray sounds:
PHP Code:
stock EmitSoundToClientAny(client,
                 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)
{
    new 
clients[1];
    
clients[0] = client;
    
/* Save some work for SDKTools and remove SOUND_FROM_PLAYER references */
    
entity = (entity == SOUND_FROM_PLAYER) ? client entity;
    
EmitSoundAny(clients1sampleentitychannel
    
levelflagsvolumepitchspeakerentity,
    
origindirupdatePossoundtime);

In case I wanted only the player, when using the spray on the server, to hear the audio of the spray being applied, other players wouldn't hear anything.

I tried as follows:
PHP Code:
EmitSoundToClientAny(SOUND_SPRAY_RELiClientSNDCHAN_AUTOSNDLEVEL_NORMALSND_NOFLAGS0.4); 
Porém da este erro na hora de compilar:
PHP Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// franug_valvesprays.sp
//
// D:\Google Drive\ZK ServidoresÖ\Servidores CSGO\Editar Plugins\addons\sourcemod\scripting\valvesprays.sp(48) : warning 241: Array-based enum structs will be removed in 1.11. See [url]https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax#Enum_Structs[/url]
// D:\Google Drive\ZK ServidoresÖ\Servidores CSGO\Editar Plugins\addons\sourcemod\scripting\valvesprays.sp(52) : warning 241: Array-based enum structs will be removed in 1.11. See [url]https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax#Enum_Structs[/url]
// D:\Google Drive\ZK ServidoresÖ\Servidores CSGO\Editar Plugins\addons\sourcemod\scripting\valvesprays.sp(177) : warning 234: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
//
//
// D:\Google Drive\ZK ServidoresÖ\Servidores CSGO\Editar Plugins\addons\sourcemod\scripting\valvesprays.sp(287) : error 035: argument type mismatch (argument 1)
// D:\Google Drive\ZK ServidoresÖ\Servidores CSGO\Editar Plugins\addons\sourcemod\scripting\valvesprays.sp(362) : warning 234: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
//
//
//
// 1 Error.
//
// Compilation Time: 0,7 sec
// ----------------------------------------

Press enter to exit ... 
How can I fix it, or is it even another native I should use?
__________________
paulo_crash is offline
Reply


Thread Tools
Display Modes

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 01:19.


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