Raised This Month: $51 Target: $400
 12% 

[CS:GO] Hitsounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Plugin ID:
3682
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows clients to hear a sound every time they hit an enemy.
    Old 06-06-2013 , 11:14   [CS:GO] Hitsounds
    Reply With Quote #1

    One of the main problems for me when playing Counter-Strike was that I couldn't aim very well, and wasn't easily able to tell if I had hit someone. I would fire an AK at someone, but then they'd kill me and it turned out that I'd hit them once, twice if I was lucky. Valve added a feature to TF2 where it plays a "ding" sound every time you hit an enemy (which quickly helped to improve my aim), so I wondered, why shouldn't Counter-Strike have it, too?

    Players can type /hitsound in chat to turn on the hitsound, and every time they hit someone, they'll hear a "ding!" sound to confirm the hit.

    Just like TF2's hitsound, this one has a few rules. The hitsound will not play if:
    • You hit someone through a wall, i.e. you don't have a clear line of sight to them
    • You hit someone who is hidden in the smoke of a smoke grenade
    • You're blinded by a flashbang
    The first two rules don't apply if your hit was fatal, though. So if you kill someone who is hidden in smoke through a wall, you'll hear it

    Oh, and cvars:
    • sm_hitsounds_displaydamage (1/0, def. 1) If 1, also display damage done to the attacker. I know that Show Damage exists, but Hitsounds' damage text abides by the above rules.
    • sm_hitsounds_rules (1/0, def. 1) Set to 0 to disable the first two above rules. In other words, if 0, players will still hear hitsounds even if they hit someone that they can't see.
    • sm_hitsounds_friendlyfire (1/0, def. 0) If 1, you'll also hear a hitsound if you damage a teammate. Has no effect if mp_friendlyfire is 0.
    Can probably work in CS:S too, but the hitsound will need to be changed, as the sound this plugin uses is not in CS:S. If you think you know of a suitable hitsound in CS:S (preferably a ding) let me know and I'll add it in.

    One more thing: the plugin does not advertise itself at all--you should add a message about /hitsound in your Advertisements or whateverplugin config, so that your players know about it.
    Attached Files
    File Type: sp Get Plugin or Get Source (hitsounds.sp - 9399 views - 4.8 KB)
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

    Last edited by MasterOfTheXP; 06-06-2013 at 11:15.
    MasterOfTheXP is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 06-08-2013 , 09:36   Re: [CS:GO] Hitsounds
    Reply With Quote #2

    Hi,

    do you know if "playgamesound" command apply only to GCF'ed audio files ? It's an interesting discovery D:

    Also, I don't see anything not following the standard. Approved.

    On a side note, you could change the following :
    • When using GetVectorDistance, put 3rd arg to true; but the don't forget to compare it to a squared value. (Sin/Cos/SQRoot are heavy math functions; as they are recursive; when using GetVectorDistance a SQRoot is done at the end; which can be avoided with that 3rd arg.; Similar to calculating a 3rd side of a square-triangle; 3^2 + 4^2 ==> SQRoot(25)).
    • You could remove FCVAR_REPLICATED as it can give error in the client console.

    Red
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work
    RedSword is offline
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 06-08-2013 , 09:45   Re: [CS:GO] Hitsounds
    Reply With Quote #3

    Quote:
    Originally Posted by RedSword View Post
    I don't see anything not following the standard. Approved.
    Thanks!
    Quote:
    do you know if "playgamesound" command apply only to GCF'ed audio files ? It's an interesting discovery D:
    I've not tried it yet with custom sounds (mostly due to the fact that Valve has, for some reason, decided to screw over most custom content for CS:GO) but I'd take the Wiki's word for it that you can only use "play" with custom sounds, unless you want to mess with the stringtables.
    Quote:
    When using GetVectorDistance, put 3rd arg to true; but the don't forget to compare it to a squared value. (Sin/Cos/SQRoot are heavy math functions; as they are recursive; when using GetVectorDistance a SQRoot is done at the end; which can be avoided with that 3rd arg.; Similar to calculating a 3rd side of a square-triangle; 3^2 + 4^2 ==> SQRoot(25)).
    Hm, I never thought it was that expensive, especially since in most cases there should only be one or two active smoke screens at most in the whole map...but I guess changing it to squared couldn't hurt.
    Quote:
    You could remove FCVAR_REPLICATED as it can give error in the client console.
    I'll make a mental note to stop doing that in all of my plugins
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
    MasterOfTheXP is offline
    PresidentEvil
    AlliedModders Donor
    Join Date: Jun 2012
    Old 06-18-2013 , 01:19   Re: [CS:GO] Hitsounds
    Reply With Quote #4

    Is there anyway to have the hit sounds enabled by default for all players when they join the server?

    Also I know this is difficult but is it possible to add a visual hit marker (like in cod) where when you hit the target their is an "x" on your crosshair? Perhaps using sprites or overlays?

    That would really make this plugin something special.


    Here's a video: http://www.youtube.com/watch?v=oB-BsjrsmXs
    __________________

    Last edited by PresidentEvil; 06-18-2013 at 01:29.
    PresidentEvil is offline
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 06-18-2013 , 01:23   Re: [CS:GO] Hitsounds
    Reply With Quote #5

    Quote:
    Originally Posted by PresidentEvil View Post
    Is there anyway to have the hit sounds enabled by default for all players when they join the server?
    If you're up to recompiling, you'd need to modify two lines:
    PHP Code:
    new bool:HitsoundsEnabled[MAXPLAYERS 1]; // Replace with   new bool:HitsoundsEnabled[MAXPLAYERS + 1] = {true, ...};

    public OnClientConnected(clientHitsoundsEnabled[client] = false// Change to true 
    I'll whip up a built-in cvar for it in the next update, though.
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
    MasterOfTheXP is offline
    PresidentEvil
    AlliedModders Donor
    Join Date: Jun 2012
    Old 06-25-2013 , 20:13   Re: [CS:GO] Hitsounds
    Reply With Quote #6

    Hi

    Can you add a cvar that replaces the stock ring sound with a custom .wav sound and have that sound added to the download table?

    This cod hit marker sound: http://www.mediafire.com/?gtizzgyywqw
    __________________
    PresidentEvil is offline
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 06-28-2013 , 11:45   Re: [CS:GO] Hitsounds
    Reply With Quote #7

    Hm, I'd imagine that sound would be a little hard to hear amidst gunfire...nevertheless, I can make a cvar for that as well, in the next release sometime soon. ™.

    The default sound will remain the same, though, to keep the plugin (at least in "default" mode) download-free.
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
    MasterOfTheXP is offline
    m22b
    Senior Member
    Join Date: Jul 2013
    Old 07-26-2013 , 09:31   Re: [CS:GO] Hitsounds
    Reply With Quote #8

    cs:go not working

    i try mp3 file too, but (he only download and not playing)

    m22b is offline
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 08-02-2013 , 20:47   Re: [CS:GO] Hitsounds
    Reply With Quote #9

    Still works for me on CS:GO. Sorry I took so long to get back to you on that...

    Could be a precaching issue (somehow, even though it uses playgamesound...) or an issue with the traces/grenade tracking code...try setting sm_hitsounds_rules to 0, perhaps?

    Oh, and be sure you have hitsounds, er, on. I usually forget to enable 'em for a round or two.
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

    Last edited by MasterOfTheXP; 08-02-2013 at 20:47.
    MasterOfTheXP is offline
    m22b
    Senior Member
    Join Date: Jul 2013
    Old 08-04-2013 , 14:09   Re: [CS:GO] Hitsounds
    Reply With Quote #10

    Ok this work .
    maybe you add custom sound like Quake3 hit sound ?
    Sound link :
    http://tf2dingalings.com/sound/details/256
    m22b 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 10:20.


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