From 2b0e0c8edcfd1bb8f7fe4b1218e81f114fdf4ecc Mon Sep 17 00:00:00 2001 From: Kakarot <57848836+GhzGarage@users.noreply.github.com> Date: Sat, 23 Jul 2022 02:14:20 -0500 Subject: [PATCH] Model check --- server/events.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/events.lua b/server/events.lua index 151d40a..fff48ff 100644 --- a/server/events.lua +++ b/server/events.lua @@ -249,9 +249,10 @@ end) -- use the netid on the client with the NetworkGetEntityFromNetworkId native -- convert it to a vehicle via the NetToVeh native QBCore.Functions.CreateCallback('QBCore:Server:SpawnVehicle', function(source, cb, model, coords, warp) + model = type(model) == 'string' and GetHashKey(model) or model if not coords then coords = GetEntityCoords(GetPlayerPed(source)) end local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, true, true) while not DoesEntityExist(veh) do Wait(0) end if warp then TaskWarpPedIntoVehicle(GetPlayerPed(source), veh, -1) end cb(NetworkGetNetworkIdFromEntity(veh)) -end) \ No newline at end of file +end)