Arma 3 Scripting

Command in Multiplayer

local

Also available as Markdown and JSON, or read the original wiki page.

Description

Check if given unit is local on the computer in multiplayer games - see Multiplayer Scripting#Locality.

This can be used to determine on which computer some code must be run. In single player all objects are local.

Syntax

Syntax 1

local object

Parameters:

Returns: Boolean

Syntax 2

since arma2 1.00

local variable = value From Arma 2 v1.00 until Arma 3 v1.54 - see private for later versions

Returns: Nothing

Examples

Example 1

if (not local _unit) then
{
    hint format ["%1 is remote", name _unit];
};

Example 2

_isLocalGroup = local group _unit;

Example 3

Sets variable's scope:

// from Arma 2 v1.00 until Arma 3v1.54
local _myVariable = 42;

// since Arma 3 v1.54
private _myVariable = 42;

Multiplayer

A few things to note amongst others:

See also

Arma 3: Event Handlers · owner · setOwner