{"name":"player","operator":null,"title":"player","type":"command","url":"https://community.bistudio.com/wiki/player","revid":363907,"updated":"2024-04-24T21:56:05Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"A person object controlled by user. In Intros and Outros this isn't set by default and must be assigned.","syntaxes":[{"syntax":"player","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Object","types":["Object"],"description":null,"text":"Object"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nplayer addRating 500;\n```","code":["player addRating 500;"]}],"multiplayer":"In MP player is different on each computer and on dedicated server it is objNull by default ([unless scripted](https://www.youtube.com/watch?v=JzgJe9sXAiU)).\nWhen user is joining a dedicated server mission, at the moment of onPlayerConnected the player object is remote to the joining client, as the player unit is created on the server, but once control of the unit is passed to the user moments later, the player objects becomes and remains local to the client.\n\nSee Multiplayer Scripting's player topic for additional helpful information.","problems":"In multiplayer, the command is not initialised in functions called by initline or init eventhandlers.","aliases":[],"see_also":["Multiplayer Scripting","isPlayer","playableUnits","selectPlayer"],"notes":[{"user":"Galzohar","date":"2010-06-20T03:11:00Z","text":"Before you use the **player** object in init scripts, to avoid JIP issues all you need is to run:\n\n```sqf\nwaitUntil { not isNull player };\n```\n\nAnything else you see in other scripts is equivalent and/or redundant. (but you may need to add other conditions too, such as checking hasInterface before initiating that loop)\n\nOf course JIP players may need more than just the player to point at the actual JIP player unit, but that's script/mission-specific."},{"user":"Killzone_Kid","date":"2014-06-26T18:49:00Z","text":"player can actually be REMOTE object on player's PC: <http://www.youtube.com/watch?v=m6IILtfa3cQ>"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}