BIS fnc getFactions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma2 |Game name=
| arma2


|1.00|Game version=
|1.00


|gr1 = Sides |GROUP1=
|gr1 = Sides


| Gets list and sides of current factions. |DESCRIPTION=
| Gets list and sides of current factions.


| [parameter] call [[BIS_fnc_getFactions]] |SYNTAX=
| [parameter] call [[BIS_fnc_getFactions]]


|p1= parameter:
|p1= parameter:
Line 15: Line 15:
* [[Object]] - returns index of the object side
* [[Object]] - returns index of the object side
* [[Array]] - [[side]] of the first element is returned, others are ignored
* [[Array]] - [[side]] of the first element is returned, others are ignored
&nbsp; |PARAMETER1=
&nbsp;


|
|
* [[Array]] of [[String|Strings]]
* [[Array]] of [[String|Strings]]
* [[Array]] of [[Side|Sides]]
* [[Array]] of [[Side|Sides]]
* [[Number]] - an index |RETURNVALUE=
* [[Number]] - an index


|x1= <code>[[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns all factions}}</code> |EXAMPLE1=
|x1= <code>[[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns all factions}}</code>


|x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// same as ''Example 1''}}</code> |EXAMPLE2=
|x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// same as ''Example 1''}}</code>


|x3= <code><nowiki>[</nowiki>[[player]]] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of player's faction}}</code> |EXAMPLE3=
|x3= <code><nowiki>[</nowiki>[[player]]] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of player's faction}}</code>


|x4= <code>["BLU_F"] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of given faction}}</code> |EXAMPLE4=
|x4= <code>["BLU_F"] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of given faction}}</code>


|x5= <code><nowiki>[[]]</nowiki> [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// will return all faction sides}}</code> |EXAMPLE5=
|x5= <code><nowiki>[[]]</nowiki> [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// will return all faction sides}}</code>


|x6= <code><nowiki>[[</nowiki>[[player]]]] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// will return player's side}}</code> |EXAMPLE6=
|x6= <code><nowiki>[[</nowiki>[[player]]]] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// will return player's side}}</code>


| [[faction]], [[side]] |SEEALSO=
| [[faction]], [[side]]
}}
}}



Revision as of 23:03, 17 January 2021

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:
factionside

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


Bottom Section