{"name":"formLeader","title":"formLeader","type":"command","url":"https://community.bistudio.com/wiki/formLeader","revid":369162,"updated":"2024-09-03T10:34:40Z","groups":["Unit Control"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"global"},"description":"Returns the formation leader of a given unit.\nThis is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit.","syntaxes":[{"syntax":"formLeader unitName","params":[{"name":"unitName","type":"Object","type_expr":"Object"}],"returns":{"type":"Object","type_expr":"Object","description":"the leader of the formation is returned. If used on a dead unit, the returned value is objNull"},"form":"unary","right":{"text":"unitName"}}],"examples":[{"text":"```sqf\nif (formLeader player != leader player) then\n{\n    hint \"The formation leader is different to the group leader!\";\n};\n```","code":["if (formLeader player != leader player) then\n{\n\thint \"The formation leader is different to the group leader!\";\n};"]}],"see_also":["commandFollow","doFollow","formationLeader","isFormationLeader","leader","selectLeader","setLeader"]}