ok this is how i blocked it and logged a new one:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <dodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "wpn stats blocking"
#define VERSION "1.0"
#define AUTHOR "Dr.G"
new wpn_id
new shoot_counter
new const WPN_CLASSNAME[] = "weapon_spring"
new const NEW_WPN_SHOOTNAME[] = "SOME_WEAPON_NAME"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam( Ham_Weapon_PrimaryAttack, WPN_CLASSNAME, "func_PrimaryAttack" )
wpn_id = custom_weapon_add( NEW_WPN_SHOOTNAME, 60 , NEW_WPN_SHOOTNAME )
}
public func_PrimaryAttack(iEnt)
{
new id = pev(iEnt, pev_owner)
if(is_user_alive(id) && is_user_connected(id) && get_user_team(id) && !is_user_bot(id))
{
custom_weapon_shot(wpn_id, id)
shoot_counter++
client_print(id,3,"custom_weapon_shot: %d times", shoot_counter)
return HAM_SUPERCEDE
}
client_print(id,3,"func_PrimaryAttack")
return HAM_IGNORED
}
BUT there is a problem. it calls the function when i hold down my IN_ATTACK key so with one normal hit is logs the custom weapon shot around 5 - 11 times lol.
Code:
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "weaponstats" (weapon "SOME_WEAPON_NAM") (shots "2015") (hits "0") (kills "0") (headshots "0") (tks "0") (damage "0") (deaths "0") (score "0")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "weaponstats2" (weapon "SOME_WEAPON_NAM") (head "0") (chest "0") (stomach "0") (leftarm "0") (rightarm "0") (leftleg "0") (rightleg "0")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "time" (time "0:36")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "latency" (ping "0")
__________________