FAQ

General Questions

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:

  • The cooldown type/title

  • 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:

  1. TMC Framework Not Loaded - Ensure your TMC core resource starts before tmc-priocd

  2. Missing Files - Verify all files exist (config.lua, server.lua, client.lua, html/ui.html)

  3. Syntax Errors - Check server console for specific Lua errors

  4. 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:

  1. Check Browser Console - Press F8 in-game and look for JavaScript errors

  2. Verify HTML File - Ensure html/ui.html exists in the resource

  3. NUI Disabled - Some anti-cheat systems block NUI; check server settings

  4. Resource Order - Try changing the start order in your server.cfg

  5. 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:

  1. Open your radial menu (default: hold Left Alt)

  2. Navigate to "Priority Cooldowns"

  3. Select the desired cooldown option

Via Command:

How do I clear an active cooldown?

Via Radial Menu:

  1. Open radial menu

  2. 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:

  • Layout and positioning

  • Font styles and sizes

  • Animation effects

  • Background opacity

  • Border styles

The UI receives data from the client script and updates dynamically.

Does this impact server performance?

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:

  1. Disable radial menu in config

  2. Enable commands OR

  3. 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:

  1. Add 'priocd' to your log categories

  2. Set the webhook URL for this category

  3. Configure formatting preferences

Log entries include:

  • Player name and Citizen ID

  • Character name

  • Cooldown type and duration

  • Timestamp

Troubleshooting

Cooldowns not clearing automatically

Possible causes:

  1. Server Time Issues - Verify TMC.Common.GetTime() works correctly

  2. Thread Not Running - Check console for errors in the timer thread

  3. 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:

  1. Check Resource Running - Ensure radialmenu is started

  2. Verify Configuration - PrioCD.Activation.Radial.Enabled = true

  3. Restart Resources - Restart both priocd and radialmenu

  4. Check Job - Verify you're on duty with an allowed job

  5. Enable Function - Check the enableMenu function returns true

UI shows wrong information

Clear steps:

  1. Stop the resource: stop priocd

  2. Clear cooldown state: Run in server console:

  3. Restart resource: start priocd

Commands not working

Verify:

  1. Commands Enabled - PrioCD.Activation.Command.Enabled = true

  2. Correct Syntax - Use /setcooldown 10MinCooldown (exact cooldown name)

  3. Permission Level - Check if permission level is too restrictive in server.lua

  4. Job Check - Verify you have an allowed job and are on duty

Multiple cooldowns showing

This shouldn't happen, but if it does:

  1. Run /clearcooldown

  2. Restart the resource

  3. Set only one cooldown

If the issue persists, check for conflicts with other scripts modifying GlobalState.

Common Errors

"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

Getting Help

Where can I report bugs?

Contact the developer through:

  • Support ticket on Tebex

  • Discord server

How do I update the resource?

  1. Download the latest version

  2. Stop the current resource: stop priocd

  3. Backup your config.lua

  4. Replace resource files (except config.lua)

  5. Compare configs for new options

  6. Start the resource: start priocd


Still have questions? Check the Installation and Configuration guides for more detailed information.

Last updated