Skip to content

Commit

Permalink
fix(vehicleProperties): wait until entity exists before setting vehic…
Browse files Browse the repository at this point in the history
…le properties
  • Loading branch information
DokaDoka committed May 8, 2022
1 parent 55bfa7c commit 1080efb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion resource/vehicleProperties/client.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
RegisterNetEvent('ox_lib:setVehicleProperties', function(netid, data)
lib.setVehicleProperties(NetToVeh(netid), data)
local timeout = 10
while not NetworkDoesEntityExistWithNetworkId(netid) and timeout > 0 do
Wait(0)
timeout -= 1
end
if timeout > 0 then
lib.setVehicleProperties(NetToVeh(netid), data)
end
end)

function lib.getVehicleProperties(vehicle)
Expand Down

0 comments on commit 1080efb

Please sign in to comment.