Add GetPlayer functions to framework and New FUnctions to Utility

This commit is contained in:
Johann Kraus authored and GitHub committed 2025-05-09 23:06:01 -03:00
1 parent 69edf6f6ab
commit 1242d9ef7c
4 files changed
+118

No files matched your search

+9
View File
@@ -16,6 +16,15 @@ Framework.GetPlayerDob = function(src)
return dob
end
--- This will return a table of the players data
---@param src any
---@return table | nil
Framework.GetPlayer = function(src)
local xPlayer = ESX.GetPlayerFromId(src)
if not xPlayer then return end
return xPlayer
end
-- Framework.GetPlayerIdentifier(src)
-- Returns the citizen ID of the player.
Framework.GetPlayerIdentifier = function(src)
+9
View File
@@ -19,6 +19,15 @@ Framework.GetPlayerIdentifier = function(src)
return playerData.citizenid
end
--- Returns the player data of the specified source.
---@param src any
---@return table | nil
Framework.GetPlayer = function(src)
local player = QBCore.Functions.GetPlayer(src)
if not player then return end
return player
end
Framework.GetFrameworkJobs = function()
local jobs = {}
for k, v in pairs(QBCore.Shared.Jobs) do
+9
View File
@@ -21,6 +21,15 @@ Framework.GetPlayerDob = function(src)
return playerData.charinfo.birthdate
end
--- Returns the player data of the specified source.
---@param src any
---@return table | nil
Framework.GetPlayer = function(src)
local player = QBox:GetPlayer(src)
if not player then return end
return player
end
---Returns a table of the jobs in the framework.
---@return table
Framework.GetFrameworkJobs = function()