Overview
The FiveM integration enables:- Real-time player position tracking on the live map
- Automatic identification of players by Steam ID or Discord ID
- In-game commands for creating calls, checking plates/names
- Vehicle and player synchronization
- Integration with CAD dispatch interface
Prerequisites
- FiveM server with admin access
- SnailyCAD instance running and accessible from your FiveM server
- Basic knowledge of FiveM resource installation
Installation
The official FiveM integration resource is maintained separately from the main SnailyCAD repository. Check the SnailyCAD GitHub organization for the latest FiveM resource.
Download FiveM Resource
Download the SnailyCAD FiveM resource from the official repository:Or download the latest release ZIP file.
Install Resource
- Extract/copy the resource to your FiveM server’s
resourcesfolder - Rename the folder to
snailycad(or your preferred name) - The structure should be:
resources/snailycad/fxmanifest.lua
Player Identification
Players are identified and linked to CAD accounts using:- Steam ID: Automatically converted from hex format
- Discord ID: If player is in your Discord server
Linking Players to CAD Accounts
For automatic role assignment and permissions:Link Discord Account
Users should link their Discord account in SnailyCAD:
- Log into SnailyCAD
- Go to Account Settings
- Click Link Discord Account
Live Map Configuration
The live map allows dispatchers to see player positions in real-time.Server-Side Setup
CAD-Side Setup
Configure Live Map URL
In SnailyCAD admin panel:
- Go to Admin > Manage > CAD Settings > Live Map
- Click Add URL
- Enter:
- Name: Your server name (e.g., “Main Server”)
- URL: Your FiveM server’s socket URL (e.g.,
http://your-fivem-ip:30120)
- Click Save
Multiple Servers
You can configure multiple FiveM servers:- Install the resource on each FiveM server
- Add each server URL in Live Map settings
- Dispatchers can switch between servers using the dropdown
In-Game Commands
The FiveM resource can provide in-game commands for players and officers.Available Commands
Configuring Commands
Inconfig.lua:
Setting Permissions
In yourserver.cfg:
Automatic Lookups
When enabled, the resource can automatically perform lookups when players:- Enter a vehicle (plate lookup)
- Get arrested (name lookup)
- Are searched by police (name lookup)
Vehicle Synchronization
Sync vehicle information between FiveM and SnailyCAD:- Real-time vehicle tracking
- Automatic plate registration
- Vehicle status updates (stolen, impounded, etc.)
Webhooks from FiveM
The resource can send webhooks for events:Troubleshooting
Players Not Appearing on Map
- Check Resource Status: Ensure resource is running (
restart snailycad) - Verify API URL: Check
Config.apiUrlis correct and accessible - Check Firewall: Ensure FiveM server can reach SnailyCAD API
- Review Console: Look for errors in FiveM server console
- Test Connection: Use
curlfrom FiveM server to test API connectivity:
Players Not Linked to Accounts
- Verify player has Steam or Discord linked in SnailyCAD
- Check that identifiers are being sent (check console output)
- Ensure Discord bot is in the same server as players
- Verify Steam ID format is correct
Commands Not Working
- Check
Config.inGameCommands = true - Verify player has required ACE permissions
- Check command syntax is correct
- Review server console for errors
Connection Errors
CORS Errors- Ensure
CORS_ORIGIN_URLincludes your FiveM server IP - Check that API is accessible from FiveM server
- If using HTTPS, ensure valid SSL certificate
- For development, you may need to allow self-signed certificates
- Check network connectivity between servers
- Verify firewall rules allow communication
- Increase timeout values in config if needed
Performance Optimization
Reduce Update Frequency
Limit Data Sent
Optimize for Many Players
Security Considerations
API Authentication
For production deployments, consider using API tokens:Example Workflows
Traffic Stop Workflow
- Officer initiates traffic stop in FiveM
- Uses
/plate ABC123to check vehicle registration - Results appear in-game and in CAD
- Dispatcher sees officer’s location on live map
- Officer can create citations/warnings in CAD
- Updates sync back to FiveM
Emergency Call Workflow
- Player uses
/911 Armed robbery at Legion Square - Call is created in SnailyCAD dispatch
- Discord webhook notifies on-duty officers
- Dispatcher assigns units to the call
- Officers see call details and location
- Live map shows responding units’ positions
Best Practices
- Test in Development: Set up a test server before production deployment
- Monitor Performance: Watch for performance impact on your FiveM server
- Regular Updates: Keep the integration resource updated
- Backup Configuration: Save your config files before updates
- Document Permissions: Maintain a list of who has which permissions
- Rate Limiting: Don’t set update intervals too low (causes unnecessary load)
Related Documentation
- Live Map - Configure live map tiles and settings
- Webhooks - Set up event notifications
- Permissions - Manage user access control