Tip: Create a -Hat system, and have your Hat weapons call one it's functions. That way if you want to add an haton, hatoff animation you don't have change all your Hat weapons.
I.e:
-Hat
PHP Code:
//#CLIENTSIDE
public function changeHat(hatimg) {
if (player.attr[1] == hatimg) {
player.attr[1] = "hat.png";
} else {
player.attr[1] = hatimg;
}
}
Hats/Gasmask:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
(@"-Hat").changeHat("ds-gasmask.png");
}