BIS fnc getFactions: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(\[[a-zA-Z,. ]*\] call ('''|\[\[)?BI(N|S)_fnc_[a-zA-Z]+('''|\]\])?) * \|p1=" to " |s1=$1 |p1=") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma2 | |game1= arma2 | ||
|1.00 | |version1= 1.00 | ||
|game2= arma2oa | |game2= arma2oa | ||
Line 15: | Line 15: | ||
|gr1= Sides | |gr1= Sides | ||
| Gets list and sides of current factions. | |descr= Gets list and sides of current factions. | ||
|s1=[parameter] call [[BIS_fnc_getFactions]] | |s1= [parameter] call [[BIS_fnc_getFactions]] | ||
|p1= parameter: | |p1= parameter: | ||
Line 23: | Line 23: | ||
* [[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 | ||
| | |r1= | ||
* [[Array]] of [[String|Strings]] | * [[Array]] of [[String|Strings]] | ||
* [[Array]] of [[Side|Sides]] | * [[Array]] of [[Side|Sides]] | ||
Line 32: | Line 31: | ||
|x1= <code>[[call]] [[BIS_fnc_getFactions]]; {{cc|returns all factions}}</code> | |x1= <code>[[call]] [[BIS_fnc_getFactions]]; {{cc|returns all factions}}</code> | ||
|x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{ | |x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{cc|same as {{HashLink|#Example 1}}}}</code> | ||
|x3= <code><nowiki | |x3= <code>[<nowiki/>[[player]]] [[call]] [[BIS_fnc_getFactions]]; {{cc|returns index of player's faction}}</code> | ||
|x4= <code>["BLU_F"] [[call]] [[BIS_fnc_getFactions]]; {{cc|returns index of given faction}}</code> | |x4= <code>["BLU_F"] [[call]] [[BIS_fnc_getFactions]]; {{cc|returns index of given faction}}</code> | ||
Line 40: | Line 39: | ||
|x5= <code><nowiki>[[]]</nowiki> [[call]] [[BIS_fnc_getFactions]]; {{cc|will return all faction sides}}</code> | |x5= <code><nowiki>[[]]</nowiki> [[call]] [[BIS_fnc_getFactions]]; {{cc|will return all faction sides}}</code> | ||
|x6= <code><nowiki>[[</nowiki>[[player]]]] [[call]] [[BIS_fnc_getFactions]]; {{ | |x6= <code><nowiki>[[</nowiki>[[player]]]] [[call]] [[BIS_fnc_getFactions]]; {{cc|will return player's side}}</code> | ||
|seealso= [[faction]], [[side]] | |seealso= [[faction]], [[side]] | ||
}} | }} | ||
Revision as of 03:02, 13 June 2021
Description
Syntax
- Syntax:
- [parameter] call BIS_fnc_getFactions
- Parameters:
- parameter:
- 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
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