Installation
1. Add the Resourceâ
Place the resource folder into your server's resources directory. The resource can be named anything, but we recommend:
resources/
âââ cfx_job_time_tracker/
âââ fxmanifest.lua
âââ shared/
âââ server/
âââ client/
âââ locales/
2. Install Dependenciesâ
This resource requires oxmysql for database operations. Make sure it's installed and started in your server.cfg:
ensure oxmysql
ensure cfx_job_time_tracker
3. Database Setupâ
Import the provided .sql file into your database.
The system uses the native oxmysql library. If you're using a different database system, ensure the connection is properly configured in your server setup.
4. Configure Frameworkâ
Edit shared/config.lua and set your framework:
Config.Framework = 'esx' -- Change to 'qbcore' if using QBCore
5. Add Discord Webhooksâ
Edit shared/webhook.lua and add your Discord webhook URLs for each job:
Webhooks.join = {
ambulance = "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_TOKEN",
police = "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_TOKEN",
-- Add more jobs...
}
Keep your webhook URLs private! Do not share them publicly or commit them to public repositories.
6. Start the Serverâ
Restart your FiveM server or use the refresh command:
refresh
start cfx_job_time_tracker
You should see console messages confirming the resource has loaded successfully.
Your Job Time Tracker is now ready! Proceed to Usage to configure tracked jobs and test the system.