diff --git a/server-data/resources/[esx_addons]/esx_vehicleshop/client/main.lua b/server-data/resources/[esx_addons]/esx_vehicleshop/client/main.lua index ed7e2f188..0265cdaf3 100644 --- a/server-data/resources/[esx_addons]/esx_vehicleshop/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_vehicleshop/client/main.lua @@ -59,7 +59,7 @@ local function Init() RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) local specialContact = { - name = _U('dealership'), + name = TranslateCap('dealership'), number = 'cardealer', base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAADMzMzszM0M0M0w0M1Q1M101M2U2M242M3Y3M383Moc4MpA4Mpg5MqE5Mqk6MrI6Mro7Mrw8Mr89M71DML5EO8I+NMU/NcBMLshANctBNs5CN8RULMddKsheKs9YLtBCONZEOdlFOtxGO99HPNhMNsplKM1nKM1uJtRhLddiLt5kMNJwJ9B2JNR/IeNIPeVJPehKPuRQOuhSO+lZOOlhNuloM+p3Lep/KupwMMFORsVYUcplXc1waNJ7delUSepgVexrYe12bdeHH9iIH9qQHd2YG+udH+OEJeuGJ+uOJeuVIuChGeSpF+aqGOykHOysGeeyFeuzFuyzFuq6E+27FO+Cee3CEdaGgdqTjvCNhfKYkvOkngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJezdycAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAQGElEQVR4Xt2d+WMUtxXHbS6bEGMPMcQQ04aEUnqYo9xJWvC6kAKmQLM2rdn//9+g0uir2Tl0PElPszP7+cnH7Fj6rPTeG2lmvfKld2azk8lk/36L/cnkZDbDIT3Sp4DZ8QS9dTI57tNDTwJOOu+4j/0TvDQz+QXMSG+7mUn+sZBZQELnNROcKhMZBXx+gS4k8+IzTpmBXAJOnqPxTDzPFRKyCODuvSKPgwwC2EZ+lxf4E4xwCzhBU7PBPQx4BWR88+fwDgNGAbMsM9/Ec8bygE3A5966L3nOlhiZBGSf+l2YggGLgBna1DMsE4FBQH9zvw1HLEgX0Evkt5GeEVIFMFztpJF6rZQm4DNasVDSEkKSgIVN/ibP0ZwoEgQsfPTPSZgH8QIG8vYr4gdBrIABvf2K2EEQKWBQb78ichBECRhE8O8SlQ5iBAQvcffFPhoYQoSAAQ5/TcQ0CBYw0OGvCZ4GoQIGF/3bhGaDQAELvfKhERgIwgQMePrPCQsEQQ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6+AqA3TNgsLBM2NUBN+ASwGbn6DFvWLv/8UASwG7n2LNvUJof8kAQzlgOA7tKo/nAWQhiSAx8CNngOBuwDS0ATwGOg3END6TxXAEgd6DQSU+S+hCuAx0F8goPafLoDJQE+BgNz/AAEsNWFPgcBb/80JEMBxXSDoIRCguSSCBDBcHUsyBwLP9W+LMAE86TBvICCmP02ggPRVspKMgYBU/tUIFZC+UlqSLRC41j+NBAsYdCAIm/4lEQKGGwgCp39JjACmacAeCIKHvyRKANM04A0EEcNfEimAKRswBoK/o2GhxApgGgRcgSDy7RfEC+AZBDyBIDT510gQwDMIGAJB/NsvSBLAkw5SA0FU8K9IE8AzD5ICQcLoL0kVEP2ERR3zZzRR6Dz/EEy6gC+z9FBwL24D9XLAwocNBgEsa0URj11xdJ9JAMeCYfBjV/RlPydMAkRCSJ0IQYGA592XsAlIjwX0QMDXfVYBgsSMQAsE6ZG/Dq+A1GBACARMU7+CW4AgZRh4AgHvm1+SQYAYBvHRwBEILnO/+SVZBAjiHZgDQZ7eC3IJEHyOnAvdQPBT2vWOk4wCJFHXSs1AkHq14yGzAMEsXEIVCH5hTPgW8gsoOQlcSr9W/Jxr0rfoSUDJ7Jg0GCbHM7ygD/oUAGazk8mkMyL2J5OTWZ89L/ny5f+yiDXCPYKoAQAAAABJRU5ErkJggg==', } @@ -78,7 +78,7 @@ local function Init() SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName('STRING') - AddTextComponentSubstringPlayerName(_U('car_dealer')) + AddTextComponentSubstringPlayerName(TranslateCap('car_dealer')) EndTextCommandSetBlipName(blip) end) end @@ -144,7 +144,7 @@ local function ReturnVehicleProvider() { unselectable = true, icon = "fas fa-car", - title = _U('car_dealer'), + title = TranslateCap('car_dealer'), }, } @@ -153,7 +153,7 @@ local function ReturnVehicleProvider() local vehicleLabel = getVehicleFromModel(v.vehicle).label TableInsert(elements, { - title = ('%s [%s]'):format(vehicleLabel, _U('generic_shopitem', ESX.Math.GroupDigits(returnPrice))), + title = ('%s [%s]'):format(vehicleLabel, TranslateCap('generic_shopitem', ESX.Math.GroupDigits(returnPrice))), name = v.vehicle }) end @@ -184,7 +184,7 @@ local function WaitForVehicleToLoad(modelHash) RequestModel(modelHash) BeginTextCommandBusyspinnerOn('STRING') - AddTextComponentSubstringPlayerName(_U('shop_awaiting_model')) + AddTextComponentSubstringPlayerName(TranslateCap('shop_awaiting_model')) EndTextCommandBusyspinnerOn(4) while not HasModelLoaded(modelHash) do @@ -229,7 +229,7 @@ local function OpenShopMenu() firstVehicleData = vehicle end - TableInsert(options, ('%s %s'):format(vehicle.name, _U('generic_shopitem', ESX.Math.GroupDigits(vehicle.price)))) + TableInsert(options, ('%s %s'):format(vehicle.name, TranslateCap('generic_shopitem', ESX.Math.GroupDigits(vehicle.price)))) end table.sort(options) @@ -245,18 +245,18 @@ local function OpenShopMenu() end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { - title = _U('car_dealer'), + title = TranslateCap('car_dealer'), align = 'top-left', elements = elements }, function(data, menu) local vehicleData = vehiclesByCategory[data.current.name][data.current.value + 1] ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', { - title = _U('buy_vehicle_shop', vehicleData.name, ESX.Math.GroupDigits(vehicleData.price)), + title = TranslateCap('buy_vehicle_shop', vehicleData.name, ESX.Math.GroupDigits(vehicleData.price)), align = 'top-left', elements = { - {label = _U('no'), value = 'no'}, - {label = _U('yes'), value = 'yes'} + {label = TranslateCap('no'), value = 'no'}, + {label = TranslateCap('yes'), value = 'yes'} }}, function(data2, menu2) if data2.current.value == 'yes' then if Config.EnablePlayerManagement then @@ -266,7 +266,7 @@ local function OpenShopMenu() DeleteDisplayVehicleInsideShop() CurrentAction = 'shop_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} local playerPed = ESX.PlayerData.ped @@ -276,9 +276,9 @@ local function OpenShopMenu() menu2.close() menu.close() - ESX.ShowNotification(_U('vehicle_purchased')) + ESX.ShowNotification(TranslateCap('vehicle_purchased')) else - ESX.ShowNotification(_U('broke_company')) + ESX.ShowNotification(TranslateCap('broke_company')) end end, vehicleData.model) else @@ -293,7 +293,7 @@ local function OpenShopMenu() FreezeEntityPosition(playerPed, false) SetEntityVisible(playerPed, true) else - ESX.ShowNotification(_U('not_enough_money')) + ESX.ShowNotification(TranslateCap('not_enough_money')) end end, vehicleData.model, generatedPlate) end @@ -309,7 +309,7 @@ local function OpenShopMenu() local playerPed = ESX.PlayerData.ped CurrentAction = 'shop_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} FreezeEntityPosition(playerPed, false) @@ -348,17 +348,17 @@ function OpenResellerMenu() ESX.CloseContext() local elements = { - {unselectable = true, icon = 'fas fa-car', title = _U('car_dealer')}, - {title = _U('buy_vehicle'), name = 'buy_vehicle'}, - {title = _U('pop_vehicle'), name = 'pop_vehicle'}, - {title = _U('depop_vehicle'), name = 'depop_vehicle'}, - {title = _U('return_provider'), name = 'return_provider'}, - {title = _U('create_bill'), name = 'create_bill'}, - {title = _U('get_rented_vehicles'), name = 'get_rented_vehicles'}, - {title = _U('set_vehicle_owner_sell'), name = 'set_vehicle_owner_sell'}, - {title = _U('set_vehicle_owner_rent'), name = 'set_vehicle_owner_rent'}, - {title = _U('deposit_stock'), name = 'put_stock'}, - {title = _U('take_stock'), name = 'get_stock'}, + {unselectable = true, icon = 'fas fa-car', title = TranslateCap('car_dealer')}, + {title = TranslateCap('buy_vehicle'), name = 'buy_vehicle'}, + {title = TranslateCap('pop_vehicle'), name = 'pop_vehicle'}, + {title = TranslateCap('depop_vehicle'), name = 'depop_vehicle'}, + {title = TranslateCap('return_provider'), name = 'return_provider'}, + {title = TranslateCap('create_bill'), name = 'create_bill'}, + {title = TranslateCap('get_rented_vehicles'), name = 'get_rented_vehicles'}, + {title = TranslateCap('set_vehicle_owner_sell'), name = 'set_vehicle_owner_sell'}, + {title = TranslateCap('set_vehicle_owner_rent'), name = 'set_vehicle_owner_rent'}, + {title = TranslateCap('deposit_stock'), name = 'put_stock'}, + {title = TranslateCap('take_stock'), name = 'get_stock'}, } ESX.OpenContext('right', elements, function(menu, element) @@ -378,7 +378,7 @@ function OpenResellerMenu() if currentDisplayVehicle then DeleteDisplayVehicleInsideShop() else - ESX.ShowNotification(_U('no_current_vehicle')) + ESX.ShowNotification(TranslateCap('no_current_vehicle')) end elseif action == 'return_provider' then ReturnVehicleProvider() @@ -386,22 +386,22 @@ function OpenResellerMenu() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if closestPlayer ~= -1 and closestDistance < 3 then ESX.CloseContext() - ESX.OpenContext('right', {{title = _U('invoice_amount'), input = true, inputType = 'number', inputValue = 0, inputMin = 0, name = 'invoice_amount'}}, function(menu2, element2) + ESX.OpenContext('right', {{title = TranslateCap('invoice_amount'), input = true, inputType = 'number', inputValue = 0, inputMin = 0, name = 'invoice_amount'}}, function(menu2, element2) if element2.name == 'invoice_amount' then local amount = tonumber(element2.inputValue) if amount ~= nil then ESX.CloseContext() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players')) + ESX.ShowNotification(TranslateCap('no_players')) else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_cardealer', _U('car_dealer'), amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_cardealer', TranslateCap('car_dealer'), amount) end end end end, function(menu) end) else - ESX.ShowNotification(_U('no_players')) + ESX.ShowNotification(TranslateCap('no_players')) end elseif action == 'get_rented_vehicles' then OpenRentedVehiclesMenu() @@ -417,10 +417,10 @@ function OpenResellerMenu() TriggerServerEvent('esx_vehicleshop:setVehicleOwnedPlayerId', GetPlayerServerId(closestPlayer), vehicleProps, CurrentVehicleData.model, CurrentVehicleData.name) currentDisplayVehicle = nil else - ESX.ShowNotification(_U('no_players')) + ESX.ShowNotification(TranslateCap('no_players')) end else - ESX.ShowNotification(_U('no_current_vehicle')) + ESX.ShowNotification(TranslateCap('no_current_vehicle')) end elseif action == 'set_vehicle_owner_rent' then if currentDisplayVehicle then @@ -428,12 +428,12 @@ function OpenResellerMenu() if closestPlayer ~= -1 and closestDistance < 3 then ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'set_vehicle_owner_rent_amount', { - title = _U('rental_amount') + title = TranslateCap('rental_amount') }, function(data2, menu2) local amount = tonumber(data2.value) if not amount then - ESX.ShowNotification(_U('invalid_amount')) + ESX.ShowNotification(TranslateCap('invalid_amount')) else menu2.close() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() @@ -445,22 +445,22 @@ function OpenResellerMenu() TriggerServerEvent('esx_vehicleshop:rentVehicle', model, newPlate, amount, GetPlayerServerId(closestPlayer)) currentDisplayVehicle = nil else - ESX.ShowNotification(_U('no_players')) + ESX.ShowNotification(TranslateCap('no_players')) end end end, function(data2, menu2) menu2.close() end) else - ESX.ShowNotification(_U('no_players')) + ESX.ShowNotification(TranslateCap('no_players')) end else - ESX.ShowNotification(_U('no_current_vehicle')) + ESX.ShowNotification(TranslateCap('no_current_vehicle')) end end end, function(menu) CurrentAction = 'reseller_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} end) end @@ -472,13 +472,13 @@ function OpenPopVehicleMenu() local vehicleLabel = getVehicleFromModel(v.vehicle).label TableInsert(elements, { - label = ('%s [%s]'):format(vehicleLabel, _U('generic_shopitem', ESX.Math.GroupDigits(v.price))), + label = ('%s [%s]'):format(vehicleLabel, TranslateCap('generic_shopitem', ESX.Math.GroupDigits(v.price))), value = v.vehicle }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'commercial_vehicles', { - title = _U('vehicle_dealer'), + title = TranslateCap('vehicle_dealer'), align = 'top-left', elements = elements }, function(data, menu) @@ -513,7 +513,7 @@ function OpenRentedVehiclesMenu() end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'rented_vehicles', { - title = _U('rent_vehicle'), + title = TranslateCap('rent_vehicle'), align = 'top-left', elements = elements }, nil, function(data, menu) @@ -525,11 +525,11 @@ local function OpenBossActionsMenu() ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'reseller',{ - title = _U('dealer_boss'), + title = TranslateCap('dealer_boss'), align = 'top-left', elements = { - {label = _U('boss_actions'), value = 'boss_actions'}, - {label = _U('boss_sold'), value = 'sold_vehicles'} + {label = TranslateCap('boss_actions'), value = 'boss_actions'}, + {label = TranslateCap('boss_sold'), value = 'sold_vehicles'} }}, function(data, menu) if data.current.value == 'boss_actions' then TriggerEvent('esx_society:openBossMenu', 'cardealer', function(data2, menu2) @@ -538,7 +538,7 @@ local function OpenBossActionsMenu() elseif data.current.value == 'sold_vehicles' then local elements = { - head = { _U('customer_client'), _U('customer_model'), _U('customer_plate'), _U('customer_soldby'), _U('customer_date') }, + head = { TranslateCap('customer_client'), TranslateCap('customer_model'), TranslateCap('customer_plate'), TranslateCap('customer_soldby'), TranslateCap('customer_date') }, rows = {} } @@ -566,7 +566,7 @@ local function OpenBossActionsMenu() menu.close() CurrentAction = 'boss_actions_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} end) end @@ -585,19 +585,19 @@ function OpenGetStocksMenu() end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { - title = _U('dealership_stock'), + title = TranslateCap('dealership_stock'), align = 'top-left', elements = elements }, function(data, menu) local itemName = data.current.value ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { - title = _U('amount') + title = TranslateCap('amount') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) + ESX.ShowNotification(TranslateCap('quantity_invalid')) else TriggerServerEvent('esx_vehicleshop:getStockItem', itemName, count) menu2.close() @@ -630,19 +630,19 @@ function OpenPutStocksMenu() end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { - title = _U('inventory'), + title = TranslateCap('inventory'), align = 'top-left', elements = elements }, function(data, menu) local itemName = data.current.value ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { - title = _U('amount') + title = TranslateCap('amount') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) + ESX.ShowNotification(TranslateCap('quantity_invalid')) else TriggerServerEvent('esx_vehicleshop:putStockItems', itemName, count) menu2.close() @@ -662,12 +662,12 @@ local function hasEnteredMarker(zone) if zone == 'ShopEntering' then if not Config.EnablePlayerManagement then CurrentAction = 'shop_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} end if LocalPlayer.state.job ~= nil and LocalPlayer.state.job.name == 'cardealer' then CurrentAction = 'reseller_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} end elseif zone == 'GiveBackVehicle' and Config.EnablePlayerManagement then @@ -677,7 +677,7 @@ local function hasEnteredMarker(zone) local vehicle = GetVehiclePedIsIn(playerPed, false) CurrentAction = 'give_back_vehicle' - CurrentActionMsg = _U('vehicle_menu') + CurrentActionMsg = TranslateCap('vehicle_menu') CurrentActionData = {vehicle = vehicle} end elseif zone == 'ResellVehicle' then @@ -701,7 +701,7 @@ local function hasEnteredMarker(zone) plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) CurrentAction = 'resell_vehicle' - CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice)) + CurrentActionMsg = TranslateCap('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice)) CurrentActionData = { vehicle = vehicle, @@ -711,14 +711,14 @@ local function hasEnteredMarker(zone) plate = plate } else - ESX.ShowNotification(_U('invalid_vehicle')) + ESX.ShowNotification(TranslateCap('invalid_vehicle')) end end end elseif zone == 'BossActions' and Config.EnablePlayerManagement and LocalPlayer.state.job ~= nil and LocalPlayer.state.job.name == 'cardealer' and LocalPlayer.state.job.grade_name == 'boss' then CurrentAction = 'boss_actions_menu' - CurrentActionMsg = _U('shop_menu') + CurrentActionMsg = TranslateCap('shop_menu') CurrentActionData = {} end end @@ -804,7 +804,7 @@ CreateThread(function() if hasDriversLicense then OpenShopMenu() else - ESX.ShowNotification(_U('license_missing')) + ESX.ShowNotification(TranslateCap('license_missing')) end end, GetPlayerServerId(PlayerId()), 'drive') else @@ -816,18 +816,18 @@ CreateThread(function() ESX.TriggerServerCallback('esx_vehicleshop:giveBackVehicle', function(isRentedVehicle) if isRentedVehicle then ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - ESX.ShowNotification(_U('delivered')) + ESX.ShowNotification(TranslateCap('delivered')) else - ESX.ShowNotification(_U('not_rental')) + ESX.ShowNotification(TranslateCap('not_rental')) end end, ESX.Math.Trim(GetVehicleNumberPlateText(CurrentActionData.vehicle))) elseif CurrentAction == 'resell_vehicle' then ESX.TriggerServerCallback('esx_vehicleshop:resellVehicle', function(vehicleSold) if vehicleSold then ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - ESX.ShowNotification(_U('vehicle_sold_for', CurrentActionData.label, ESX.Math.GroupDigits(CurrentActionData.price))) + ESX.ShowNotification(TranslateCap('vehicle_sold_for', CurrentActionData.label, ESX.Math.GroupDigits(CurrentActionData.price))) else - ESX.ShowNotification(_U('not_yours')) + ESX.ShowNotification(TranslateCap('not_yours')) end end, CurrentActionData.plate, CurrentActionData.model) elseif CurrentAction == 'boss_actions_menu' then diff --git a/server-data/resources/[esx_addons]/esx_vehicleshop/server/main.lua b/server-data/resources/[esx_addons]/esx_vehicleshop/server/main.lua index 791fffae1..fbb960198 100644 --- a/server-data/resources/[esx_addons]/esx_vehicleshop/server/main.lua +++ b/server-data/resources/[esx_addons]/esx_vehicleshop/server/main.lua @@ -62,7 +62,7 @@ local function getRentedVehicles() end CreateThread(function() - TriggerEvent('esx_society:registerSociety', 'cardealer', _U('car_dealer'), 'society_cardealer', 'society_cardealer', 'society_cardealer', {type = 'private'}) + TriggerEvent('esx_society:registerSociety', 'cardealer', TranslateCap('car_dealer'), 'society_cardealer', 'society_cardealer', 'society_cardealer', {type = 'private'}) getCategories() getVehicles() @@ -109,8 +109,8 @@ AddEventHandler('esx_vehicleshop:setVehicleOwnedPlayerId', function(playerId, ve end 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)) + xPlayer.showNotification(TranslateCap('vehicle_set_owned', vehicleProps.plate, xTarget.getName())) + xTarget.showNotification(TranslateCap('vehicle_belongs', vehicleProps.plate)) end) local sqlIns = MySQL.insert.await('INSERT INTO vehicle_sold (client, model, plate, soldby, date) VALUES (?, ?, ?, ?, ?)', {xTarget.getName(), label, vehicleProps.plate, xPlayer.getName(), os.date('%Y-%m-%d %H:%M')}) @@ -147,7 +147,7 @@ AddEventHandler('esx_vehicleshop:rentVehicle', function(vehicle, plate, rentPric 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() - xPlayer.showNotification(_U('vehicle_set_rented', plate, xTarget.getName())) + xPlayer.showNotification(TranslateCap('vehicle_set_rented', plate, xTarget.getName())) end) end) @@ -162,13 +162,13 @@ AddEventHandler('esx_vehicleshop:getStockItem', function(itemName, count) if count > 0 and item.count >= count then if not xPlayer.canCarryItem(itemName, count) then - return xPlayer.showNotification(_U('player_cannot_hold')) + return xPlayer.showNotification(TranslateCap('player_cannot_hold')) end inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + xPlayer.showNotification(TranslateCap('have_withdrawn', count, item.label)) else - xPlayer.showNotification(_U('not_enough_in_society')) + xPlayer.showNotification(TranslateCap('not_enough_in_society')) end end) end) @@ -182,13 +182,13 @@ AddEventHandler('esx_vehicleshop:putStockItems', function(itemName, count) local item = inventory.getItem(itemName) if item.count < 0 then - xPlayer.showNotification(_U('invalid_amount')) + xPlayer.showNotification(TranslateCap('invalid_amount')) return end xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) - xPlayer.showNotification(_U('have_deposited', count, item.label)) + xPlayer.showNotification(TranslateCap('have_deposited', count, item.label)) end) end) @@ -210,7 +210,7 @@ ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, mo MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {xPlayer.identifier, plate, json.encode({model = joaat(model), plate = plate}) }, function(rowsChanged) - xPlayer.showNotification(_U('vehicle_belongs', plate)) + xPlayer.showNotification(TranslateCap('vehicle_belongs', plate)) ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading,{plate = plate}, function(vehicle) Wait(100) local vehicle = NetworkGetEntityFromNetworkId(vehicle) @@ -281,7 +281,7 @@ AddEventHandler('esx_vehicleshop:returnProvider', function(vehicleModel) local vehicleLabel = getVehicleFromModel(vehicleModel).label account.addMoney(vehPrice) - xPlayer.showNotification(_U('vehicle_sold_for', vehicleLabel, ESX.Math.GroupDigits(vehPrice))) + xPlayer.showNotification(TranslateCap('vehicle_sold_for', vehicleLabel, ESX.Math.GroupDigits(vehPrice))) end) end) @@ -434,9 +434,9 @@ local function payRent() if xPlayer.getAccount('bank').money >= rental.rent_price then total = total + rental.rent_price xPlayer.removeAccountMoney('bank', rental.rent_price, "Vehicle Rental") - xPlayer.showNotification(_U('paid_rental', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) + xPlayer.showNotification(TranslateCap('paid_rental', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) else - xPlayer.showNotification(_U('paid_rental_evicted', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) + xPlayer.showNotification(TranslateCap('paid_rental_evicted', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) unrentals[#unrentals + 1] = {rental.owner, rental.plate} end end