mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
@@ -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 .. ' [<span style="color: orange;">' .. vehicles[i].plate .. '</span>]',
|
||||
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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user