Update stored.lua
This commit is contained in:
		
							parent
							
								
									03fd2d2e7b
								
							
						
					
					
						commit
						383c34245b
					
				
					 1 changed files with 15 additions and 20 deletions
				
			
		|  | @ -4,10 +4,10 @@ AddEventHandler('mh_garage:storeVehicle', function(zone) | |||
|     print(json.encode(zone)) | ||||
|     local coords = GetEntityCoords(PlayerPedId()) | ||||
|     local vehicles = GetGamePool('CVehicle') | ||||
|     local randomname, randomdes = SelectName() | ||||
|     local random = SelectName() | ||||
|  | ||||
|     local opt = {} | ||||
| print("1") | ||||
| print(json.encode(random)) | ||||
|     for i = 1, #vehicles, 1 do | ||||
|         local veh_coords = GetEntityCoords(vehicles[i]) | ||||
|         local distance = #(veh_coords - coords) | ||||
|  | @ -38,8 +38,8 @@ print("3") | |||
| print("4") | ||||
|             lib.registerContext({ | ||||
|                 id = "StoredVehicles", | ||||
|                 title = randomname, | ||||
|                 description = randomdes, | ||||
|                 title = random[1], | ||||
|                 description = random[2], | ||||
|                 options = opt | ||||
|             }) | ||||
| print("5") | ||||
|  | @ -50,22 +50,17 @@ end) | |||
|  | ||||
| function SelectName() | ||||
|     local names = { | ||||
|         ["Garagen-Guru"] = "passt auf, dass keiner falsch parkt, Schranken nicht durchdrehen und Autos nicht fliegen!", | ||||
|         ["Torflüsterer"] = "Redet Schranken gut zu wenn diese wieder nicht funktionieren.", | ||||
|         ["Parkplatz-Papst"] = "segnet jedes Auto, das diese heilige Halle betritt. Kein Ölverlust ohne dein Amen!", | ||||
|         ["Schranken-Schamane"] = "Elektronik und Technik? Kein Problem! Ich kontrolliere den Strom der Schranken mit reiner Willenskraft und Kabelbinder!", | ||||
|         ["Chef vom Schuppen"] = "Wer falsch parkt, kriegt nicht den Abschleppdienst, sondern eine Ansprache. Kurz. Hart. Legendär!" | ||||
|         {name = "Garagen-Guru", | ||||
|         description = "passt auf, dass keiner falsch parkt, Schranken nicht durchdrehen und Autos nicht fliegen!"}, | ||||
|         {name = "Torflüsterer", | ||||
|         description = "Redet Schranken gut zu wenn diese wieder nicht funktionieren."}, | ||||
|         {name = "Parkplatz-Papst", | ||||
|         description = "segnet jedes Auto, das diese heilige Halle betritt. Kein Ölverlust ohne dein Amen!"}, | ||||
|         {name = "Schranken-Schamane", | ||||
|         description = "Elektronik und Technik? Kein Problem! Ich kontrolliere den Strom der Schranken mit reiner Willenskraft und Kabelbinder!"}, | ||||
|         {name = "Chef vom Schuppen", | ||||
|         description = "Wer falsch parkt, kriegt nicht den Abschleppdienst, sondern eine Ansprache. Kurz. Hart. Legendär!"} | ||||
|     } | ||||
|  | ||||
|     -- Schlüssel extrahieren | ||||
|     local keys = {} | ||||
|     for k in pairs(names) do | ||||
|         table.insert(keys, k) | ||||
|     end | ||||
|  | ||||
|     -- Zufälligen Schlüssel wählen | ||||
|     local randomKey = keys[math.random(1, #keys)] | ||||
|      | ||||
|     -- Gib Titel und Beschreibung zurück | ||||
|     return randomKey, names[randomKey] | ||||
|     return names[math.random(1, #names)] | ||||
| end | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miho931
						Miho931