Quote:
Originally Posted by XHeadHunterX
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
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.