8000 GitHub - swkeep/keep-cooldown: A Standalone Server-Side Cooldown Resource
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

swkeep/keep-cooldown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keep-cooldown

  • A small fivem resource to make server-side cooldowns
  • check wiki for more information

Guide

Youtube video

installation

  • insert sql.sql into your database
  • copy files
  • ensure keep-cooldown
  • done

Dependencies

  • oxmysql

example

-- client-side
local CD = exports["keep-cooldown"]:CD()

local cd_id =
    CD.add(
    {
        id = "keep_blackmarket_payphone" .. PlayerPedId(),
        cooldownLength = 30,
        cType = "temporary" -- or persistent
    }
)

local state, remaining = CD.isOnCooldown(cd_id)

if state then
    print("on CD " .. remaining)
    return
end

if not state then
    CD.setOnCooldown(cd_id)
end
--server-side
local CD = exports["keep-cooldown"]:CD()

local cd_id =
    CD.add(
    {
        id = "keep_blackmarket_payphone_2",
        cooldownLength = 30,
        cType = "persistent" -- or persistent
    }
)

local state, remaining = CD.isOnCooldown(cd_id)
print(state, remaining)
if state then
    print("on CD " .. remaining)
    return
end

if not state then
    CD.setOnCooldown(cd_id)
end

state, remaining = CD.isOnCooldown(cd_id)
print(state, remaining)

Support

About

A Standalone Server-Side Cooldown Resource

Topics

Resources

License

Stars

Watchers

Forks

Languages

0