From 03ae638141125832be54893afa85ee75d3af9eac Mon Sep 17 00:00:00 2001 From: Miho931 <98314142+Miho931@users.noreply.github.com> Date: Sun, 8 Jun 2025 14:04:18 +0200 Subject: [PATCH] [Garage] AddTarget --- .../[carscripts]/mh_garage/client/main.lua | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/resources/[carscripts]/mh_garage/client/main.lua b/resources/[carscripts]/mh_garage/client/main.lua index d93ad39ac..9de283b79 100644 --- a/resources/[carscripts]/mh_garage/client/main.lua +++ b/resources/[carscripts]/mh_garage/client/main.lua @@ -65,12 +65,36 @@ CreateThread(function() local spawnDistance = v.NPC.distance if dist < spawnDistance and not isNPCSpawned then + AddTargetOptions() SpawnGuardNPC(v.NPC) elseif dist > spawnDistance and isNPCSpawned then + exports['qb-target']:RemoveTargetEntity(npcHandle) RemoveGuardNPC() end end - Wait(1000) -- Überprüfung jede Sekunde + Wait(0) -- Überprüfung jede Sekunde end -end) \ No newline at end of file +end) + +function AddTargetOptions() + exports['qb-target']:AddTargetEntity(npcHandle, { + options = { + { + type = "client", + event = "garage:storeVehicle", + icon = "fas fa-parking", + label = "Fahrzeug einparken", + canInteract = true + }, + { + type = "client", + event = "garage:retrieveVehicle", + icon = "fas fa-car", + label = "Fahrzeug ausparken", + canInteract = true + } + }, + distance = 2.5 + }) +end \ No newline at end of file