Arma 3 SQF Command Quick Reference
Searchable reference for the most-used Arma 3 SQF scripting commands. The Bohemia wiki frequently 403s and isn't mobile-friendly — this one works offline and stays fast.
Click any syntax row to copy it to your clipboard. Operator types: nular (no arguments), unary (prefix), binary (left op right).
Unit / Player
Add a magazine to the player's inventory.
player addMagazine "30Rnd_65x39_caseless_mag"
Add a magazine to the player's inventory.
player addMagazine "30Rnd_65x39_caseless_mag"
Add an item to the player's inventory.
player addItem "FirstAidKit"
Add an item to the player's inventory.
player addItem "FirstAidKit"
Add a weapon to the player's inventory.
player addWeapon "arifle_MX_F"
Add a weapon to the player's inventory.
player addWeapon "arifle_MX_F"
Assign an item to a dedicated slot (map, compass, watch).
player assignItem "ItemMap"
Assign an item to a dedicated slot (map, compass, watch).
player assignItem "ItemMap"
Remove item from unit's inventory.
player removeItem "ItemMap"
Remove item from unit's inventory.
player removeItem "ItemMap"
Remove all items and weapons from unit.
player removeAllItems
Remove all items and weapons from unit.
player removeAllItems
Get unit's world position as [x, y, z].
_pos = getPos player
Get unit's world position as [x, y, z].
_pos = getPos player
Teleport a unit to world coordinates.
player setPos [3500, 4200, 0]
Teleport a unit to world coordinates.
player setPos [3500, 4200, 0]
Set position above terrain level (ignores sea level).
player setPosATL [100, 200, 0]
Set position above terrain level (ignores sea level).
player setPosATL [100, 200, 0]
Set the unit's facing direction in degrees (0 = North).
player setDir 90
Set the unit's facing direction in degrees (0 = North).
player setDir 90
Returns true if the unit is alive.
if (alive player) then { hint "alive" }
Returns true if the unit is alive.
if (alive player) then { hint "alive" }
Returns the unit's in-game display name.
_n = name player
Returns the unit's in-game display name.
_n = name player
Returns the side (WEST, EAST, GUER, CIV) of the unit.
_s = side player
Returns the side (WEST, EAST, GUER, CIV) of the unit.
_s = side player
Returns the unit's rank as a string.
_r = rank player
Returns the unit's rank as a string.
_r = rank player
Returns the group object the unit belongs to.
_grp = group player
Returns the group object the unit belongs to.
_grp = group player
Returns the vehicle the unit is in (or the unit itself).
_v = vehicle player
Returns the vehicle the unit is in (or the unit itself).
_v = vehicle player
Set damage level (0 = healthy, 1 = dead).
player setDamage 0
Set damage level (0 = healthy, 1 = dead).
player setDamage 0
Force a unit into a stance: STAND, CROUCH, or DOWN.
player setUnitPos "CROUCH"
Force a unit into a stance: STAND, CROUCH, or DOWN.
player setUnitPos "CROUCH"
Toggle whether a unit can receive damage.
player allowDamage false
Toggle whether a unit can receive damage.
player allowDamage false
Disable/enable physics and AI simulation for an object.
Disable/enable physics and AI simulation for an object.
Returns true if the unit is controlled by a human player.
if (isPlayer _unit) then {}
Returns true if the unit is controlled by a human player.
if (isPlayer _unit) then {}
Class name of the unit's primary weapon, or empty string.
_wpn = primaryWeapon player
Class name of the unit's primary weapon, or empty string.
_wpn = primaryWeapon player
Class name of the unit's handgun weapon.
Class name of the unit's handgun weapon.
Array of item class names stored in the unit's uniform.
Array of item class names stored in the unit's uniform.
Set overall AI skill level (0-1).
_ai setSkill 0.5
Set overall AI skill level (0-1).
_ai setSkill 0.5
Command unit to follow a target object.
Command unit to follow a target object.
Command unit to move to a position.
_unit doMove getPos player
Command unit to move to a position.
_unit doMove getPos player
Command unit to stop current action.
Command unit to stop current action.
Returns true if unit has completed its move order.
waitUntil { moveToCompleted _unit }
Returns true if unit has completed its move order.
waitUntil { moveToCompleted _unit }
Group
Returns array of all units in the group.
_units = units (group player)
Returns array of all units in the group.
_units = units (group player)
Returns the current leader of the group.
_ldr = leader (group player)
Returns the current leader of the group.
_ldr = leader (group player)
Move a unit into a different group.
[player, _grp] join player
Move a unit into a different group.
[player, _grp] join player
Create a new empty group for the given side.
_grp = createGroup WEST
Create a new empty group for the given side.
_grp = createGroup WEST
Assign a specific unit as group leader.
(group player) setLeader _unit
Assign a specific unit as group leader.
(group player) setLeader _unit
Returns the group's identifier string.
_id = groupID (group player)
Returns the group's identifier string.
_id = groupID (group player)
Delete an empty group.
deleteGroup _grp
Delete an empty group.
deleteGroup _grp
Set combat mode: BLUE (safe), GREEN, WHITE, YELLOW, RED.
(group player) setCombatMode "RED"
Set combat mode: BLUE (safe), GREEN, WHITE, YELLOW, RED.
(group player) setCombatMode "RED"
Set group behaviour: CARELESS, SAFE, AWARE, COMBAT, STEALTH.
(group player) setBehaviour "AWARE"
Set group behaviour: CARELESS, SAFE, AWARE, COMBAT, STEALTH.
(group player) setBehaviour "AWARE"
Vehicle
Returns array of all units that are crew of the vehicle.
_crew = fullCrew _v
Returns array of all units that are crew of the vehicle.
_crew = fullCrew _v
Order a unit to exit their current vehicle.
player leaveVehicle vehicle player
Order a unit to exit their current vehicle.
player leaveVehicle vehicle player
Returns the object currently driving the vehicle.
_drv = driver _v
Returns the object currently driving the vehicle.
_drv = driver _v
Returns the primary gunner of the vehicle.
_g = gunner _v
Returns the primary gunner of the vehicle.
_g = gunner _v
Teleport unit into the driver seat instantly.
player moveInDriver _v
Teleport unit into the driver seat instantly.
player moveInDriver _v
Teleport unit into the gunner seat instantly.
player moveInGunner _v
Teleport unit into the gunner seat instantly.
player moveInGunner _v
Teleport unit into a cargo (passenger) seat.
player moveInCargo _v
Teleport unit into a cargo (passenger) seat.
player moveInCargo _v
Set vehicle lock state: UNLOCKED, DEFAULT, LOCKEDPLAYER, LOCKED.
_v setVehicleLock "LOCKED"
Set vehicle lock state: UNLOCKED, DEFAULT, LOCKEDPLAYER, LOCKED.
_v setVehicleLock "LOCKED"
Set vehicle fuel level (0-1).
_v setFuel 0.5
Set vehicle fuel level (0-1).
_v setFuel 0.5
Set vehicle damage level (0 = pristine, 1 = destroyed).
_v setDamage 0
Set vehicle damage level (0 = pristine, 1 = destroyed).
_v setDamage 0
Turn the vehicle engine on or off.
_v engineOn true
Turn the vehicle engine on or off.
_v engineOn true
Returns current speed of the vehicle in km/h.
_spd = speed _v
Returns current speed of the vehicle in km/h.
_spd = speed _v
Markers
Create a new map marker at position. Returns the marker name.
_m = createMarker ["obj1", [3500, 4200]]
Create a new map marker at position. Returns the marker name.
_m = createMarker ["obj1", [3500, 4200]]
Move an existing marker to new map coordinates.
setMarkerPos ["obj1", getPos player]
Move an existing marker to new map coordinates.
setMarkerPos ["obj1", getPos player]
Set the text label displayed on the marker.
setMarkerText ["obj1", "Rally Point"]
Set the text label displayed on the marker.
setMarkerText ["obj1", "Rally Point"]
Set marker color by color class name.
setMarkerColor ["obj1", "ColorRed"]
Set marker color by color class name.
setMarkerColor ["obj1", "ColorRed"]
Set the marker icon type.
setMarkerType ["obj1", "mil_triangle"]
Set the marker icon type.
setMarkerType ["obj1", "mil_triangle"]
Set marker size as [width, height] in map units.
setMarkerSize ["obj1", [2, 2]]
Set marker size as [width, height] in map units.
setMarkerSize ["obj1", [2, 2]]
Set marker transparency (0 = invisible, 1 = opaque).
setMarkerAlpha ["obj1", 0.7]
Set marker transparency (0 = invisible, 1 = opaque).
setMarkerAlpha ["obj1", 0.7]
Remove a marker from the map.
deleteMarker "obj1"
Remove a marker from the map.
deleteMarker "obj1"
Set fill brush for area markers: Solid, Border, Horizontal, etc.
Set fill brush for area markers: Solid, Border, Horizontal, etc.
Set marker shape: ICON, RECTANGLE, ELLIPSE, POLYLINE.
Set marker shape: ICON, RECTANGLE, ELLIPSE, POLYLINE.
Returns the world position [x, y, 0] of the named marker.
_p = markerPos "obj1"
Returns the world position [x, y, 0] of the named marker.
_p = markerPos "obj1"
Events
Attach an event handler to a unit. Returns handler ID.
_id = player addEventHandler ["Killed", { hint "Dead!" }]
Attach an event handler to a unit. Returns handler ID.
_id = player addEventHandler ["Killed", { hint "Dead!" }]
Remove a specific event handler by its returned ID.
player removeEventHandler ["Killed", _id]
Remove a specific event handler by its returned ID.
player removeEventHandler ["Killed", _id]
Remove all event handlers of a specific event type.
player removeAllEventHandlers "Killed"
Remove all event handlers of a specific event type.
player removeAllEventHandlers "Killed"
Attach an event handler to the mission itself.
Attach an event handler to the mission itself.
Remove a mission-level event handler by ID.
Remove a mission-level event handler by ID.
Multiplayer-safe event handler; executes on the machine owning the unit.
Multiplayer-safe event handler; executes on the machine owning the unit.
Timing
Pause script execution for N seconds. Not usable in functions.
sleep 3
Pause script execution for N seconds. Not usable in functions.
sleep 3
UI-safe sleep — suspends script without blocking the interface.
uiSleep 1.5
UI-safe sleep — suspends script without blocking the interface.
uiSleep 1.5
Pause until the code block returns true. Checks every frame.
waitUntil { alive _enemy }
Pause until the code block returns true. Checks every frame.
waitUntil { alive _enemy }
Returns [year, month, day, hour, minute, second, millisecond].
_t = systemTime
Returns [year, month, day, hour, minute, second, millisecond].
_t = systemTime
Seconds elapsed since the mission started.
_elapsed = time
Seconds elapsed since the mission started.
_elapsed = time
Seconds elapsed since mission start on the server.
Seconds elapsed since mission start on the server.
Run a block of code in a separate script thread. Non-blocking.
[] spawn { sleep 5; hint "Done" }
Run a block of code in a separate script thread. Non-blocking.
[] spawn { sleep 5; hint "Done" }
Execute an external SQF file as a new script thread.
[] execVM "fn_init.sqf"
Execute an external SQF file as a new script thread.
[] execVM "fn_init.sqf"
Strings & Arrays
Convert any value to its string representation.
_s = str 42
Convert any value to its string representation.
_s = str 42
Parse a string into a number. Returns 0 on failure.
_n = parseNumber "5"
Parse a string into a number. Returns 0 on failure.
_n = parseNumber "5"
Returns number of elements in an array or string.
_len = count [1,2,3]
Returns number of elements in an array or string.
_len = count [1,2,3]
Returns the element at the given index (0-based).
_el = ["a","b"] select 0
Returns the element at the given index (0-based).
_el = ["a","b"] select 0
Append item to end of array. Returns new count.
_arr pushBack "x"
Append item to end of array. Returns new count.
_arr pushBack "x"
Merge array2 into array (modifies array in place).
_a append [4,5,6]
Merge array2 into array (modifies array in place).
_a append [4,5,6]
Replace element at index with a new value.
_arr set [0, "new"]
Replace element at index with a new value.
_arr set [0, "new"]
Remove and return the element at index.
_arr deleteAt 2
Remove and return the element at index.
_arr deleteAt 2
Returns index of value in array, or -1 if not found.
_i = _arr find "x"
Returns index of value in array, or -1 if not found.
_i = _arr find "x"
Sort array in place. true = ascending, false = descending.
_nums sort true
Sort array in place. true = ascending, false = descending.
_nums sort true
Resize array to N elements (pads with nil or truncates).
_arr resize 10
Resize array to N elements (pads with nil or truncates).
_arr resize 10
Returns true if the value is present in the array.
if (player in allPlayers) then {}
Returns true if the value is present in the array.
if (player in allPlayers) then {}
Format a string with placeholders (%1, %2, ...).
hint format ["Player: %1", name player]
Format a string with placeholders (%1, %2, ...).
hint format ["Player: %1", name player]
Convert string to lower case.
_l = toLower "ABC"
Convert string to lower case.
_l = toLower "ABC"
Convert string to upper case.
_u = toUpper "abc"
Convert string to upper case.
_u = toUpper "abc"
Map: return new array with code applied to each element.
[1,2,3] apply { _x ^ 2 }
Map: return new array with code applied to each element.
[1,2,3] apply { _x ^ 2 }
Filter: return elements where code returns true.
[1,2,3,4] select { _x > 2 }
Filter: return elements where code returns true.
[1,2,3,4] select { _x > 2 }
Conditionals
Execute code block if condition is true.
if (alive player) then { hint "alive" }
Execute code block if condition is true.
if (alive player) then { hint "alive" }
If-else branch. Returns value of executed branch.
if (_x > 0) then { "pos" } else { "neg" }
If-else branch. Returns value of executed branch.
if (_x > 0) then { "pos" } else { "neg" }
Exit the current scope if condition is true.
if (!alive player) exitWith {}
Exit the current scope if condition is true.
if (!alive player) exitWith {}
Switch statement with optional default case.
Switch statement with optional default case.
Count elements in array where condition is true.
{ _x > 0 } count [1,-1,2,-2]
Count elements in array where condition is true.
{ _x > 0 } count [1,-1,2,-2]
Execute code for each element; _x is the element, _forEachIndex is its index.
{ systemChat str _x } forEach allPlayers
Execute code for each element; _x is the element, _forEachIndex is its index.
{ systemChat str _x } forEach allPlayers
UI / Output
Display a local chat message (only visible to you).
systemChat "Debug: reached point A"
Display a local chat message (only visible to you).
systemChat "Debug: reached point A"
Show a hint box in the top-right corner.
hint format ["HP: %1", getHit player "head"]
Show a hint box in the top-right corner.
hint format ["HP: %1", getHit player "head"]
Display a full-screen title/subtitle.
["Mission Start", "PLAIN DOWN"] titleText
Display a full-screen title/subtitle.
["Mission Start", "PLAIN DOWN"] titleText
Display a subtitle cut at the top of the screen.
Display a subtitle cut at the top of the screen.
Show hint without the sound effect.
hintSilent "Silent hint"
Show hint without the sound effect.
hintSilent "Silent hint"
Send a side chat message as a specific unit.
player sideChat "Ready"
Send a side chat message as a specific unit.
player sideChat "Ready"
Broadcast message to all players on all sides.
player globalChat "GG"
Broadcast message to all players on all sides.
player globalChat "GG"
Math & Logic
Add two numbers (also concatenates arrays and strings).
_sum = 5 + 3
Add two numbers (also concatenates arrays and strings).
_sum = 5 + 3
Subtract b from a.
_diff = 10 - 4
Subtract b from a.
_diff = 10 - 4
Multiply a by b.
_prod = 3 * 7
Multiply a by b.
_prod = 3 * 7
Divide a by b.
_q = 10 / 2
Divide a by b.
_q = 10 / 2
Modulo — remainder after dividing a by b.
_r = 7 % 3
Modulo — remainder after dividing a by b.
_r = 7 % 3
Raise a to the power of b.
_sq = 2 ^ 8
Raise a to the power of b.
_sq = 2 ^ 8
Round down to nearest integer.
_f = floor 3.9
Round down to nearest integer.
_f = floor 3.9
Round up to nearest integer.
_c = ceil 3.1
Round up to nearest integer.
_c = ceil 3.1
Round to nearest integer.
_r = round 3.5
Round to nearest integer.
_r = round 3.5
Returns the absolute (positive) value.
_a = abs _val
Returns the absolute (positive) value.
_a = abs _val
Returns a random float from 0 up to (but not including) N.
_r = random 100
Returns a random float from 0 up to (but not including) N.
_r = random 100
Returns the larger of two values.
_m = _x max 0
Returns the larger of two values.
_m = _x max 0
Returns the smaller of two values.
_m = _x min 100
Returns the smaller of two values.
_m = _x min 100
Logical AND — true if both a and b are true.
if (alive p && side p == WEST) then {}
Logical AND — true if both a and b are true.
if (alive p && side p == WEST) then {}
Logical OR — true if either a or b is true.
Logical OR — true if either a or b is true.
Logical NOT — inverts a boolean.
if (!alive _unit) then {}
Logical NOT — inverts a boolean.
if (!alive _unit) then {}
World & Mission
Array of all player-controlled units on the server.
_n = count allPlayers
Array of all player-controlled units on the server.
_n = count allPlayers
Array of all living non-player units in the mission.
_all = allUnits
Array of all living non-player units in the mission.
_all = allUnits
Array of all groups currently in the mission.
_grps = allGroups
Array of all groups currently in the mission.
_grps = allGroups
Array of all dead units.
_count = count allDead
Array of all dead units.
_count = count allDead
Returns the class name of the current map/world.
_map = worldName
Returns the class name of the current map/world.
_map = worldName
Returns the file name of the current mission.
_mn = missionName
Returns the file name of the current mission.
_mn = missionName
Returns the 3D distance between two positions or objects.
player distance _enemy
Returns the 3D distance between two positions or objects.
player distance _enemy
Returns the flat (2D) distance, ignoring altitude.
player distance2D _obj
Returns the flat (2D) distance, ignoring altitude.
player distance2D _obj
Objects of given types within radius of position.
nearestObjects [player, ["Man"], 100]
Objects of given types within radius of position.
nearestObjects [player, ["Man"], 100]
Spawn a vehicle or object at position.
_v = createVehicle ["B_MRAP_01_F", getPos player]
Spawn a vehicle or object at position.
_v = createVehicle ["B_MRAP_01_F", getPos player]
Remove an object from the mission.
deleteVehicle _v
Remove an object from the mission.
deleteVehicle _v
Set position above sea level (useful for aircraft spawn).
Set position above sea level (useful for aircraft spawn).
True if code is running on the game server (not a client).
if (isServer) then {}
True if code is running on the game server (not a client).
if (isServer) then {}
True if code is running on a machine with a player interface.
if (hasInterface) then {}
True if code is running on a machine with a player interface.
if (hasInterface) then {}
True if object is of the given class or a subclass of it.
if (_unit isKindOf "Man") then {}
True if object is of the given class or a subclass of it.
if (_unit isKindOf "Man") then {}
Broadcast a global variable value to all machines in MP.
publicVariable "g_score"
Broadcast a global variable value to all machines in MP.
publicVariable "g_score"
Send a variable value to the server only.
Send a variable value to the server only.
Operator Type Legend
No arguments. The command stands alone. Example: systemTime
One argument on the right. Example: alive unit
Left argument, command, right argument. Example: player addItem "x"
Run your own Arma 3 server.
Rent a private Arma 3 server on real hardware — full control-panel access, your mods, your configs, your rules. It's your server; run it your way.
Don't want to run it yourself? Our managed services & consulting team will set it up and keep it running for you — game servers, Windows, Linux, and cloud, from 10+ years of MSP work.