Raised This Month: $ Target: $400
 0% 

EmitSoundToClient is crashing my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Terminator1337
Junior Member
Join Date: Jan 2015
Old 02-23-2015 , 09:34   EmitSoundToClient is crashing my plugin
Reply With Quote #1

I'm currently writing a jailbreak warden plugin, but whenever I try to play a sound when a warden is chosen is crashes the plugin. My code follows:

for (new i = 1; i <= MAXPLAYERS; i++)
EmitSoundToClient(i, "*sound/thunder.mp3", SOUND_FROM_PLAYER, SNDCHAN_STATIC);

When I comment that out the plugin works fine. Is there a special way I have to do it in CS:GO?

Thanks
Terminator1337 is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 02-23-2015 , 09:38   Re: EmitSoundToClient is crashing my plugin
Reply With Quote #2

There could be some infos regarding this here: https://wiki.alliedmods.net/Csgo_quirks

Here's something you could try: https://forums.alliedmods.net/showthread.php?t=237045
JoB2C is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-23-2015 , 09:51   Re: EmitSoundToClient is crashing my plugin
Reply With Quote #3

If just the plugin is crashing, I can make some guesses.
  1. You're not checking IsClientInGame(i) before EmitSoundToClient
  2. You're not Precaching the sound (or in CS:GO's case, fake precaching it)

For the first one, why not just use EmitSoundToAll("*sound/thunder.mp3", SOUND_FROM_PLAYER, SNDCHAN_STATIC);
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-23-2015 at 14:55.
Powerlord is offline
Terminator1337
Junior Member
Join Date: Jan 2015
Old 02-23-2015 , 10:05   Re: EmitSoundToClient is crashing my plugin
Reply With Quote #4

Thanks for the help powerlord, I didn't realize the method you had to use in CS:GO (fake precaching). It works great now.
Terminator1337 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 04:06.


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