playerSide: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Text replacement - "\{\{Feature *\| *Informative *\| ([^↵]+) *\}\}" to "{{Feature|informative|$1}}") |
||
(9 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
|descr= 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 | | {{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 {{Link|#Example 3}} for information.}} | ||
|s1= [[playerSide]] | |s1= [[playerSide]] | ||
Line 25: | Line 25: | ||
|r1= [[Side]] | |r1= [[Side]] | ||
|x1= < | |x1= <sqf> | ||
if (side man1 == playerSide) then | |||
{ | { | ||
hint "man1 is on your side!"; | |||
};</ | }; | ||
</sqf> | |||
|x2= < | |x2= <sqf> | ||
switch (playerSide) do | |||
{ | { | ||
case west: { hint "You are BLUFOR"; }; | |||
case east: { hint "You are OPFOR"; }; | |||
};</ | }; | ||
</sqf> | |||
|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]]: | ||
< | <sqf> | ||
private _player = player; | |||
[player] join createGroup east; | |||
selectNoPlayer; | |||
selectPlayer _player; | |||
hint str playerSide; // EAST | |||
</sqf> | |||
|seealso= [[Side]] [[side]] [[west]] [[east]] [[resistance]] [[civilian]] [[sideLogic]] | |seealso= [[Side]] [[side]] [[west]] [[east]] [[resistance]] [[civilian]] [[sideLogic]] [[sideFriendly]] [[sideEnemy]] [[sideUnknown]] [[sideEmpty]] [[sideAmbientLife]] [[Side Relations]] | ||
}} | }} | ||
{{Note | |||
|user= Dr_Eyeball | |||
|timestamp= 20080127075200 | |||
|text= [[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. | ||
}} | |||
{{Note | |||
|user= Dr_Eyeball | |||
|timestamp= 20081013083000 | |||
|text= [[playerSide]] also shows your starting side, even if your [[side]] changes to [[enemy]] due to a bad [[rating]]. In that case, playerSide != side player. | |||
}} | |||
Latest revision as of 18:11, 15 March 2024
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:
- Example 2:
- 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:
- Side side west east resistance civilian sideLogic sideFriendly sideEnemy sideUnknown sideEmpty sideAmbientLife 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
- Posted on Jan 27, 2008 - 07:52 (UTC)
-
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 Oct 13, 2008 - 08:30 (UTC)
- 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