Raised This Month: $ Target: $400
 0% 

Efficent way to block secondary Attack of knife


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-07-2014 , 16:07   Re: Efficent way to block secondary Attack of knife
Reply With Quote #8

Quote:
Originally Posted by yokomo View Post
This will block stab and replace animation to idle.
You need New Hamsandwich module.
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("No Stab""0.0.1""wbyokomo")
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_knife""OnKnifeSecAtk")
}

public 
OnKnifeSecAtk(ent)
{
    
ExecuteHamB(Ham_CS_Weapon_SendWeaponAniment00)
    return 
HAM_SUPERCEDE;

Nice, but as it has be stated, code gonna be executed on every player frame if holding +attack2, you should set m_flNextSecondaryAttack there.

PHP Code:
public OnKnifeSecAtk(ent)
{
    
ExecuteHamB(Ham_CS_Weapon_SendWeaponAniment00)
    
set_pdata_float(entm_flNextSecondaryAttack9999.94)
    return 
HAM_SUPERCEDE

9999 if you don't bother about delays, else few seconds.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-07-2014 at 16:07.
ConnorMcLeod 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 10:06.


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