Raised This Month: $ Target: $400
 0% 

Check Slash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-27-2014 , 07:01   Re: Check Slash
Reply With Quote #1

Check attacker's button bitsum for IN_ATTACK. Like so:
PHP Code:
if(pev(iAttackerpev_button) & IN_ATTACK)
{
       
// slash

To check for stab(if you ever need it), check for IN_ATTACK2.
klippy is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 06-27-2014 , 07:06   Re: Check Slash
Reply With Quote #2

So, Something like this will be good ?

PHP Code:
public fwTakeDamagePrevictiminflictorattackerFloat:damagedamage_bits )
{
    if ( 
IsPlayerattacker ) && g_bHasSuperKnifeattacker ] && is_user_aliveattacker ) && inflictor == attacker && get_user_weaponattacker ) == CSW_KNIFE )
    {
        if( 
peviAttackerpev_button ) & IN_ATTACK )
        {
            
SetHamParamFloat4damage 15 );
        }
        else
        {
            
SetHamParamFloat4damage 100 );
        }
    }

Monster Truck 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 21:06.


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