I thought putting some recoil (camera shake) on the Glock was simple enough. And it actually works. But when I switch to burst mode I get bullet holes directly above me. Not sure why it's doing that. =/
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
new cvar_glock_recoil;
new const glock_model[] = "models/v_glock18.mdl";
public plugin_init()
{
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_glock18", "Fw_Weapon_PrimaryAttack_Post", 1);
cvar_glock_recoil = register_cvar("glock_recoil", "1.1");
}
public Fw_Weapon_PrimaryAttack_Post(weapon)
{
static id, model[32];
id = pev(weapon, pev_owner);
pev(id, pev_viewmodel2, model, 31);
if(!equali(model, glock_model))
return HAM_IGNORED
if(!cs_get_weapon_ammo(weapon))
return HAM_IGNORED
set_pev(id, pev_punchangle, get_pcvar_float(cvar_glock_recoil));
return HAM_IGNORED
}
__________________