1
0
Fork 0
forked from Simnation/Main

[Garage] AddTarget

This commit is contained in:
Miho931 2025-06-08 14:04:18 +02:00
parent 13431ff326
commit 03ae638141

View file

@ -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)
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