Skip to content

Instantly share code, notes, and snippets.

@BaerMitUmlaut
Created March 14, 2023 22:00
Show Gist options
  • Save BaerMitUmlaut/27ef5a82ef095859d3cdc5d5fabd7707 to your computer and use it in GitHub Desktop.
Save BaerMitUmlaut/27ef5a82ef095859d3cdc5d5fabd7707 to your computer and use it in GitHub Desktop.
Global Mobilization T-55 IR Searchlight
addUserActionEventHandler ["headlights", "Activate", {
private _vehicle = vehicle ACE_player;
if !(_vehicle isKindOf "gm_t55_base" && { ACE_player == gunner _vehicle }) exitWith {};
private _light = _vehicle getVariable ["bb_irlight", objNull];
if (!isNull _light) then {
_vehicle animate ["mainturret_searchlight_cover_unhide", 1, true];
deleteVehicle _light;
} else {
_vehicle animate ["mainturret_searchlight_cover_unhide", 0, true];
_light = "#lightreflector" createVehicle [0, 0, 0];
_light attachTo [_vehicle, [0, 0, 0], "mainturret_searchlight_elev", true];
_vehicle setVariable ["bb_irlight", _light, true];
_light setLightIntensity 200;
_light setLightColor [1, 1, 1];
_light setLightAmbient [1, 1, 1];
_light setLightConePars [30, 10, 10];
_light setLightAttenuation [0, 0, 0.5, 0, 500, 550];
_light setLightVolumeShape ["a3\data_f\VolumeLightFlashlight.p3d", [2, 4, 2]];
_light setLightIR true;
_light setLightUseFlare true;
_light setLightFlareSize 3;
_light setLightFlareMaxDistance 500;
};
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment