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)
|
SetVehicleEngineOn(vehicle, true, true, false)
|
||||||
GiveVehicleKeys(data.plate, model, vehicle)
|
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
|
-- Job-Fahrzeug: allen Spielern mit gleichem Job Schlüssel geben
|
||||||
if data.isJobVehicle and data.jobAccess then
|
if data.isJobVehicle and data.jobAccess then
|
||||||
TriggerServerEvent('mercyv-garage:giveJobKeys', data.plate, data.jobAccess)
|
TriggerServerEvent('mercyv-garage:giveJobKeys', data.plate, data.jobAccess)
|
||||||
@ -848,7 +854,8 @@ end)
|
|||||||
|
|
||||||
RegisterNUICallback('takeOut', function(data, cb)
|
RegisterNUICallback('takeOut', function(data, cb)
|
||||||
if not CurrentGarage then cb({}); return end
|
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({})
|
cb({})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@ -59,8 +59,12 @@ const app = new Vue({
|
|||||||
},
|
},
|
||||||
takeOut() {
|
takeOut() {
|
||||||
if (!this.selectedVehicle) return;
|
if (!this.selectedVehicle) return;
|
||||||
$.post(`https://${GetParentResourceName()}/takeOut`, JSON.stringify({ plate: this.selectedVehicle.plate, vehClass: this.selectedVehicle.vehClass || 0 }));
|
$.post(`https://${GetParentResourceName()}/takeOut`, JSON.stringify({
|
||||||
this.show = false; this.showAdminPanel = false;
|
plate: this.selectedVehicle.plate,
|
||||||
|
vehClass: this.selectedVehicle.vehClass || 0,
|
||||||
|
}));
|
||||||
|
// close() aufrufen damit SetNuiFocus(false) auf Lua-Seite läuft
|
||||||
|
this.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
parkFromPanel() {
|
parkFromPanel() {
|
||||||
|
|||||||
@ -5,9 +5,24 @@
|
|||||||
local ESX = nil
|
local ESX = nil
|
||||||
local GaragesData = {}
|
local GaragesData = {}
|
||||||
local SpawnedPlates = {}
|
local SpawnedPlates = {}
|
||||||
local ActiveJobPlates = {} -- [plate] = jobName, aktive Job-Fahrzeuge in der Welt
|
local ActiveJobPlates = {} -- [plate] = jobName
|
||||||
local PersistSentTo = {} -- [src] = true
|
local PersistSentTo = {}
|
||||||
local PersistDone = false -- true sobald erster Spieler alle Fahrzeuge gespawnt hat
|
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
|
-- Framework
|
||||||
@ -707,7 +722,6 @@ end
|
|||||||
|
|
||||||
RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
||||||
if not plate or not jobName then return end
|
if not plate or not jobName then return end
|
||||||
-- Plate tracken damit nachträgliche Einlogger auch Schlüssel bekommen
|
|
||||||
ActiveJobPlates[plate] = jobName
|
ActiveJobPlates[plate] = jobName
|
||||||
|
|
||||||
local players = GetPlayers()
|
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
|
if xp and xp.job and xp.job.name == jobName then
|
||||||
local ks = Config.VehicleKeySystem
|
local ks = Config.VehicleKeySystem
|
||||||
if ks == 'jaksam' then
|
if ks == 'jaksam' then
|
||||||
|
-- jaksam erwartet das Kennzeichen ohne Leerzeichen und uppercase
|
||||||
|
TriggerEvent('vehicles_keys:addKey', plate, src)
|
||||||
TriggerClientEvent('vehicles_keys:selfGiveVehicleKeys', src, plate)
|
TriggerClientEvent('vehicles_keys:selfGiveVehicleKeys', src, plate)
|
||||||
elseif ks == 'qs-vehiclekeys' then
|
elseif ks == 'qs-vehiclekeys' then
|
||||||
TriggerClientEvent('qs-vehiclekeys:client:GiveKeys', src, plate)
|
TriggerClientEvent('qs-vehiclekeys:client:GiveKeys', src, plate)
|
||||||
@ -729,8 +745,7 @@ RegisterNetEvent('mercyv-garage:giveJobKeys', function(plate, jobName)
|
|||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print(string.format('[mercyv-garage] Job-Schlüssel für %s an %d %s-Spieler verteilt.',
|
print(string.format('[mercyv-garage] Job-Schlüssel für %s an %d %s-Spieler verteilt.', plate, count, jobName))
|
||||||
plate, count, jobName))
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- ──────────────────────────────────────────────────────────────
|
-- ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user