Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jan 28, 2024
1 parent f624daa commit 37486d9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions server-data/resources/[esx_addons]/esx_vehicleshop/server/main.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
local Config = Config

local vehicleShop = {
categories = {},
vehicles = {},
vehiclesByModel = {},
soldVehicles = {},
cardealerVehicles = {},
rentedVehicles = {}
categories = {},
vehicles = {},
vehiclesByModel = {},
soldVehicles = {},
cardealerVehicles = {},
rentedVehicles = {}
}
CreateThread(function()
while true do
Expand All @@ -17,17 +17,17 @@ end)

local function getCategories()
vehicleShop.categories = MySQL.query.await('SELECT * FROM vehicle_categories')
GlobalState.vehicleShop = vehicleShop
GlobalState.vehicleShop = vehicleShop
return true
end

local function getVehicles()
vehicleShop.vehicles = MySQL.query.await('SELECT vehicles.*, vehicle_categories.label AS categoryLabel FROM vehicles JOIN vehicle_categories ON vehicles.category = vehicle_categories.name')

for _, vehicle in pairs(vehicleShop.vehicles) do
vehicleShop.vehiclesByModel[vehicle.model] = vehicle
end

GlobalState.vehicleShop = vehicleShop
return true
end
Expand Down Expand Up @@ -56,7 +56,7 @@ local function getRentedVehicles()
playerName = vehicle.player_name
}
end
GlobalState.vehicleShop = vehicleShop
GlobalState.vehicleShop = vehicleShop
return true
end)
end
Expand Down Expand Up @@ -108,7 +108,7 @@ AddEventHandler('esx_vehicleshop:setVehicleOwnedPlayerId', function(playerId, ve
end
end

MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {xTarget.identifier, vehicleProps.plate, json.encode(vehicleProps)}, function(id)
MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {xTarget.identifier, vehicleProps.plate, json.encode(vehicleProps)}, function()
xPlayer.showNotification(_U('vehicle_set_owned', vehicleProps.plate, xTarget.getName()))
xTarget.showNotification(_U('vehicle_belongs', vehicleProps.plate))
end)
Expand Down Expand Up @@ -146,7 +146,7 @@ AddEventHandler('esx_vehicleshop:rentVehicle', function(vehicle, plate, rentPric
if not price then return end

MySQL.insert('INSERT INTO rented_vehicles (vehicle, plate, player_name, base_price, rent_price, owner) VALUES (?, ?, ?, ?, ?, ?)', {vehicle, plate, xTarget.getName(), price, rentPrice, xTarget.identifier},
function(id)
function()
xPlayer.showNotification(_U('vehicle_set_rented', plate, xTarget.getName()))
end)
end)
Expand Down

0 comments on commit 37486d9

Please sign in to comment.