Auto-sync 2026-04-15 21:50
This commit is contained in:
parent
bdd177e25c
commit
b2e8f89415
@ -597,6 +597,12 @@ function SpawnVehicle(data, closeGarageAfter)
|
||||
SetVehicleEngineOn(vehicle, true, true, false)
|
||||
GiveVehicleKeys(data.plate, model, vehicle)
|
||||
|
||||
-- NUI wurde schon durch close() geschlossen - nur Fokus sicherstellen
|
||||
SetNuiFocus(false, false)
|
||||
exports['hex_4_hud']:HideHud(false)
|
||||
GarageIsOpen = false
|
||||
CurrentGarage = nil
|
||||
|
||||
-- Job-Fahrzeug: allen Spielern mit gleichem Job Schlüssel geben
|
||||
if data.isJobVehicle and data.jobAccess then
|
||||
TriggerServerEvent('mercyv-garage:giveJobKeys', data.plate, data.jobAccess)
|
||||
@ -848,7 +854,8 @@ end)
|
||||
|
||||
RegisterNUICallback('takeOut', function(data, cb)
|
||||
if not CurrentGarage then cb({}); return end
|
||||
TriggerServerEvent('mercyv-garage:takeOut', data.plate, CurrentGarage, data.vehClass or 0)
|
||||
local garageId = CurrentGarage -- Garage-ID sichern bevor CloseGarage nil setzt
|
||||
TriggerServerEvent('mercyv-garage:takeOut', data.plate, garageId, data.vehClass or 0)
|
||||
cb({})
|
||||
end)
|
||||
|
||||
|
||||
@ -59,8 +59,12 @@ const app = new Vue({
|
||||
},
|
||||
takeOut() {
|
||||
if (!this.selectedVehicle) return;
|
||||
$.post(`https://${GetParentResourceName()}/takeOut`, JSON.stringify({ plate: this.selectedVehicle.plate, vehClass: this.selectedVehicle.vehClass || 0 }));
|
||||
this.show = false; this.showAdminPanel = false;
|
||||
$.post(`https://${GetParentResourceName()}/takeOut`, JSON.stringify({
|
||||
plate: this.selectedVehicle.plate,
|
||||
vehClass: this.selectedVehicle.vehClass || 0,
|
||||
}));
|
||||
// close() aufrufen damit SetNuiFocus(false) auf Lua-Seite läuft
|
||||
this.close();
|
||||
},
|
||||
|
||||
parkFromPanel() {
|
||||
|
||||
@ -5,9 +5,24 @@
|
||||
local ESX = nil
|
||||
local GaragesData = {}
|
||||
local SpawnedPlates = {}
|
||||
local ActiveJobPlates = {} -- [plate] = jobName, aktive Job-Fahrzeuge in der Welt
|
||||
local PersistSentTo = {} -- [src] = true
|
||||
local PersistDone = false -- true sobald erster Spieler alle Fahrzeuge gespawnt hat
|
||||
local ActiveJobPlates = {} -- [plate] = jobName
|
||||
local PersistSentTo = {}
|
||||
local PersistDone = false
|
||||
|
||||
-- Zufälliges Kennzeichen für Job-Fahrzeuge (ABC 123 Format)
|
||||
local function GenerateJobPlate()
|
||||
local chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ'
|
||||
local plate = ''
|
||||
for i = 1, 3 do
|
||||
local idx = math.random(1, #chars)
|
||||
plate = plate .. chars:sub(idx, idx)
|
||||
end
|
||||
plate = plate .. ' '
|
||||
for i = 1, 3 do
|
||||
plate = plate .. tostring(math.random(0, 9))
|
||||
end
|
||||
return plate
|
||||
end
|
||||
|
||||
-- ──────────────────────────────────────────────────────────────
|
||||
-- Framework
|
||||
@ -707,7 +722,6 @@ end
|
||||
|
||||
RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
||||
if not plate or not jobName then return end
|
||||
-- Plate tracken damit nachträgliche Einlogger auch Schlüssel bekommen
|
||||
ActiveJobPlates[plate] = jobName
|
||||
|
||||
local players = GetPlayers()
|
||||
@ -718,6 +732,8 @@ RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
||||
if xp and xp.job and xp.job.name == jobName then
|
||||
local ks = Config.VehicleKeySystem
|
||||
if ks == 'jaksam' then
|
||||
-- jaksam erwartet das Kennzeichen ohne Leerzeichen und uppercase
|
||||
TriggerEvent('vehicles_keys:addKey', plate, src)
|
||||
TriggerClientEvent('vehicles_keys:selfGiveVehicleKeys', src, plate)
|
||||
elseif ks == 'qs-vehiclekeys' then
|
||||
TriggerClientEvent('qs-vehiclekeys:client:GiveKeys', src, plate)
|
||||
@ -729,8 +745,7 @@ RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
print(string.format('[mercyv-garage] Job-Schlüssel für %s an %d %s-Spieler verteilt.',
|
||||
plate, count, jobName))
|
||||
print(string.format('[mercyv-garage] Job-Schlüssel für %s an %d %s-Spieler verteilt.', plate, count, jobName))
|
||||
end)
|
||||
|
||||
-- ──────────────────────────────────────────────────────────────
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user