Update functions.lua

This commit is contained in:
Pickle
2025-01-12 14:13:07 -05:00
committed by GitHub
parent 989868262c
commit ebae2c35f7
+2 -2
View File
@@ -45,8 +45,8 @@ end
---@param source any
---@return table
function QBCore.Functions.GetPlayer(source)
if type(source) == 'number' then
return QBCore.Players[source]
if tonumber(source) ~= nil then -- If a number is a string ("1"), this will still correctly identify the index to use.
return QBCore.Players[tonumber(source)]
else
return QBCore.Players[QBCore.Functions.GetSource(source)]
end