# Configuration

All editable settings for \*\*zcf\_antitank\*\* are inside: config.lua

This file is not protected by escrow, so you can edit it freely.

The core client and server logic is protected through Cfx Asset Escrow.

### Debug

```
Config.Debug = true
```

Enables debug logs in the client console and server console.

Use this while testing the resource.

Recommended live value:

```
Config.Debug = false
```

When enabled, debug logs can help you understand why a hit was accepted, ignored or forced.

### OnlyHeadshotBullet

```
Config.OnlyHeadshotBullet = true
```

If enabled, the resource only applies its logic to valid firearm headshots.

Recommended value:

```
Config.OnlyHeadshotBullet = true
```

This should normally stay enabled.

### ValidationDelayMs

```
Config.ValidationDelayMs = 120
```

This is the delay, in milliseconds, before the resource performs the final validation and forces the kill if needed.

The delay gives the natural FiveM damage sync time to apply first.

Recommended value:

```
Config.ValidationDelayMs = 120
```

If your server has heavy combat scripts or unusual damage behavior, you can test slightly higher values such as:

```
Config.ValidationDelayMs = 150
```

Avoid setting this too high, otherwise the kill may feel delayed.

### HitCooldownMs

```
Config.HitCooldownMs = 650
```

This prevents duplicate triggers from the same attacker and weapon.

Recommended value:

```
Config.HitCooldownMs = 650
```

If you notice duplicate forced kill logs, increase this slightly.

Example:

```
Config.HitCooldownMs = 800
```

### IgnoreIfVictimInVehicle

```
Config.IgnoreIfVictimInVehicle = false
```

If enabled, the resource will not force a kill when the victim is inside a vehicle.

Use this if you want to avoid edge cases in cars, motorcycles or other vehicles.

Recommended default:

```
Config.IgnoreIfVictimInVehicle = false
```

Safer vehicle setup:

```
Config.IgnoreIfVictimInVehicle = true
```

### IgnoreIfShooterInVehicle

```
Config.IgnoreIfShooterInVehicle = false
```

If enabled, the resource will not force a kill when the shooter is inside a vehicle.

Recommended default:

```
Config.IgnoreIfShooterInVehicle = false
```

Safer vehicle setup:

```
Config.IgnoreIfShooterInVehicle = true
```

### HeadBones

```
Config.HeadBones = {    [31086] = true,    [39317] = true,}
```

These are the bones accepted as valid headshot bones.

Default bones:

```
31086 = SKEL_Head39317 = SKEL_Neck_1
```

The neck bone is included as a small tolerance area.

If you want stricter headshots, use only:

```
Config.HeadBones = {    [31086] = true,}
```

Recommended default:

```
Config.HeadBones = {    [31086] = true,    [39317] = true,}
```

### MeleeWeapons

```
    Config.MeleeWeapons = {    
        ['WEAPON_UNARMED'] = true,    
        ['WEAPON_KNIFE'] = true,    
        ['WEAPON_SWITCHBLADE'] = true,    
        ['WEAPON_BAT'] = true,}
```

Weapons listed here are ignored by the anti-tank logic.

This prevents melee hits from being treated as firearm headshots.

You can add more melee weapons if your server uses custom weapon names.

Example:

```
Config.MeleeWeapons['WEAPON_CUSTOM_MELEE'] = true
```

### WeaponRanges

```
Config.WeaponRanges = {    
    ['WEAPON_PISTOL'] = 60.0,    
    ['WEAPON_COMBATPISTOL'] = 80.0,    
    ['WEAPON_SMG'] = 100.0,
}
```

This table controls which firearms can trigger the forced headshot logic and from what maximum distance.

The value is the maximum distance in GTA units.

Example:

```
['WEAPON_PISTOL'] = 60.0
```

This means `WEAPON_PISTOL` can trigger the forced headshot logic only if the attacker is within `60.0` units from the victim.

### Recommended range logic

You can balance ranges based on weapon type.

Example:

```
    -- Pistols
    ['WEAPON_PISTOL'] = 60.0,
    ['WEAPON_COMBATPISTOL'] = 80.0,
    
    -- SMGs
    ['WEAPON_SMG'] = 100.0,
    ['WEAPON_COMBATPDW'] = 100.0,
    
    -- Rifles
    ['WEAPON_CARBINERIFLE'] = 100.0,
    ['WEAPON_SPECIALCARBINE'] = 100.0,
```

Lower values make the resource stricter.

Higher values make headshots valid from longer distances.

### Adding a custom weapon

If your server uses custom weapons, add the weapon spawn name to `Config.WeaponRanges`.

Example:

```
Config.WeaponRanges['WEAPON_CUSTOMPISTOL'] = 70.0
```

Make sure the weapon name matches the actual weapon spawn name used by your server.

### DefaultFirearmRange

```
Config.DefaultFirearmRange = 55.0
```

This range is used only when:

```
Config.AllowUnknownFirearms = true
```

If unknown firearms are allowed, any weapon not listed in `Config.WeaponRanges` and not listed as melee will use this default range.

Recommended value:

```
Config.DefaultFirearmRange = 55.0
```

### AllowUnknownFirearms

```
Config.AllowUnknownFirearms = false
```

If disabled, only weapons listed in `Config.WeaponRanges` can trigger the logic.

Recommended value:

```
Config.AllowUnknownFirearms = false
```

This is safer because you control every allowed weapon manually.

If enabled:

```
Config.AllowUnknownFirearms = true
```

Unknown firearms will use:

```
Config.DefaultFirearmRange
```

This can be useful for servers with many custom weapons, but it is less strict.

### Recommended live configuration

This is a safe recommended setup for most servers:

```
    Config.Debug = false
    Config.OnlyHeadshotBullet = true
    Config.ValidationDelayMs = 120
    Config.HitCooldownMs = 650
    Config.IgnoreIfVictimInVehicle = false
    Config.IgnoreIfShooterInVehicle = false
    Config.DefaultFirearmRange = 55.0
    Config.AllowUnknownFirearms = false
```

### Recommended testing configuration

Use this while testing:

```
    Config.Debug = true
    Config.OnlyHeadshotBullet = true
    Config.ValidationDelayMs = 120
    Config.HitCooldownMs = 650
    Config.IgnoreIfVictimInVehicle = false
    Config.IgnoreIfShooterInVehicle = false
    Config.DefaultFirearmRange = 55.0
    Config.AllowUnknownFirearms = false
```

After testing, disable debug mode.

### Notes

* Keep weapon names uppercase.
* Keep weapon names inside quotes.
* Keep values as numbers.
* Restart the resource after changing the config.
* Do not edit protected escrow files.
* Only `config.lua` is meant to be edited.

### Example restart command

After changing the configuration, restart the resource:

```
restart zcf_antitank
```

Or restart the server completely.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zcf-development.gitbook.io/zcf_dev/resources/zcf_antitank/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
