BIS fnc getFactions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Some wiki formatting)
 
(8 intermediate revisions by the same user not shown)
Line 25: Line 25:


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


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


|x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{cc|same as {{HashLink|#Example 1}}}}</code>
|x2= <sqf>[] call BIS_fnc_getFactions; // same as Example 1</sqf>


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


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


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


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


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

Latest revision as of 12: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