{"name":"aimedAtTarget","operator":null,"title":"aimedAtTarget","type":"command","url":"https://community.bistudio.com/wiki/aimedAtTarget","revid":363498,"updated":"2024-04-01T11:17:25Z","groups":["Object Manipulation","Weapons"],"status":"ok","replaced_by":[],"games":[{"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":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns how good a vehicle's weapon is aimed at the target.","syntaxes":[{"syntax":"vehicle aimedAtTarget [target, weapon]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle only, not unit","types":["Object"],"since":null,"text":"vehicle: Object - vehicle only, not unit"},{"name":"target","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"target: Object"},{"name":"weapon","type":"String","optional":true,"default":null,"description":"if not provided, checks all weapons; if provided, checks that weapon only","types":["String"],"since":null,"text":"weapon: String - (Optional) if not provided, checks all weapons; if provided, checks that weapon only"}],"returns":{"type":"Number in range 0..1","types":["Number"],"description":"0 if no weapons or if weapon was provided and not found","text":"Number in range 0..1 - 0 if no weapons or if *weapon* was provided and not found"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[target, weapon]","types":["Array"]}}],"examples":[{"text":"```sqf\n_aimingQuality = heli aimedAtTarget [target];\n```","code":["_aimingQuality = heli aimedAtTarget [target];"]},{"text":"```sqf\n_aimingQuality = heli aimedAtTarget [target, \"M197\"];\n```","code":["_aimingQuality = heli aimedAtTarget [target, \"M197\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["fireAtTarget"],"notes":[{"user":"Killzone_Kid","date":"2013-11-19T15:02:00Z","text":"The command doesn't work with soldier weapons, only vehicle weapons (in Arma 3 at least). The return value is either 1 or 0, very rarely the value falls in between.\n1 doesn't mean you are going to hit the target, while 0 means you're definitely off."}],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Weapons","Introduced with Arma 2: Operation Arrowhead version 1.50","Scripting Commands","Take On Helicopters: Scripting Commands"]}