We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fac67bd + 73e80fb commit 251f41aCopy full SHA for 251f41a
server/functions.lua
@@ -45,8 +45,8 @@ end
45
---@param source any
46
---@return table
47
function QBCore.Functions.GetPlayer(source)
48
- if type(source) == 'number' then
49
- 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)]
50
else
51
return QBCore.Players[QBCore.Functions.GetSource(source)]
52
end
0 commit comments