From 4fd106e321ce5bc80b296d3365330dbae6fec84a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 4 Jan 2020 11:03:55 +0100 Subject: [PATCH] Fixed cone not spawning --- client/main.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index fabe8c79..688f7daa 100644 --- a/client/main.lua +++ b/client/main.lua @@ -747,15 +747,10 @@ function OpenPoliceActionsMenu() {label = _U('cash'), model = 'hei_prop_cash_crate_half_full'} }}, function(data2, menu2) local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) + local coords, forward = GetEntityCoords(playerPed), GetEntityForwardVector(playerPed) + local objectCoords = (coords + forward * 1.0) - if data2.current.model == 'prop_roadcone02a' then - z = z - 2.0 - end - - ESX.Game.SpawnObject(data2.current.model, {x = x, y = y, z = z}, function(obj) + ESX.Game.SpawnObject(data2.current.model, objectCoords, function(obj) SetEntityHeading(obj, GetEntityHeading(playerPed)) PlaceObjectOnGroundProperly(obj) end)