Weapon_ShootPosition get's called everytime a player fires a shot (and has ammo for it etc).
Since TF2 is missing a proper way to detect firing with TF2_CalcIsCritical requiring tf_weapon_criticals to be 1 and +ATTACK hooks fire even if the player has no weapons and therefore require lots of validity checks, hooking ShootPosition is probably one of the easier ways.
This plugin simply provides a forward whenever a client shoots a weapon.
Example Code:
PHP Code:
#include <sourcemod>
#include <tweaponshootposition>
public OnClientWeaponShootPosition(client, Float:position[3]) {
PrintToServer("%N is firing his weapon at %.2f %.2f %.2f", client, position[0], position[1], position[2]);
}
Attached Files Get Plugin or Get Source (tWeaponShootPosition.sp - 1.6 KB) tweaponshootposition.inc (162 Bytes) tweaponshootposition.tf.txt (164 Bytes)
Wyświetl pełny artykuł