BIS fnc getFactions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Some wiki formatting)
 
(34 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/*
|version4= 0.50
File: getFactions.sqf


Description:
|gr1= Sides
Gets list of current factions


Parameter(s):
|descr= Gets list and sides of current factions.
_this: Nothing, Object or String
Nothing - list of all factions is returned.
Object - Index number of objects faction is returned.
String - Index number of given faction is returned.
Array - When empty, sides of all factions are returned, otherwise side of first element is returned.


*/
|s1= [parameter] call [[BIS_fnc_getFactions]]
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_getFactions]]; --> |= Syntax
|p1= parameter:
* [[Nothing]] or empty [[Array]] - returns all factions
* [[Object]] - returns index of the object side
* [[Array]] - [[side]] of the first element is returned, others are ignored


|p1= |= Parameter 1
|r1=
* [[Array]] of [[String]]s
* [[Array]] of [[Side]]s
* [[Number]] - an index


| |= Return value
|x1= <sqf>call BIS_fnc_getFactions; // returns all factions</sqf>
____________________________________________________________________________________________


|x1= <code></code> |=
|x2= <sqf>[] call BIS_fnc_getFactions; // same as Example 1</sqf>
____________________________________________________________________________________________


| |= See also
|x3= <sqf>[player] call BIS_fnc_getFactions; // returns index of player's faction</sqf>


}}
|x4= <sqf>["BLU_F"] call BIS_fnc_getFactions; // returns index of given faction</sqf>


<h3 style="display:none">Notes</h3>
|x5= <sqf>[[]] call BIS_fnc_getFactions; // will return all faction sides</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x6= <sqf>[[player]] call BIS_fnc_getFactions; // will return player's side</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[faction]] [[side]]
[[Category:Function Group: Misc|{{uc:getFactions}}]]
}}
[[Category:Functions|{{uc:getFactions}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:getFactions}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:getFactions}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:getFactions}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:getFactions}}]]

Latest revision as of 13:00, 13 July 2022

Hover & click on the images for description

Description

Description:
Gets list and sides of current factions.
Execution:
call
Groups:
Sides

Syntax

Syntax:
[parameter] call BIS_fnc_getFactions
Parameters:
parameter:
  • Nothing or empty Array - returns all factions
  • Object - returns index of the object side
  • Array - side of the first element is returned, others are ignored
Return Value:

Examples

Example 1:
call BIS_fnc_getFactions; // returns all factions
Example 2:
[] call BIS_fnc_getFactions; // same as Example 1
Example 3:
[player] call BIS_fnc_getFactions; // returns index of player's faction
Example 4:
["BLU_F"] call BIS_fnc_getFactions; // returns index of given faction
Example 5:
[[]] call BIS_fnc_getFactions; // will return all faction sides
Example 6:
[[player]] call BIS_fnc_getFactions; // will return player's side

Additional Information

See also:
faction side

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