> For the complete documentation index, see [llms.txt](https://docs.imperialcad.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imperialcad.app/api-and-integrations/fivem-installation/paid-resources/local-calls-imperial.md).

# Local Calls Imperial

Local Calls Imperial brings immersive realism to your FiveM server by enabling AI locals to automatically report crimes to ImperialCAD. Fully standalone and deeply customizable, this script raises the

***

### 💾 Installation

1. Purchase and download the resource from our [Tebex store](https://imperial-solutions.tebex.io/package/6785514).
2. Drag and drop the `LocalCallsImperial` resource into your `resources` folder, ensure there are no spaces in the name..
3. Add the following to your `server.cfg`:

```bash
ensure LocalCallsImperial
```

4. Set the required convars for ImperialCAD API communication: (If not already done)

```bash
setr imperial_community_id "YOUR_COMMUNITY_ID"
set imperialAPI "YOUR_SECRET_KEY"
```

> ❗ These convars are **required** for all ImperialCAD scripts.

***

### ⚙️ Configuration

All customization is handled inside `config.lua`.

#### Basic Settings

```lua
Config = {
  debug = true,
  extremeDebug = true,
  snitchPercent = 70,
  callDuration = 7,
  callNature = "Local 911 Call",
```

#### Report Cooldowns (per crime type)

```lua
  reportcooldowns = {
    hotwire = 15,
    murder = 15,
    shooting = 15,
    carjack = 15,
    lockpick = 15,
    drugs = 15,
    explosion = 15,
    brandish = 30,
  },
```

#### Witness Radius (per crime type)

```lua
  witnessradius = {
    hotwire = 75.0,
    murder = 75.0,
    shooting = 100.0,
    carjack = 50.0,
    lockpick = 75.0,
    drugs = 45.0,
    explosion = 100.0,
    playerdead = 60.0,
    brandish = 20.0,
  },
```

#### Ignore Zones (no reporting will occur in these zones)

```lua
  ignorezones = {
    { name = "Paleto Shooting Range", coords = vector3(-229.0, 6178.0, 31.9), radius = 50.0 },
    { name = "Sandy Range", coords = vector3(851.0, 3567.0, 33.5), radius = 45.0 },
    { name = "Mt Chiliad Hunting Area", coords = vector3(-1125.8, 4840.0, 218.0), radius = 150.0 },
    { name = "testing beach", coords = vector3(-1720.9, -1443.58, 4.58), radius = 1000 },
  }
}
```

***

### 📤 Exports & Developer Events

#### Client-Side Exports

**`exports["LocalCallsImperial"]:HasWitnessNearby(coords, radius)`**

Checks if there is a witness nearby within the given radius.

* 📥 **Params:**
  * `coords` (vector3): Coordinates to check around
  * `radius` (number): Radius to search for witnesses
* 📤 **Returns:**
  * `boolean`: true if a witness is found
  * `number` or `nil`: ped entity
  * `number` or `nil`: distance from witness

**`exports["LocalCallsImperial"]:AttemptWitnessCall(ped, coords, reportType, appearance, distance, cause, duration?)`**

Attempts to simulate a 911 call by a nearby witness.

* 📥 **Params:**
  * `ped` (number): Witness ped
  * `coords` (vector3): Location of incident
  * `reportType` (string): Type of crime (e.g. "shoot", "murder")
  * `appearance` (string): Suspect appearance
  * `distance` (number): Distance to witness
  * `cause` (string): Description or cause of report
  * `duration?` (integer): Optional duration of call (default: 7)

**`exports["LocalCallsImperial"]:CustomEvent(reportType, coords?, customMessage?, radius?)`**

Triggers a witness detection event from any script.

* 📥 **Params:**
  * `reportType` (string): Should match a key in `Config.reportcooldowns`
  * `coords?` (vector3): Optional override location
  * `customMessage?` (string): Custom message override
  * `radius?` (number): Optional override radius

Use this to report lockpicking, robbery attempts, drug dealing, or any interactions that arent possible with base GTA in your logic.

***

### 💡 Key Features

* No framework dependency (fully standalone)
* Built-in witness cancel system (eliminate them before they call)
* Smart cooldowns to prevent spam
* Exportable reporting logic
* out of the box ImperialCAD integration
* Includes default events for shooting, murder, carjack, drugs, etc.
* exports for custom reporting

***

### 🔐 License

LocalCallsImperial is a paid product by Imperial Solutions. Unauthorized redistribution or resale is strictly prohibited. For support, please contact us through your download page or ticket panel.
