> For the complete documentation index, see [llms.txt](https://docs.c7scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.c7scripts.com/paid/smart-axon/config.md).

# Smart Axon Configuration

This guide explains how to correctly install and configure C7 Smart Axon on your FiveM server. Follow each step carefully to ensure the framework loads and functions as intended.

## 01. Installing the Resource

{% stepper %}
{% step %}

### Download the latest release of the C7 Smart Axon;

This folder should contain the folder: <mark style="color:yellow;">**c7-scripts-smart-axon**</mark>
{% endstep %}

{% step %}

### Extract the .zip file's

{% endstep %}

{% step %}

### Place the folders into your server's resource directory

Your resources folder should look like the following:

{% code lineNumbers="true" %}

```
resources/
└── [c7-scripts]
    └── c7-scripts-smart-axon
```

{% endcode %}
{% endstep %}
{% endstepper %}

## 02. Adding to 'server.cfg'

Add the following line to your <mark style="color:yellow;">server.cfg</mark>, preferably after your MySQL and connection resources:

{% code lineNumbers="true" %}

```
ensure c7-scripts-smart-axon
```

{% endcode %}

## 03. Script Configuration

Altering the script to your preferred configuration has been made easy with our configuration file. To get started, you need to open the file: <mark style="color:yellow;">c7-scripts-smart-axon/shared/config.lua</mark>

{% stepper %}
{% step %}

### Configuring the Basics

To change the basics of the script, you need to change the following configuration lines:

{% code lineNumbers="true" expandable="true" %}

```lua
Config.AxonCommand = "axon" -- The command to toggle the manual Axon Body 3
Config.AxonManualKeybind = "J" -- The keybind to toggle the manual Axon Body 3

Config.AxonReadyCommand = "axonready" -- The command to toggle smart detection & automatic Axon Body 3
Config.AxonReadyKeybind = "K" -- The keybind to toggle smart detection & automatic Axon Body 3
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring Smart Features

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
Config.SmartFeatures = {}
Config.SmartFeatures.Enabled = true -- Should smart features be enabled?
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Emergency Lights

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on and off with Emergency Lights
-- Emergency Lights On = Bodycam On
-- Emergency Lights Off = Bodycam Off
Config.SmartFeatures.EmergencyLights = { Enabled = true }
Config.SmartFeatures.EmergencyLights.Radius = "5" -- if you're 5 meteres (etc) within a vehicle that has its emergency lights turned on (even if ur outsie the vehicle) ur bodycam will turn on.
Config.SmartFeatures.EmergencyLights.Webhook = "YOUR_DISCORD_WEBHOOK" -- Discord webhook if this is triggered.
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Gun Drawn

You must change the following lines:

{% code lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
-- Automatically turn your bodycam on and off if a gun is present in your hands.
-- Gun Present In Arms = Bodycam On
-- Gun Not Present In Arms = Bodycam Off
Config.SmartFeatures.GunDrawn = { Enabled = true }
Config.SmartFeatures.GunDrawn.DetectOthers = { Enabled = true }
Config.SmartFeatures.GunDrawn.DetectOthers.Radius = "10" -- If you're within this distance (meters) of someone with a weapon drawn, your bodycam will turn on.
Config.SmartFeatures.GunDrawn.Webhook = "YOUR_DISCORD_WEBHOOK" -- Discord webhook if this is triggered.
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Driving Too Fast

You must change the following lines:

{% code overflow="wrap" lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on and off if you're driving too fast.
-- Current Speed Is Over 'HighSpeed' = Bodycam On
-- Current Speed Is Under 'HighSpeed' = Bodycam Off
Config.SmartFeatures.DriveTooFast = { Enabled = true }
Config.SmartFeatures.DriveTooFast.HighSpeed = "60" -- How fast to drive before bodycam on.
Config.SmartFeatures.DriveTooFast.Cooldown = "20" -- Webhook cooldown (prevents spam). In seconds.
Config.SmartFeatures.DriveTooFast.Webhook = "YOUR_DISCORD_WEBHOOK" -- Discord webhook if this is triggered.
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Shooting a Firearm

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on if you shoot a firearm.
-- Shoot A Firearm = Bodycam On
Config.SmartFeatures.ShootFirearm = { Enabled = true }
Config.SmartFeatures.ShootFirearm.DelayType = "Automatic" -- Choose between: Manual or Automatic (If manual, you will have to turn the bodycam off yourself)
Config.SmartFeatures.ShootFirearm.DelayTime = "30" -- In seconds, how long should the bodycam stay active for if DelayType is Automatic
Config.SmartFeatures.ShootFirearm.Webhook = "YOUR_DISCORD_WEBHOOK" -- Discord webhook if this is triggered.
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Taking Damage

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on when you take damage.
Config.SmartFeatures.DamageTaken = { Enabled = true }
Config.SmartFeatures.DamageTaken.Shot = true
Config.SmartFeatures.DamageTaken.Stabbed = true
Config.SmartFeatures.DamageTaken.Punched = true
Config.SmartFeatures.DamageTaken.Tazed = true
Config.SmartFeatures.DamageTaken.Webhook = "YOUR_DISCORD_WEBHOOK"
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Vehicle Collisions

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on when a vehicle collision is detected (while you are driving).
Config.SmartFeatures.VehicleCollision = { Enabled = true }
Config.SmartFeatures.VehicleCollision.MinSpeed = "20" -- MPH threshold before collisions are considered.
Config.SmartFeatures.VehicleCollision.Cooldown = "10" -- Seconds between collision triggers.
Config.SmartFeatures.VehicleCollision.Delay = "30" -- How long the bodycam should stay active for before turning back off.
Config.SmartFeatures.VehicleCollision.Webhook = "YOUR_DISCORD_WEBHOOK"
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Zones

You must change the following lines:

{% code lineNumbers="true" expandable="true" %}

```lua
-- Automatically turn your bodycam on if you enter certain zones.
Config.SmartFeatures.ZoneTrigger = { Enabled = true }
Config.SmartFeatures.ZoneTrigger.Zones = {
  { name = "Mission Row", coords = vector3(441.2, -981.9, 30.7), radius = 50 },
}
Config.SmartFeatures.ZoneTrigger.Webhook = "YOUR_DISCORD_WEBHOOK"
```

{% endcode %}
{% endstep %}

{% step %}

### Configuring SF: Discord Webhooks

You must change the following lines:

```lua
-- =========================================================
-- Discord Webhooks Configuration
--
-- Webhook message templates (configurable per trigger)
-- Available placeholders: {speed}, {highSpeed}, {zone}, {damage}
-- =========================================================
Config.Webhooks = Config.Webhooks or {}
Config.Webhooks.Messages = {
  VehicleCollision = {
    Title = "[WARNING] Vehicle Collision Detected",
    Description = "Axon Body 3 device has automatically detected a vehicle collision occurring at approximately {speed} mph."
  },

  DriveTooFast = {
    Title = "[WARNING] High Speed Detected",
    Description = "Axon Body 3 device has automatically detected high speed driving at approximately {speed} mph (threshold: {highSpeed} mph)."
  },

  EmergencyLights = {
    Title = "[WARNING] Emergency Lights Detected",
    Description = "Axon Body 3 device has automatically detected emergency lights being activated."
  },

  GunDrawn = {
    Title = "[WARNING] Weapon Drawn Detected",
    Description = "Axon Body 3 device has automatically detected a weapon being present."
  },

  ShootFirearm = {
    Title = "[WARNING] Firearm Discharged",
    Description = "Axon Body 3 device has automatically detected a firearm discharge."
  },

  DamageTaken = {
    Title = "[WARNING] Officer Took Damage",
    Description = "Axon Body 3 device has automatically detected the unit taking damage ({damage})."
  },

  ZoneTrigger = {
    Title = "[WARNING] Zone Trigger Activated",
    Description = "Axon Body 3 device has automatically detected entry into a configured zone ({zone})."
  }
}
Config.WebhookMessages = Config.Webhooks.Messages
```

{% endstep %}

{% step %}

### Configuring Notifcations

You must change the following lines:

```lua
-- =========================================================
-- Notification Configuration
-- =========================================================

-- Notifications
Config.Notifications = Config.Notifications or {}
Config.Notifications.Enabled = true
Config.Notifications.Mode = "Default" -- 'Default' or 'C7-Chat' or 'C7-Notify'
Config.Notifications.Types = {
  EmergencyLights = true,
  GunDrawn = true,
  DriveTooFast = true,
  ShootFirearm = true,
  DamageTaken = true,
  VehicleCollision = true,
  ZoneTrigger = true,
}

-- Notification message templates (configurable)
-- Placeholders (when applicable): {zone}, {damage}, {speed}
Config.Notifications.Messages = {
  Ready = "Axon Body 3 is now ready for events.",
  EventsOff = "Axon Body 3 event detection is now OFF.",
  RecordingOn = "Axon Body 3 is recording.",
  RecordingOff = "Axon Body 3 is no longer recording.",
  EventDetected = "Axon Body 3 detected an event and is now recording.",

  AlertsOn = "Axon Body 3 alerts are now ON.",
  AlertsOff = "Axon Body 3 alerts are now OFF.",

  EmergencyLights = "Axon Body 3 detected emergency lights.",
  GunDrawn = "Axon Body 3 detected a weapon.",
  DriveTooFast = "Axon Body 3 detected high speed driving.",
  ShootFirearm = "Axon Body 3 detected a firearm discharge.",
  DamageTaken = "Axon Body 3 detected: {damage}.",
  VehicleCollision = "Axon Body 3 detected a vehicle collision at approximately {speed} mph.",
  ZoneTrigger = "Axon Body 3 detected zone entry: {zone}.",
}
```

{% endstep %}

{% step %}

### Configuring Sounds

You must change the following lines:

```lua
-- =========================================================
-- Axon Body 3 Sound Configuration
-- =========================================================

-- Axon sounds (client-side NUI audio)
Config.AxonSounds = Config.AxonSounds or {}
Config.AxonSounds.Enabled = true
Config.AxonSounds.Volume = 0.3
Config.AxonSounds.Settings = {
  axon_on = { Enabled = true, File = "sounds/axon_on.ogg" },
  axon_off = { Enabled = true, File = "sounds/axon_off.ogg" },
  axon_beep = { Enabled = true, File = "sounds/axon_beep.ogg" },
}
```

{% endstep %}
{% endstepper %}
