What is the Priority Cooldowns System?
The Priority Cooldowns System is a server management tool that allows authorized staff (police, medical, etc.) to temporarily restrict certain activities on the server. When a priority cooldown is active, players see a notification on their screen, and other scripts can check the cooldown status to prevent activities like robberies, heists, or other criminal activities.
What's the difference between timed and unlimited cooldowns?
Timed Cooldowns - Have a specific duration (e.g., 10 minutes, 30 minutes) and automatically clear when the timer expires
Unlimited Cooldowns - Stay active indefinitely until manually cleared by an authorized user
Unlimited cooldowns are useful for meetings, training sessions, or server maintenance.
Can players see the cooldown timer?
Yes! When a cooldown is active, players see a UI notification displaying:
Information message about why the cooldown is active
A countdown timer (for timed cooldowns)
Does this block activities automatically?
No, the cooldown system itself only displays notifications and tracks cooldown state. Other scripts (heist scripts, robbery scripts, etc.) need to integrate with this system to check the cooldown status and block activities accordingly.
Installation Questions
The resource won't start, what should I check?
Common issues and solutions:
TMC Framework Not Loaded - Ensure your TMC core resource starts before tmc-priocd
Missing Files - Verify all files exist (config.lua, server.lua, client.lua, html/ui.html)
Syntax Errors - Check server console for specific Lua errors
Wrong Resource Name - Ensure the resource folder is named correctly
Do I need the radial menu resource?
No, it's optional. The system works in two modes:
With Radial Menu - Provides easy-access menu for setting cooldowns (recommended)
Without Radial Menu - Commands can be used instead (/setcooldown, /clearcooldown)
You can enable one or both activation methods in the config.
UI notification isn't showing, why?
Troubleshooting steps:
Check Browser Console - Press F8 in-game and look for JavaScript errors
Verify HTML File - Ensure html/ui.html exists in the resource
NUI Disabled - Some anti-cheat systems block NUI; check server settings
Resource Order - Try changing the start order in your server.cfg
Clear Cache - Clear your FiveM cache and reconnect
How do I add more jobs to the allowed list?
Edit the PrioCD.AllowedJobs table in config.lua:
Save the file and restart the resource.
Configuration Questions
How do I change cooldown durations?
Edit the Timer value in the cooldown's settings (in minutes):
Can I add more cooldown options?
Yes! Add new entries to the PrioCD.Cooldowns table:
Don't forget to restart the resource after making changes.
How do I change the UI colors?
Edit the color values in PrioCD.Types:
Use hex color codes (e.g., #FF0000 for red, #0000FF for blue).
Can I disable the radial menu but keep commands?
Yes! Configure the activation methods independently:
How do I create different cooldown types?
Add new types to PrioCD.Types:
Then reference it in a cooldown:
Can I rename the commands?
Yes, change the command names in the config:
Usage Questions
How do I set a priority cooldown?
There are two methods:
Via Radial Menu:
Open your radial menu (default: hold Left Alt)
Navigate to "Priority Cooldowns"
Select the desired cooldown option
Via Command:
How do I clear an active cooldown?
Via Radial Menu:
Priority Cooldowns → Remove Cooldown
Via Command:
Who can set priority cooldowns?
Only players who meet these requirements:
Have a job listed in PrioCD.AllowedJobs
Are currently on duty with that job
Have appropriate command permissions (if using commands)
Do cooldowns persist through server restarts?
Yes! Cooldowns are stored in GlobalState, which persists across resource restarts. However, if the entire server restarts, active cooldowns will be cleared.
To restore cooldowns after a full server restart, you would need to manually set them again.
Can multiple cooldowns be active at once?
No, only one cooldown can be active at a time. Setting a new cooldown will replace the current one.
What happens when a timed cooldown expires?
When the timer reaches zero:
The cooldown automatically clears
The UI notification disappears from player screens
Activities blocked by the cooldown can resume
A log entry is created (depending on configuration)
Can I check cooldown status as a player?
Players can see active cooldowns via the on-screen UI notification. For scripts/developers, exports are available to check cooldown status programmatically (see Technical Questions).
Integration Questions
How do I integrate this with my robbery script?
Use the exports to check cooldown status:
What exports are available?
Server-Side Exports:
Client-Side Exports:
What does GetCurrentCooldown() return?
For active cooldowns:
For unlimited cooldowns:
For no active cooldown:
Can I trigger cooldowns from other resources?
Yes! Use the server-side export:
Example use cases:
Automatically set cooldown when a major heist starts
Set meeting cooldown when police meeting begins
Set maintenance cooldown during server events
How do I block specific activities during cooldowns?
Integrate the export into your activity scripts:
Technical Questions
How does the cooldown state work?
The system uses FiveM's GlobalState to store cooldown information:
GlobalState.Priority - The current cooldown type (e.g., 'Standard', 'Meeting')
GlobalState.PriorityEnds - Timestamp when cooldown ends (or nil for unlimited)
GlobalState is synchronized across all clients automatically, ensuring everyone sees the same cooldown status.
How is time tracked?
The system uses TMC.Common.GetTime() which returns the current time in milliseconds. A server-side thread checks every second if timed cooldowns have expired.
Can I modify the UI appearance?
Yes! Edit the html/ui.html file to customize:
The UI receives data from the client script and updates dynamically.
The resource is designed to be extremely lightweight.
Can I use this with other menu systems?
The radial menu integration is specific to the TMC radialmenu resource. To use with other menu systems:
Disable radial menu in config
Create custom integration using the client events
Events available:
How do I add Discord webhook logging?
The script logs to your TMC Framework logging system. Configure the webhook in your TMC core configuration:
Add 'priocd' to your log categories
Set the webhook URL for this category
Configure formatting preferences
Log entries include:
Player name and Citizen ID
Cooldown type and duration
Troubleshooting
Cooldowns not clearing automatically
Possible causes:
Server Time Issues - Verify TMC.Common.GetTime() works correctly
Thread Not Running - Check console for errors in the timer thread
GlobalState Not Updating - Try manually clearing with /clearcooldown
Test by setting a 1-minute cooldown and watching if it clears.
Radial menu option not appearing
Solutions:
Check Resource Running - Ensure radialmenu is started
Verify Configuration - PrioCD.Activation.Radial.Enabled = true
Restart Resources - Restart both priocd and radialmenu
Check Job - Verify you're on duty with an allowed job
Enable Function - Check the enableMenu function returns true
Clear steps:
Stop the resource: stop priocd
Clear cooldown state: Run in server console:
Restart resource: start priocd
Commands not working
Verify:
Commands Enabled - PrioCD.Activation.Command.Enabled = true
Correct Syntax - Use /setcooldown 10MinCooldown (exact cooldown name)
Permission Level - Check if permission level is too restrictive in server.lua
Job Check - Verify you have an allowed job and are on duty
Multiple cooldowns showing
This shouldn't happen, but if it does:
If the issue persists, check for conflicts with other scripts modifying GlobalState.
"attempt to index a nil value (field 'Priority')"
Cause: GlobalState not properly initialized Solution: Restart the resource or set a cooldown once
"TMC.Functions is not available"
Cause: TMC Framework not loaded Solution: Ensure TMC core starts before priocd in server.cfg
"enableMenu function error"
Cause: Issue with job checking function Solution: Verify TMC.Functions.IsOnDuty() works in your framework version
"NUI callback error"
Cause: UI file issue or JavaScript error Solution: Check browser console (F8) for specific error, verify html/ui.html exists
Where can I report bugs?
Contact the developer through:
How do I update the resource?
Download the latest version
Stop the current resource: stop priocd
Replace resource files (except config.lua)
Compare configs for new options
Start the resource: start priocd
Still have questions? Check the Installation and Configuration guides for more detailed information.