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

Suicide by grenade sound effect?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OmgKhalifa
Member
Join Date: Aug 2018
Location: Marijuana Land
Old 09-19-2019 , 02:48   Suicide by grenade sound effect?
Reply With Quote #1

Can someone please make me a simple plugin where if you kill yourself with a grenade it will play a sound to you and nearby players who are around you can hear the sound as well

i have the laughing sound file i just need the plugin created please

thanks!
__________________
OmgKhalifa is offline
OmgKhalifa
Member
Join Date: Aug 2018
Location: Marijuana Land
Old 09-19-2019 , 19:34   Re: Suicide by grenade sound effect?
Reply With Quote #2

Anyone? I will most definitely use this.
__________________
OmgKhalifa is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-19-2019 , 22:47   Re: Suicide by grenade sound effect?
Reply With Quote #3

I tested it on Gearbox and Counter-Strike 1.6 The sound only happens on suicide death of grenade. Confirmed.
Code:
#include <amxmodx> public plugin_init() {         register_plugin("suicide_sound","1.2","SPiNX")         register_event("ScoreInfo", "plugin_log", "bcf", "1=committed suicide with", "2=grenade", "2=ARgrenade" ); } public plugin_precache() {         precache_sound("misc/ear_ringing.wav"); } public plugin_log() {         new szDummy[ 32 ];         read_logargv(2,szDummy, charsmax(szDummy))         if (containi(szDummy, "grenade") != -1)make_deathsound(); } public make_deathsound() {         new victim = get_loguser_index();         #define PITCH (random_num (90,111))         emit_sound(victim, CHAN_AUTO, "misc/ear_ringing.wav", VOL_NORM, ATTN_NORM, 0, PITCH);         {         return PLUGIN_HANDLED;         } } stock get_loguser_index() { new loguser[80], name[32] read_logargv(0, loguser, 79) parse_loguser(loguser, name, 31) return get_user_index(name); }
Attached Files
File Type: zip sound_fx.zip (479 Bytes, 135 views)
__________________

Last edited by DJEarthQuake; 09-21-2019 at 13:01. Reason: long story
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-20-2019 , 07:33   Re: Suicide by grenade sound effect?
Reply With Quote #4

Quote:
Originally Posted by DJEarthQuake View Post
I tested it on Gearbox and Counter-Strike 1.6 The sound only happens on suicide death of grenade. Confirmed.

It uses an ear ringing sound with random pitch inspired by Counter-Strike Source and another mod I am working on to over-dramatize the violence on GoldSrc. Feel free to use your custom sound. One can set it to play 1 sound for victim and another for everybody else.
PHP Code:
#include <amxmisc> //sound
#include <hamsandwich> //death register 
Both are not needed. You're not using Ham for registering death and the sound doesn't require amxmisc.

You overcomplicated the simplest plugin. Just use "DeathMsg" and you won't need any of those stuff:

PHP Code:
#include <amxmodx>

new const SOUND_PATH[] = "your_sound_here.wav"

public plugin_init()
{
    
register_plugin("Grenade Suicide Sound""1.0""OciXCrom")
    
register_event("DeathMsg""OnPlayerKilled""a")
}

public 
plugin_precache()
{
    
precache_sound(SOUND_PATH)
}

public 
OnPlayerKilled()
{
    new 
iVictim read_data(2)

    if(
iVictim == read_data(1))
    {
        new 
szWeapon[8]
        
read_data(4szWeaponcharsmax(szWeapon))

        if(
equal(szWeapon"grenade"))
        {
            
emit_sound(iVictimCHAN_AUTOSOUND_PATH1.0ATTN_NORM0PITCH_NORM)
        }
    }

__________________

Last edited by OciXCrom; 09-20-2019 at 07:34.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-20-2019 , 14:26   Re: Suicide by grenade sound effect?
Reply With Quote #5

It was late. Thanks!
My initial version was even smaller but it wasn't for Counter-Strike.

ARgrenade is missing from your version. My example includes novelty item: pitch bender. The other difference is this will play to the victim instead of all. Later testing I was wrong about that. Attenuation values control the sound radius.
__________________

Last edited by DJEarthQuake; 09-21-2019 at 12:21. Reason: edit from test
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-20-2019 , 17:01   Re: Suicide by grenade sound effect?
Reply With Quote #6

I assume he wants it for CS.
emit_sound emits the sound from the player. It doesn't play it only to the player. It's exactly what the user requested - nearby players to hear it.
Why do you nead a random pitch?
__________________

Last edited by OciXCrom; 09-20-2019 at 17:02.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-20-2019 , 19:40   Re: Suicide by grenade sound effect?
Reply With Quote #7

He does want it for CS. Pitch bend will come in handy with a fun plugin like this with his single LOL sound. Otherwise discard it. Thanks for the cleaner example BTW.
__________________

Last edited by DJEarthQuake; 09-21-2019 at 13:10. Reason: flags were off
DJEarthQuake 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 22:30.


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