Raised This Month: $ Target: $400
 0% 

Random HeadShot sounds + Suicide + Team-Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 03-08-2010 , 07:51   Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #1

Anyone have plugin for (for example 5) random HeadShot sounds (only for Victim and Killer)?
or (one) Team Kill sound (for all players)
or (one) Suicide sound (for all players)
???
If plugin doesn't exist ill be appreciated if someone can write.
Thanks!
Mifuntm is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-08-2010 , 08:23   Re: Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
 
new const g_HeadShotSounds[][] =
{
        
"misc/headshot1.wav",
        
"misc/headshot2.wav",
        
"misc/headshot3.wav",
        
"misc/headshot4.wav",
        
"misc/headshot5.wav"
};
 
new const 
g_TeamKillSound[] = "misc/teamkill.wav";
new const 
g_SuicideSound[] = "misc/suicide.wav";
 
public 
plugin_precache()
{
        for (new 
ItemItem sizeof(g_HeadShotSounds); Item++)
                
precache_sound(g_HeadShotSounds[Item]);
 
        
precache_sound(g_TeamKillSound);
        
precache_sound(g_SuicideSound);
}
 
public 
plugin_init()
{
        
register_plugin("HS/TK/Suicide Sounds""1.0""hleV");
 
        
register_event("DeathMsg""DeathMsg""a");
}
 
public 
DeathMsg(KillerVictimHeadShot)
{
        
Killer read_data(1);
        
Victim read_data(2);
        
HeadShot read_data(3);
 
        if (
Killer == Victim || !Killer)
                
client_cmd(0"spk %s"g_SuicideSound);
        else if (
cs_get_user_team(Killer) == cs_get_user_team(Victim))
                
client_cmd(0"spk %s"g_TeamKillSound);
        else if (
HeadShot)
        {
                new 
Random random(sizeof(g_HeadShotSounds));
 
                
client_cmd(Killer"spk %s"g_HeadShotSounds[Random]);
                
client_cmd(Victim"spk %s"g_HeadShotSounds[Random]);
        }

__________________
hleV is offline
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 03-08-2010 , 10:35   Re: Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #3

Work perfect

Thanks!
__________________
Only God can judge me...
Mifuntm is offline
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 03-11-2010 , 06:34   Re: Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #4

another question about this plugin

How to remove "suicide" sound from here?
__________________
Only God can judge me...
Mifuntm is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-11-2010 , 07:04   Re: Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #5

@ Mifuntm -
PHP Code:
if (Killer == Victim || !Killer)
                
client_cmd(0"spk %s"g_SuicideSound);
        else if (
cs_get_user_team(Killer) == cs_get_user_team(Victim))
                
client_cmd(0"spk %s"g_TeamKillSound); 

PHP Code:
        if (cs_get_user_team(Killer) == cs_get_user_team(Victim))
                
client_cmd(0"spk %s"g_TeamKillSound); 
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 03-11-2010 at 07:07.
wrecked_ is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-11-2010 , 07:07   Re: Random HeadShot sounds + Suicide + Team-Kill
Reply With Quote #6

Should also check if Killer > 0 and Killer != Victim.
__________________
hleV 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 03:45.


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