Jump to content
Sign in to follow this  
nark0t1k

How to check if i'm CoPilot

Recommended Posts

Hi

I get some problem to check the Copilot from Humming bird

I can use a eventhandle GetIn to check sit use for copilot : Gunner

But if i try to check if i'm gunner that doesn't work

if(gunner (vehicle player) == player) then {hint "You are the copilot";};

I already use this for pilot and that work well but doesn't find another way than use

Eventhandle with getin then check if _this select 2 was "gunner" ...

But i need to make this without eventhandle ...

Hope you understand and can help :)

Share this post


Link to post
Share on other sites

fn_isUnitCopilot = {
if(vehicle _this == _this) exitWith {false};

private ["_veh", "_cfg", "_trts", "_return", "_trt"];
_veh = (vehicle _this);
_cfg = configFile >> "CfgVehicles" >> typeOf(_veh);
_trts = _cfg >> "turrets";
_return = false;

for "_i" from 0 to (count _trts - 1) do {
	_trt = _trts select _i;

	if(getNumber(_trt >> "iscopilot") == 1) exitWith {
		_return = (_veh turretUnit [_i] == _this);
	};
};

_return
};

use as

player call fn_isUnitCopilot

you can check any units too

Script is bit simplified and doesn't check for secondary turrets (turret on top of a turret) but since there is no such vehicles that have copilots on such turrets you should be fine with stock Arma 3 content and pretty much any addon.

Share this post


Link to post
Share on other sites

Samatra's magic is always welcome!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×