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)

8guawong 06-14-2021 20:17

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

Originally Posted by paulo_crash (Post 2749737)
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?

don't think csgo needs to use this anymore

to fix your compile error try

Code:

EmitSoundToClientAny(iClient, SOUND_SPRAY_REL, iClient, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, 0.4);

paulo_crash 06-15-2021 01:28

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

Originally Posted by 8guawong (Post 2749759)
don't think csgo needs to use this anymore

to fix your compile error try

Code:

EmitSoundToClientAny(iClient, SOUND_SPRAY_REL, iClient, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, 0.4);

Compiled, but now neither I nor the players hear the spray sound.

Apparently gives a precache error:
PHP Code:

EmitAmbientSound:  sound not precached: **/player/spray_zk.mp3

EmitAmbientSound
:  sound not precached: **/player/spray_zk.mp3

EmitAmbientSound
:  sound not precached: **/player/spray_zk.mp3 


8guawong 06-16-2021 11:53

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

Originally Posted by paulo_crash (Post 2749768)
Compiled, but now neither I nor the players hear the spray sound.

Apparently gives a precache error:
PHP Code:

EmitAmbientSound:  sound not precached: **/player/spray_zk.mp3

EmitAmbientSound
:  sound not precached: **/player/spray_zk.mp3

EmitAmbientSound
:  sound not precached: **/player/spray_zk.mp3 


like i said above i don't think csgo needs to use this include anymore
try using the one provided by sourcemod

paulo_crash 06-17-2021 16:25

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

Originally Posted by 8guawong (Post 2750002)
like i said above i don't think csgo needs to use this include anymore
try using the one provided by sourcemod

Thanks, I will try to fix some BUGS in it first and then I see to remove the include and use the sourcemod one.

Anything I'll contact you here.

If you can help me with the BUGS I commented on, it would be in this topic: https://forums.alliedmods.net/showthread.php?t=333070 (From what I could see you know more about sourcepawn and such :))


All times are GMT -4. The time now is 15:46.

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