Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes misidentification of source as an identifier #660

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -551,4 +551,4 @@ function DeleteVehicle(vehicle)
end
end

exports('DeleteVehicle', DeleteVehicle)
exports('DeleteVehicle', DeleteVehicle)
Loading