View Single Post
Mitchell
~lick~
Join Date: Mar 2010
Old 10-14-2013 , 11:29   Re: [CS:GO] Disable Game Sounds (1.3.0)
Reply With Quote #7

Quote:
Originally Posted by XHeadHunterX View Post
Another question, why not use for(new i = 1; i <= MaxClients; i++) for all events to remove the code lines using new client = (GetClientOfUserId(GetEventInt(event, "userid"))); ? Is there any benefits of using both? This is just for personal knowledge
Because player_spawn is fired when ever a player is spawned, so if you have 64 players in your server and they spawn all at the same time then it would do 64 loops of 0-64, which is very unnecessary for what i'm doing.

And i cant seem to replicate the other request about a timer; i dont hear the sound until the round_start.

Quote:
Originally Posted by XHeadHunterX View Post
By the way, why do you hook the events twice? You hook once with EventHookMode_Pre and once without it. Also, I don't think that hooking the round_prestart is necessary in this case.
I didnt notice if it would have an effect or not, i know that some of them probably could be removed.
This isnt perfect, but its the clostest thing i can get it to, since i cant hook the sound when it plays i have to guess to see if it plays. I.E. There's no way of me checking if it's playing on a client or not.

--------------------
Updated:
1.3.1: Removed some hooks that looks unnecessary. Added a few different hooks in attempt to stop all left over sounds.

Last edited by Mitchell; 10-14-2013 at 11:37. Reason: updated to 1.3.1
Mitchell is offline