BIS fnc sideName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Side relations" to "Side Relations")
 
(46 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<syntaxhighlight lang=javascript>/*
{{RV|type=function
Author: Karel Moricky


Description:
|game1= arma3
Returns side name
|version1= 1.00


Parameter(s):
|gr1= Sides
0: SIDE or NUMBER - either side or side ID


Returns:
|descr= Returns localized side name.
STRING
{{Columns|2|
*/
* 0 / [[opfor]] ([[east]]) {{=}} "OPFOR"
* 1 / [[blufor]] ([[west]]) {{=}} "BLUFOR"
* 2 / [[independent]] ([[resistance]]) {{=}} "Independent"
* 3 / [[civilian]] {{=}} "Civilian"
* 4 / [[sideUnknown]] {{=}} "Unknown"
* 5 / [[sideEnemy]] {{=}} "Enemy"
* 6 / [[sideFriendly]] {{=}} "Friendly"
* 7 / [[sideLogic]] {{=}} "Game Logic"
* 8 / [[sideEmpty]] {{=}} "Empty"
* 9 / [[sideAmbientLife]] {{=}} "Ambient life"
}}


private ["_sideID","_sideName"];
|s1= [input] call [[BIS_fnc_sideName]]
_sideID = [_this,0,sidelogic,[sidelogic,0]] call bis_fnc_param;
if (typename _sideID != typename 0) then {_sideID = _sideID call bis_fnc_sideID;};


_sideName = [
|p1= input: [[Side]] or [[Number]] - either side or side ID
"STR_EAST",
 
"STR_WEST",
|r1= [[String]]
"STR_GUERRILA",
 
"STR_CIVILIAN",
|x1= <sqf>[2] call BIS_fnc_sideName;</sqf>
"STR_DN_UNKNOWN",
 
"STR_DISP_CAMPAIGN_ENEMY",
|x2= <sqf>[independent] call BIS_fnc_sideName;</sqf>
"STR_DISP_CAMPAIGN_FRIENDLY",
 
"STR_LOGIC",
|seealso= [[side]] [[countSide]] {{Link|CfgVehicles Config Reference#side}} [[Side]] [[playerSide]] [[Side Relations]]
"STR_EMPTY",
}}
"STR_AMBIENT_LIFE"
] select _sideID;
localize _sideName;
</syntaxhighlight>

Latest revision as of 20:02, 12 June 2023

Hover & click on the images for description

Description

Description:
Returns localized side name.
Execution:
call
Groups:
Sides

Syntax

Syntax:
[input] call BIS_fnc_sideName
Parameters:
input: Side or Number - either side or side ID
Return Value:
String

Examples

Example 1:
[2] call BIS_fnc_sideName;
Example 2:
[independent] call BIS_fnc_sideName;

Additional Information

See also:
side countSide CfgVehicles Config Reference - side Side playerSide Side Relations

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