Skip to content

Commit 251f41a

Browse files
authored
Merge pull request #1165 from PickleModifications/main
Fixes misidentification of source as an identifier
2 parents fac67bd + 73e80fb commit 251f41a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/functions.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ end
4545
---@param source any
4646
---@return table
4747
function QBCore.Functions.GetPlayer(source)
48-
if type(source) == 'number' then
49-
return QBCore.Players[source]
48+
if tonumber(source) ~= nil then -- If a number is a string ("1"), this will still correctly identify the index to use.
49+
return QBCore.Players[tonumber(source)]
5050
else
5151
return QBCore.Players[QBCore.Functions.GetSource(source)]
5252
end

0 commit comments

Comments
 (0)