; ; This is a part of the Group Link II script. ; ; /KeyCat ; ; Check if variable KEY_Suppressed is true, if it is then exit if (KEY_Suppressed) then {exit} ; ########### DEBUG ########### ;hint "DEBUG: Gun fire!" ; ############################# ; Assign who fired the weapon to variable KEY_WhoFired = player ; Calculate time between bullets KEY_TimeBetweenBullets = (time - KEY_LastTimeFired) ; ########### DEBUG ########### ;hint format["DEBUG: %1", KEY_TimeBetweenBullets] ; ############################# ; If rapid fire then increase KEY_BulletsFired else clear KEY_BulletsFired if (KEY_TimeBetweenBullets < KEY_ROF) then {KEY_BulletsFired = KEY_BulletsFired + 1} else {KEY_BulletsFired = 0} ; If rapid fire and enough bullets is fired then set KEY_Suppressed = true and broadcast it to all if ((KEY_TimeBetweenBullets < KEY_ROF) && (KEY_BulletsFired > KEY_BulletsReq)) then {KEY_Suppressed = True; PublicVariable "KEY_Suppressed"; publicVariable "KEY_WhoFired"} ; Save current time KEY_LastTimeFired = time exit