# FAQ & Troubleshooting

## ❓ FAQ & Troubleshooting

Common questions and solutions for EL\_EVENTS.

***

### Frequently Asked Questions

#### Events don't start automatically

Check these settings:

1. Config.Scheduler.enabled must be true
2. Config.Scheduler.minPlayers - server needs this many players online
3. Wait for the interval (minInterval to maxInterval minutes)
4. Check console for any error messages

#### Admin panel won't open

1. Verify your player group is listed in Config.AdminGroups
2. Make sure Config.Commands.admin.enabled is true
3. Use the correct command: /eventadmin
4. Check F8 console for client errors

#### Events end immediately after starting

Check for duplicate stopEvent handlers. Each event file should NOT have its own RegisterNetEvent for stopEvent. Only client/main.lua should handle it.

#### Double notifications appearing

Remove ServerFunctions.NotifyAll() calls from server event files. The client announcement is sufficient.

#### History tab shows "No event history yet"

1. Verify Config.Database.enabled is true
2. Make sure oxmysql starts before el\_events
3. Check that tables exist in your database
4. Verify the history data is included in the NUI message (check client/main.lua openAdminPanel event)

#### Convoy drives through walls

The driving style 786603 keeps vehicles on roads. Add more waypoints to routes for smoother paths. Avoid waypoints that require driving through buildings.

#### Convoy doesn't take damage

Check Config.Convoy.cargoEngineHealth and cargoBodyHealth values. Lower values make it easier to destroy. The system checks engine health, body health, and total combined health.

#### Treasure found too quickly

The system is cheat-proof - actual coordinates never reach the client. If a player finds it fast, they are either lucky or skilled at following the signal.

#### Items not being given to players

Verify that item names in config match your server's item registry. For QBCore, items must exist in qb-core/shared/items.lua. For ESX, items must exist in your items database table.

***

### Common Errors

#### attempt to call a nil value (global 'StartAirdropEvent')

Event files must load before main.lua. Fix your fxmanifest.lua:

```lua
server_scripts = {
    '@oxmysql/lib/MySQL.lua',
    'server/database.lua',
    'server/discord.lua',
    'server/framework.lua',
    'server/functions.lua',
    'server/events/airdrop.lua',
    'server/events/hotzone.lua',
    'server/events/convoy.lua',
    'server/events/treasure.lua',
    'server/main.lua',
}
```

#### attempt to index a nil value (field 'spawnPoints')

Config.Convoy is missing the spawnPoints field. Add it to your config.lua:

```lua
spawnPoints = {
    cargo = { coords = vector3(163.0, -3188.0, 5.9), heading = 270.0 },
},
```

#### 'end' expected near eof

A function or if block is missing its closing end statement. Check the last lines of the file mentioned in the error.

#### Config.Convoy.spawnPoints not found

Make sure there is only ONE Config.Convoy block in config.lua. If there are two, the first one (without spawnPoints) overrides the second.

#### History data not showing in UI

Check that client/main.lua sends history in the NUI message:

```lua
SendNUIMessage({
    action = 'openAdmin',
    events = data.events,
    stats = data.stats,
    history = data.history,
})
```

### Performance Tips

1. Events use Wait(500) when players are far away to reduce CPU usage
2. Markers and 3D text only render when players are nearby
3. Signal requests for treasure are sent every 1 second, not every frame
4. Particle effects use minimal count (8 for hotzone boundary)
5. Blip updates happen every 3 seconds, not every frame
6. Database queries use async calls to prevent blocking

***

### Debug Mode

Enable debug mode to see detailed console output:

```lua
Config.Debug = true
```

This will print:

* Event creation and deletion
* Player zone entry and exit
* Convoy waypoint progress
* Signal strength calculations
* Database query results
* Reward distribution details


---

# 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://elena-scripts.gitbook.io/elenascripts/core-systems/el-events/faq-and-troubleshooting.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.
