From 33ffd2c9a9c94b5cf122e59742ddca3ec565a0e1 Mon Sep 17 00:00:00 2001 From: zykem#0643 <86602828+Zykem@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:01:31 +0200 Subject: [PATCH] Add ESX.GetConfig optional parameter --- [core]/es_extended/shared/functions.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/shared/functions.lua b/[core]/es_extended/shared/functions.lua index 8e326150..90223383 100644 --- a/[core]/es_extended/shared/functions.lua +++ b/[core]/es_extended/shared/functions.lua @@ -28,9 +28,10 @@ function ESX.GetRandomString(length) return length > 0 and ESX.GetRandomString(length - 1) .. Charset[math.random(1, #Charset)] or "" end ----@return table -function ESX.GetConfig() - return Config +---@param key? string Key pair to get specific value of config +---@return unknown: Returns the whole config if no key is passed, or a specific value +function ESX.GetConfig(key) + return key and Config[key] or Config end ---@param weaponName string