{"name":"vehicle","operator":null,"title":"vehicle","type":"command","url":"https://community.bistudio.com/wiki/vehicle","revid":376160,"updated":"2025-09-08T19:48:37Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Vehicle in which given unit is mounted. If none, unit is returned. Alternatively, use objectParent\n\n> [!IMPORTANT]\n> While vehicle may return the vehicle the unit is in for **alive** units, for dead units which are groupless, this command returns the unit itself - use objectParent instead.","syntaxes":[{"syntax":"vehicle unitName","since":null,"effect":null,"exec":null,"params":[{"name":"unitName","type":"Object","optional":false,"default":null,"description":"alive unit","types":["Object"],"since":null,"text":"unitName: Object - alive unit"}],"returns":{"type":"Object","types":["Object"],"description":null,"text":"Object"},"form":"unary","operator":null,"left":null,"right":{"text":"unitName","types":["Object"]}}],"examples":[{"text":"SQS\n\n```sqs\n? vehicle player != player : hint \"Player is in a vehicle\"\n```","code":["? vehicle player != player : hint \"Player is in a vehicle\""]},{"text":"SQF\n\n```sqf\nif (vehicle player != player) then { hint \"Player is in a vehicle\" };\n```","code":["if (vehicle player != player) then { hint \"Player is in a vehicle\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["objectParent"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}