This works great. You are amazing! I tried using this code to force the bots to set the famas to burst, but it freezes. Any ideas?
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
const XO_WEAPON = 4
const m_pPlayer = 41
const m_flNextSecondaryAttack = 47
public plugin_init()
{
register_plugin( "Force Famas Secondary Burst", "1.0", "Amxx Community" )
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_famas" , "Cfamas_SecondaryAttack_Pre" , 0)
RegisterHam( Ham_Item_Deploy , "weapon_famas" , "Cfamas_Deploy_Post", 1)
}
public Cfamas_Deploy_Post( ifamas )
{
new id = get_pdata_cbase(ifamas, m_pPlayer, XO_WEAPON)
if( id > 0 && is_user_alive(id) && is_user_bot(id) && !cs_get_user_shield(id) )
{
cs_set_weapon_burst(ifamas, 1)
set_pdata_float(ifamas , m_flNextSecondaryAttack , 9999.0, XO_WEAPON)
}
}
public Cfamas_SecondaryAttack_Pre( ifamas )
{
new id = get_pdata_cbase(ifamas, m_pPlayer, XO_WEAPON)
if( id > 0 && is_user_alive(id) && is_user_bot(id) && !cs_get_user_shield(id) )
{
cs_set_weapon_burst(ifamas, 1)
set_pdata_float(ifamas , m_flNextSecondaryAttack , 9999.0, XO_WEAPON)
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
Thanks again for all your help!