{"name":"playerSide","title":"playerSide","type":"command","url":"https://community.bistudio.com/wiki/playerSide","revid":353328,"updated":"2024-03-15T17:11:49Z","groups":["Sides"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Returns the player's side. This is valid even when the player controlled person is dead (a difference from side player).\n\n> [!NOTE]\n> playerSide will not change automatically if player joins a group on different side. However, selectPlayer command can and does change playerSide - see Example 3 for information.","syntaxes":[{"syntax":"playerSide","params":[],"returns":{"type":"Side","type_expr":"Side"},"form":"nullary"}],"examples":[{"text":"```sqf\nif (side man1 == playerSide) then\n{\n    hint \"man1 is on your side!\";\n};\n```","code":["if (side man1 == playerSide) then\n{\n\thint \"man1 is on your side!\";\n};"]},{"text":"```sqf\nswitch (playerSide) do\n{\n    case west: { hint \"You are BLUFOR\"; };\n    case east: { hint \"You are OPFOR\"; };\n};\n```","code":["switch (playerSide) do\n{\n\tcase west: { hint \"You are BLUFOR\"; };\n\tcase east: { hint \"You are OPFOR\"; };\n};"]},{"text":"the following code will change the side of the player including playerSide:\n\n```sqf\nprivate _player = player;\n[player] join createGroup east;\nselectNoPlayer;\nselectPlayer _player;\nhint str playerSide; // EAST\n```","code":["private _player = player;\n[player] join createGroup east;\nselectNoPlayer;\nselectPlayer _player;\nhint str playerSide; // EAST"]}],"see_also":["Side","side","west","east","resistance","civilian","sideLogic","sideFriendly","sideEnemy","sideUnknown","sideEmpty","sideAmbientLife","Side Relations"],"notes":[{"user":"Dr_Eyeball","date":"2008-01-27T07:52:00Z","text":"playerSide defaults to west for JIP players early on during initialization regardless of their side.\nSo if you are a JIP player on another side (like east), you will need to cater for this for any early initializations."},{"user":"Dr_Eyeball","date":"2008-10-13T08:30:00Z","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."}]}