playerSide: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma1 | |game1= arma1 | ||
|version1= 1.00 | |||
|1.00 | |game2= arma2 | ||
|version2= 1.00 | |||
|game3= arma2oa | |||
|version3= 1.50 | |||
|game4= tkoh | |||
|version4= 1.00 | |||
|game5= arma3 | |||
|version5= 0.50 | |||
|gr1= Sides | |gr1= Sides | ||
| Returns the player's [[Side|side]]. This is valid even when the player controlled person is dead (a difference from [[side]] [[player]]). | |descr= Returns the player's [[Side|side]]. This is valid even when the player controlled person is dead (a difference from [[side]] [[player]]). | ||
{{Feature | Informative | [[playerSide]] will not change automatically if [[player]] [[join]]s a [[group]] on different [[side]]. However, [[selectPlayer]] command can and does change [[playerSide]] - see | {{Feature | Informative | [[playerSide]] will not change automatically if [[player]] [[join]]s a [[group]] on different [[side]]. However, [[selectPlayer]] command can and does change [[playerSide]] - see {{HashLink|#Example 3}} for information.}} | ||
| | |s1= [[playerSide]] | ||
| [[Side]] | |r1= [[Side]] | ||
|x1= | |x1= <code>[[if]] ([[side]] man1 == [[playerSide]]) [[then]] | ||
<code>[[if]] ([[side]] man1 == | { | ||
[[hint]] "man1 is on your side!"; | |||
};</code> | };</code> | ||
|x2= <code>[[switch]] ([[playerSide]]) do { | |x2= <code>[[switch]] ([[playerSide]]) [[do]] | ||
{ | |||
[[case]] [[west]]: { [[hint]] "You are BLUFOR"; }; | |||
[[case]] [[east]]: { [[hint]] "You are OPFOR"; }; | |||
};</code> | };</code> | ||
|x3= the following code will change the side of the player including [[playerSide]]: | |x3= the following code will change the side of the player including [[playerSide]]: | ||
<code>[[private]] _player | <code>[[private]] _player = [[player]]; | ||
[<nowiki/>[[player]]] [[join]] [[createGroup]] [[east]]; | [<nowiki/>[[player]]] [[join]] [[createGroup]] [[east]]; | ||
[[selectNoPlayer]]; | [[selectNoPlayer]]; | ||
Line 39: | Line 47: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on 27 Jan, 2008</dd> | <dd class="notedate">Posted on 27 Jan, 2008</dd> | ||
<dt class="note">[[User:Dr_Eyeball|Dr_Eyeball]]<dd class="note"> | <dt class="note">[[User:Dr_Eyeball|Dr_Eyeball]]</dt> | ||
<dd class="note"> | |||
[[playerSide]] defaults to [[west]] for JIP players early on during initialization regardless of their side.<br> | [[playerSide]] defaults to [[west]] for JIP players early on during initialization regardless of their side.<br> | ||
So if you are a JIP player on another side (like [[east]]), you will need to cater for this for any early initializations. | So if you are a JIP player on another side (like [[east]]), you will need to cater for this for any early initializations. | ||
</dd> | |||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on 13 Oct, 2008</dd> | <dd class="notedate">Posted on 13 Oct, 2008</dd> | ||
<dt class="note">[[User:Dr_Eyeball|Dr_Eyeball]]<dd class="note"> | <dt class="note">[[User:Dr_Eyeball|Dr_Eyeball]]</dt> | ||
[[playerSide]] also shows your starting side, even if your [[side]] changes to [[enemy]] due to a bad [[rating]]. In that case, playerSide != side player. | <dd class="note">[[playerSide]] also shows your starting side, even if your [[side]] changes to [[enemy]] due to a bad [[rating]]. In that case, playerSide != side player.</dd> | ||
</dl> | </dl> | ||
Revision as of 15:51, 9 June 2021
Description
- Description:
- Returns the player's side. This is valid even when the player controlled person is dead (a difference from side player).
- Groups:
- Sides
Syntax
- Syntax:
- playerSide
- Return Value:
- Side
Examples
- Example 1:
if (side man1 == playerSide) then { hint "man1 is on your side!"; };
- Example 2:
switch (playerSide) do { case west: { hint "You are BLUFOR"; }; case east: { hint "You are OPFOR"; }; };
- Example 3:
- the following code will change the side of the player including playerSide:
private _player = player; [player] join createGroup east; selectNoPlayer; selectPlayer _player; hint str playerSide; // EAST
Additional Information
- See also:
- SidesidewesteastresistanceciviliansideLogicsideFriendlysideEnemysideUnknownsideEmptysideAmbientLifeSide 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
- Posted on 27 Jan, 2008
- Dr_Eyeball
-
playerSide defaults to west for JIP players early on during initialization regardless of their side.
So if you are a JIP player on another side (like east), you will need to cater for this for any early initializations. - Posted on 13 Oct, 2008
- Dr_Eyeball
- playerSide also shows your starting side, even if your side changes to enemy due to a bad rating. In that case, playerSide != side player.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Sides