mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
fix(es_extended/client/functions): reject on invalid vehicle model
This commit is contained in:
@@ -551,7 +551,13 @@ function ESX.Game.SpawnVehicle(vehicleModel, coords, heading, cb, networked)
|
||||
|
||||
local promise = not cb and promise.new()
|
||||
CreateThread(function()
|
||||
ESX.Streaming.RequestModel(model)
|
||||
local modelHash = ESX.Streaming.RequestModel(model)
|
||||
if not modelHash then
|
||||
if promise then
|
||||
return promise:reject(("Tried to spawn invalid vehicle - ^5%s^7!"):format(model))
|
||||
end
|
||||
error(("Tried to spawn invalid vehicle - ^5%s^7!"):format(model))
|
||||
end
|
||||
|
||||
local vehicle = CreateVehicle(model, vector.x, vector.y, vector.z, heading, isNetworked, true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user