ACE3/addons/cookoff/functions/fnc_engineFire.sqf

32 lines
810 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2016-07-14 14:16:53 +00:00
/*
* Author: KoffeinFlummi, commy2
* Start fire in engine block of a car.
*
* Arguments:
2024-01-27 08:14:10 +00:00
* 0: Vehicle <OBJECT>
2016-07-14 14:16:53 +00:00
*
* Return Value:
* None
*
* Example:
2024-01-27 08:14:10 +00:00
* cursorObject call ace_cookoff_fnc_engineFire
2016-07-14 14:16:53 +00:00
*
* Public: No
*/
2024-01-27 08:14:10 +00:00
if (!isServer) exitWith {};
2016-07-14 14:16:53 +00:00
params ["_vehicle"];
2024-01-27 08:14:10 +00:00
// If already smoking, stop
2016-07-14 14:16:53 +00:00
if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {};
2016-09-16 11:08:19 +00:00
2024-01-27 08:14:10 +00:00
_vehicle setVariable [QGVAR(isEngineSmoking), true];
2016-07-14 14:16:53 +00:00
2024-01-27 08:14:10 +00:00
// Spawn engine fire effects on all connected machines
private _jipID = [QGVAR(engineFireLocal), [_vehicle, CBA_missionTime + random [ENGINE_FIRE_TIME / 2, ENGINE_FIRE_TIME, ENGINE_FIRE_TIME / 2 * 3]]] call CBA_fnc_globalEventJIP;
[_jipID, _vehicle] call CBA_fnc_removeGlobalEventJIP;
2016-07-14 14:16:53 +00:00
2024-01-27 08:14:10 +00:00
_vehicle setVariable [QGVAR(engineFireJipID), _jipID];