Quote:
Originally Posted by yokomo
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_SendWeaponAnim, ent, 0, 0) 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_SendWeaponAnim, ent, 0, 0)
set_pdata_float(ent, m_flNextSecondaryAttack, 9999.9, 4)
return HAM_SUPERCEDE
}
9999 if you don't bother about delays, else few seconds.
__________________