Thread: Chat Sounds

Results 1 to 5 of 5
  1. #1
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    436

    Chat Sounds

    Description: If the first word typed to the in-game chat matches a key of a g_SoundList entry, the sound will be played with a medium radius around the players origin (just like the medic call). I think this is more cool and less annoying than alike amxx plugins who play the sound for everyone everywhere. In g_SpriteName you can set a sprite which appears for 2sec over the players head when he is playing a sound. To prevent spamming g_Delay is the time in ms a player has to wait becore he can play a new sound. Custom sounds do work and are downloaded+precached by the client on connect. Don't overdo it lol.

    Console commands: .listsounds (dumps all available triggers to console)

    Add to: svencoop/default_plugins.txt
    Code:
            "plugin"
            {
                    "name" "ChatSounds"
                    "script" "ChatSounds"
            }
    Add to: svencoop_addon/scripts/plugins/ChatSounds.txt (example file. syntax: trigger path/in/sound/folder/file.mp3)
    Code:
    hello scientist/hello.wav
    move hgrunt/move!.wav
    yay cards/yay.ogg
    yees scientist/yees.wav
    Download & Save as: svencoop_addon/scripts/plugins/ChatSounds.as
    Last edited by nico; 13-11-2016 at 09:04 AM. Reason: added default_plugins.txt

  2. #2
    Been playing since 2000, Joined the threads late, Still killin and having fun even. Better late than never. Darkassassin198's Avatar
    Join Date
    Nov 2010
    Location
    In a HEV suit
    Posts
    311

    Re: Chat Sounds

    So this plays the sound around the player but not to everyone, is the code all we need or....no?
    Did you know...if you touch a wall you run faster?

    now try it with crates.


  3. #3
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    436

    Re: Chat Sounds

    Quote Originally Posted by Darkassassin198 View Post
    So this plays the sound around the player but not to everyone, is the code all we need or....no?
    It plays to everyone in a specific range of the player triggering the sound. If you want everyone regardless of where they are on the map to hear it, change ATTN_NORM to, I think, ATTN_NONE.

  4. #4
    Been playing since 2000, Joined the threads late, Still killin and having fun even. Better late than never. Darkassassin198's Avatar
    Join Date
    Nov 2010
    Location
    In a HEV suit
    Posts
    311

    Re: Chat Sounds

    Quote Originally Posted by nico View Post
    It plays to everyone in a specific range of the player triggering the sound. If you want everyone regardless of where they are on the map to hear it, change ATTN_NORM to, I think, ATTN_NONE.
    Uh I was just asking if the code was all we needed, that was kinda it.
    Did you know...if you touch a wall you run faster?

    now try it with crates.


  5. #5
    Registered User Joce's Avatar
    Join Date
    Feb 2016
    Location
    Paris
    Posts
    91

    Re: Chat Sounds

    Hi.

    Is there a way to hide the message in chat ? I want to play the sound, but without displaying to other players the key command in chat.
    I believe that something must be deleted/edited in the script.


    EDIT: Thanks to KernCore for his help. Just put:

    pParams.ShouldHide = true;
    between:

    CBasePlayer@ pPlayer = pParams.GetPlayer();
    string sid = g_EngineFuncs.GetPlayerAuthId(pPlayer.edict());
    Last edited by Joce; 29-09-2016 at 02:17 PM. Reason: Found the way to do it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •