forked from Simnation/Main
[Garage] AddTarget
This commit is contained in:
parent
13431ff326
commit
03ae638141
1 changed files with 26 additions and 2 deletions
|
@ -65,12 +65,36 @@ CreateThread(function()
|
||||||
local spawnDistance = v.NPC.distance
|
local spawnDistance = v.NPC.distance
|
||||||
|
|
||||||
if dist < spawnDistance and not isNPCSpawned then
|
if dist < spawnDistance and not isNPCSpawned then
|
||||||
|
AddTargetOptions()
|
||||||
SpawnGuardNPC(v.NPC)
|
SpawnGuardNPC(v.NPC)
|
||||||
elseif dist > spawnDistance and isNPCSpawned then
|
elseif dist > spawnDistance and isNPCSpawned then
|
||||||
|
exports['qb-target']:RemoveTargetEntity(npcHandle)
|
||||||
RemoveGuardNPC()
|
RemoveGuardNPC()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Wait(1000) -- Überprüfung jede Sekunde
|
Wait(0) -- Überprüfung jede Sekunde
|
||||||
end
|
end
|
||||||
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
|
Loading…
Add table
Add a link
Reference in a new issue