What am I missing to get this to work with glock18?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.0.1"
#define PLUGIN "Force GLOCK18 BurstFire"
#define XO_WEAPON 4
#define m_pPlayer 41
#define m_flNextSecondaryAttack 47
#define m_fWeaponState 74
const WEAPONSTATE_GLOCK18_BURST_MODE = ( 1 << 1 )
#define get_weapon_owner(%0) get_pdata_cbase(%0, m_pPlayer, XO_WEAPON)
#define set_weapon_nextsecondaryattack(%0,%1) set_pdata_float(%0, m_flNextSecondaryAttack, %1, XO_WEAPON)
#define set_GLOCK18_burst(%0) set_pdata_int(%0, m_fWeaponState, WEAPONSTATE_GLOCK18_BURST_MODE, XO_WEAPON)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
RegisterHam(Ham_Spawn, "weapon_GLOCK18", "CGLOCK18_Spawn_Post", 1)
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_GLOCK18", "CGLOCK18_SecondaryAttack", 0)
}
public CGLOCK18_Spawn_Post( iWeapon )
{
set_GLOCK18_burst( iWeapon )
}
public CGLOCK18_SecondaryAttack( iWeapon )
{
new id = get_weapon_owner( iWeapon )
if( is_user_bot( id ) )
client_print(id, print_center, "Only Burst Mode Is Allowed")
set_weapon_nextsecondaryattack(iWeapon, get_gametime() + 0.3)
return HAM_SUPERCEDE
}