Zone Einstellung geändert, da ohne Funktion

This commit is contained in:
Miho931 2025-06-09 18:14:06 +02:00
parent 5af07673d7
commit 9c4920eaf5
3 changed files with 16 additions and 15 deletions

View file

@ -3,6 +3,7 @@ QBCore = exports['qb-core']:GetCoreObject()
Player = nil
local npcHandle = nil
local isNPCSpawned = false
CurrentZone = nil
Citizen.CreateThread(function()
while Player == nil do
@ -79,10 +80,12 @@ CreateThread(function()
local spawnDistance = v.NPC.distance
if dist < spawnDistance and not isNPCSpawned then
CurrentZone = v
SpawnGuardNPC(v.NPC)
Wait(300)
AddTargetOptions(v)
AddTargetOptions()
elseif dist > spawnDistance and isNPCSpawned then
CurrentZone = nil
exports['qb-target']:RemoveTargetEntity(npcHandle)
RemoveGuardNPC()
end
@ -92,7 +95,7 @@ CreateThread(function()
end
end)
function AddTargetOptions(zone)
function AddTargetOptions())
local opt = {
{
@ -100,14 +103,12 @@ function AddTargetOptions(zone)
event = "mh_garage:storeVehicle",
icon = "fas fa-parking",
label = "Fahrzeug einparken",
args = zone
},
{
type = "client",
event = "mh_garage:retrieveVehicle",
icon = "fas fa-car",
label = "Fahrzeug ausparken",
args = zone
}
}
@ -126,9 +127,9 @@ function AddTargetOptions(zone)
})
end
function Notification(text, type, zone)
function Notification(text, type)
lib.notify({
title = "Garage - "..zone,
title = "Garage - "..CurrentZone.name,
description = text,
type = type,
position = 'top',