Dang, im so slow

. Here is my version.
Note:
Untested
Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Extra Recoil"
#define VERSION "1.0"
#define AUTHOR "Cheap_Suit"
new g_lastwpn[33]
new g_lastclip[33]
new cvar_extrarecoil
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "event_curweapon", "be","1=1")
cvar_extrarecoil = register_cvar("amx_recoil_multiplier", "1.5")
}
public event_curweapon(id)
{
new weapon_id = read_data(2)
new weapon_clip = read_data(3)
// weapons we dont want to give extra recoil to.
switch(weapon_id)
{
case CSW_KNIFE, CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE, CSW_C4: return
}
// check if the user is currently attacking.
if(!(pev(id, pev_button) & IN_ATTACK))
return
// check if the user didnt change weapon or if shots were fired. or has no ammo
if(weapon_id != g_lastwpn[id] || weapon_clip >= g_lastclip[id] || weapon_clip < 1)
return
// where the recoil magic really happens.
static Float:punchangle[3]
pev(id, pev_punchangle, punchangle)
new Float:punchangle_length = vector_length(punchangle)
// add extra recoil if there is a recoil?
if(punchangle_length == 0.0)
return
new Float:extra_recoil = get_pcvar_float(cvar_extrarecoil)
punchangle[0] *= extra_recoil
punchangle[1] *= extra_recoil
// punchangle[2] *= extra_recoil // i dont think you want this.
set_pev(id, pev_punchangle, punchangle)
// save current weapon and clip.
g_lastwpn[id] = weapon_id
g_lastclip[id] = weapon_clip
}
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.