Skip to content

Commit

Permalink
chore: 🎨 Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jun 10, 2024
1 parent 04cfd19 commit f019a07
Show file tree
Hide file tree
Showing 8 changed files with 3,883 additions and 4,359 deletions.
689 changes: 312 additions & 377 deletions server-data/resources/[bpt_addons]/bpt_importjob/client/main.lua

Large diffs are not rendered by default.

301 changes: 144 additions & 157 deletions server-data/resources/[bpt_addons]/bpt_taxijob/client/main.lua

Large diffs are not rendered by default.

689 changes: 312 additions & 377 deletions server-data/resources/[bpt_addons]/bpt_unicornjob/client/main.lua

Large diffs are not rendered by default.

57 changes: 27 additions & 30 deletions server-data/resources/[bpt_addons]/bpt_vehicletax/server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,40 @@ local percentage = 1
ESX = exports["es_extended"]:getSharedObject()

MySQL.ready(function()
local result = MySQL.Sync.fetchAll("SELECT * FROM vehicles")
for i = 1, #result, 1 do
if vehicleprices[(GetHashKey(result[i].model))] == nil then
table.insert(vehicleprices, { model = GetHashKey(result[i].model), price = result[i].price })
end
end
local result = MySQL.Sync.fetchAll("SELECT * FROM vehicles")
for i = 1, #result, 1 do
if vehicleprices[(GetHashKey(result[i].model))] == nil then
table.insert(vehicleprices, { model = GetHashKey(result[i].model), price = result[i].price })
end
end
end)

function Tax()
local result = MySQL.Sync.fetchAll("SELECT * FROM owned_vehicles")
local xPlayers = ESX.GetPlayers()
local result = MySQL.Sync.fetchAll("SELECT * FROM owned_vehicles")
local xPlayers = ESX.GetPlayers()

for i = 1, #result, 1 do
if result[i].job == "" or result[i].job == nil then
local sqlplayer = ESX.GetPlayerFromIdentifier(result[i].owner)
for i = 1, #result, 1 do
if result[i].job == "" or result[i].job == nil then
local sqlplayer = ESX.GetPlayerFromIdentifier(result[i].owner)

if sqlplayer ~= nil then
for j = 1, #xPlayers, 1 do
local xPlayer = ESX.GetPlayerFromId(xPlayers[j])
if sqlplayer ~= nil then
for j = 1, #xPlayers, 1 do
local xPlayer = ESX.GetPlayerFromId(xPlayers[j])

if xPlayer.identifier == result[i].owner then
local model = json.decode(result[i].vehicle).model
if xPlayer.identifier == result[i].owner then
local model = json.decode(result[i].vehicle).model

for m = 1, #vehicleprices, 1 do
if vehicleprices[m].model == model then
TriggerEvent("esx_billing:sendBill", xPlayer[j], "society_cardealer",
TranslateCap("vehicle_tax") .. result[i].plate,
((vehicleprices[m].price * percentage) / 100), 1
)
break
end
end
end
end
end
end
end
for m = 1, #vehicleprices, 1 do
if vehicleprices[m].model == model then
TriggerEvent("bpt_billing:sendBill", xPlayer[j], "society_cardealer", TranslateCap("vehicle_tax") .. result[i].plate, ((vehicleprices[m].price * percentage) / 100), 1)
break
end
end
end
end
end
end
end
end

TriggerEvent("cron", 24, 0, Tax)
Expand Down
Loading

0 comments on commit f019a07

Please sign in to comment.