Auto-sync 2026-04-15 21:40

This commit is contained in:
root 2026-04-15 21:40:01 +02:00
parent 5fe91241b9
commit bdd177e25c

View File

@ -499,7 +499,11 @@ end)
function SpawnVehicle(data, closeGarageAfter)
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 spawn
@ -516,9 +520,27 @@ function SpawnVehicle(data, closeGarageAfter)
z = pedCoords.z,
w = heading,
}
else
elseif g.car and g.car.spawncar then
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
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 model = nil