diff --git a/client.lua b/client.lua index 2d84079..d01c606 100644 --- a/client.lua +++ b/client.lua @@ -197,6 +197,10 @@ function PlaceEntityOnGroundProperly(entity, p1) return Citizen.InvokeNative(0x9587913B9E772D29, entity, p1) end +function IsModelAnObject(model) + return Citizen.InvokeNative(0x274EE1B90CFA669E, model) +end + function EnableSpoonerMode() local x, y, z = table.unpack(GetGameplayCamCoord()) local pitch, roll, yaw = table.unpack(GetGameplayCamRot(2)) @@ -624,6 +628,10 @@ function SpawnObject(name, model, x, y, z, pitch, roll, yaw, collisionDisabled, return nil end + if not IsModelAnObject(model) then + return nil + end + if not LoadModel(model) then return nil end @@ -678,6 +686,10 @@ function SpawnVehicle(name, model, x, y, z, pitch, roll, yaw, collisionDisabled, return nil end + if not IsModelAVehicle(model) then + return nil + end + if not LoadModel(model) then return nil end @@ -750,6 +762,10 @@ function SpawnPed(props) return nil end + if not IsModelAPed(props.model) then + return nil + end + if not LoadModel(props.model) then return nil end