ACE3/addons/medical/functions/fnc_isInMedicalVehicle.sqf

24 lines
556 B
Plaintext
Raw Normal View History

2015-03-15 02:25:31 +00:00
/*
* Author: KoffeinFlummi
* Checks if a unit is in a medical vehicle.
*
* Arguments:
* 0: unit to be checked <OBJECT>
*
* Return Value:
* Is unit in medical vehicle? <BOOL>
*
* Public: Yes
*/
2015-04-06 12:32:37 +00:00
#include "script_component.hpp"
2015-08-22 14:25:10 +00:00
private ["_vehicle"];
params ["_unit"];
2015-03-15 02:25:31 +00:00
_vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {false};
if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false};
(_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0