player

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Operation Flashpoint version 1.00

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
Person controlled by player.

In MP this value is different on each computer.

In Intros and Outros this isn't set by default and must be assigned.

Syntax

Syntax:
Person = player
Return Value:
Object

Examples

Example 1:
player addRating 500

Additional Information

Multiplayer:
Behaviour unknown.
Problems:
In MP the command is not initialised in functions called by initline or init eventhandlers.

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Posted on 27 Jan, 2008
Dr_Eyeball
(isNull player) is true for JIP players on their client during initialization.
After initialization, it will be set, making it valid again.

To cater for this, some people use code similar to the following in their spawned scripts:

if (!isServer && (player != player)) then
{
  waitUntil {player == player};
  waitUntil {time > 10};
};

// 'player' will now be valid
_action = player addAction ["heal", "heal.sqf", [], -1, false, false, ""];


See JIP/player topic for additional helpful information.

Bottom Section

Personal tools
Buy ArmA now!