{"name":"currentPilot","operator":null,"title":"currentPilot","type":"command","url":"https://community.bistudio.com/wiki/currentPilot","revid":309146,"updated":"2022-05-03T14:07:26Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.96"}],"since":{"game":"arma3","name":"Arma 3","version":"1.96"},"arma3_since":"1.96","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the person piloting the vehicle. If co-pilot is piloting, co-pilot is returned. If you need current pilot of a UAV or UGV, see UAVControl command.","syntaxes":[{"syntax":"currentPilot vehicle","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicle: Object"}],"returns":{"type":"Object","types":["Object"],"description":"piloting unit or objNull","text":"Object - piloting unit or objNull"},"form":"unary","operator":null,"left":null,"right":{"text":"vehicle","types":["Object"]}}],"examples":[{"text":"```sqf\nif (currentPilot _vehicle != driver _vehicle) then\n{\n    hint \"The pilot is not piloting!\";\n};\n```","code":["if (currentPilot _vehicle != driver _vehicle) then\n{\n\thint \"The pilot is not piloting!\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["driver","gunner","commander","effectiveCommander","turretUnit","UAVControl","enableCopilot"],"notes":[{"user":"Killzone_Kid","date":"2019-08-20T23:15:00Z","text":"To return co-pilot units:\n\n```sqf\nprivate _fnc_getCoPilots = \n{\n    private _copilotTurrets = allTurrets _this select { getNumber ([_this, _x] call BIS_fnc_turretConfig >> \"isCopilot\") > 0 };\n    private _copilots = _copilotTurrets apply { _this turretUnit _x };\n    _copilots;\n};\n\nhint str (heli call _fnc_getCoPilots);\n```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 3 version 1.96","Scripting Commands"]}