doAutomatic()
{
self endon("death");
self endon("disconnect");
self _setPerk("specialty_fastreload");
self setclientDvar("perk_weapReloadMultiplier", "0.0001");
//Uncomment for no recoil:
//self _setPerk("specialty_bulletaccuracy");
//self setclientDvar("perk_weapSpreadMultiplier", "0.0001");
self thread monitorKey("reload");
while(1)
{
if(self.keyPressed["reload"])
{
currentWeapon = self getCurrentWeapon();
self setWeaponAmmoClip(currentWeapon, 0);
self giveMaxAmmo(currentWeapon);
}
wait 0.01;
}
}
monitorKey(keyID)
{
self.keyPressed[keyID] = false;
self endon("death");
self endon("disconnect");
self notifyOnPlayerCommand(keyID + "ON", "+" + keyID);
self notifyOnPlayerCommand(keyID + "OFF", "-" + keyID);
while(1)
{
self waittill(keyID + "ON");
self.keyPressed[keyID] = true;
self waittill(keyID + "OFF");
self.keyPressed[keyID] = false;
}
}