Raised This Month: $ Target: $400
 0% 

Headshot Sound !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darksmith
Junior Member
Join Date: Jan 2013
Location: Morocco
Old 05-11-2013 , 07:43   Headshot Sound !
Reply With Quote #1

Hello Guys
I Tried To Use a Sound for Headshot (Bom Headshot) But it Dosn't work

Quote:
#include <amxmodx>


new const BoomHeadShot[] = "jbextreme/HS-darksmith.wav";

enum _eathMsg
{
Killer = 1,
Victim,
IsHeadShot,
WeaponName
}

public plugin_precache()
{

precache_sound( BoomHeadShot );
}

public plugin_init()
{

register_event( "DeathMsg" , "EvDeathMsg_Hs" , "a" , "3=1" );
}

public EvDeathMsg_Hs()
{

client_cmd( read_data( Killer ) , "spk %s" , BoomHeadShot );
set_hudmessage (255, 000, 000, -1.0, 0.61, 2, 0.02, 6.0, 0.01, 0.1, -1);
show_hudmessage(Victim, "HEADSHOT!");
set_hudmessage (255, 000, 000, -1.0, 0.61, 2, 0.02, 6.0, 0.01, 0.1, -1);
show_hudmessage(Killer, "HEADSHOT!");
}
Help Me pleise !
Darksmith is offline
Send a message via MSN to Darksmith
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 08:20   Re: Headshot Sound !
Reply With Quote #2

Remove the last parameter in register_event() and read headshot inside the hook.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-11-2013 at 08:22.
hornet is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-11-2013 , 08:28   Re: Headshot Sound !
Reply With Quote #3

PHP Code:
#include <amxmodx>

#define VERSION "1.0" 

new const g_szSound[][] = {
    
"headshot/headshot1",
    
"headshot/headshot2",
    
"headshot/headshot3"
}

public 
plugin_precache() {
    for(new 
0sizeof(g_szSound); i++) {
        
precache_sound(g_szSound[i]);
    }
}


public 
plugin_init() { 
    
register_plugin("Headshot Sound"VERSION"NapoleoN#"); 
    
    
register_event("DeathMsg""eDeath""a""1>0""2>0""3=1");



public 
eDeath() {
    
client_cmd0"spk ^"%s^""g_szSoundrandom_num0sizeof g_szSound ) ] );

Old plugin from me... Got some help from xPaw with this so we were discussing what's the best way to make a headshot sound plugin, and it looks like this way is the best way
__________________

Last edited by Napoleon_be; 05-11-2013 at 08:29.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 08:32   Re: Headshot Sound !
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
Old plugin from me... Got some help from xPaw with this so we were discussing what's the best way to make a headshot sound plugin, and it looks like this way is the best way
By reading what he has posted it's clear that he only wants the sound played to the killer and victim.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-11-2013 , 08:42   Re: Headshot Sound !
Reply With Quote #5

Quote:
Old plugin from me... Got some help from xPaw with this so we were discussing what's the best way to make a headshot sound plugin, and it looks like this way is the best way
I think it would be more effective to change the sound in Emitsound

New sound + block default
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 09:11   Re: Headshot Sound !
Reply With Quote #6

Quote:
Originally Posted by Bos93 View Post
I think it would be more effective to change the sound in Emitsound

New sound + block default
Huh? And what would be the default headshot sound?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-11-2013 , 09:17   Re: Headshot Sound !
Reply With Quote #7

Quote:
Originally Posted by hornet View Post
Huh? And what would be the default headshot sound?

Your new sound O_O


PHP Code:
public eDeath() {
    
client_cmd0"spk ^"%s^""g_szSoundrandom_num0sizeof g_szSound ) ] ); 

So it will play two sound, new and default
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 09:22   Re: Headshot Sound !
Reply With Quote #8

We're talking about playing a sound, not blocking one, and not emitting one.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 16:22.


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