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)