I found plugin by
ConnorMcLeod (source: #47)
But i can't add cvar for enable/disable.
What's wrong ?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
// weapons offsets
#define XO_WEAPONS 4
#define m_pPlayer 41
#define m_iId 43
#define m_flNextPrimaryAttack 46
#define m_flNextSecondaryAttack 47
// players offsets
#define XO_PLAYER 5
#define m_flNextAttack 83
public plugin_init()
{
register_cvar("amx_nodamage", "0")
new szWeaponName[20]
for(new i=CSW_P228; i<=CSW_P90; i++)
{
if( get_weaponname(i, szWeaponName, charsmax(szWeaponName)) && get_cvar_num("amx_nodamage") == 1 )
{
RegisterHam(Ham_Item_Deploy, szWeaponName, "Weapons_Deploy", true)
}
}
}
public Weapons_Deploy(iWeapon)
{
new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPONS)
new iId = get_pdata_int(iWeapon, m_iId, XO_WEAPONS)
set_pdata_float(iWeapon, m_flNextPrimaryAttack, 99999.0, XO_WEAPONS)
set_pdata_float(iWeapon, m_flNextSecondaryAttack, 99999.0, XO_WEAPONS)
set_pdata_float(id, m_flNextAttack, 99999.0, XO_PLAYER)
}