AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect awp hs kill (https://forums.alliedmods.net/showthread.php?t=226165)

HamletEagle 09-14-2013 10:14

Detect awp hs kill
 
It's this method correct to detect hs kill with awp ?

Code:


#include <amxmodx>

public plugin_init() {
       
        register_event( "DeathMsg", "DeathMsg", "a" )
       
}

public DeathMsg() {
       
        new headshot=read_data(3)
        new Victim=read_data(2)
        new weapon, HitPoint, attacker = get_user_attacker(Victim, weapon, HitPoint)
       
        if(weapon == CSW_AWP && headshot) {
               
                //awp hs kill
               
        }
       
}


~Ice*shOt 09-14-2013 10:27

Re: Detect awp hs kill
 
Yes, but better check weapon is with

PHP Code:

read_data(3Weapon31

I think.

HamletEagle 09-14-2013 10:45

Re: Detect awp hs kill
 
Quote:

Originally Posted by ~Ice*shOt (Post 2034436)
Yes, but better check weapon is with

PHP Code:

read_data(3Weapon31

I think.

I know but in my code I need to check all this things,not only weapon.

dark_style 09-14-2013 10:55

Re: Detect awp hs kill
 
https://forums.alliedmods.net/showthread.php?t=88792

Example included.

Black Rose 09-14-2013 10:56

Re: Detect awp hs kill
 
Why don't you just try it instead?

ConnorMcLeod 09-14-2013 11:27

Re: Detect awp hs kill
 
Add correct filters and you don't need to check for awp or for headshot :

PHP Code:

register_event("DeathMsg""Event_DeathMsg_Awp_Hs""a""3=1""4=awp"); 


HamletEagle 09-14-2013 11:27

Re: Detect awp hs kill
 
Quote:

Originally Posted by dark_style (Post 2034448)

I didn't ask that. I simply ask if my method is correct. Because I can't test now,some problems with the pc. Solved,thx connor.


All times are GMT -4. The time now is 19:08.

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