AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to check whether knife kills (https://forums.alliedmods.net/showthread.php?t=298894)

RAW_192 06-25-2017 10:21

how to check whether knife kills
 
how to check whether a player killed someone with a knife ?

wickedd 06-25-2017 10:39

Re: how to check whether knife kills
 
Here's a way.

PHP Code:

#include < csx >

public client_deathiKilleriVictimiweaponheadshot //  client_death( killer, victim, wpnindex, hitplace, TK )
{    
    if( 
iweapon == CSW_KNIFE )
    {
        
// Knife kill
    
}



RAW_192 06-25-2017 13:05

Re: how to check whether knife kills
 
Ok thanks..

One more thing .. Can we use ham here ? or it can just be done by csx?

wickedd 06-25-2017 13:13

Re: how to check whether knife kills
 
Yes. You can use "Ham_Killed" or even"DeathMsg" if you want.

RAW_192 06-25-2017 13:16

Re: how to check whether knife kills
 
Can you please give an example on how to use Ham_Killed ?

wickedd 06-25-2017 13:33

Re: how to check whether knife kills
 
There are many examples on the forum already.

P.S. I don't see why you don't want to use client_death, it's the easiest way.

Craxor 06-25-2017 23:16

Re: how to check whether knife kills
 
Or DeathMsg with the 4 argument as KNIFE ( 4=KNIFE )

RAW_192 06-26-2017 01:24

Re: how to check whether knife kills
 
Ok thanks solved


All times are GMT -4. The time now is 23:03.

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