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

Swap vehicle model check. #58

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ RegisterNetEvent('qbx_vehicleshop:client:swapVehicle', function(data)

local closestVehicle = lib.getClosestVehicle(dataClosestVehicle.coords.xyz, 5, false)
if not closestVehicle then return end

if not IsModelInCdimage(data.toVehicle) then
print(('Failed to find model for "%s". Vehicle might not be streamed?'):format(data.toVehicle))
Randolio marked this conversation as resolved.
Show resolved Hide resolved
return
end

DeleteEntity(closestVehicle)
while DoesEntityExist(closestVehicle) do
Expand Down
Loading