Raised This Month: $ Target: $400
 0% 

headshot sound when doing headshot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Afro-Ankan
Member
Join Date: Jul 2009
Location: Sweden
Old 07-30-2010 , 15:42   headshot sound when doing headshot
Reply With Quote #1

hello, im trying to make a own "Knife fight" plugin and now i need some

help with headshot sound when you kill an enemy with headshot a hud

msg should be shown and a headshot sound should play. but i don't really know how to do


THANKS
__________________
My Current Projects:
Pistols vs Pistols Public
Progress [ | | | | | | | | | | ]
Only 10% Completed

Last edited by Afro-Ankan; 07-30-2010 at 15:45.
Afro-Ankan is offline
Send a message via MSN to Afro-Ankan
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-30-2010 , 16:00   Re: headshot sound when doing headshot
Reply With Quote #2

Learn pawn, see the existing tutorials, wiki, others plugin source, etc. There are many resources. Before wanting to do a plugin, learn the basics.
__________________
Arkshine is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-30-2010 , 16:00   Re: headshot sound when doing headshot
Reply With Quote #3

Include:
PHP Code:
#include <hamsandwich> 
Register:
PHP Code:
RegisterHam(Ham_TraceAttack"player""TraceAttack"); 
Public
PHP Code:
public TraceAttack(victimattackerFloat:damageFloat:dir[3], resultdmgbits)
{
            if(
get_tr2(resultTR_iHitgroup) = HIT_HEAD)
            {
                if(
get_user_health(victim) <= damage)
                {
                    
////emit_sound
                    ////hud_message
                
{
            }

Untested.
Gadzislaw007 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-30-2010 , 16:04   Re: headshot sound when doing headshot
Reply With Quote #4

Why you don't hook Ham_Killed Gadzislaw007 ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Afro-Ankan
Member
Join Date: Jul 2009
Location: Sweden
Old 07-30-2010 , 16:03   Re: headshot sound when doing headshot
Reply With Quote #5

thanks, but im gonna do what arkshine told me to do, thanks anyway
__________________
My Current Projects:
Pistols vs Pistols Public
Progress [ | | | | | | | | | | ]
Only 10% Completed
Afro-Ankan is offline
Send a message via MSN to Afro-Ankan
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-30-2010 , 16:07   Re: headshot sound when doing headshot
Reply With Quote #6

LoL. I'm new so I don't know every command - forgot about something really simple, hamtrace was my first idea. But yeah, my bad .
Gadzislaw007 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-30-2010 , 16:10   Re: headshot sound when doing headshot
Reply With Quote #7

You can hook Ham_Killed or event DeathMsg

PHP Code:
public fw_Ham_Killed()

     if ( 
read_data(3) )
     {
           
// stuff
     
}

__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 07-30-2010 at 18:39.
Devil259 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-30-2010 , 17:08   Re: headshot sound when doing headshot
Reply With Quote #8

Guys he wants headshot, just register then normal death even and do read_data(3)
__________________
I am out of order!
grimvh2 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-30-2010 , 18:39   Re: headshot sound when doing headshot
Reply With Quote #9

Fixed, thank you, I forgot
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-30-2010 , 21:52   Re: headshot sound when doing headshot
Reply With Quote #10

Search the forums prior to requesting code.

Untested.
PHP Code:
public plugin_init()
{
    
register_event"DeathMsg" "EvDeathMsg" "a" "3=1" "4&knife" );    
}

public 
EvDeathMsg()
{
    static 
szKiller33 ] , szVictim33 ];
    new 
iKiller read_data);
    new 
iVictim read_data);

    
get_user_nameiKiller szKiller charsmaxszKiller ) );
    
get_user_nameiVictim szVictim charsmaxszVictim ) );
    
    
client_cmd"spk misc/headshot" );
    
client_printprint_chat "* %s killed %s with knife headshot!" szKiller szVictim );

__________________

Last edited by Bugsy; 07-30-2010 at 22:28.
Bugsy is offline
Reply


Thread Tools
Display Modes

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 00:08.


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