{"name":"playerTargetLock","title":"playerTargetLock","type":"command","url":"https://community.bistudio.com/wiki/playerTargetLock","revid":377647,"updated":"2026-01-02T09:01:49Z","groups":["Object Manipulation"],"status":"ok","games":{"arma3":"2.18"},"since":"arma3 2.18","arma3_since":"2.18","description":"Get the local player's current locked target (with weapons that can lock on).","syntaxes":[{"syntax":"playerTargetLock","params":[],"returns":{"type":"Array","type_expr":"Array","description":"with [target, lockValue, config]\n- target: Object - the locked object - lockValue: Number - in range 0..1 where 1 is fully locked - config: Config - used weapon's `CfgWeapons` config","text":"Array with [target, lockValue, config]\n\n- target: Object - the locked object\n- lockValue: Number - in range 0..1 where 1 is fully locked\n- config: Config - used weapon's `CfgWeapons` config"},"form":"nullary"}],"examples":[{"text":"```sqf\nplayerTargetLock params [\"_target\", \"_lock\", \"_cfg\"];\nif (_lock == 1) then\n{\n    hint format [\"%1 locked %2\", getText (_cfg >> \"displayName\"), getText (configOf _target >> \"displayName\")];\n};\n```","code":["playerTargetLock params [\"_target\", \"_lock\", \"_cfg\"];\nif (_lock == 1) then\n{\n\thint format [\"%1 locked %2\", getText (_cfg >> \"displayName\"), getText (configOf _target >> \"displayName\")];\n};"]},{"code":["playerTargetLock; // returns [objNull, 0, configNull] if no lock is being done"]}],"see_also":["cursorTarget"]}