ed
This commit is contained in:
		
							parent
							
								
									9ec9374b18
								
							
						
					
					
						commit
						1ee6dbef40
					
				
					 64 changed files with 5206 additions and 177 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -6,42 +6,58 @@ QBCore.Functions.CreateCallback("roadphone:valet:getCars", function(source, cb)
 | 
			
		|||
        return;
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    MySQL.Async.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @citizenid and type = @type and `impound` = @impound", {
 | 
			
		||||
        ['@impound'] = 0,
 | 
			
		||||
        ['@citizenid'] = xPlayer.PlayerData.citizenid,
 | 
			
		||||
        ['@type'] = "car"
 | 
			
		||||
    }, function(result)
 | 
			
		||||
        local cachedvehicles = {}
 | 
			
		||||
    local result
 | 
			
		||||
 | 
			
		||||
        for i = 1, #result do
 | 
			
		||||
            table.insert(cachedvehicles, {
 | 
			
		||||
                plate = result[i].plate,
 | 
			
		||||
                vehicle = result[i].vehicle, -- result[i].vehicle,
 | 
			
		||||
                type = 'car',
 | 
			
		||||
                hash = result[i].hash,
 | 
			
		||||
                garage = result[i].garage_id,
 | 
			
		||||
                stored = result[i].in_garage
 | 
			
		||||
            })
 | 
			
		||||
    if Config.JGAdvancedGarages then
 | 
			
		||||
        result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier and `impound` = @impound", {
 | 
			
		||||
            ['@impound'] = 0,
 | 
			
		||||
            ['@identifier'] = xPlayer.PlayerData.citizenid
 | 
			
		||||
        })
 | 
			
		||||
    else
 | 
			
		||||
        result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier", {
 | 
			
		||||
            ['@identifier'] = xPlayer.PlayerData.citizenid
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
        end
 | 
			
		||||
    local cachedvehicles = {}
 | 
			
		||||
 | 
			
		||||
        cb(cachedvehicles)
 | 
			
		||||
    for i = 1, #result do
 | 
			
		||||
 | 
			
		||||
    end)
 | 
			
		||||
    local Garage = result[i].garage_id
 | 
			
		||||
 | 
			
		||||
    table.insert(cachedvehicles, {
 | 
			
		||||
        plate = result[i].plate,
 | 
			
		||||
        vehicle = result[i].vehicle,
 | 
			
		||||
        hash = result[i].hash,
 | 
			
		||||
        garage = result[i].garage,
 | 
			
		||||
        stored = result[i].state
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    cb(cachedvehicles)
 | 
			
		||||
    
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
QBCore.Functions.CreateCallback('roadphone:valet:loadVehicle', function(source, cb, plate)
 | 
			
		||||
 | 
			
		||||
    local valetCheck = valetServerSideCheck(plate)
 | 
			
		||||
    local xPlayer = QBCore.Functions.GetPlayer(source)
 | 
			
		||||
 | 
			
		||||
    if valetCheck ~= false then
 | 
			
		||||
        cb(false, valetCheck)
 | 
			
		||||
        return;
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate', {
 | 
			
		||||
        ['@plate'] = plate
 | 
			
		||||
    if not xPlayer then
 | 
			
		||||
        cb(false)
 | 
			
		||||
        return;
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate AND `citizenid` = @identifier', {
 | 
			
		||||
        ['@plate'] = plate,
 | 
			
		||||
        ['@identifier'] = xPlayer.PlayerData.citizenid
 | 
			
		||||
    }, function(vehicle)
 | 
			
		||||
        cb(vehicle)
 | 
			
		||||
    end)
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +80,7 @@ QBCore.Functions.CreateCallback('roadphone:valet:checkMoney', function(source, c
 | 
			
		|||
        TriggerClientEvent("roadphone:sendNotification", source, {
 | 
			
		||||
            apptitle = "APP_VALET_NAME",
 | 
			
		||||
            title = "APP_VALET_CAR_ONTHEWAY",
 | 
			
		||||
            img = "/public/img/Apps/valet.jpg"
 | 
			
		||||
            img = "/public/img/Apps/light_mode/valet.webp"
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        discordLog("9807270", "Valet", xPlayer.PlayerData.name .. ' ' .. Lang:t('info.valet_car_delivered_2', { value = Config.ValetDeliveryPrice }), 'RoadPhone - Valet', nil, Cfg.ValetWebhook)
 | 
			
		||||
| 
						 | 
				
			
			@ -74,7 +90,7 @@ QBCore.Functions.CreateCallback('roadphone:valet:checkMoney', function(source, c
 | 
			
		|||
        TriggerClientEvent("roadphone:sendNotification", source, {
 | 
			
		||||
            apptitle = "APP_VALET_NAME",
 | 
			
		||||
            title = "APP_VALET_NOTENOUGHMONEY",
 | 
			
		||||
            img = "/public/img/Apps/valet.jpg"
 | 
			
		||||
            img = "/public/img/Apps/light_mode/valet.webp"
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        cb(false)
 | 
			
		||||
| 
						 | 
				
			
			@ -85,8 +101,17 @@ end)
 | 
			
		|||
 | 
			
		||||
RegisterServerEvent("roadphone:valetCarSetOutside")
 | 
			
		||||
AddEventHandler("roadphone:valetCarSetOutside", function(plate)
 | 
			
		||||
    MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', {
 | 
			
		||||
        ['@plate'] = plate,
 | 
			
		||||
        ['@in_garage'] = 0,
 | 
			
		||||
    
 | 
			
		||||
    if Config.cdGarages or Config.JGAdvancedGarages then
 | 
			
		||||
        MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', {
 | 
			
		||||
          ['@plate'] = plate,
 | 
			
		||||
          ['@in_garage'] = 0,
 | 
			
		||||
        })
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    MySQL.Async.execute("UPDATE " .. Config.OwnedVehiclesTable .. " SET `state` = @stored WHERE `plate` = @plate", {
 | 
			
		||||
        ["@plate"] = plate,
 | 
			
		||||
        ["@stored"] = 0
 | 
			
		||||
    })
 | 
			
		||||
end)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue