From 89c4c67de6856b58d50f2a9dacfb835f764633e6 Mon Sep 17 00:00:00 2001 From: Pickle <111543470+PickleModifications@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:17:53 -0500 Subject: [PATCH] Update functions.lua --- server/functions.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/functions.lua b/server/functions.lua index d5f0e4b44..5874397bb 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -46,8 +46,8 @@ exports('GetUserId', GetUserId) ---@param source Source|string source or identifier of the player ---@return Player function GetPlayer(source) - if type(source) == 'number' then - return QBX.Players[source] + if tonumber(source) ~= nil then + return QBX.Players[tonumber(source)] else return QBX.Players[GetSource(source --[[@as string]])] end @@ -551,4 +551,4 @@ function DeleteVehicle(vehicle) end end -exports('DeleteVehicle', DeleteVehicle) \ No newline at end of file +exports('DeleteVehicle', DeleteVehicle)