From bef2488041a45b49a2706e4c274b17b907eb7153 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Thu, 24 Mar 2022 21:30:16 +0100 Subject: [PATCH] Update commands.lua --- ND_Core/source/server/commands.lua | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ND_Core/source/server/commands.lua b/ND_Core/source/server/commands.lua index d5ebc1a..afd5a68 100644 --- a/ND_Core/source/server/commands.lua +++ b/ND_Core/source/server/commands.lua @@ -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)