selectLeader: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
m (Some wiki formatting)
 
(73 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|R]]
{{RV|type=command
[[Category:Scripting Commands ArmA|R]]


<new command not populated>
|game1= ofpe
|version1= 1.00


|game2= arma1
|version2= 1.00


<h2 style="color:#000066">''''' selectLeader '''''</h2>
|game3= arma2
|version3= 1.00


|game4= arma2oa
|version4= 1.50


'''Operand types:'''
|game5= tkoh
|version5= 1.00


'''Type of returned value:'''
|game6= arma3
|version6= 0.50


'''Compatibility:'''
|gr1= Groups


'''Description:'''
|arg= local


|eff= global


'''Example:'''
|descr= Select the group's leader. Group locality can be checked with [[local]] command and group ownership with [[groupOwner]] command.
 
{{Feature | important | An invalid combination can be provided to this command, e.g ''unitName'' '''not''' being part of ''group''. In that case:
* ''unitName'' will be [[leader]] of ''group'', but will not be able to command them
* if ''unitName'' is deleted or killed, [[leader]] of ''group'' will be [[objNull]] and will not automatically be reassigned.
}}
 
|s1= group [[selectLeader]] unitName
 
|p1= group: [[Group]]
 
|p2= unitName: [[Object]]
 
|r1= [[Nothing]]
 
|x1= <sqf>group player selectLeader player;</sqf>
 
|x2= Make unit a leader from server:
<sqf>[group _unit, _unit] remoteExec ["selectLeader", groupOwner group _unit];</sqf>
 
|seealso= [[commandFollow]] [[doFollow]] [[formationLeader]] [[formLeader]] [[isFormationLeader]] [[leader]] [[setLeader]]
}}

Latest revision as of 15:14, 13 May 2022

Hover & click on the images for description

Description

Description:
Select the group's leader. Group locality can be checked with local command and group ownership with groupOwner command.
An invalid combination can be provided to this command, e.g unitName not being part of group. In that case:
  • unitName will be leader of group, but will not be able to command them
  • if unitName is deleted or killed, leader of group will be objNull and will not automatically be reassigned.
Groups:
Groups

Syntax

Syntax:
group selectLeader unitName
Parameters:
group: Group
unitName: Object
Return Value:
Nothing

Examples

Example 1:
group player selectLeader player;
Example 2:
Make unit a leader from server:
[group _unit, _unit] remoteExec ["selectLeader", groupOwner group _unit];

Additional Information

See also:
commandFollow doFollow formationLeader formLeader isFormationLeader leader setLeader

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note