From 8e76143a7b7e749df221c88088fa127facf29a1b Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 20 Nov 2018 11:48:53 +0100 Subject: [PATCH] Removed PV command, closes #97, closes #90, closes # --- client/main.lua | 54 ------------------------------------------------- config.lua | 1 - locales/br.lua | 1 - locales/en.lua | 2 -- locales/fi.lua | 2 -- locales/fr.lua | 2 -- locales/pl.lua | 2 -- locales/sv.lua | 2 -- server/main.lua | 23 --------------------- 9 files changed, 89 deletions(-) diff --git a/client/main.lua b/client/main.lua index 6b0047d4..f18c6523 100644 --- a/client/main.lua +++ b/client/main.lua @@ -574,55 +574,6 @@ function OpenResellerMenu() end -function OpenPersonnalVehicleMenu() - ESX.UI.Menu.CloseAll() - - ESX.TriggerServerCallback('esx_vehicleshop:getPersonnalVehicles', function (vehicles) - local elements = {} - - for i=1, #vehicles, 1 do - for j=1, #Vehicles, 1 do - if vehicles[i].model == GetHashKey(Vehicles[j].model) then - vehicles[i].name = Vehicles[j].name - break - end - end - end - - for i=1, #vehicles, 1 do - table.insert(elements, { - label = vehicles[i].name .. ' [' .. vehicles[i].plate .. ']', - value = vehicles[i] - }) - end - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'personnal_vehicle', - { - title = _U('personal_vehicle'), - align = 'top-left', - elements = elements, - }, function (data, menu) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local heading = GetEntityHeading(playerPed) - local vehicleData = data.current.value - - menu.close() - - ESX.Game.SpawnVehicle(vehicleData.model, { - x = coords.x, - y = coords.y, - z = coords.z - }, heading, function (vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleData) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - end, function (data, menu) - menu.close() - end) - end) -end - function OpenPopVehicleMenu() ESX.TriggerServerCallback('esx_vehicleshop:getCommercialVehicles', function (vehicles) local elements = {} @@ -815,11 +766,6 @@ AddEventHandler('esx:setJob', function (job) end end) -RegisterNetEvent('esx_vehicleshop:openPersonnalVehicleMenu') -AddEventHandler('esx_vehicleshop:openPersonnalVehicleMenu', function () - OpenPersonnalVehicleMenu() -end) - AddEventHandler('esx_vehicleshop:hasEnteredMarker', function (zone) if zone == 'ShopEntering' then diff --git a/config.lua b/config.lua index cacff508..855c7922 100644 --- a/config.lua +++ b/config.lua @@ -2,7 +2,6 @@ Config = {} Config.DrawDistance = 100.0 Config.MarkerColor = { r = 120, g = 120, b = 240 } Config.EnablePlayerManagement = false -- enables the actual car dealer job. You'll need esx_addonaccount, esx_billing and esx_society -Config.EnablePvCommand = true Config.EnableOwnedVehicles = true Config.EnableSocietyOwnedVehicles = false -- use with EnablePlayerManagement disabled, or else it wont have any effects Config.ResellPercentage = 50 diff --git a/locales/br.lua b/locales/br.lua index 2320d5fe..abf891e4 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -20,7 +20,6 @@ Locales['br'] = { ['not_rental'] = 'isso não é um ~r~veículo de aluguel~s~', ['not_yours'] = 'este veículo não pertence a você', ['paid_rental'] = 'Você tem ~g~pago~s~ para o seu aluguel de veiculos: ~g~$%s~s~', - ['personal_vehicle'] = 'veículo pessoal', ['pop_vehicle'] = 'sai do veiculo', ['rent_vehicle'] = 'Concessionária - Veículos para alugar', ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', diff --git a/locales/en.lua b/locales/en.lua index bbb029c0..a3026876 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -18,7 +18,6 @@ Locales['en'] = { ['get_rented_vehicles'] = 'vehicles for rent', ['invalid_amount'] = 'invalid amount', ['invoice_amount'] = 'invoice amount', - ['leaving'] = 'leaving a personal vehicle', ['no'] = 'no', ['yes'] = 'yes', ['no_players'] = 'no players nearby', @@ -26,7 +25,6 @@ Locales['en'] = { ['not_rental'] = 'this is not a ~r~rental vehicle~s~', ['not_yours'] = 'this vehicle does not belong to you', ['paid_rental'] = 'you have ~g~payed~s~ for your vehicle rental: ~g~$%s~s~', - ['personal_vehicle'] = 'personal vehicle', ['pop_vehicle'] = 'put out vehicle for sale', ['rent_vehicle'] = 'car Dealer - Vehicles for rent', ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', diff --git a/locales/fi.lua b/locales/fi.lua index 8eb7ada1..c80c7ef8 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -18,7 +18,6 @@ Locales['fi'] = { ['get_rented_vehicles'] = 'vuokrattavat ajoneuvot', ['invalid_amount'] = 'virheellinen summa', ['invoice_amount'] = 'laskun summa', - ['leaving'] = 'jätetään henkilökohtainen ajoneuvo', ['no'] = 'ei', ['yes'] = 'kyllä', ['no_players'] = 'ei pelaajia lähettyvillä', @@ -26,7 +25,6 @@ Locales['fi'] = { ['not_rental'] = 'tämä ei ole ~r~vuokra ajoneuvo~s~', ['not_yours'] = 'tämä ajoneuvo ei kuulu sinulle', ['paid_rental'] = 'sinä ~g~maksoit~s~ ajoneuvon vuokraamisesta: ~g~$%s~s~', - ['personal_vehicle'] = 'henkilökohtainen ajoneuvo', ['pop_vehicle'] = 'ota ajoneuvo ulos näkyville myyntiä varten', ['rent_vehicle'] = 'autokauppa - Vuokrattavat ajokit', ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', diff --git a/locales/fr.lua b/locales/fr.lua index ec580cd7..24dddeaf 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -16,7 +16,6 @@ Locales['fr'] = { ['get_rented_vehicles'] = 'Véhicules en location', ['invalid_amount'] = 'Montant invalide', ['invoice_amount'] = 'Montant de la facture', - ['leaving'] = 'Sortir un véhicule personnel', ['no'] = 'Non', ['yes'] = 'Oui', ['no_players'] = 'Aucun joueur à proximité', @@ -24,7 +23,6 @@ Locales['fr'] = { ['not_rental'] = 'Ce n\'est pas un ~r~véhicule de location~s~', ['not_yours'] = 'Ce véhicule ne vous appartient pas', ['paid_rental'] = 'Vous avez ~g~payé~s~ votre location de véhicule: ~g~$%s~s~', - ['personal_vehicle'] = 'Véhicule personnel', ['pop_vehicle'] = 'Sortir véhicule', ['rent_vehicle'] = 'Concessionnaire - Véhicules en location', ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', diff --git a/locales/pl.lua b/locales/pl.lua index 09ac063a..b983687c 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -17,7 +17,6 @@ Locales['pl'] = { ['get_rented_vehicles'] = 'pojazdy do wynajęcia', ['invalid_amount'] = 'nieprawidłowa ilość', ['invoice_amount'] = 'suma faktury', - ['leaving'] = 'zostawiasz swój prywatny samochód', ['no'] = 'nie', ['yes'] = 'tak', ['no_players'] = 'brak graczy w pobliżu', @@ -25,7 +24,6 @@ Locales['pl'] = { ['not_rental'] = 'to nie jest ~r~wypożyczone auto~s~', ['not_yours'] = 'ten pojazd nie należy do ciebie', ['paid_rental'] = '~g~Płacisz~s~ za wynajęcie auta: ~g~$%s~s~', - ['personal_vehicle'] = 'prywatne auto', ['pop_vehicle'] = 'wyciągnij auto do sprzedaży', ['rent_vehicle'] = 'salon samochodowy - Pojazdy do wynajęcia', ['rental_amount'] = 'suma wynajęcia', diff --git a/locales/sv.lua b/locales/sv.lua index 377bf281..983660c7 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -18,7 +18,6 @@ Locales['sv'] = { ['get_rented_vehicles'] = 'uthyrda fordon', ['invalid_amount'] = 'ogiltigt belopp', ['invoice_amount'] = 'belopp att betala', - ['leaving'] = 'lämnar ditt fordon', ['no'] = 'nej', ['yes'] = 'ja', ['no_players'] = 'det finns ingen i närheten', @@ -26,7 +25,6 @@ Locales['sv'] = { ['not_rental'] = 'detta är inte ett ~r~uthyrt fordon~s~', ['not_yours'] = 'det här fordonet tillhör inte dig', ['paid_rental'] = 'du har ~y~betalat~s~ ditt hyrda fordon: ~g~%s SEK~s~', - ['personal_vehicle'] = 'privat fordon', ['pop_vehicle'] = 'ställ ut fordon till salu', ['rent_vehicle'] = 'bilförsäljare - fordon för uthyrning', ['return_provider_menu'] = 'bilförsäljare - sälj tillbaka fordon till leverantör', diff --git a/server/main.lua b/server/main.lua index 18473003..6371b624 100644 --- a/server/main.lua +++ b/server/main.lua @@ -224,23 +224,6 @@ ESX.RegisterServerCallback('esx_vehicleshop:buyVehicleSociety', function (source end) end) -ESX.RegisterServerCallback('esx_vehicleshop:getPersonnalVehicles', function (source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @owner', { - ['@owner'] = xPlayer.identifier - }, function (result) - local vehicles = {} - - for i=1, #result, 1 do - local vehicleData = json.decode(result[i].vehicle) - table.insert(vehicles, vehicleData) - end - - cb(vehicles) - end) -end) - ESX.RegisterServerCallback('esx_vehicleshop:getCommercialVehicles', function (source, cb) MySQL.Async.fetchAll('SELECT * FROM cardealer_vehicles ORDER BY vehicle ASC', {}, function (result) local vehicles = {} @@ -399,12 +382,6 @@ ESX.RegisterServerCallback('esx_vehicleshop:isPlateTaken', function (source, cb, end) end) -if Config.EnablePvCommand then - TriggerEvent('es:addGroupCommand', 'pv', 'user', function(source, args, user) - TriggerClientEvent('esx_vehicleshop:openPersonnalVehicleMenu', source) - end, {help = _U('leaving')}) -end - function PayRent(d, h, m) MySQL.Async.fetchAll('SELECT * FROM rented_vehicles', {}, function (result) for i=1, #result, 1 do