mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
29 lines
566 B
Plaintext
29 lines
566 B
Plaintext
/*
|
|
* Author: commy2
|
|
*
|
|
* Get the gunner of a vehicle who uses the given weapon type. Requires every turret to have a different weapon.
|
|
*
|
|
* Argument:
|
|
* 0: The vehicle (Object)
|
|
* 1: weapon of the vehicle (String)
|
|
*
|
|
* Return value:
|
|
* The turret gunner with this weapon (Object)
|
|
*/
|
|
|
|
private ["_vehicle", "_weapon"];
|
|
|
|
_vehicle = _this select 0;
|
|
_weapon = _this select 1;
|
|
|
|
private "_gunner";
|
|
_gunner = objNull;
|
|
|
|
{
|
|
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
|
|
_gunner = _vehicle turretUnit _x;
|
|
};
|
|
} forEach allTurrets _vehicle;
|
|
|
|
_gunner
|