---
name: "createGuardedPoint"
type: command
status: ok
groups: ["Waypoints"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/createGuardedPoint
revid: 348606
updated: 2023-11-08T13:45:17Z
---

# createGuardedPoint

*Command · Waypoints · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

## Description

Adds a point guarded by the given side (scripted way of adding equivalent of "GUARDED BY" trigger in Editor). A closest AI group in the given side with assigned "GUARD" waypoint will attempt to secure this guard point. The actual guarded position is determined via the following rules:
- Given "position" is always considered. It could be [Object](../topics/Object.md), [Group](../topics/Group.md), [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction). In every case, z coordinate will be ignored and point will be placed on nearest surface.
- If "objectMapID" is not negative, the position of the object with the given ID is used (Overrides "position"). -1 to ignore this argument. z of the object position will be intact.
- If the given "vehicle" is valid, the position of the vehicle is extracted and guarded (Overrides both "position" and "objectMapID"). [objNull](../commands/objNull.md) to ignore. z of the vehicle position will be intact.
To be used with "GUARD" [waypoint](../commands/setWaypointType.md).

> [!NOTE]
> To know how does the "GUARD" waypoint work, see Waypoint:Guard.

## Syntax

```sqf
createGuardedPoint [side, position, objectMapID, vehicle]
```

**Parameters:**

- `side`: [Side](../topics/Side.md) - the side which will be guarding
- `position`: [Object](../topics/Object.md), [Group](../topics/Group.md), [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction)
- `objectMapID`: [Number](../topics/Number.md) - static id of map object. -1 to ignore
- `vehicle`: [Object](../topics/Object.md) - vehicle to be used for position. [objNull](../commands/objNull.md) to ignore

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
createGuardedPoint [east, [0,0], -1, vehicle player];
```

## See also

[createTrigger](../commands/createTrigger.md) · [addWaypoint](../commands/addWaypoint.md) · [setWaypointType](../commands/setWaypointType.md)

<sub>Source: [BI Community Wiki — createGuardedPoint](https://community.bistudio.com/wiki/createGuardedPoint) (revision 348606).</sub>
