Raised This Month: $ Target: $400
 0% 

Knife kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bl00keRs
Member
Join Date: Mar 2009
Old 04-25-2009 , 15:53   Knife kill
Reply With Quote #1

Hi, I'm looking for a plugin which will play sound when I hit or kill somebody with knife, anybody can help me?
bl00keRs is offline
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 04-25-2009 , 16:04   Re: Knife kill
Reply With Quote #2

Not understand what do you mean...
PHP Code:
#include <amxmodx>

new PLUGIN [] = "Knife Sounds"
new VERSION [] = "1.0"
new AUTHOR [] = "M1R0n,M'"

new g_Status;

public 
plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR);

        
g_Status register_cvar("amx_knife""1");

        
register_event("DeathMsg""eventDeathMsg""a""1>0");
}

public 
eventDeathMsg()
{
        if (!
get_pcvar_num(g_Status))
                return;

        new 
szWeapon[32];
        
read_data(4szWeapon31);

        if (
equal(szWeapon"knife"))

        
client_cmd(0"spk misc/your_sound.wav")
   

?
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){


Last edited by M1R0n,M'; 04-26-2009 at 12:14.
M1R0n,M' is offline
bl00keRs
Member
Join Date: Mar 2009
Old 04-25-2009 , 17:51   Re: Knife kill
Reply With Quote #3

HMMM, I mean when I hit or kill somebody with a knife plugin will play a sound.
bl00keRs is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-25-2009 , 18:37   Re: Knife kill
Reply With Quote #4

Code:
read_data(1, szWeapon, 31);

Code:
read_data(4, szWeapon, 31);
__________________
hleV is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2009 , 18:43   Re: Knife kill
Reply With Quote #5

http://wiki.amxmodx.org/Half-Life_1_...vents#DeathMsg
__________________
Bugsy is offline
bl00keRs
Member
Join Date: Mar 2009
Old 04-25-2009 , 18:49   Re: Knife kill
Reply With Quote #6

What do you mean guys, it's M1R0n,M's plugin correct or not?
bl00keRs is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2009 , 18:52   Re: Knife kill
Reply With Quote #7

It is correct except for this line:

read_data(1, szWeapon, 31);

it should be

read_data(4, szWeapon, 31);

Per this link, the weapon is the 4th param, not first:
http://wiki.amxmodx.org/Half-Life_1_...vents#DeathMsg
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2009 , 19:24   Re: Knife kill
Reply With Quote #8

It will also only play sound when you kill the enemy, not with each knife attack.
__________________
Bugsy is offline
bl00keRs
Member
Join Date: Mar 2009
Old 04-25-2009 , 19:41   Re: Knife kill
Reply With Quote #9

THX, plugin working 100%
bl00keRs 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 06:56.


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