BIS fnc getFactions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Gets list and sides of current factions. |= Description
/*
____________________________________________________________________________________________
File: getFactions.sqf


Description:
| [parameter] call [[BIS_fnc_getFactions]] |= Syntax
Gets list of current factions


Parameter(s):
|p1= parameter:
_this: Nothing, Object or String
* [[Nothing]] or empty [[Array]] - returns all factions
Nothing - list of all factions is returned.
* [[Object]] - returns index of the object side
Object - Index number of objects faction is returned.
* [[Array]] - [[side]] of the first element is returned, others are ignored
String - Index number of given faction is returned.
&nbsp; |= Parameter 1
Array - When empty, sides of all factions are returned, otherwise side of first element is returned.


*/
|
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
* [[Array]] of [[String|Strings]]
* [[Array]] of [[Side|Sides]]
* [[Number]] - an index |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_getFactions]]; --> |= Syntax
|x1= <code>[[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns all factions}}</code> |= Example 1
 
|x2= <code>[] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// same as ''Example 1''}}</code> |= Example 2
 
|x3= <code><nowiki>[</nowiki>[[player]]] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of player's faction}}</code> |= Example 3


|p1= |= Parameter 1
|x4= <code>["BLU_F"] [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// returns index of given faction}}</code> |= Example 3


| |= Return value
|x5= <code><nowiki>[[]]</nowiki> [[call]] [[BIS_fnc_getFactions]]; {{codecomment|// will return all faction sides}}</code> |= Example 4
____________________________________________________________________________________________


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


| |= See also
| [[faction]], [[side]] |= See also
 
}}
}}



Revision as of 14:13, 5 May 2018

Hover & click on the images for description

Description

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

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

Notes

Bottom Section