Auto-sync 2026-04-15 21:40
This commit is contained in:
parent
5fe91241b9
commit
bdd177e25c
@ -499,7 +499,11 @@ end)
|
|||||||
|
|
||||||
function SpawnVehicle(data, closeGarageAfter)
|
function SpawnVehicle(data, closeGarageAfter)
|
||||||
local g = Garages[data.garageId]
|
local g = Garages[data.garageId]
|
||||||
if not g then return end
|
if not g then
|
||||||
|
print('[mercyv-garage] SpawnVehicle: Garage nicht gefunden: ' .. tostring(data.garageId))
|
||||||
|
if closeGarageAfter then CloseGarage() end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local gType = g.garage or 'normal'
|
local gType = g.garage or 'normal'
|
||||||
local spawn
|
local spawn
|
||||||
@ -516,9 +520,27 @@ function SpawnVehicle(data, closeGarageAfter)
|
|||||||
z = pedCoords.z,
|
z = pedCoords.z,
|
||||||
w = heading,
|
w = heading,
|
||||||
}
|
}
|
||||||
else
|
elseif g.car and g.car.spawncar then
|
||||||
spawn = g.car.spawncar
|
spawn = g.car.spawncar
|
||||||
|
else
|
||||||
|
-- Fallback: 5m vor Spieler spawnen
|
||||||
|
local pedCoords = GetEntityCoords(PlayerPedId())
|
||||||
|
local heading = GetEntityHeading(PlayerPedId())
|
||||||
|
local rad = math.rad(heading)
|
||||||
|
spawn = {
|
||||||
|
x = pedCoords.x + math.sin(-rad) * 5.0,
|
||||||
|
y = pedCoords.y + math.cos(-rad) * 5.0,
|
||||||
|
z = pedCoords.z,
|
||||||
|
w = heading,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not spawn then
|
||||||
|
print('[mercyv-garage] ERROR: Keine Spawn-Koordinaten für ' .. tostring(data.garageId))
|
||||||
|
if closeGarageAfter then CloseGarage() end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local props = type(data.props) == 'string' and json.decode(data.props) or data.props
|
local props = type(data.props) == 'string' and json.decode(data.props) or data.props
|
||||||
local model = nil
|
local model = nil
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user