If you're going to hook weapon_fire for pistols, DON'T DO IT!
The event gets called billions of times if the client holds his +attack button.
Hook bullet_impact instead.
Here an example from one of my plugins:
Code:
public Action:EventBulletImpact(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"))
,weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if (weapon == specialWeapon) {
MyFunction(client); // MyFunction needs to be called ONCE for each weapon fire, so bullet_impact is the right way to do it.
}
return Plugin_Continue;
}
BULLET_IMPACT IS CREDIT TO PLUGIN!