CS_DEATHTIMEOUT

A death timeout system for FiveM that temporarily blocks player actions after death, with whitelists, notifications, and webhook logging.


Installation

start CS_DEATHTIMEOUT

Configuration

Config.lua

This configuration file defines the behavior of the deathtimeout system.

General Settings
  • reviveEvent: Event to trigger for reviving the player. Example: "esx_ambulancejob:revive"

  • deathtimeout: Time in seconds until the player exits deathtimeout. Example: 60

  • displayAtTop: true / false – Whether the UI text is displayed at the top or bottom of the screen.

Commands & Permissions
  • ClearCommand: Enable command to clear deathtimeout. Example: true

  • ClearCommandName: Name of the command. Example: "dtclear"

  • AllowedGroups: Groups allowed to use the clear command. Example: {"owner", "admin"}

Whitelists
  • WhitelistedGroups: Groups exempt from deathtimeout. Example: {"none"}

  • WhitelistedJobs: Jobs exempt from deathtimeout. Example: {"lsmd", "ambulance"}

Timeout Conditions & Blocked Actions
  • startTimeout: Function to define conditions when deathtimeout should start

  • BlockedActions: Function to block certain actions (weapon usage, drive-by, controls) while in deathtimeout


Exports & Events

exports.lua
-- Ends the death timeout for the player calling it
exports('endTimeout', function()
    TriggerEvent("cs_deathtimeout:endTimeout")
end)

-- Ends the death timeout for a target player (server-side)
exports('endTimeoutForTarget', function(targetId)
    TriggerServerEvent("cs_deathtimeout:endTimeoutForTarget", targetId)
end)

-- Checks if the player is currently in death timeout
exports('isInDeathtimeout', function()
    return LocalPlayer.state.inDeathtimeout
end)

Usage Examples:

  • End timeout for yourself:

    exports["CS_DEATHTIMEOUT"]:endTimeout()
  • End timeout for another player (server-side):

    exports["CS_DEATHTIMEOUT"]:endTimeoutForTarget(playerId)
  • Check if a player is still in death timeout:

    local inTimeout = exports["CS_DEATHTIMEOUT"]:isInDeathtimeout()
    if inTimeout then
        print("Player is still in death timeout")
    end

Notifications & Locales

Notification System

CustomClientSideNotification(msg) → Shows messages via ESX.ShowNotification or your custom notification Script

UI Text:

  • TextPt1: "Du bist noch"

  • Minutes: "Minuten"

  • TextPt2: "kampfunfähig"

Notification Messages
  • WhitelistedJob: Job exemption notification

  • WhitelistedGroup: Group exemption notification

  • MissingPermissions: Not authorized

  • ClearedSelfDeathtimeout: Self deathtimeout cleared

  • ClearedDeathtimeout: Deathtimeout cleared for another player

  • PlayerNotOnline: Player ID not online

  • NoIDServer: Invalid server ID

  • PlayerNotInDeathtimeout: Player not in deathtimeout


Webhooks
Webhook = {}
Webhook.Link = "https://discord.com/api/webhooks/cscscscscscscscs/cscscscscscscscscscscscscscscs"
  • WebhookOnStart: Log script start

  • WebhookWhenTried: Log attempts to clear deathtimeout

  • Titles and messages for console, client, and own actions are included with player info, Discord, and group

Tip: Leave the URL as an empty string "" if you do not want the webhook to trigger for that event.

Features
  • Automatically block player actions after death for configurable time

  • Whitelist certain jobs and groups

  • Notifications for timeout remaining

  • Clear timeout via command with permission control

  • Discord webhook logging for all relevant events

  • Configurable UI position (top/bottom)

  • English and German locale support


Support

If you have any further questions, open a ticket on our discord server: discord.gg/core-services

Last updated

Was this helpful?