From a66fb9221ddc82462697a86869bcf57be9b2fc47 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Mon, 8 Apr 2024 03:05:49 -0300 Subject: [PATCH 01/11] translate pt-br --- locales/pt-br.json | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 locales/pt-br.json diff --git a/locales/pt-br.json b/locales/pt-br.json new file mode 100644 index 0000000..61a744f --- /dev/null +++ b/locales/pt-br.json @@ -0,0 +1,83 @@ +{ + "error": { + "testdrive_alreadyin": "Já está em um test drive", + "testdrive_return": "Este não é o seu veículo de test drive", + "Invalid_ID": "ID de jogador fornecido inválido", + "playertoofar": "Este jogador não está perto o suficiente", + "notenoughmoney": "Dinheiro insuficiente", + "minimumallowed": "O pagamento mínimo permitido é $", + "overpaid": "Você pagou a mais", + "alreadypaid": "O veículo já está quitado", + "notworth": "O veículo não vale tanto", + "downtoosmall": "Pagamento inicial muito pequeno", + "exceededmax": "Excedido o valor máximo de pagamento", + "repossessed": "Seu veículo com placa %s foi recuperado", + "buyerinfo": "Não foi possível obter informações do comprador", + "notinveh": "Você deve estar no veículo que deseja transferir", + "vehinfo": "Não foi possível obter informações do veículo", + "notown": "Você não possui este veículo", + "buyertoopoor": "O comprador não tem dinheiro suficiente", + "nofinanced": "Você não possui nenhum veículo financiado", + "financed": "Este veículo está financiado", + "buyerdeclined": "O jogador recusou a transação", + "sale_timeout": "Espere um pouco antes de negociar seu veículo" + }, + "success": { + "purchased": "Parabéns pela compra!", + "earned_commission": "Você ganhou $ %s de comissão", + "gifted": "Você presenteou seu veículo", + "received_gift": "Você recebeu um veículo de presente", + "soldfor": "Você vendeu seu veículo por $", + "boughtfor": "Você comprou um veículo por $" + }, + "menus": { + "vehHeader_header": "Opções do Veículo", + "vehHeader_txt": "Interaja com o veículo atual", + "financed_header": "Veículos Financiados", + "finance_txt": "Veja seus veículos possuídos", + "returnTestDrive_header": "Finalizar Test Drive", + "categories_header": "Categorias", + "goback_header": "Voltar", + "veh_price": "Preço: $", + "veh_platetxt": "Placa: ", + "veh_finance": "Pagamento do Veículo", + "veh_finance_balance": "Saldo Total Restante", + "veh_finance_currency": "$", + "veh_finance_total": "Pagamentos Totais Restantes", + "veh_finance_reccuring": "Valor do Pagamento Recorrente", + "veh_finance_pay": "Efetuar um pagamento", + "veh_finance_payoff": "Quitar veículo", + "veh_finance_payment": "Valor do Pagamento ($)", + "submit_text": "Enviar", + "test_header": "Test Drive", + "finance_header": "Financiar Veículo", + "owned_vehicles_header": "Veículos Possuídos", + "swap_header": "Trocar Veículo", + "swap_txt": "Troque o veículo atualmente selecionado", + "financesubmit_downpayment": "Valor do Pagamento Inicial - Mín ", + "financesubmit_totalpayment": "Pagamentos Totais - Máx ", + "freeuse_test_txt": "Teste o veículo atualmente selecionado", + "freeuse_buy_header": "Comprar Veículo", + "freeuse_buy_txt": "Compre o veículo atualmente selecionado", + "freeuse_finance_txt": "Financie o veículo atualmente selecionado", + "managed_test_txt": "Permita que o jogador faça um test drive", + "managed_sell_header": "Vender Veículo", + "managed_sell_txt": "Venda o veículo para o jogador", + "managed_finance_txt": "Financie o veículo para o jogador", + "submit_ID": "ID do Servidor (#)", + "keypress_showFinanceMenu": "[E] Abrir Menu de Finanças", + "keypress_vehicleViewMenu": "[E] Visualizar Veículo" + }, + "general": { + "testdrive_timer": "Tempo Restante do Test Drive: ", + "vehinteraction": "Interação com o Veículo", + "testdrive_timenoti": "Você tem %s minutos restantes", + "testdrive_complete": "Test drive do veículo concluído", + "paymentduein": "Seu pagamento do veículo vence em %s minutos", + "command_transfervehicle": "Presenteie ou venda seu veículo", + "command_transfervehicle_help": "ID do comprador", + "command_transfervehicle_amount": "Valor da venda (opcional)", + "transfervehicle_confirm": "Confirmar a troca de %s %s por $ %s" + } + } + \ No newline at end of file From bcff7c4e2f6b7ea35782529ae3a5ff4ee86ed9ee Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:43:30 -0300 Subject: [PATCH 02/11] update lib.requestmodel 5000 --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 4254304..9e3eb3d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -487,7 +487,7 @@ end ---@param coords vector4 ---@return number vehicleEntity local function createShowroomVehicle(model, coords) - lib.requestModel(model, 1000) + lib.requestModel(model, 5000) local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, false, false) SetModelAsNoLongerNeeded(model) SetVehicleOnGroundProperly(veh) From 4da7cb80735f01f15c082590de3759e886e45266 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Fri, 10 May 2024 15:33:14 -0300 Subject: [PATCH 03/11] Update configs --- config/client.lua | 2 +- config/server.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/client.lua b/config/client.lua index 2431e2d..839bf3a 100644 --- a/config/client.lua +++ b/config/client.lua @@ -2,7 +2,7 @@ return { useTarget = false, debugPoly = false, enableFreeUseBuy = true, -- Allows players to buy from NPC shops - requestModelTimeout = 5000, -- load model timeout for oxlib + requestModelTimeout = 100000, -- load model timeout for oxlib enableTestDrive = true, finance = { diff --git a/config/server.lua b/config/server.lua index 9822f82..55ac1f3 100644 --- a/config/server.lua +++ b/config/server.lua @@ -3,7 +3,7 @@ return { finance = { paymentWarning = 10, -- time in minutes that player has to make payment before repo paymentInterval = 24, -- time in hours between payment being due - preventSelling = false, -- prevents players from using /transfervehicle if financed + preventSelling = true, -- prevents players from using /transfervehicle if financed }, saleTimeout = 60000 -- Delay between attempts to sell/gift a vehicle. Prevents abuse } \ No newline at end of file From d123a45e1b3e08c33947a9c1d1ac506fe707a322 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Wed, 22 May 2024 04:16:56 -0300 Subject: [PATCH 04/11] Fix: test drive exiting vehicle/dead and financing attempt call nil value --- client/main.lua | 9 ++++++++- server/main.lua | 10 ++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 8bcc95f..48fb156 100644 --- a/client/main.lua +++ b/client/main.lua @@ -423,18 +423,23 @@ end local function startTestDriveTimer(time) local gameTimer = GetGameTimer() local timeMs = time * 1000 + local outVeh = false + while not IsPedInAnyVehicle(cache.ped, false) do Wait(0) end CreateThread(function() while inTestDrive do local currentGameTime = GetGameTimer() local secondsLeft = currentGameTime - gameTimer - if currentGameTime < gameTimer + timeMs and secondsLeft >= timeMs - 50 then + if currentGameTime < gameTimer + timeMs and secondsLeft >= timeMs - 50 or outVeh then TriggerServerEvent('qbx_vehicleshop:server:deleteVehicle', testDriveVeh) testDriveVeh = 0 inTestDrive = false exports.qbx_core:Notify(locale('general.testdrive_complete'), 'success') end qbx.drawText2d({ text = locale('general.testdrive_timer')..math.ceil(time - secondsLeft / 1000), coords = vec2(1.0, 1.38), scale = 0.5}) + if not IsPedInAnyVehicle(cache.ped, false) or IsPlayerDead(cache.playerId) then + outVeh = true + end Wait(0) end end) @@ -598,6 +603,8 @@ RegisterNetEvent('qbx_vehicleshop:client:testDrive', function(args) local plate = 'TEST'..lib.string.random('1111') local netId = lib.callback.await('qbx_vehicleshop:server:spawnVehicle', false, args.vehicle, testDrive.spawn, plate) testDriveVeh = netId + while not NetworkGetEntityFromNetworkId(netId) do Wait(100) end + exports.qbx_core:Notify(locale('general.testdrive_timenoti', testDrive.limit), 'inform') startTestDriveTimer(testDrive.limit * 60) end) diff --git a/server/main.lua b/server/main.lua index 996bc2d..575da50 100644 --- a/server/main.lua +++ b/server/main.lua @@ -96,10 +96,12 @@ lib.callback.register('qbx_vehicleshop:server:GetVehiclesByName', function(sourc local vehicles = FetchVehicleEntitiesByCitizenId(player.PlayerData.citizenid) local financeVehicles = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) for _, v in pairs(financeVehicles) do - vehicles[v.vehicleId].balance = v.balance - vehicles[v.vehicleId].paymentamount = v.paymentamount - vehicles[v.vehicleId].paymentsleft = v.paymentsleft - vehicles[v.vehicleId].financetime = v.financetime + if vehicles[v.vehicleId] then + vehicles[v.vehicleId].balance = v.balance + vehicles[v.vehicleId].paymentamount = v.paymentamount + vehicles[v.vehicleId].paymentsleft = v.paymentsleft + vehicles[v.vehicleId].financetime = v.financetime + end end if vehicles[1] then return vehicles From fe73e54a9888502aa658e6982ee7bb5a419a5aa3 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Wed, 22 May 2024 18:38:40 -0300 Subject: [PATCH 05/11] =?UTF-8?q?corre=C3=A7=C3=A3o=20de=20bug=20do=20fina?= =?UTF-8?q?nciamento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/main.lua b/server/main.lua index 575da50..ba133cd 100644 --- a/server/main.lua +++ b/server/main.lua @@ -96,11 +96,13 @@ lib.callback.register('qbx_vehicleshop:server:GetVehiclesByName', function(sourc local vehicles = FetchVehicleEntitiesByCitizenId(player.PlayerData.citizenid) local financeVehicles = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) for _, v in pairs(financeVehicles) do - if vehicles[v.vehicleId] then - vehicles[v.vehicleId].balance = v.balance - vehicles[v.vehicleId].paymentamount = v.paymentamount - vehicles[v.vehicleId].paymentsleft = v.paymentsleft - vehicles[v.vehicleId].financetime = v.financetime + for k, v2 in pairs(vehicles) do + if v.vehicleId == v2.id then + vehicles[k].balance = v.balance + vehicles[k].paymentamount = v.paymentamount + vehicles[k].paymentsleft = v.paymentsleft + vehicles[k].financetime = v.financetime + end end end if vehicles[1] then From 2804927f3367fa4f0509ea579c612a14105eaed9 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Wed, 22 May 2024 23:23:35 -0300 Subject: [PATCH 06/11] =?UTF-8?q?Update:=20tradu=C3=A7=C3=B5es=20pt-br=20e?= =?UTF-8?q?=20atualiza=C3=A7=C3=A3o=20da=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/main.lua | 29 ++++++++++++++++++++--------- locales/en.json | 1 + locales/pt-br.json | 1 + 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/client/main.lua b/client/main.lua index 48fb156..ea26193 100644 --- a/client/main.lua +++ b/client/main.lua @@ -29,13 +29,13 @@ end local function confirmationCheck() local alert = lib.alertDialog({ - header = 'Wait a minute!', - content = 'Are you sure you wish to proceed?', + header = 'Espere um minuto!', + content = 'Tem certeza de que deseja prosseguir?', centered = true, cancel = true, labels = { - cancel = 'No', - confirm = 'Yes', + cancel = 'Não', + confirm = 'Sim', } }) return alert @@ -46,9 +46,9 @@ local function showVehicleFinanceMenu(data) local vehLabel = VEHICLES[data.vehicle].brand..' '..VEHICLES[data.vehicle].name local vehFinance = { { - title = 'Finance Information', + title = locale('menus.veh_finance_title'), icon = 'circle-info', - description = string.format('Name: %s\nPlate: %s\nRemaining Balance: $%s\nRecurring Payment Amount: $%s\nPayments Left: %s', vehLabel, data.vehiclePlate, lib.math.groupdigits(data.balance), lib.math.groupdigits(data.paymentAmount), data.paymentsLeft), + description = string.format('Nome: %s\nPlaca: %s\nSaldo restante: R$%s\nValor das parcelas: R$%s\nParcelas restantes: %s', vehLabel, data.vehiclePlate, lib.math.groupdigits(data.balance), lib.math.groupdigits(data.paymentAmount), data.paymentsLeft), readOnly = true, }, { @@ -152,16 +152,19 @@ end ---@param targetShowroomVehicle integer vehicleName ---@param buyVehicle string model local function openFinance(targetShowroomVehicle, buyVehicle) - local dialog = lib.inputDialog(VEHICLES[buyVehicle].brand:upper()..' '..VEHICLES[buyVehicle].name:upper()..' - $'..getVehPrice(targetShowroomVehicle), { + local dialog = lib.inputDialog(VEHICLES[buyVehicle].brand:upper()..' '..VEHICLES[buyVehicle].name:upper()..' - R$'..getVehPrice(targetShowroomVehicle), { { type = 'number', label = locale('menus.financesubmit_downpayment')..sharedConfig.finance.minimumDown..'%', + placeholder = string.format('%.2f', math.ceil(VEHICLES[buyVehicle].price * sharedConfig.finance.minimumDown / 100)), + default = math.ceil(VEHICLES[buyVehicle].price * sharedConfig.finance.minimumDown / 100), min = VEHICLES[buyVehicle].price * sharedConfig.finance.minimumDown / 100, max = VEHICLES[buyVehicle].price }, { type = 'number', label = locale('menus.financesubmit_totalpayment')..sharedConfig.finance.maximumPayments, + default = 2, min = 2, max = sharedConfig.finance.maximumPayments } @@ -273,7 +276,7 @@ end ---@param targetVehicle integer local function openCustomFinance(targetVehicle) local vehicle = config.shops[insideShop].showroomVehicles[targetVehicle].vehicle - local dialog = lib.inputDialog(getVehBrand(targetVehicle):upper()..' '..vehicle:upper()..' - $'..getVehPrice(targetVehicle), { + local dialog = lib.inputDialog(getVehBrand(targetVehicle):upper()..' '..vehicle:upper()..' - R$'..getVehPrice(targetVehicle), { { type = 'number', label = locale('menus.financesubmit_downpayment')..sharedConfig.finance.minimumDown..'%', @@ -337,6 +340,7 @@ local function openVehicleSellMenu(targetVehicle) local swapOption = { title = locale('menus.swap_header'), description = locale('menus.swap_txt'), + icon = 'right-left', onSelect = openVehicleCategoryMenu, args = { targetVehicle = targetVehicle @@ -349,6 +353,7 @@ local function openVehicleSellMenu(targetVehicle) options[#options + 1] = { title = locale('menus.test_header'), description = locale('menus.freeuse_test_txt'), + icon = 'fas fa-car', event = 'qbx_vehicleshop:client:testDrive', args = { vehicle = vehicle @@ -360,6 +365,7 @@ local function openVehicleSellMenu(targetVehicle) options[#options + 1] = { title = locale('menus.freeuse_buy_header'), description = locale('menus.freeuse_buy_txt'), + icon = 'dollar-sign', serverEvent = 'qbx_vehicleshop:server:buyShowroomVehicle', args = { buyVehicle = vehicle @@ -371,6 +377,7 @@ local function openVehicleSellMenu(targetVehicle) options[#options + 1] = { title = locale('menus.finance_header'), description = locale('menus.freeuse_finance_txt'), + icon = 'fa-solid fa-file-invoice-dollar', onSelect = function() openFinance(targetVehicle, vehicle) end @@ -382,6 +389,7 @@ local function openVehicleSellMenu(targetVehicle) options[1] = { title = locale('menus.managed_sell_header'), description = locale('menus.managed_sell_txt'), + icon = 'fa-solid fa-hand-holding-dollar', onSelect = function() sellVehicle(vehicle) end, @@ -391,6 +399,7 @@ local function openVehicleSellMenu(targetVehicle) options[#options + 1] = { title = locale('menus.test_header'), description = locale('menus.managed_test_txt'), + icon = 'fas fa-car', onSelect = function() startTestDrive(vehicle) end @@ -401,6 +410,7 @@ local function openVehicleSellMenu(targetVehicle) options[#options + 1] = { title = locale('menus.finance_header'), description = locale('menus.managed_finance_txt'), + icon = 'fa-solid fa-file-invoice-dollar', onSelect = function() openCustomFinance(targetVehicle) end @@ -412,7 +422,8 @@ local function openVehicleSellMenu(targetVehicle) lib.registerContext({ id = 'vehicleMenu', - title = getVehBrand(targetVehicle):upper()..' '..getVehName(targetVehicle):upper()..' - $'..getVehPrice(targetVehicle), + title = getVehBrand(targetVehicle):upper()..' '..getVehName(targetVehicle):upper(), + description = '**R$'..getVehPrice(targetVehicle)..'**', options = options }) lib.showContext('vehicleMenu') diff --git a/locales/en.json b/locales/en.json index b321a96..c4ca66a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -41,6 +41,7 @@ "goback_header": "Go Back", "veh_price": "Price: $", "veh_platetxt": "Plate: ", + "veh_finance_title": "Finance Information", "veh_finance": "Vehicle Payment", "veh_finance_balance": "Total Balance Remaining", "veh_finance_currency": "$", diff --git a/locales/pt-br.json b/locales/pt-br.json index 61a744f..4e89f9e 100644 --- a/locales/pt-br.json +++ b/locales/pt-br.json @@ -40,6 +40,7 @@ "goback_header": "Voltar", "veh_price": "Preço: $", "veh_platetxt": "Placa: ", + "veh_finance_title": "Informações de Financiamento", "veh_finance": "Pagamento do Veículo", "veh_finance_balance": "Saldo Total Restante", "veh_finance_currency": "$", From fccbaec782e2c2121068a35e231ffdf38a7a6e5c Mon Sep 17 00:00:00 2001 From: Gabriel Filipe Guimaraes de Freitas Date: Wed, 22 May 2024 23:36:40 -0300 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20otimiza=C3=A7=C3=A3o=20da=20lista?= =?UTF-8?q?gem=20dos=20ve=C3=ADculos=20financiados?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.lua | 20 ++++---------------- server/storage.lua | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/server/main.lua b/server/main.lua index ba133cd..1385a78 100644 --- a/server/main.lua +++ b/server/main.lua @@ -93,20 +93,9 @@ lib.callback.register('qbx_vehicleshop:server:GetVehiclesByName', function(sourc local src = source local player = exports.qbx_core:GetPlayer(src) if not player then return end - local vehicles = FetchVehicleEntitiesByCitizenId(player.PlayerData.citizenid) local financeVehicles = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) - for _, v in pairs(financeVehicles) do - for k, v2 in pairs(vehicles) do - if v.vehicleId == v2.id then - vehicles[k].balance = v.balance - vehicles[k].paymentamount = v.paymentamount - vehicles[k].paymentsleft = v.paymentsleft - vehicles[k].financetime = v.financetime - end - end - end - if vehicles[1] then - return vehicles + if #financeVehicles > 0 then + return financeVehicles end end) @@ -416,12 +405,11 @@ end) RegisterNetEvent('qbx_vehicleshop:server:checkFinance', function() local src = source local player = exports.qbx_core:GetPlayer(src) - local result = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) - if not result[1] then return end + local vehicles = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) + if not vehicles[1] then return end exports.qbx_core:Notify(src, locale('general.paymentduein', config.finance.paymentWarning)) Wait(config.finance.paymentWarning * 60000) - local vehicles = FetchFinancedVehicleEntitiesByCitizenId(player.PlayerData.citizenid) for _, v in pairs(vehicles) do local plate = v.plate DeleteVehicleEntity(v.id) diff --git a/server/storage.lua b/server/storage.lua index cb108d8..21dfed0 100644 --- a/server/storage.lua +++ b/server/storage.lua @@ -93,7 +93,7 @@ end ---@param citizenId string ---@return VehicleFinancingEntity function FetchFinancedVehicleEntitiesByCitizenId(citizenId) - return MySQL.query.await('SELECT vehicle_financing.* FROM vehicle_financing INNER JOIN player_vehicles ON player_vehicles.citizenid = ? WHERE vehicle_financing.vehicleId = player_vehicles.id AND vehicle_financing.balance > 0 AND vehicle_financing.financetime > 1', {citizenId}) + return MySQL.query.await('SELECT player_vehicles.vehicle, player_vehicles.plate, vehicle_financing.* FROM player_vehicles LEFT JOIN vehicle_financing ON player_vehicles.id = vehicle_financing.vehicleId WHERE citizenid = ?', {citizenId}) end ---@param license string From 619111c49ae17126454daf17795ab3d33408d701 Mon Sep 17 00:00:00 2001 From: gvs006 <40977112+gvs006@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:19:11 -0300 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20statebag=20para=20verifica=C3=A7?= =?UTF-8?q?=C3=A3o=20se=20a=20entidade=20=C3=A9=20um=20veiculo=20da=20conc?= =?UTF-8?q?ession=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index ea26193..46cd78d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -532,6 +532,7 @@ local function createShowroomVehicle(model, coords) SetVehicleDoorsLocked(veh, 3) FreezeEntityPosition(veh, true) SetVehicleNumberPlateText(veh, 'BUY ME') + Entity(veh).state.isVehicleShopEntity = true; return veh end @@ -615,7 +616,6 @@ RegisterNetEvent('qbx_vehicleshop:client:testDrive', function(args) local netId = lib.callback.await('qbx_vehicleshop:server:spawnVehicle', false, args.vehicle, testDrive.spawn, plate) testDriveVeh = netId while not NetworkGetEntityFromNetworkId(netId) do Wait(100) end - exports.qbx_core:Notify(locale('general.testdrive_timenoti', testDrive.limit), 'inform') startTestDriveTimer(testDrive.limit * 60) end) From 18b96b04c373534a7aa1a190771d430906bd9879 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:13:51 -0300 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20adicionado=20para=20dar=20chaves?= =?UTF-8?q?=20ao=20comprar=20ve=C3=ADculo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 1385a78..4cc0683 100644 --- a/server/main.lua +++ b/server/main.lua @@ -107,7 +107,8 @@ lib.callback.register('qbx_vehicleshop:server:spawnVehicle', function(source, mo if vehicleId then Entity(veh).state:set('vehicleid', vehicleId, false) end SetVehicleNumberPlateText(veh, plate) - TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate) + --- @old TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate) + exports.mri_Qcarkeys:GiveKeyItem(source, plate) return netId end) From 2740814052ce173f14414b0fdf251906a591aa2e Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:55:38 -0300 Subject: [PATCH 10/11] fix: bug do teste drive --- client/main.lua | 1 + server/main.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 46cd78d..4747c31 100644 --- a/client/main.lua +++ b/client/main.lua @@ -657,6 +657,7 @@ RegisterNetEvent('qbx_vehicleshop:client:buyShowroomVehicle', function(vehicle, local props = lib.getVehicleProperties(veh) props.plate = plate TriggerServerEvent('qb-vehicletuning:server:SaveVehicleProps', props) + exports.mri_Qcarkeys:GiveKeyItem(plate) end) local function confirmTrade(confirmationText) diff --git a/server/main.lua b/server/main.lua index 4cc0683..1385a78 100644 --- a/server/main.lua +++ b/server/main.lua @@ -107,8 +107,7 @@ lib.callback.register('qbx_vehicleshop:server:spawnVehicle', function(source, mo if vehicleId then Entity(veh).state:set('vehicleid', vehicleId, false) end SetVehicleNumberPlateText(veh, plate) - --- @old TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate) - exports.mri_Qcarkeys:GiveKeyItem(source, plate) + TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate) return netId end) From e5a801399013da149f6f53c9266d06145ef521e5 Mon Sep 17 00:00:00 2001 From: kaJseia <89431075+mur4i@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:06:34 -0300 Subject: [PATCH 11/11] fix: coords de test drive --- config/client.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/client.lua b/config/client.lua index 839bf3a..a515783 100644 --- a/config/client.lua +++ b/config/client.lua @@ -92,7 +92,7 @@ return { }, testDrive = { limit = 5.0, - spawn = vec4(-7.84, -1081.35, 26.67, 121.83), + spawn = vec4(-12.89, -1089.17, 26.4, 158.47), }, returnLocation = vec3(-44.74, -1082.58, 26.68), vehicleSpawn = vec4(-31.69, -1090.78, 26.42, 328.79),