[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 | ||||
|          | ||||
|             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 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miho931
						Miho931