Created
February 16, 2020 00:44
-
-
Save Heyoxe/ebd6ceba3193013674c21835bc5b0e30 to your computer and use it in GitHub Desktop.
Arma 3 - No-Recoil Detector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
player addEventHandler ["FiredMan", { | |
_this spawn { | |
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; | |
if (!((stance _unit) in ["STAND", "CROUCH"]) || { isWeaponRested _unit } || { isWeaponDeployed _unit }) exitWith {}; | |
private _onFireFrameVector = getCameraViewDirection _unit; | |
uiSleep (diag_deltaTime * 2); | |
private _onFireBufferedFrameVector = getCameraViewDirection _unit; | |
private _onFireVectorDeltaArray = (_onFireFrameVector vectorDiff _onFireBufferedFrameVector) apply { parseNumber ((abs _x) toFixed 5) }; | |
private _onFireVectorDeltaAbsolute = 0; | |
{ _onFireVectorDeltaAbsolute = _onFireVectorDeltaAbsolute + _x } forEach _onFireVectorDeltaArray; | |
private _isSuspect = _onFireVectorDeltaAbsolute <= 0.001; // Tweak delta | |
if (_isSuspect) exitWith { | |
// moar calculation (check % of suspect bullets, maybe by each series, etc) | |
}; | |
}; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment