Website Installation
Step 1: Upload Files
- Download and extract the LonexMap ZIP file
- Upload the contents of the
website/folder to your web server - Your folder structure should look like this:
Step 2: Configure License Key
- Open
config.phpin a text editor - Enter your LonexLabs license key:
Step 3: Configure Secret Key
Set a secure secret key that will be shared between the website and FiveM resource:Important: Use a long, random string. This key must match exactly in both config.php and your FiveM resource.
Step 4: Verify Installation
Visit your website URL. You should see the LonexMap interface with a “Connecting…” status until the FiveM resource is configured.FiveM Resource Installation
Step 1: Upload Resource
- Copy the
fivem-resourcefolder to your server’sresources/directory - Rename it to
lonexmap(or your preferred name)
Step 2: Configure the Resource
Openserver/main.lua and update these settings:
Step 3: Add to Server Config
Add the resource to yourserver.cfg:
Step 4: Restart Server
Restart your FiveM server or start the resource:Step 5: Verify Connection
-
Check your FiveM server console for:
- Visit your website - the status should change from “Connecting…” to “Online”
Configuration
Website Configuration (config.php)
| Option | Description | Default |
|---|---|---|
license_key | Your LonexLabs license key | Required |
secret_key | Shared key with FiveM resource | Required |
stale_timeout | Seconds before showing offline | 10 |
site_name | Shown in browser tab | LonexMap |
community_name | Your server name | Live Map |
logo | Path to logo image | assets/img/logo.png |
refresh_rate | Map update interval (ms) | 2000 |
default_zoom | Initial zoom level | 4 |
lonex_api_enabled | Enable duty status | true |
FiveM Configuration (server/main.lua)
| Option | Description | Default |
|---|---|---|
WebsiteURL | Your LonexMap website URL | Required |
SecretKey | Must match website config | Required |
PushInterval | Update frequency (ms) | 2000 |
UseLonexDiscordAPI | Enable API integration | true |
Debug | Enable console logging | false |
Custom Blips (server/blips.json)
Add custom location markers by editingblips.json:
LonexDiscordAPI Integration (Optional)
LonexMap integrates with LonexDiscordAPI for enhanced features:Features When Enabled
- Duty Status - Shows player department (LEO, Fire, EMS) with color-coded markers
- 911/311 Calls - Display emergency calls on the map
- AOP Indicator - Shows current Area of Play in the header
- PeaceTime Indicator - Shows when PeaceTime is active
- Siren Detection - Flashing red/blue markers when sirens are active
Setup
- Ensure LonexDiscordAPI is installed and running on your FiveM server
- Set
UseLonexDiscordAPI = trueinserver/main.lua - Set
'lonex_api_enabled' => trueinconfig.php
Required Exports
LonexMap uses these LonexDiscordAPI exports:| Export | Description |
|---|---|
GetDutyInfo(source) | Player duty status |
GetAllActiveCalls() | Active 911/311 calls |
GetAOP() | Current Area of Play |
IsPeaceTime() | PeaceTime status |
Troubleshooting
”Connecting…” Never Changes to Online
Cause: FiveM resource can’t reach your website Solutions:- Verify
WebsiteURLinserver/main.luais correct (no trailing slash) - Verify
SecretKeymatches in both config files (case-sensitive) - Check FiveM console for errors
- Ensure your website is accessible from the internet
- Check if
data/folder is writable
HTTP 403 Error in FiveM Console
Cause: Secret key mismatch Solutions:- Copy the exact same key to both files
- Check for extra spaces or quotes
- Ensure
config.phpis not encrypted
HTTP 500 Error
Cause: PHP error on website Solutions:- Check PHP error logs on your web server
- Verify ionCube Loader is installed
- Ensure PHP 7.0+ is running
- Check all required files are uploaded
Map Shows But No Players
Cause: Data not being received or processed Solutions:- Visit
yoursite.com/api.php?endpoint=statusto check data - Verify FiveM resource is running (
ensure lonexmap) - Check for JavaScript errors in browser console (F12)
License Validation Failed
Cause: License key issues Solutions:- Verify license key is entered correctly in
config.php - Check your license is active at lonexlabs.com
- Ensure
data/folder is writable (for license caching) - Check server can reach
lonexlabs.com
Map Image Not Loading
Cause: Missing or corrupted map.png Solutions:- Verify
assets/img/map.pngexists (should be ~21MB) - Re-download if file is corrupted
- Check file permissions

