mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 17:23:31 +00:00
Update functions.lua
This commit is contained in:
@@ -45,8 +45,8 @@ end
|
|||||||
---@param source any
|
---@param source any
|
||||||
---@return table
|
---@return table
|
||||||
function QBCore.Functions.GetPlayer(source)
|
function QBCore.Functions.GetPlayer(source)
|
||||||
if type(source) == 'number' then
|
if tonumber(source) ~= nil then -- If a number is a string ("1"), this will still correctly identify the index to use.
|
||||||
return QBCore.Players[source]
|
return QBCore.Players[tonumber(source)]
|
||||||
else
|
else
|
||||||
return QBCore.Players[QBCore.Functions.GetSource(source)]
|
return QBCore.Players[QBCore.Functions.GetSource(source)]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user