valet app
This commit is contained in:
		
							parent
							
								
									9b0c3281d7
								
							
						
					
					
						commit
						c07bc915bd
					
				
					 2 changed files with 52 additions and 49 deletions
				
			
		|  | @ -56,60 +56,54 @@ RegisterNUICallback('searchCar', function(data, cb) | |||
|     cb('ok') | ||||
| end) | ||||
|  | ||||
| RegisterNUICallback("deliverormarkcar", function(data, cb) | ||||
|     QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords) | ||||
| -- RegisterNUICallback("deliverormarkcar", function(data, cb) | ||||
| --     QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords) | ||||
| --         if not vehicle and not coords then | ||||
| --             return | ||||
| --         end | ||||
| --         if vehicle == false then | ||||
| --             if coords then | ||||
| --                 SetNewWaypoint(coords.x, coords.y) | ||||
| --                 TriggerEvent("roadphone:sendNotification", { | ||||
| --                     apptitle = 'APP_VALET_NAME', | ||||
| --                     title = 'APP_VALET_TITLE_WAYPOINT', | ||||
| --                     img = "/public/img/Apps/valet.jpg" | ||||
| --                 }) | ||||
| --             end | ||||
| --             return; | ||||
| --         end | ||||
|  | ||||
|         if not vehicle and not coords then | ||||
|             return | ||||
|         end | ||||
| --         local plate = vehicle[1].plate | ||||
|  | ||||
|         if vehicle == false then | ||||
|             if coords then | ||||
|                 SetNewWaypoint(coords.x, coords.y) | ||||
|                 TriggerEvent("roadphone:sendNotification", { | ||||
|                     apptitle = 'APP_VALET_NAME', | ||||
|                     title = 'APP_VALET_TITLE_WAYPOINT', | ||||
|                     img = "/public/img/Apps/valet.jpg" | ||||
|                 }) | ||||
| --         local gameVehicles = GetGamePool('CVehicle') | ||||
| --         for i = 1, #gameVehicles do | ||||
| --             local vehicle = gameVehicles[i] | ||||
| --             if DoesEntityExist(vehicle) then | ||||
| --                 if GetVehicleNumberPlateText(vehicle) == plate then | ||||
| --                     local vehicleCoords = GetEntityCoords(vehicle) | ||||
| --                     SetNewWaypoint(vehicleCoords.x, vehicleCoords.y) | ||||
| --                     TriggerEvent("roadphone:sendNotification", { | ||||
| --                         apptitle = 'APP_VALET_NAME', | ||||
| --                         title = 'APP_VALET_TITLE_WAYPOINT', | ||||
| --                         img = "/public/img/Apps/valet.jpg" | ||||
| --                     }) | ||||
| --                     cb('ok') | ||||
| --                     return | ||||
| --                 end | ||||
| --             end | ||||
| --         end | ||||
|  | ||||
|             end | ||||
|             return; | ||||
|         end | ||||
| --         QBCore.Functions.TriggerCallback("roadphone:valet:checkMoney", function(cb) | ||||
| --             if cb then | ||||
| --                 SpawnVehicle(vehicle[1].vehicle, plate, json.decode(vehicle[1].mods)) | ||||
| --             end | ||||
| --         end) | ||||
|  | ||||
|         local plate = vehicle[1].plate | ||||
| --     end, data.plate) | ||||
|  | ||||
|         local gameVehicles = GetGamePool('CVehicle') | ||||
| --     cb('ok') | ||||
| -- end) | ||||
|  | ||||
|         for i = 1, #gameVehicles do | ||||
|             local vehicle = gameVehicles[i] | ||||
|  | ||||
|             if DoesEntityExist(vehicle) then | ||||
|                 if GetVehicleNumberPlateText(vehicle) == plate then | ||||
|                     local vehicleCoords = GetEntityCoords(vehicle) | ||||
|                     SetNewWaypoint(vehicleCoords.x, vehicleCoords.y) | ||||
|                     TriggerEvent("roadphone:sendNotification", { | ||||
|                         apptitle = 'APP_VALET_NAME', | ||||
|                         title = 'APP_VALET_TITLE_WAYPOINT', | ||||
|                         img = "/public/img/Apps/valet.jpg" | ||||
|                     }) | ||||
|                     cb('ok') | ||||
|                     return | ||||
|                 end | ||||
|             end | ||||
|         end | ||||
|  | ||||
|         QBCore.Functions.TriggerCallback("roadphone:valet:checkMoney", function(cb) | ||||
|  | ||||
|             if cb then | ||||
|                 SpawnVehicle(vehicle[1].vehicle, plate, json.decode(vehicle[1].mods)) | ||||
|             end | ||||
|         end) | ||||
|  | ||||
|     end, data.plate) | ||||
|  | ||||
|     cb('ok') | ||||
|  | ||||
| end) | ||||
|  | ||||
| function SpawnVehicle(vehicle, plate, mods) | ||||
|  | ||||
|  |  | |||
|  | @ -234,7 +234,7 @@ | |||
|             "disallowJobs": [] | ||||
|         }, | ||||
|         { | ||||
|             "name": "Fotos", | ||||
|             "name": "Galerie", | ||||
|             "icon": "/public/img/Apps/gallery.png", | ||||
|             "default": true, | ||||
|             "category": "apps", | ||||
|  | @ -242,6 +242,15 @@ | |||
|             "allowJobs": [], | ||||
|             "disallowJobs": [] | ||||
|         }, | ||||
|         { | ||||
|             "name": "Garage", | ||||
|             "icon": "/public/img/Apps/valet.jpg", | ||||
|             "default": true, | ||||
|             "category": "apps", | ||||
|             "redirect": "gallery", | ||||
|             "allowJobs": [], | ||||
|             "disallowJobs": [] | ||||
|         }, | ||||
|         { | ||||
|             "name": "Rechner", | ||||
|             "icon": "/public/img/Apps/calculator.png", | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nordi98
						Nordi98