Update commands.lua

This commit is contained in:
Andyyy7666
2022-03-24 21:30:16 +01:00
committed by GitHub
parent b40cbf43c9
commit bef2488041

View File

@@ -1,10 +1,4 @@
------------------------------------------------------------------------
------------------------------------------------------------------------
-- DO NOT EDIT IF YOU DON'T KNOW WHAT YOU'RE DOING --
-- --
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6 --
------------------------------------------------------------------------
------------------------------------------------------------------------
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6
if config.enableAopCommand then
local aop = config.defaultAop
@@ -48,6 +42,29 @@ if config.enablePriorityCooldown then
RegisterCommand(config.stopPriorityCommand, function(source, args, rawCommand) -- stop the priority & update.
priorityCooldown(config.cooldownAfterPriority)
end, false)
RegisterCommand(config.cooldownPriorityCommand, function(source, args, rawCommand)
local time = tonumber(args[1])
if time then
priorityCooldown(time)
end
end, false)
RegisterCommand(config.joinPriorityCommand, function(source, args, rawCommand)
if string.find(priority, "Active") then
if not string.find(priority, GetPlayerName(source)) then
priority = string.gsub(priority, "%)", "")
priority = priority .. ", " .. GetPlayerName(source) .. ")"
TriggerClientEvent("returnPriority", -1, priority)
end
end
end, false)
RegisterCommand(config.leavePriorityCommand, function(source, args, rawCommand)
if string.find(priority, "Active") then
if string.find(priority, GetPlayerName(source)) then
priority = string.gsub(priority, ", " .. GetPlayerName(source), "")
TriggerClientEvent("returnPriority", -1, priority)
end
end
end, false)
-- Priority count down and updates.
function priorityCooldown(time)