selectLeader: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|Game version=" to "|Game version= |gr1= Groups |GROUP1=")
m (Some wiki formatting)
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= ofpe
|version1= 1.00


|gr1= Groups |GROUP1=
|game2= arma1
|version2= 1.00


|game3= arma2
|version3= 1.00


|game4= arma2oa
|version4= 1.50


|1.00|Game version=
|game5= tkoh
|gr1= Groups |GROUP1=
|version5= 1.00


|arg= local |Multiplayer Arguments=
|game6= arma3
|version6= 0.50


|eff= global |Multiplayer Effects=
|gr1= Groups
____________________________________________________________________________________________


| Select the group's leader. Group locality can be checked with [[local]] command and group ownership with [[groupOwner]] command.
|arg= local


{{Important | An invalid combination can be provided to this command, e.g ''unitName'' '''not''' being part of ''group''. In that case:
|eff= global
 
|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
* ''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.
* if ''unitName'' is deleted or killed, [[leader]] of ''group'' will be [[objNull]] and will not automatically be reassigned.
}} |DESCRIPTION=
}}


____________________________________________________________________________________________
|s1= group [[selectLeader]] unitName


| group [[selectLeader]] unitName |SYNTAX=
|p1= group: [[Group]]


|p1= group: [[Group]] |PARAMETER1=
|p2= unitName: [[Object]]


|p2= unitName: [[Object]] |PARAMETER2=
|r1= [[Nothing]]


| [[Nothing]] |RETURNVALUE=
|x1= <sqf>group player selectLeader player;</sqf>
____________________________________________________________________________________________
 
|x1= <code>[[group]] [[player]] [[selectLeader]] [[player]];</code> |EXAMPLE1=


|x2= Make unit a leader from server:<code><nowiki>[</nowiki>[[group]] _unit, _unit] [[remoteExec]] ["selectLeader", [[groupOwner]] [[group]] _unit];</code> |EXAMPLE2=
|x2= Make unit a leader from server:
____________________________________________________________________________________________
<sqf>[group _unit, _unit] remoteExec ["selectLeader", groupOwner group _unit];</sqf>


| [[commandFollow]], [[doFollow]], [[formationLeader]], [[formLeader]], [[isFormationLeader]], [[leader]], [[setLeader]] |SEEALSO=
|seealso= [[commandFollow]] [[doFollow]] [[formationLeader]] [[formLeader]] [[isFormationLeader]] [[leader]] [[setLeader]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP Elite |{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Groups|{{uc:{{PAGENAME}}}}]]

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