chore(intellisense): improve parameter annotations and add missing comments
Touched up incorrect or missing Intellisense parameter annotations across several functions. Added some missing descriptions to improve editor support. Still more to do, but this is a small step forward for overall developer workflow. Also small fix in picklexp
This commit is contained in:
1 parent
866283162b
commit
c71a261115
87 files changed
+326
-273
No files matched your search
@@ -22,9 +22,9 @@ Clothing.SetAppearance = function(src, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on gender-specific data
|
--- Sets a player's appearance based on gender-specific data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table Table containing separate appearance data for male and female characters
|
---@param data table Table containing separate appearance data for male and female characters
|
||||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
---@return table|nil Appearance updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearanceExt(src, data)
|
function Clothing.SetAppearanceExt(src, data)
|
||||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||||
Clothing.SetAppearance(src, tbl)
|
Clothing.SetAppearance(src, tbl)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
@@ -6,9 +7,9 @@ Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
|||||||
Table = Table or Require('lib/utility/shared/tables.lua')
|
Table = Table or Require('lib/utility/shared/tables.lua')
|
||||||
ESX = ESX or exports['es_extended']:getSharedObject()
|
ESX = ESX or exports['es_extended']:getSharedObject()
|
||||||
|
|
||||||
--- Internal function to get the full appearance data including skin, model, and converted format
|
---Internal function to get the full appearance data including skin, model, and converted format
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return table|nil The player's full appearance data or nil if not found
|
---@return table|nil The player's full appearance data or nil if not found
|
||||||
function Clothing.GetFullAppearanceData(src)
|
function Clothing.GetFullAppearanceData(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -36,10 +37,10 @@ function Clothing.GetFullAppearanceData(src)
|
|||||||
return Clothing.Players[citId]
|
return Clothing.Players[citId]
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Retrieves a player's converted appearance data for easy use across modules
|
---Retrieves a player's converted appearance data for easy use across modules
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param fullData boolean Optional - If true, returns the full data object including skin and model
|
---@param fullData boolean Optional - If true, returns the full data object including skin and model
|
||||||
--- @return table|nil The player's converted appearance data or full appearance data if fullData=true
|
---@return table|nil The player's converted appearance data or full appearance data if fullData=true
|
||||||
function Clothing.GetAppearance(src, fullData)
|
function Clothing.GetAppearance(src, fullData)
|
||||||
if fullData then
|
if fullData then
|
||||||
return Clothing.GetFullAppearanceData(src)
|
return Clothing.GetFullAppearanceData(src)
|
||||||
@@ -49,7 +50,8 @@ function Clothing.GetAppearance(src, fullData)
|
|||||||
return completeData.converted
|
return completeData.converted
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will save the player's current appearance to the database
|
||||||
|
---@param src number|string
|
||||||
function Clothing.Save(src)
|
function Clothing.Save(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -66,11 +68,11 @@ function Clothing.Save(src)
|
|||||||
citId
|
citId
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
--- Sets a player's appearance based on the provided data
|
---Sets a player's appearance based on the provided data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table The appearance data to apply
|
---@param data table The appearance data to apply
|
||||||
--- @param updateBackup boolean Whether to update the backup appearance data
|
---@param updateBackup boolean Whether to update the backup appearance data
|
||||||
--- @return table|nil The updated player appearance data or nil if failed
|
---@return table|nil The updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearance(src, data, updateBackup, save)
|
function Clothing.SetAppearance(src, data, updateBackup, save)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -113,17 +115,17 @@ function Clothing.SetAppearance(src, data, updateBackup, save)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on gender-specific data
|
--- Sets a player's appearance based on gender-specific data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table Table containing separate appearance data for male and female characters
|
---@param data table Table containing separate appearance data for male and female characters
|
||||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
---@return table|nil Appearance updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearanceExt(src, data)
|
function Clothing.SetAppearanceExt(src, data)
|
||||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||||
Clothing.SetAppearance(src, tbl)
|
Clothing.SetAppearance(src, tbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Reverts a player's appearance to their backup appearance
|
---Reverts a player's appearance to their backup appearance
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return boolean|nil Returns true if successful or nil if failed
|
---@return boolean|nil Returns true if successful or nil if failed
|
||||||
function Clothing.Revert(src)
|
function Clothing.Revert(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -134,15 +136,16 @@ function Clothing.Revert(src)
|
|||||||
return Clothing.SetAppearance(src, backup)
|
return Clothing.SetAppearance(src, backup)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will open the menu for the passed src
|
||||||
|
---@param src number|string
|
||||||
function Clothing.OpenMenu(src)
|
function Clothing.OpenMenu(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
TriggerClientEvent('esx_skin:openMenu', src)
|
TriggerClientEvent('esx_skin:openMenu', src)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Event handler for when a player loads into the server
|
---Event handler for when a player loads into the server
|
||||||
--- Caches the player's appearance data
|
---Caches the player's appearance data
|
||||||
AddEventHandler('community_bridge:Server:OnPlayerLoaded', function(src)
|
AddEventHandler('community_bridge:Server:OnPlayerLoaded', function(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -150,8 +153,8 @@ AddEventHandler('community_bridge:Server:OnPlayerLoaded', function(src)
|
|||||||
Clothing.GetFullAppearanceData(src)
|
Clothing.GetFullAppearanceData(src)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- Event handler for when a player disconnects from the server
|
---Event handler for when a player disconnects from the server
|
||||||
--- Removes the player's appearance data from the cache
|
---Removes the player's appearance data from the cache
|
||||||
AddEventHandler('community_bridge:Server:OnPlayerUnload', function(src)
|
AddEventHandler('community_bridge:Server:OnPlayerUnload', function(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -161,8 +164,8 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Event handler for when the resource starts
|
---Event handler for when the resource starts
|
||||||
--- Caches appearance data for all currently connected players
|
---Caches appearance data for all currently connected players
|
||||||
AddEventHandler('onResourceStart', function(resource)
|
AddEventHandler('onResourceStart', function(resource)
|
||||||
if resource ~= GetCurrentResourceName() then return end
|
if resource ~= GetCurrentResourceName() then return end
|
||||||
for _, playerId in ipairs(GetPlayers()) do
|
for _, playerId in ipairs(GetPlayers()) do
|
||||||
@@ -174,13 +177,12 @@ AddEventHandler('onResourceStart', function(resource)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- Callback handler for retrieving a player's appearance data
|
---Callback handler for retrieving a player's appearance data
|
||||||
Callback.Register('community_bridge:cb:GetAppearance', function(source)
|
Callback.Register('community_bridge:cb:GetAppearance', function(source)
|
||||||
local src = source
|
local src = source
|
||||||
return Clothing.GetAppearance(src)
|
return Clothing.GetAppearance(src)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
||||||
local src = source
|
local src = source
|
||||||
Clothing.SetAppearance(src, {
|
Clothing.SetAppearance(src, {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
|
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('fivem-appearance') == 'missing' then return end
|
if GetResourceState('fivem-appearance') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('fivem-appearance') == 'missing' then return end
|
if GetResourceState('fivem-appearance') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
@@ -6,8 +7,8 @@ Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
|||||||
Table = Table or Require('lib/utility/shared/tables.lua')
|
Table = Table or Require('lib/utility/shared/tables.lua')
|
||||||
|
|
||||||
--- Internal function to get the full appearance data including skin, model, and converted format
|
--- Internal function to get the full appearance data including skin, model, and converted format
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return table|nil The player's full appearance data or nil if not found
|
---@return table|nil The player's full appearance data or nil if not found
|
||||||
function Clothing.GetFullAppearanceData(src)
|
function Clothing.GetFullAppearanceData(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -34,9 +35,9 @@ function Clothing.GetFullAppearanceData(src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Retrieves a player's converted appearance data for easy use across modules
|
--- Retrieves a player's converted appearance data for easy use across modules
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param fullData boolean Optional - If true, returns the full data object including skin and model
|
---@param fullData boolean Optional - If true, returns the full data object including skin and model
|
||||||
--- @return table|nil The player's converted appearance data or full appearance data if fullData=true
|
---@return table|nil The player's converted appearance data or full appearance data if fullData=true
|
||||||
function Clothing.GetAppearance(src, fullData)
|
function Clothing.GetAppearance(src, fullData)
|
||||||
if fullData then
|
if fullData then
|
||||||
return Clothing.GetFullAppearanceData(src)
|
return Clothing.GetFullAppearanceData(src)
|
||||||
@@ -47,10 +48,10 @@ function Clothing.GetAppearance(src, fullData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on the provided data
|
--- Sets a player's appearance based on the provided data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table The appearance data to apply
|
---@param data table The appearance data to apply
|
||||||
--- @param updateBackup boolean Whether to update the backup appearance data
|
---@param updateBackup boolean Whether to update the backup appearance data
|
||||||
--- @return table|nil The updated player appearance data or nil if failed
|
---@return table|nil The updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearance(src, data, updateBackup, save)
|
function Clothing.SetAppearance(src, data, updateBackup, save)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -89,17 +90,17 @@ function Clothing.SetAppearance(src, data, updateBackup, save)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on gender-specific data
|
--- Sets a player's appearance based on gender-specific data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table Table containing separate appearance data for male and female characters
|
---@param data table Table containing separate appearance data for male and female characters
|
||||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
---@return table|nil Appearance updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearanceExt(src, data)
|
function Clothing.SetAppearanceExt(src, data)
|
||||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||||
Clothing.SetAppearance(src, tbl)
|
Clothing.SetAppearance(src, tbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Reverts a player's appearance to their backup appearance
|
--- Reverts a player's appearance to their backup appearance
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return boolean|nil Returns true if successful or nil if failed
|
---@return boolean|nil Returns true if successful or nil if failed
|
||||||
function Clothing.Revert(src)
|
function Clothing.Revert(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
local currentClothing = Clothing.GetFullAppearanceData(src)
|
local currentClothing = Clothing.GetFullAppearanceData(src)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('illenium-appearance') == 'missing' then return end
|
if GetResourceState('illenium-appearance') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('illenium-appearance') == 'missing' then return end
|
if GetResourceState('illenium-appearance') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
@@ -6,8 +7,8 @@ Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
|||||||
Table = Table or Require('lib/utility/shared/tables.lua')
|
Table = Table or Require('lib/utility/shared/tables.lua')
|
||||||
|
|
||||||
--- Internal function to get the full appearance data including skin, model, and converted format
|
--- Internal function to get the full appearance data including skin, model, and converted format
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return table|nil The player's full appearance data or nil if not found
|
---@return table|nil The player's full appearance data or nil if not found
|
||||||
function Clothing.GetFullAppearanceData(src)
|
function Clothing.GetFullAppearanceData(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -34,9 +35,9 @@ function Clothing.GetFullAppearanceData(src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Retrieves a player's converted appearance data for easy use across modules
|
--- Retrieves a player's converted appearance data for easy use across modules
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param fullData boolean Optional - If true, returns the full data object including skin and model
|
---@param fullData boolean Optional - If true, returns the full data object including skin and model
|
||||||
--- @return table|nil The player's converted appearance data or full appearance data if fullData=true
|
---@return table|nil The player's converted appearance data or full appearance data if fullData=true
|
||||||
function Clothing.GetAppearance(src, fullData)
|
function Clothing.GetAppearance(src, fullData)
|
||||||
if fullData then
|
if fullData then
|
||||||
return Clothing.GetFullAppearanceData(src)
|
return Clothing.GetFullAppearanceData(src)
|
||||||
@@ -47,10 +48,10 @@ function Clothing.GetAppearance(src, fullData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on the provided data
|
--- Sets a player's appearance based on the provided data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table The appearance data to apply
|
---@param data table The appearance data to apply
|
||||||
--- @param updateBackup boolean Whether to update the backup appearance data
|
---@param updateBackup boolean Whether to update the backup appearance data
|
||||||
--- @return table|nil The updated player appearance data or nil if failed
|
---@return table|nil The updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearance(src, data, updateBackup, save)
|
function Clothing.SetAppearance(src, data, updateBackup, save)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -89,17 +90,17 @@ function Clothing.SetAppearance(src, data, updateBackup, save)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on gender-specific data
|
--- Sets a player's appearance based on gender-specific data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table Table containing separate appearance data for male and female characters
|
---@param data table Table containing separate appearance data for male and female characters
|
||||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
---@return table|nil Appearance updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearanceExt(src, data)
|
function Clothing.SetAppearanceExt(src, data)
|
||||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||||
Clothing.SetAppearance(src, tbl)
|
Clothing.SetAppearance(src, tbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Reverts a player's appearance to their backup appearance
|
--- Reverts a player's appearance to their backup appearance
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return boolean|nil Returns true if successful or nil if failed
|
---@return boolean|nil Returns true if successful or nil if failed
|
||||||
function Clothing.Revert(src)
|
function Clothing.Revert(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qb-clothing') == 'missing' then return end
|
if GetResourceState('qb-clothing') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
function Clothing.OpenMenu()
|
function Clothing.OpenMenu()
|
||||||
TriggerEvent('qb-clothing:client:openMenu')
|
TriggerEvent('qb-clothing:client:openMenu')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qb-clothing') == 'missing' then return end
|
if GetResourceState('qb-clothing') == 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
@@ -7,8 +8,8 @@ Table = Table or Require('lib/utility/shared/tables.lua')
|
|||||||
QBCore = QBCore or exports['qb-core']:GetCoreObject() -- probably easiest for now to call the Framework module
|
QBCore = QBCore or exports['qb-core']:GetCoreObject() -- probably easiest for now to call the Framework module
|
||||||
|
|
||||||
--- Internal function to get the full appearance data including skin, model, and converted format
|
--- Internal function to get the full appearance data including skin, model, and converted format
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return table|nil The player's full appearance data or nil if not found
|
---@return table|nil The player's full appearance data or nil if not found
|
||||||
function Clothing.GetFullAppearanceData(src)
|
function Clothing.GetFullAppearanceData(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -37,9 +38,9 @@ function Clothing.GetFullAppearanceData(src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Retrieves a player's converted appearance data for easy use across modules
|
--- Retrieves a player's converted appearance data for easy use across modules
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param fullData boolean Optional - If true, returns the full data object including skin and model
|
---@param fullData boolean Optional - If true, returns the full data object including skin and model
|
||||||
--- @return table|nil The player's converted appearance data or full appearance data if fullData=true
|
---@return table|nil The player's converted appearance data or full appearance data if fullData=true
|
||||||
function Clothing.GetAppearance(src, fullData)
|
function Clothing.GetAppearance(src, fullData)
|
||||||
if fullData then
|
if fullData then
|
||||||
return Clothing.GetFullAppearanceData(src)
|
return Clothing.GetFullAppearanceData(src)
|
||||||
@@ -50,10 +51,10 @@ function Clothing.GetAppearance(src, fullData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on the provided data
|
--- Sets a player's appearance based on the provided data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table The appearance data to apply
|
---@param data table The appearance data to apply
|
||||||
--- @param updateBackup boolean Whether to update the backup appearance data
|
---@param updateBackup boolean Whether to update the backup appearance data
|
||||||
--- @return table|nil The updated player appearance data or nil if failed
|
---@return table|nil The updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearance(src, data, updateBackup, save)
|
function Clothing.SetAppearance(src, data, updateBackup, save)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -94,17 +95,17 @@ function Clothing.SetAppearance(src, data, updateBackup, save)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Sets a player's appearance based on gender-specific data
|
--- Sets a player's appearance based on gender-specific data
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @param data table Table containing separate appearance data for male and female characters
|
---@param data table Table containing separate appearance data for male and female characters
|
||||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
---@return table|nil Appearance updated player appearance data or nil if failed
|
||||||
function Clothing.SetAppearanceExt(src, data)
|
function Clothing.SetAppearanceExt(src, data)
|
||||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||||
Clothing.SetAppearance(src, tbl)
|
Clothing.SetAppearance(src, tbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Reverts a player's appearance to their backup appearance
|
--- Reverts a player's appearance to their backup appearance
|
||||||
--- @param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
--- @return boolean|nil Returns true if successful or nil if failed
|
---@return boolean|nil Returns true if successful or nil if failed
|
||||||
function Clothing.Revert(src)
|
function Clothing.Revert(src)
|
||||||
src = src and tonumber(src)
|
src = src and tonumber(src)
|
||||||
assert(src, "src is nil")
|
assert(src, "src is nil")
|
||||||
@@ -145,8 +146,6 @@ AddEventHandler('community_bridge:Server:OnPlayerUnload', function(src)
|
|||||||
Clothing.Players[strSrc] = nil
|
Clothing.Players[strSrc] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Event handler for when the resource starts
|
--- Event handler for when the resource starts
|
||||||
--- Caches appearance data for all currently connected players
|
--- Caches appearance data for all currently connected players
|
||||||
AddEventHandler('onResourceStart', function(resource)
|
AddEventHandler('onResourceStart', function(resource)
|
||||||
@@ -166,7 +165,7 @@ Callback.Register('community_bridge:cb:GetAppearance', function(source)
|
|||||||
return Clothing.GetAppearance(src)
|
return Clothing.GetAppearance(src)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
--[[
|
||||||
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
||||||
local src = source
|
local src = source
|
||||||
Clothing.SetAppearance(src, {
|
Clothing.SetAppearance(src, {
|
||||||
@@ -206,7 +205,7 @@ RegisterCommand('clothing:openmenu', function(source, args, rawCommand)
|
|||||||
local src = source
|
local src = source
|
||||||
Clothing.OpenMenu(src)
|
Clothing.OpenMenu(src)
|
||||||
end, false)
|
end, false)
|
||||||
|
--]]
|
||||||
|
|
||||||
-- RegisterCommand('clothing:crowley', function(source, args, rawCommand)
|
-- RegisterCommand('clothing:crowley', function(source, args, rawCommand)
|
||||||
-- local src = source
|
-- local src = source
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ function Dialogue.Close(name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Open a dialogue with the player
|
--- Open a dialogue with the player
|
||||||
--- @param name string
|
---@param name string
|
||||||
--- @param dialogue string
|
---@param dialogue string
|
||||||
--- @param options table example = {{ id = string, label = string}}
|
---@param options table example = {{ id = string, label = string}}
|
||||||
function Dialogue.Open( name, dialogue, characterOptions, dialogueOptions, onSelected)
|
function Dialogue.Open( name, dialogue, characterOptions, dialogueOptions, onSelected)
|
||||||
assert(name, "Name is required")
|
assert(name, "Name is required")
|
||||||
assert(dialogue, "Dialogue is required")
|
assert(dialogue, "Dialogue is required")
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
---This will send an alert to currently supported dispatch systems.
|
---This will send an alert to currently supported dispatch systems.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('bub-mdt') == 'missing' then return end
|
if GetResourceState('bub-mdt') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('cd_dispatch') == 'missing' then return end
|
if GetResourceState('cd_dispatch') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('lb-tablet') == 'missing' then return end
|
if GetResourceState('lb-tablet') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ local function getPriorityLevel(priority)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---commentThis will send an alert to the passed jobs
|
---This will send an alert to the passed jobs
|
||||||
---@param data table
|
---@param data table
|
||||||
Dispatch.SendAlert = function(data)
|
Dispatch.SendAlert = function(data)
|
||||||
local streetName, _ = Utility.GetStreetNameAtCoords(data.coords)
|
local streetName, _ = Utility.GetStreetNameAtCoords(data.coords)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('linden_outlawalert') == 'missing' then return end
|
if GetResourceState('linden_outlawalert') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('ps-dispatch') == 'missing' then return end
|
if GetResourceState('ps-dispatch') == 'missing' then return end
|
||||||
if GetResourceState('lb-tablet') == 'started' then return end
|
if GetResourceState('lb-tablet') == 'started' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qs-dispatch') == 'missing' then return end
|
if GetResourceState('qs-dispatch') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('redutzu-mdt') == 'missing' then return end
|
if GetResourceState('redutzu-mdt') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('tk_dispatch') == 'missing' then return end
|
if GetResourceState('tk_dispatch') == 'missing' then return end
|
||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
---This will get the closest door to the ped
|
---This will get the closest door to the ped
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "BigDaddy-Fuel"
|
local resourceName = "BigDaddy-Fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "cdn-fuel"
|
local resourceName = "cdn-fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "esx-sna-fuel"
|
local resourceName = "esx-sna-fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "LegacyFuel"
|
local resourceName = "LegacyFuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "okokGasStation"
|
local resourceName = "okokGasStation"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ox_fuel"
|
local resourceName = "ox_fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ps-fuel"
|
local resourceName = "ps-fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qs-fuelstations"
|
local resourceName = "qs-fuelstations"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "Renewed-Fuel"
|
local resourceName = "Renewed-Fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ti_fuel"
|
local resourceName = "ti_fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "x-fuel"
|
local resourceName = "x-fuel"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Fuel = Fuel or {}
|
Fuel = Fuel or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
|
|
||||||
---This will show a help text message at the screen position passed
|
---This will show a help text message at the screen position passed
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
|
|
||||||
---This will show a help text message to the specified player at the screen position passed
|
---This will show a help text message to the specified player at the screen position passed
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
local resourceName = "cd_drawtextui"
|
local resourceName = "cd_drawtextui"
|
||||||
local configValue = BridgeSharedConfig.HelpText
|
local configValue = BridgeSharedConfig.HelpText
|
||||||
@@ -8,14 +9,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@param _position string
|
---@param _position string
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.ShowHelpText = function(message, _position)
|
HelpText.ShowHelpText = function(message, _position)
|
||||||
return TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
|
return TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will hide the help text message on the screen
|
---This will hide the help text message on the screen
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.HideHelpText = function()
|
HelpText.HideHelpText = function()
|
||||||
return TriggerEvent('cd_drawtextui:HideUI')
|
return TriggerEvent('cd_drawtextui:HideUI')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
local resourceName = "jg-textui"
|
local resourceName = "jg-textui"
|
||||||
local configValue = BridgeSharedConfig.HelpText
|
local configValue = BridgeSharedConfig.HelpText
|
||||||
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@param _position string
|
---@param _position string
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.ShowHelpText = function(message, _position)
|
HelpText.ShowHelpText = function(message, _position)
|
||||||
return exports['jg-textui']:DrawText(message)
|
return exports['jg-textui']:DrawText(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will hide the help text message on the screen
|
---This will hide the help text message on the screen
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.HideHelpText = function()
|
HelpText.HideHelpText = function()
|
||||||
return exports['jg-textui']:HideText()
|
return exports['jg-textui']:HideText()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
local resourceName = "lab-HintUI"
|
local resourceName = "lab-HintUI"
|
||||||
local configValue = BridgeSharedConfig.HelpText
|
local configValue = BridgeSharedConfig.HelpText
|
||||||
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@param _position string
|
---@param _position string
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.ShowHelpText = function(message, _position)
|
HelpText.ShowHelpText = function(message, _position)
|
||||||
return exports['lab-HintUI']:Show(message, "Hint Text")
|
return exports['lab-HintUI']:Show(message, "Hint Text")
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will hide the help text message on the screen
|
---This will hide the help text message on the screen
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.HideHelpText = function()
|
HelpText.HideHelpText = function()
|
||||||
return exports['lab-HintUI']:Hide()
|
return exports['lab-HintUI']:Hide()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
local resourceName = "okokTextUI"
|
local resourceName = "okokTextUI"
|
||||||
local configValue = BridgeSharedConfig.HelpText
|
local configValue = BridgeSharedConfig.HelpText
|
||||||
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@param _position string
|
---@param _position string
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.ShowHelpText = function(message, _position)
|
HelpText.ShowHelpText = function(message, _position)
|
||||||
return exports['okokTextUI']:Open(message, 'darkblue', _position, false)
|
return exports['okokTextUI']:Open(message, 'darkblue', _position, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will hide the help text message on the screen
|
---This will hide the help text message on the screen
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.HideHelpText = function()
|
HelpText.HideHelpText = function()
|
||||||
return exports['okokTextUI']:Close()
|
return exports['okokTextUI']:Close()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
HelpText = HelpText or {}
|
HelpText = HelpText or {}
|
||||||
local resourceName = "ox_lib"
|
local resourceName = "ox_lib"
|
||||||
local configValue = BridgeSharedConfig.HelpText
|
local configValue = BridgeSharedConfig.HelpText
|
||||||
@@ -7,7 +8,6 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@param position string
|
---@param position string
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.ShowHelpText = function(message, position)
|
HelpText.ShowHelpText = function(message, position)
|
||||||
return exports.ox_lib:showTextUI(message, {
|
return exports.ox_lib:showTextUI(message, {
|
||||||
position = position or 'top-center'
|
position = position or 'top-center'
|
||||||
@@ -16,7 +16,6 @@ end
|
|||||||
|
|
||||||
---This will hide the help text message on the screen
|
---This will hide the help text message on the screen
|
||||||
---@return nil
|
---@return nil
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
HelpText.HideHelpText = function()
|
HelpText.HideHelpText = function()
|
||||||
return exports.ox_lib:hideTextUI()
|
return exports.ox_lib:hideTextUI()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qb-input"
|
local resourceName = "qb-input"
|
||||||
local configValue = BridgeClientConfig.InputSystem
|
local configValue = BridgeClientConfig.InputSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ox_lib"
|
local resourceName = "ox_lib"
|
||||||
local configValue = BridgeClientConfig.InputSystem
|
local configValue = BridgeClientConfig.InputSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|||||||
@@ -34,12 +34,16 @@ Inventory.AddTrunkItems = function(identifier, items)
|
|||||||
return false, Prints.Error("This Inventory Has Not Been Bridged For A Trunk Feature.")
|
return false, Prints.Error("This Inventory Has Not Been Bridged For A Trunk Feature.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will clear the specified inventory, will return success or failure.
|
||||||
|
---@param id string
|
||||||
|
---@return boolean
|
||||||
Inventory.ClearStash = function(id, _type)
|
Inventory.ClearStash = function(id, _type)
|
||||||
if type(id) ~= "string" then return false end
|
if type(id) ~= "string" then return false end
|
||||||
return false, Prints.Error("This Inventory Has Not Been Bridged For A ClearStash Feature.")
|
return false, Prints.Error("This Inventory Has Not Been Bridged For A ClearStash Feature.")
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will return a table with the item info, {name, label, stack, weight, description, image}
|
---This will return a table with the item info,
|
||||||
|
---example: {name = "coolitem", label = "a cool item name", stack = false, weight = 1000, description = "some item description", image = "coolitem.png"}
|
||||||
---@param item string
|
---@param item string
|
||||||
---@return table
|
---@return table
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
@@ -47,8 +51,8 @@ Inventory.GetItemInfo = function(item)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---This will return the count of the item in the players inventory, if not found will return 0.
|
---This will return the count of the item in the players inventory, if not found will return 0.
|
||||||
---
|
|
||||||
---if metadata is passed it will find the matching items count.
|
---if metadata is passed it will find the matching items count.
|
||||||
|
---example: 0
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param item string
|
---@param item string
|
||||||
---@param metadata table
|
---@param metadata table
|
||||||
@@ -58,6 +62,7 @@ Inventory.GetItemCount = function(src, item, metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---This wil return the players inventory.
|
---This wil return the players inventory.
|
||||||
|
---example: {{weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 1, label = "stinky", count = 1}, {weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 2, label = "stinky", count = 1}}
|
||||||
---@param src number
|
---@param src number
|
||||||
---@return table
|
---@return table
|
||||||
Inventory.GetPlayerInventory = function(src)
|
Inventory.GetPlayerInventory = function(src)
|
||||||
@@ -65,8 +70,7 @@ Inventory.GetPlayerInventory = function(src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---Returns the specified slot data as a table.
|
---Returns the specified slot data as a table.
|
||||||
---
|
---example {weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 1, label = "stinky", count = 1}
|
||||||
---format {weight, name, metadata, slot, label, count}
|
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param slot number
|
---@param slot number
|
||||||
---@return table
|
---@return table
|
||||||
@@ -152,10 +156,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return false, Prints.Error("This Inventory Has Not Been Bridged For A CreateShop Feature.")
|
return false, Prints.Error("This Inventory Has Not Been Bridged For A CreateShop Feature.")
|
||||||
end
|
end
|
||||||
@@ -167,6 +171,10 @@ Inventory.GetImagePath = function(item)
|
|||||||
return "https://avatars.githubusercontent.com/u/47620135"
|
return "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will remove the file extension from the item name if present.
|
||||||
|
---example: "item.png" will become "item"
|
||||||
|
---@param item string
|
||||||
|
---@return string
|
||||||
Inventory.StripPNG = function(item)
|
Inventory.StripPNG = function(item)
|
||||||
if string.find(item, ".png") then
|
if string.find(item, ".png") then
|
||||||
item = string.gsub(item, ".png", "")
|
item = string.gsub(item, ".png", "")
|
||||||
|
|||||||
@@ -193,10 +193,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return true, print("Unable to Create Shop for codem-inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
return true, print("Unable to Create Shop for codem-inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ Inventory.RemoveItem = function(src, item, count, slot, metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---This will return the count of the item in the players inventory, if not found will return 0.
|
---This will return the count of the item in the players inventory, if not found will return 0.
|
||||||
---
|
|
||||||
---if metadata is passed it will find the matching items count.
|
---if metadata is passed it will find the matching items count.
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param item string
|
---@param item string
|
||||||
@@ -110,7 +109,6 @@ Inventory.GetPlayerInventory = function(src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---Returns the specified slot data as a table.
|
---Returns the specified slot data as a table.
|
||||||
---
|
|
||||||
---format {weight, name, metadata, slot, label, count}
|
---format {weight, name, metadata, slot, label, count}
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param slot number
|
---@param slot number
|
||||||
@@ -175,7 +173,6 @@ Inventory.RegisterStash = function(id, label, slots, weight, owner, groups, coor
|
|||||||
groups = groups,
|
groups = groups,
|
||||||
coords = coords
|
coords = coords
|
||||||
}
|
}
|
||||||
--core:openInventory(nil, id, 'stash', mathyShit, mathyShit, false, nil, false)
|
|
||||||
return true, id
|
return true, id
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -246,25 +243,24 @@ Inventory.GetImagePath = function(item)
|
|||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This will open the specified shop for the src passed.
|
---This will open the specified shop for the src passed.
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param shopTitle string
|
---@param shopTitle string
|
||||||
Inventory.OpenShop = function(src, shopTitle)
|
Inventory.OpenShop = function(src, shopTitle)
|
||||||
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
---This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---<-- TODO swap to internal callback system
|
||||||
--<-- TODO swap to internal callback system
|
---This is used for the esx users, documentation doesnt show a client side available option for the inventory so we use jank callbacks to get this.
|
||||||
-- This is used for the esx users, documentation doesnt show a client side available option for the inventory so we use jank callbacks to get this.
|
|
||||||
lib.callback.register('community_bridge:Callback:core_inventory', function(source)
|
lib.callback.register('community_bridge:Callback:core_inventory', function(source)
|
||||||
local items = core:getItemsList()
|
local items = core:getItemsList()
|
||||||
return items or {}
|
return items or {}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ Inventory.GetItemInfo = function(item)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---Returns the specified slot data as a table.
|
---Returns the specified slot data as a table.
|
||||||
---
|
|
||||||
---format {weight, name, metadata, slot, label, count}
|
---format {weight, name, metadata, slot, label, count}
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param slot number
|
---@param slot number
|
||||||
@@ -156,18 +155,18 @@ Inventory.GetImagePath = function(item)
|
|||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This will open the specified shop for the src passed.
|
---This will open the specified shop for the src passed.
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param shopTitle string
|
---@param shopTitle string
|
||||||
Inventory.OpenShop = function(src, shopTitle)
|
Inventory.OpenShop = function(src, shopTitle)
|
||||||
jpr:OpenShop(src, shopTitle)
|
jpr:OpenShop(src, shopTitle)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
---This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
if not shopTitle or not shopInventory or not shopCoords then return end
|
if not shopTitle or not shopInventory or not shopCoords then return end
|
||||||
if registeredShops[shopTitle] then return true end
|
if registeredShops[shopTitle] then return true end
|
||||||
|
|||||||
@@ -227,10 +227,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return true, print("Currently runtime shops are not supported in origen_inventory")
|
return true, print("Currently runtime shops are not supported in origen_inventory")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -190,10 +190,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
if registeredShops[shopTitle] then return true end
|
if registeredShops[shopTitle] then return true end
|
||||||
registeredShops[shopTitle] = true
|
registeredShops[shopTitle] = true
|
||||||
|
|||||||
@@ -185,10 +185,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(src, shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(src, shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
if not shopTitle or not shopInventory or not shopCoords then return end
|
if not shopTitle or not shopInventory or not shopCoords then return end
|
||||||
if registeredShops[shopTitle] then return true end
|
if registeredShops[shopTitle] then return true end
|
||||||
|
|||||||
@@ -223,10 +223,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return false, print("Currently qs shop is not bridged")
|
return false, print("Currently qs shop is not bridged")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ Inventory.OpenShop = function(src, shopTitle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
-- @param shopTitle string
|
---@param shopTitle string
|
||||||
-- @param shopInventory table
|
---@param shopInventory table
|
||||||
-- @param shopCoords table
|
---@param shopCoords table
|
||||||
-- @param shopGroups table
|
---@param shopGroups table
|
||||||
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
|
||||||
return false, print("Currently tgiann-inventory is not bridged for shops")
|
return false, print("Currently tgiann-inventory is not bridged for shops")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ local resourceName = "ox_lib"
|
|||||||
local configValue = BridgeClientConfig.MenuSystem
|
local configValue = BridgeClientConfig.MenuSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
Menus = Menus or {}
|
Menus = Menus or {}
|
||||||
--- Converts a QB menu to an Ox menu.
|
|
||||||
|
---Converts a QB menu to an Ox menu.
|
||||||
---@param id string The menu ID.
|
---@param id string The menu ID.
|
||||||
---@param menu table The QB menu data.
|
---@param menu table The QB menu data.
|
||||||
---@return table The Ox menu data.
|
---@return table The Ox menu data.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
local resourceName = "qb-menu"
|
local resourceName = "qb-menu"
|
||||||
local configValue = BridgeClientConfig.MenuSystem
|
local configValue = BridgeClientConfig.MenuSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Loading QB Menu")
|
|
||||||
--- Converts an Ox menu to a QB menu.
|
---Converts an Ox menu to a QB menu.
|
||||||
---@param id string The menu ID.
|
---@param id string The menu ID.
|
||||||
---@param menu table The Ox menu data.
|
---@param menu table The Ox menu data.
|
||||||
---@return table The QB menu data.
|
---@return table The QB menu data.
|
||||||
|
|||||||
+4
-91
@@ -1,7 +1,7 @@
|
|||||||
Menus = Menus or {}
|
Menus = Menus or {}
|
||||||
Menu = {}
|
Menu = {}
|
||||||
|
|
||||||
--- Opens a menu based on the configuration.
|
---Opens a menu based on the configuration.
|
||||||
---@param data table The menu data.
|
---@param data table The menu data.
|
||||||
---@param useQb boolean Whether to use QB menu syntax.
|
---@param useQb boolean Whether to use QB menu syntax.
|
||||||
---@return id string The menu ID.
|
---@return id string The menu ID.
|
||||||
@@ -12,9 +12,9 @@ function Menu.Open(data, useQb)
|
|||||||
return id
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Event to handle callback from menu selection.
|
---Event to handle callback from menu selection.
|
||||||
--- @param _args table The arguments passed to the callback.
|
---@param _args table The arguments passed to the callback.
|
||||||
--- @return nil
|
---@return nil
|
||||||
RegisterNetEvent('community_bridge:client:MenuCallback', function(_args)
|
RegisterNetEvent('community_bridge:client:MenuCallback', function(_args)
|
||||||
local id = _args.id
|
local id = _args.id
|
||||||
local onSelect = _args.onSelect
|
local onSelect = _args.onSelect
|
||||||
@@ -24,90 +24,3 @@ RegisterNetEvent('community_bridge:client:MenuCallback', function(_args)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
return Menu
|
return Menu
|
||||||
|
|
||||||
--[[
|
|
||||||
|
|
||||||
--Unit Tests
|
|
||||||
local qbMenu = {
|
|
||||||
{
|
|
||||||
header = 'QBCore Test Menu',
|
|
||||||
icon = 'fas fa-code',
|
|
||||||
isMenuHeader = true, -- Set to true to make a nonclickable title
|
|
||||||
},
|
|
||||||
{
|
|
||||||
header = 'First Button',
|
|
||||||
txt = 'Open a secondary menu!',
|
|
||||||
icon = 'fas fa-code-pull-request',
|
|
||||||
-- disabled = false, -- optional, non-clickable and grey scale
|
|
||||||
-- hidden = true, -- optional, hides the button completely
|
|
||||||
params = {
|
|
||||||
-- isServer = false, -- optional, specify event type
|
|
||||||
event = 'community_bridge:client:TestEvent',
|
|
||||||
args = {
|
|
||||||
number = 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
header = 'Second Button',
|
|
||||||
txt = 'Open a secondary menu!',
|
|
||||||
icon = 'fas fa-code-pull-request',
|
|
||||||
params = {
|
|
||||||
event = 'community_bridge:client:TestEvent',
|
|
||||||
args = {
|
|
||||||
number = 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local oxMenu = {
|
|
||||||
id = "test",
|
|
||||||
title = "Test Menu",
|
|
||||||
options = {
|
|
||||||
{
|
|
||||||
title = "First Button",
|
|
||||||
description = "Open a secondary menu!",
|
|
||||||
icon = "fas fa-code-pull-request",
|
|
||||||
args = {
|
|
||||||
number = 1,
|
|
||||||
},
|
|
||||||
onSelect = function(selected, secondary, args)
|
|
||||||
print("Selected", json.encode(selected))
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = "Second Button",
|
|
||||||
description = "Open a secondary menu!",
|
|
||||||
icon = "fas fa-code-pull-request",
|
|
||||||
args = {
|
|
||||||
number = 2,
|
|
||||||
},
|
|
||||||
onSelect = function(selected, secondary, args)
|
|
||||||
print("Selected", json.encode(selected))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RegisterCommand("testmenu-qbtoox", function()
|
|
||||||
Menu.Open(qbMenu, true)
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterCommand("testmenu-oxtoqb", function()
|
|
||||||
Menu.Open(oxMenu, false)
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterCommand("testmenu-oxtoox", function()
|
|
||||||
Menu.Open(oxMenu, false)
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterCommand("testmenu-qbtoqb", function()
|
|
||||||
Menu.Open(qbMenu, true)
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterNetEvent('community_bridge:client:TestEvent', function(args)
|
|
||||||
print("Test Event", json.encode(args))
|
|
||||||
end)
|
|
||||||
|
|
||||||
--]]
|
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ox_lib"
|
local resourceName = "ox_lib"
|
||||||
local configValue = BridgeClientConfig.ProgressBarSystem
|
local configValue = BridgeClientConfig.ProgressBarSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
ProgressBar = ProgressBar or {}
|
ProgressBar = ProgressBar or {}
|
||||||
|
|
||||||
|
---This function converts a QB progress bar options table to an Ox progress bar options table.
|
||||||
|
---@param options table
|
||||||
|
---@return table
|
||||||
local function convertFromQB(options)
|
local function convertFromQB(options)
|
||||||
if not options then return options end
|
if not options then return options end
|
||||||
local prop1 = options.prop or {}
|
local prop1 = options.prop or {}
|
||||||
@@ -46,9 +50,8 @@ end
|
|||||||
---This function opens a progress bar.
|
---This function opens a progress bar.
|
||||||
---@param options table
|
---@param options table
|
||||||
---@param cb any
|
---@param cb any
|
||||||
---@param isQBInput boolean
|
---@param isQBInput boolean||optional
|
||||||
---@return boolean
|
---@return boolean
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
function ProgressBar.Open(options, cb, isQBInput)
|
function ProgressBar.Open(options, cb, isQBInput)
|
||||||
if isQBInput then
|
if isQBInput then
|
||||||
options = convertFromQB(options)
|
options = convertFromQB(options)
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "progressbar"
|
local resourceName = "progressbar"
|
||||||
local configValue = BridgeClientConfig.ProgressBarSystem
|
local configValue = BridgeClientConfig.ProgressBarSystem
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
ProgressBar = ProgressBar or {}
|
ProgressBar = ProgressBar or {}
|
||||||
|
|
||||||
|
---This function converts an Ox progress bar options table to a QB progress bar options table.
|
||||||
|
---@param options table
|
||||||
|
---@return table
|
||||||
local function convertFromOx(options)
|
local function convertFromOx(options)
|
||||||
if not options then return options end
|
if not options then return options end
|
||||||
local prop1 = options.prop?[1] or options.prop or {}
|
local prop1 = options.prop?[1] or options.prop or {}
|
||||||
@@ -45,7 +49,6 @@ end
|
|||||||
---@param cb any
|
---@param cb any
|
||||||
---@param qbFormat boolean
|
---@param qbFormat boolean
|
||||||
---@return boolean boolean
|
---@return boolean boolean
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
function ProgressBar.Open(options, cb, qbFormat)
|
function ProgressBar.Open(options, cb, qbFormat)
|
||||||
if not exports['progressbar'] then return false end
|
if not exports['progressbar'] then return false end
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Shops = Shops or {}
|
|||||||
|
|
||||||
local registeredShops = {}
|
local registeredShops = {}
|
||||||
|
|
||||||
---commentThis can open a shop for the client
|
---This can open a shop for the client
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param shopTitle string
|
---@param shopTitle string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
|
|
||||||
local function warnUser()
|
local function warnUser()
|
||||||
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
|
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return "none"
|
return "none"
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the skill level of the passed skill name.
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
|
---@return nil
|
||||||
Skills.GetSkillLevel = function(skillName)
|
Skills.GetSkillLevel = function(skillName)
|
||||||
return 0, warnUser()
|
warnUser()
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
return Skills
|
return Skills
|
||||||
@@ -1,27 +1,43 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
|
|
||||||
local function warnUser()
|
local function warnUser()
|
||||||
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
|
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return "none"
|
return "none"
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the skill level of the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(src, skillName)
|
Skills.GetSkillLevel = function(src, skillName)
|
||||||
return 0, warnUser()
|
warnUser()
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will add xp to the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.AddXp = function(src, skillName, amount)
|
Skills.AddXp = function(src, skillName, amount)
|
||||||
return false, warnUser()
|
warnUser()
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will remove xp from the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.RemoveXp = function(src, skillName, amount)
|
Skills.RemoveXp = function(src, skillName, amount)
|
||||||
return false, warnUser()
|
warnUser()
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return Skills
|
return Skills
|
||||||
@@ -1,14 +1,18 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "evolent_skills"
|
local resourceName = "evolent_skills"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(skillName)
|
Skills.GetSkillLevel = function(skillName)
|
||||||
local skillData = exports.evolent_skills:getSkillLevel(skillName)
|
local skillData = exports.evolent_skills:getSkillLevel(skillName)
|
||||||
return skillData or 0
|
return skillData or 0
|
||||||
|
|||||||
@@ -1,20 +1,30 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "evolent_skills"
|
local resourceName = "evolent_skills"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(src, skillName)
|
Skills.GetSkillLevel = function(src, skillName)
|
||||||
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
||||||
return skillData or 0
|
return skillData or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will add xp to the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.AddXp = function(src, skillName, amount)
|
Skills.AddXp = function(src, skillName, amount)
|
||||||
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
@@ -22,7 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will remove xp from the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.RemoveXp = function(src, skillName, amount)
|
Skills.RemoveXp = function(src, skillName, amount)
|
||||||
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "OT_skills"
|
local resourceName = "OT_skills"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(skillName)
|
Skills.GetSkillLevel = function(skillName)
|
||||||
local skillData = exports.OT_skills:getSkill(skillName)
|
local skillData = exports.OT_skills:getSkill(skillName)
|
||||||
return skillData.level or 0
|
return skillData.level or 0
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "OT_skills"
|
local resourceName = "OT_skills"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(src, skillName)
|
Skills.GetSkillLevel = function(src, skillName)
|
||||||
local skillData = exports.OT_skills:getSkill(src, skillName)
|
local skillData = exports.OT_skills:getSkill(src, skillName)
|
||||||
return skillData.level or 0
|
return skillData.level or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will add xp to the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.AddXp = function(src, skillName, amount)
|
Skills.AddXp = function(src, skillName, amount)
|
||||||
local skillData = exports.OT_skills:getSkill(src, skillName)
|
local skillData = exports.OT_skills:getSkill(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will remove xp from the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.RemoveXp = function(src, skillName, amount)
|
Skills.RemoveXp = function(src, skillName, amount)
|
||||||
local skillData = exports.OT_skills:getSkill(src, skillName)
|
local skillData = exports.OT_skills:getSkill(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "pickle_xp"
|
local resourceName = "pickle_xp"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(skillName)
|
Skills.GetSkillLevel = function(skillName)
|
||||||
local skillData = exports.OT_skills:GetLevel(skillName)
|
local skillData = exports.pickle_xp:GetLevel(skillName)
|
||||||
return skillData or 0
|
return skillData or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Skills = Skills or {}
|
Skills = Skills or {}
|
||||||
local resourceName = "pickle_xp"
|
local resourceName = "pickle_xp"
|
||||||
local configValue = BridgeSharedConfig.Skills
|
local configValue = BridgeSharedConfig.Skills
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will get the name of the Skills system being used.
|
||||||
|
---@return string
|
||||||
Skills.GetResourceName = function()
|
Skills.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---This will return the skill level of the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@return number
|
||||||
Skills.GetSkillLevel = function(src, skillName)
|
Skills.GetSkillLevel = function(src, skillName)
|
||||||
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
||||||
return skillData or 0
|
return skillData or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will add xp to the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.AddXp = function(src, skillName, amount)
|
Skills.AddXp = function(src, skillName, amount)
|
||||||
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will remove xp from the passed skill name.
|
||||||
|
---@param src number
|
||||||
|
---@param skillName string
|
||||||
|
---@param amount number
|
||||||
|
---@return boolean
|
||||||
Skills.RemoveXp = function(src, skillName, amount)
|
Skills.RemoveXp = function(src, skillName, amount)
|
||||||
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
|
||||||
if not skillData then return false, print("Skill not found") end
|
if not skillData then return false, print("Skill not found") end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Target = Target or {}
|
Target = Target or {}
|
||||||
|
|
||||||
local function warnUser()
|
local function warnUser()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "ox_target"
|
local resourceName = "ox_target"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qb-target"
|
local resourceName = "qb-target"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
if GetResourceState("ox_target") == 'started' then return end
|
if GetResourceState("ox_target") == 'started' then return end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "sleepless_interact"
|
local resourceName = "sleepless_interact"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
if GetResourceState("ox_target") == 'started' then return end
|
if GetResourceState("ox_target") == 'started' then return end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "F_RealCarKeysSystem"
|
local resourceName = "F_RealCarKeysSystem"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "MrNewbVehicleKeys"
|
local resourceName = "MrNewbVehicleKeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "Renewed-Vehiclekeys"
|
local resourceName = "Renewed-Vehiclekeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|
||||||
---This will give keys to the specifed vehicle/plate.
|
---This will give keys to the specifed vehicle/plate.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "cd_garage"
|
local resourceName = "cd_garage"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "jaksams_VehiclesKeys"
|
local resourceName = "jaksams_VehiclesKeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "mk_vehiclekeys"
|
local resourceName = "mk_vehiclekeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "mono_carkeys"
|
local resourceName = "mono_carkeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "okokGarage"
|
local resourceName = "okokGarage"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qb-vehiclekeys"
|
local resourceName = "qb-vehiclekeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qbx_vehiclekeys"
|
local resourceName = "qbx_vehiclekeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "qs-vehiclekeys"
|
local resourceName = "qs-vehiclekeys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "t1ger_keys"
|
local resourceName = "t1ger_keys"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
local resourceName = "wasabi_carlock"
|
local resourceName = "wasabi_carlock"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
Weather = Weather or {}
|
Weather = Weather or {}
|
||||||
|
|
||||||
---This will toggle the players weather/time sync
|
---This will toggle the players weather/time sync
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('cd_easytime') == 'missing' then return end
|
if GetResourceState('cd_easytime') == 'missing' then return end
|
||||||
Weather = Weather or {}
|
Weather = Weather or {}
|
||||||
|
|
||||||
---comment
|
---This will toggle the players weather/time sync
|
||||||
---@param toggle boolean
|
---@param toggle boolean
|
||||||
|
---@return nil
|
||||||
Weather.ToggleSync = function(toggle)
|
Weather.ToggleSync = function(toggle)
|
||||||
TriggerEvent('cd_easytime:PauseSync', toggle)
|
TriggerEvent('cd_easytime:PauseSync', toggle)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qb-weathersync') == 'missing' then return end
|
if GetResourceState('qb-weathersync') == 'missing' then return end
|
||||||
Weather = Weather or {}
|
Weather = Weather or {}
|
||||||
|
|
||||||
---comment
|
---This will toggle the players weather/time sync
|
||||||
---@param toggle boolean
|
---@param toggle boolean
|
||||||
|
---@return nil
|
||||||
Weather.ToggleSync = function(toggle)
|
Weather.ToggleSync = function(toggle)
|
||||||
if toggle then
|
if toggle then
|
||||||
TriggerEvent("qb-weathersync:client:EnableSync")
|
TriggerEvent("qb-weathersync:client:EnableSync")
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('Renewed-Weathersync') == 'missing' then return end
|
if GetResourceState('Renewed-Weathersync') == 'missing' then return end
|
||||||
Weather = Weather or {}
|
Weather = Weather or {}
|
||||||
|
|
||||||
---comment
|
---This will toggle the players weather/time sync
|
||||||
---@param toggle boolean
|
---@param toggle boolean
|
||||||
|
---@return nil
|
||||||
Weather.ToggleSync = function(toggle)
|
Weather.ToggleSync = function(toggle)
|
||||||
LocalPlayer.state.syncWeather = toggle
|
LocalPlayer.state.syncWeather = toggle
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user