Raised This Month: $ Target: $400
 0% 

Block secondary knife attack for a certain time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-01-2018 , 13:22   Re: Block secondary knife attack for a certain time
Reply With Quote #7

PHP Code:
#include <fakemeta>
#include <hamsandwich>

const m_flNextSecondaryAttack 47
const OFFSET_LINUX 4

public plugin_init() 
{
        
RegisterHam(Ham_Weapon_SecondaryAttack "weapon_knife" "ham_weapon_secundaryattack" 0)
        
RegisterHam(Ham_Weapon_SecondaryAttack "weapon_knife" "ham_weapon_secundaryattack_post" 1)
}

public 
ham_weapon_secundaryattack(ent)
{    
         if (!
pev_valid(ent))
               return 
HAM_IGNORED    
    
         
static Float:flCurrentTime
         flCurrentTime 
get_pdata_float(entm_flNextSecondaryAttackOFFSET_LINUX//Get Secondary Attack Delay 

         
if(flCurrentTime 0.0//If it still > 0 then Stop it
             
return HAM_SUPERCEDE

    
         
return HAM_IGNORED
}  

public 
ham_weapon_secundaryattack_post(ent)
{    
         if (!
pev_valid(ent))
               return 
HAM_IGNORED

         
//Executed above. Time to set delay
         
set_pdata_float(ent m_flNextSecondaryAttack 10.0OFFSET_LINUX)    

         return 
HAM_IGNORED
 

__________________
My plugin:
Celena Luna is offline
 



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 12:11.


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