From ebae2c35f75e74811c0a72183eefc136ff030a4a Mon Sep 17 00:00:00 2001 From: Pickle <111543470+PickleModifications@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:13:07 -0500 Subject: [PATCH] Update functions.lua --- server/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/functions.lua b/server/functions.lua index d9bfc57a6..b0296dbc6 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -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