Skip to content

Server Cooldowns

File: server/cooldown.lua

Global and per-activity cooldown management.

Events

EventDescription
wtf_group:server:setCooldownSet cooldown for activity
wtf_group:server:checkCooldownCheck if on cooldown
wtf_group:server:clearCooldownClear specific cooldown
wtf_group:server:clearAllCooldownsClear all cooldowns

Functions

lua
DB.SetGlobalCooldown(citizenid, activity, seconds, metadata)
DB.GetGlobalCooldown(citizenid, activity) → remaining_seconds
DB.ClearGlobalCooldown(citizenid, activity)
DB.ClearAllCooldowns(citizenid)
DB.GetAllCooldowns(citizenid) → { activity = { remaining, expires, metadata } }
DB.IsAnyOnCooldown(citizenid) → boolean, remaining

Cooldown Check

Before starting a task, server checks:

  1. Is the player on any cooldown?
  2. Are all group members on cooldown?
  3. If yes → reject with groupOnCooldown notification

AIFAZI — FiveM Resources