mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
feat: locales
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
lib.locale()
|
||||
NDCore = {}
|
||||
|
||||
Config = {
|
||||
@@ -26,11 +27,11 @@ CreateThread(function()
|
||||
SetDiscordRichPresenceAssetSmall(Config.discordAssetSmall)
|
||||
SetDiscordRichPresenceAction(0, Config.discordActionText, Config.discordActionLink)
|
||||
SetDiscordRichPresenceAction(1, Config.discordActionText2, Config.discordActionLink2)
|
||||
local presenceText = ("Playing: %s"):format(Config.serverName)
|
||||
local presenceText = locale("discord_text_server", Config.serverName)
|
||||
while true do
|
||||
if NDCore.player then
|
||||
local presence = ("Playing: %s as %s %s"):format(Config.serverName, NDCore.player.firstname, NDCore.player.lastname)
|
||||
local presenceTextSmall = ("Playing as: %s %s"):format(NDCore.player.firstname, NDCore.player.lastname)
|
||||
local presence = locale("discord_text", Config.serverName, NDCore.player.firstname, NDCore.player.lastname)
|
||||
local presenceTextSmall = locale("discord_text_small", NDCore.player.firstname, NDCore.player.lastname)
|
||||
SetRichPresence(presence)
|
||||
SetDiscordRichPresenceAssetText(presenceText)
|
||||
SetDiscordRichPresenceAssetSmallText(presenceTextSmall)
|
||||
@@ -49,8 +50,8 @@ CreateThread(function()
|
||||
sleep = 0
|
||||
BeginScaleformMovieMethodOnFrontendHeader("SET_HEADING_DETAILS")
|
||||
ScaleformMovieMethodAddParamPlayerNameString(("%s %s"):format(NDCore.player.firstname, NDCore.player.lastname))
|
||||
ScaleformMovieMethodAddParamTextureNameString(("Cash: $%d"):format(NDCore.player.cash))
|
||||
ScaleformMovieMethodAddParamTextureNameString(("Bank: $%d"):format(NDCore.player.bank))
|
||||
ScaleformMovieMethodAddParamTextureNameString(locale("pause_menu_cash", NDCore.player.cash))
|
||||
ScaleformMovieMethodAddParamTextureNameString(locale("pause_menu_bank", NDCore.player.bank))
|
||||
EndScaleformMovieMethod()
|
||||
elseif sleep == 0 then
|
||||
sleep = 500
|
||||
|
||||
@@ -119,8 +119,8 @@ end
|
||||
local function parkVehicle(veh)
|
||||
if not veh or not DoesEntityExist(veh) then
|
||||
return NDCore.notify({
|
||||
title = "Garage",
|
||||
description = "No owned vehicle found nearby.",
|
||||
title = locale("garage"),
|
||||
description = locale("no_owned_veh_nearby"),
|
||||
type = "error",
|
||||
position = "bottom",
|
||||
duration = 3000
|
||||
@@ -128,8 +128,8 @@ local function parkVehicle(veh)
|
||||
end
|
||||
if GetPedInVehicleSeat(veh, -1) ~= 0 then
|
||||
NDCore.notify({
|
||||
title = "Garage",
|
||||
description = "Player in vehicle!",
|
||||
title = locale("garage"),
|
||||
description = locale("player_in_veh"),
|
||||
type = "error",
|
||||
position = "bottom",
|
||||
duration = 3000
|
||||
@@ -156,13 +156,13 @@ end
|
||||
|
||||
local function getEngineStatus(health)
|
||||
if health > 950 then
|
||||
return "Perfect"
|
||||
return locale("perfect")
|
||||
elseif health > 750 then
|
||||
return "Good"
|
||||
return locale("good")
|
||||
elseif health > 500 then
|
||||
return "Bad"
|
||||
return locale("bad")
|
||||
end
|
||||
return "Very bad"
|
||||
return locale("very_bad")
|
||||
end
|
||||
|
||||
local function createMenuOptions(vehicle, vehicleSpawns)
|
||||
@@ -174,21 +174,21 @@ local function createMenuOptions(vehicle, vehicleSpawns)
|
||||
if not makeName or makeName == "NULL" then
|
||||
makeName = ""
|
||||
else
|
||||
metadata[#metadata+1] = {label = "Make", value = makeName}
|
||||
metadata[#metadata+1] = {label = locale("veh_make_brand"), value = makeName}
|
||||
makeName = makeName .. " "
|
||||
end
|
||||
if not modelName or modelName == "NULL" then
|
||||
modelName = ""
|
||||
else
|
||||
metadata[#metadata+1] = {label = "Model", value = modelName}
|
||||
metadata[#metadata+1] = {label = locale("veh_model"), value = modelName}
|
||||
end
|
||||
|
||||
if props?.plate then
|
||||
metadata[#metadata+1] = {label = "Plate", value = props.plate}
|
||||
metadata[#metadata+1] = {label = locale("veh_plate"), value = props.plate}
|
||||
end
|
||||
if props?.engineHealth then
|
||||
metadata[#metadata+1] = {
|
||||
label = "Engine status",
|
||||
label = locale("engine_status"),
|
||||
value = getEngineStatus(props.engineHealth),
|
||||
progress = props.engineHealth/10,
|
||||
colorScheme = "blue"
|
||||
@@ -205,7 +205,7 @@ local function createMenuOptions(vehicle, vehicleSpawns)
|
||||
end
|
||||
|
||||
return {
|
||||
title = ("Vehicle: %s%s\nPlate: %s"):format(makeName, modelName, props?.plate or "not found"),
|
||||
title = ("%s: %s%s\n%s: %s"):format(locale("vehicle"), makeName, modelName, locale("veh_plate"), props?.plate or locale("not_found")),
|
||||
metadata = metadata,
|
||||
onSelect = function(args)
|
||||
TriggerServerEvent("ND_Vehicles:takeVehicle", vehicle.id, vehicleSpawns)
|
||||
@@ -217,7 +217,7 @@ local function createMenu(vehicles, garageType, vehicleSpawns, impound)
|
||||
local options = {}
|
||||
if not impound then
|
||||
options[#options+1] = {
|
||||
title = "Park vehicle",
|
||||
title = locale("park_veh"),
|
||||
onSelect = function(args)
|
||||
local veh = getClosestOwnedVehicle()
|
||||
parkVehicle(veh)
|
||||
@@ -231,13 +231,13 @@ local function createMenu(vehicles, garageType, vehicleSpawns, impound)
|
||||
end
|
||||
if impound and #options == 0 then
|
||||
options[#options+1] = {
|
||||
title = "No vehicles found",
|
||||
title = locale("no_vehs_found"),
|
||||
readOnly = true
|
||||
}
|
||||
end
|
||||
return {
|
||||
id = ("garage_%s"):format(garageType),
|
||||
title = impound and "Vehicle impound" or "Parking garage",
|
||||
title = impound and locale("vehicle_impound") or locale("parking_garage"),
|
||||
options = options,
|
||||
onExit = function()
|
||||
garageOpen = false
|
||||
@@ -253,7 +253,7 @@ for i=1, #locations do
|
||||
distance = 45.0,
|
||||
clothing = clothing[math.random(1, #clothing)],
|
||||
blip = {
|
||||
label = location.impound and ("Impound (%s)"):format(location.garageType) or ("Parking garage (%s)"):format(location.garageType),
|
||||
label = location.impound and locale("impound_w_location", location.garageType) or locale("garage_w_location", location.garageType),
|
||||
sprite = location.impound and 285 or sprite[location.garageType],
|
||||
scale = 0.7,
|
||||
color = 3,
|
||||
@@ -267,7 +267,7 @@ for i=1, #locations do
|
||||
{
|
||||
name = "nd_core:garagePed",
|
||||
icon = "fa-solid fa-warehouse",
|
||||
label = location.impound and "View impounded vehicles" or "View garage",
|
||||
label = location.impound and locale("view_impounded_vehs") or locale("view_garage"),
|
||||
distance = 2.0,
|
||||
canInteract = function(entity, distance, coords, name, bone)
|
||||
if not location.groups then return true end
|
||||
|
||||
@@ -1,188 +1,188 @@
|
||||
local vehicleColorNames = {
|
||||
[0] = "Black",
|
||||
[1] = "Black",
|
||||
[2] = "Black",
|
||||
[3] = "Silver",
|
||||
[4] = "Silver",
|
||||
[5] = "Silver",
|
||||
[6] = "Gray",
|
||||
[7] = "Silver",
|
||||
[8] = "Silver",
|
||||
[9] = "Silver",
|
||||
[10] = "Metal",
|
||||
[11] = "Grey",
|
||||
[12] = "Black",
|
||||
[13] = "Gray",
|
||||
[14] = "Grey",
|
||||
[15] = "Black",
|
||||
[16] = "Black",
|
||||
[17] = "Silver",
|
||||
[18] = "Silver",
|
||||
[19] = "Metal",
|
||||
[20] = "Silver",
|
||||
[21] = "Black",
|
||||
[22] = "Graphite",
|
||||
[23] = "Silver",
|
||||
[24] = "Silver",
|
||||
[25] = "Silver",
|
||||
[26] = "Silver",
|
||||
[27] = "Red",
|
||||
[28] = "Red",
|
||||
[29] = "Red",
|
||||
[30] = "Red",
|
||||
[31] = "Red",
|
||||
[32] = "Red",
|
||||
[33] = "Red",
|
||||
[34] = "Red",
|
||||
[35] = "Red",
|
||||
[36] = "Orange",
|
||||
[37] = "Gold",
|
||||
[38] = "Orange",
|
||||
[39] = "Red",
|
||||
[40] = "Red",
|
||||
[41] = "Orange",
|
||||
[42] = "Yellow",
|
||||
[43] = "Red",
|
||||
[44] = "Red",
|
||||
[45] = "Red",
|
||||
[46] = "Red",
|
||||
[47] = "Red",
|
||||
[48] = "Red",
|
||||
[49] = "Green",
|
||||
[50] = "Green",
|
||||
[51] = "Green",
|
||||
[52] = "Green",
|
||||
[53] = "Green",
|
||||
[54] = "Green",
|
||||
[55] = "Green",
|
||||
[56] = "Green",
|
||||
[57] = "Green",
|
||||
[58] = "Green",
|
||||
[59] = "Green",
|
||||
[60] = "Green",
|
||||
[61] = "Blue",
|
||||
[62] = "Blue",
|
||||
[63] = "Blue",
|
||||
[64] = "Blue",
|
||||
[65] = "Blue",
|
||||
[66] = "Blue",
|
||||
[67] = "Blue",
|
||||
[68] = "Blue",
|
||||
[69] = "Blue",
|
||||
[70] = "Blue",
|
||||
[71] = "Blue",
|
||||
[72] = "Blue",
|
||||
[73] = "Blue",
|
||||
[74] = "Blue",
|
||||
[75] = "Blue",
|
||||
[76] = "Blue",
|
||||
[77] = "Blue",
|
||||
[78] = "Blue",
|
||||
[79] = "Bblue",
|
||||
[80] = "Blue",
|
||||
[81] = "Blue",
|
||||
[82] = "Blue",
|
||||
[83] = "Blue",
|
||||
[84] = "Blue",
|
||||
[85] = "Blue",
|
||||
[86] = "Blue",
|
||||
[87] = "Blue",
|
||||
[88] = "Yellow",
|
||||
[89] = "Yellow",
|
||||
[90] = "Bronze",
|
||||
[91] = "Yellow",
|
||||
[92] = "Lime",
|
||||
[93] = "Champagne",
|
||||
[94] = "Beige",
|
||||
[95] = "Ivory",
|
||||
[96] = "Brown",
|
||||
[97] = "Brown",
|
||||
[98] = "Brown",
|
||||
[99] = "Beige",
|
||||
[100] = "Brown",
|
||||
[101] = "Brown",
|
||||
[102] = "Beechwood",
|
||||
[103] = "Beechwood",
|
||||
[104] = "Orange",
|
||||
[105] = "Sand",
|
||||
[106] = "Sand",
|
||||
[107] = "Cream",
|
||||
[108] = "Brown",
|
||||
[109] = "Brown",
|
||||
[110] = "Brown",
|
||||
[111] = "White",
|
||||
[112] = "White",
|
||||
[113] = "Beige",
|
||||
[114] = "Brown",
|
||||
[115] = "Brown",
|
||||
[116] = "Beige",
|
||||
[117] = "Steel",
|
||||
[118] = "Steel",
|
||||
[119] = "Aluminium",
|
||||
[120] = "Chrome",
|
||||
[121] = "White",
|
||||
[122] = "White",
|
||||
[123] = "Orange",
|
||||
[124] = "Orange",
|
||||
[125] = "Green",
|
||||
[126] = "Yellow",
|
||||
[127] = "Blue",
|
||||
[128] = "Green",
|
||||
[129] = "Brown",
|
||||
[130] = "Orange",
|
||||
[131] = "White",
|
||||
[132] = "White",
|
||||
[133] = "Green",
|
||||
[134] = "White",
|
||||
[135] = "Pink",
|
||||
[136] = "pink",
|
||||
[137] = "Pink",
|
||||
[138] = "Orange",
|
||||
[139] = "Green",
|
||||
[140] = "Blue",
|
||||
[141] = "Black",
|
||||
[142] = "Black",
|
||||
[143] = "Black",
|
||||
[144] = "Green",
|
||||
[145] = "Purple",
|
||||
[146] = "Blue",
|
||||
[147] = "Black",
|
||||
[148] = "Purple",
|
||||
[149] = "Purple",
|
||||
[150] = "Red",
|
||||
[151] = "Green",
|
||||
[152] = "Green",
|
||||
[153] = "Brown",
|
||||
[154] = "Tan",
|
||||
[155] = "Green",
|
||||
[156] = "ALLOY",
|
||||
[157] = "Blue",
|
||||
[0] = locale("veh_color_black"),
|
||||
[1] = locale("veh_color_black"),
|
||||
[2] = locale("veh_color_black"),
|
||||
[3] = locale("veh_color_silver"),
|
||||
[4] = locale("veh_color_silver"),
|
||||
[5] = locale("veh_color_silver"),
|
||||
[6] = locale("veh_color_grey"),
|
||||
[7] = locale("veh_color_silver"),
|
||||
[8] = locale("veh_color_silver"),
|
||||
[9] = locale("veh_color_silver"),
|
||||
[10] = locale("veh_color_metal"),
|
||||
[11] = locale("veh_color_grey"),
|
||||
[12] = locale("veh_color_black"),
|
||||
[13] = locale("veh_color_grey"),
|
||||
[14] = locale("veh_color_grey"),
|
||||
[15] = locale("veh_color_black"),
|
||||
[16] = locale("veh_color_black"),
|
||||
[17] = locale("veh_color_silver"),
|
||||
[18] = locale("veh_color_silver"),
|
||||
[19] = locale("veh_color_metal"),
|
||||
[20] = locale("veh_color_silver"),
|
||||
[21] = locale("veh_color_black"),
|
||||
[22] = locale("veh_color_graphite"),
|
||||
[23] = locale("veh_color_silver"),
|
||||
[24] = locale("veh_color_silver"),
|
||||
[25] = locale("veh_color_silver"),
|
||||
[26] = locale("veh_color_silver"),
|
||||
[27] = locale("veh_color_red"),
|
||||
[28] = locale("veh_color_red"),
|
||||
[29] = locale("veh_color_red"),
|
||||
[30] = locale("veh_color_red"),
|
||||
[31] = locale("veh_color_red"),
|
||||
[32] = locale("veh_color_red"),
|
||||
[33] = locale("veh_color_red"),
|
||||
[34] = locale("veh_color_red"),
|
||||
[35] = locale("veh_color_red"),
|
||||
[36] = locale("veh_color_orange"),
|
||||
[37] = locale("veh_color_gold"),
|
||||
[38] = locale("veh_color_orange"),
|
||||
[39] = locale("veh_color_red"),
|
||||
[40] = locale("veh_color_red"),
|
||||
[41] = locale("veh_color_orange"),
|
||||
[42] = locale("veh_color_yellow"),
|
||||
[43] = locale("veh_color_red"),
|
||||
[44] = locale("veh_color_red"),
|
||||
[45] = locale("veh_color_red"),
|
||||
[46] = locale("veh_color_red"),
|
||||
[47] = locale("veh_color_red"),
|
||||
[48] = locale("veh_color_red"),
|
||||
[49] = locale("veh_color_green"),
|
||||
[50] = locale("veh_color_green"),
|
||||
[51] = locale("veh_color_green"),
|
||||
[52] = locale("veh_color_green"),
|
||||
[53] = locale("veh_color_green"),
|
||||
[54] = locale("veh_color_green"),
|
||||
[55] = locale("veh_color_green"),
|
||||
[56] = locale("veh_color_green"),
|
||||
[57] = locale("veh_color_green"),
|
||||
[58] = locale("veh_color_green"),
|
||||
[59] = locale("veh_color_green"),
|
||||
[60] = locale("veh_color_green"),
|
||||
[61] = locale("veh_color_blue"),
|
||||
[62] = locale("veh_color_blue"),
|
||||
[63] = locale("veh_color_blue"),
|
||||
[64] = locale("veh_color_blue"),
|
||||
[65] = locale("veh_color_blue"),
|
||||
[66] = locale("veh_color_blue"),
|
||||
[67] = locale("veh_color_blue"),
|
||||
[68] = locale("veh_color_blue"),
|
||||
[69] = locale("veh_color_blue"),
|
||||
[70] = locale("veh_color_blue"),
|
||||
[71] = locale("veh_color_blue"),
|
||||
[72] = locale("veh_color_blue"),
|
||||
[73] = locale("veh_color_blue"),
|
||||
[74] = locale("veh_color_blue"),
|
||||
[75] = locale("veh_color_blue"),
|
||||
[76] = locale("veh_color_blue"),
|
||||
[77] = locale("veh_color_blue"),
|
||||
[78] = locale("veh_color_blue"),
|
||||
[79] = locale("veh_color_bblue"),
|
||||
[80] = locale("veh_color_blue"),
|
||||
[81] = locale("veh_color_blue"),
|
||||
[82] = locale("veh_color_blue"),
|
||||
[83] = locale("veh_color_blue"),
|
||||
[84] = locale("veh_color_blue"),
|
||||
[85] = locale("veh_color_blue"),
|
||||
[86] = locale("veh_color_blue"),
|
||||
[87] = locale("veh_color_blue"),
|
||||
[88] = locale("veh_color_yellow"),
|
||||
[89] = locale("veh_color_yellow"),
|
||||
[90] = locale("veh_color_bronze"),
|
||||
[91] = locale("veh_color_yellow"),
|
||||
[92] = locale("veh_color_lime"),
|
||||
[93] = locale("veh_color_champagne"),
|
||||
[94] = locale("veh_color_beige"),
|
||||
[95] = locale("veh_color_ivory"),
|
||||
[96] = locale("veh_color_brown"),
|
||||
[97] = locale("veh_color_brown"),
|
||||
[98] = locale("veh_color_brown"),
|
||||
[99] = locale("veh_color_beige"),
|
||||
[100] = locale("veh_color_brown"),
|
||||
[101] = locale("veh_color_brown"),
|
||||
[102] = locale("veh_color_beechwood"),
|
||||
[103] = locale("veh_color_beechwood"),
|
||||
[104] = locale("veh_color_orange"),
|
||||
[105] = locale("veh_color_sand"),
|
||||
[106] = locale("veh_color_sand"),
|
||||
[107] = locale("veh_color_cream"),
|
||||
[108] = locale("veh_color_brown"),
|
||||
[109] = locale("veh_color_brown"),
|
||||
[110] = locale("veh_color_brown"),
|
||||
[111] = locale("veh_color_white"),
|
||||
[112] = locale("veh_color_white"),
|
||||
[113] = locale("veh_color_beige"),
|
||||
[114] = locale("veh_color_brown"),
|
||||
[115] = locale("veh_color_brown"),
|
||||
[116] = locale("veh_color_beige"),
|
||||
[117] = locale("veh_color_steel"),
|
||||
[118] = locale("veh_color_steel"),
|
||||
[119] = locale("veh_color_aluminium"),
|
||||
[120] = locale("veh_color_chrome"),
|
||||
[121] = locale("veh_color_white"),
|
||||
[122] = locale("veh_color_white"),
|
||||
[123] = locale("veh_color_orange"),
|
||||
[124] = locale("veh_color_orange"),
|
||||
[125] = locale("veh_color_green"),
|
||||
[126] = locale("veh_color_yellow"),
|
||||
[127] = locale("veh_color_blue"),
|
||||
[128] = locale("veh_color_green"),
|
||||
[129] = locale("veh_color_brown"),
|
||||
[130] = locale("veh_color_orange"),
|
||||
[131] = locale("veh_color_white"),
|
||||
[132] = locale("veh_color_white"),
|
||||
[133] = locale("veh_color_green"),
|
||||
[134] = locale("veh_color_white"),
|
||||
[135] = locale("veh_color_pink"),
|
||||
[136] = locale("veh_color_pink"),
|
||||
[137] = locale("veh_color_pink"),
|
||||
[138] = locale("veh_color_orange"),
|
||||
[139] = locale("veh_color_green"),
|
||||
[140] = locale("veh_color_blue"),
|
||||
[141] = locale("veh_color_black"),
|
||||
[142] = locale("veh_color_black"),
|
||||
[143] = locale("veh_color_black"),
|
||||
[144] = locale("veh_color_green"),
|
||||
[145] = locale("veh_color_purple"),
|
||||
[146] = locale("veh_color_blue"),
|
||||
[147] = locale("veh_color_black"),
|
||||
[148] = locale("veh_color_purple"),
|
||||
[149] = locale("veh_color_purple"),
|
||||
[150] = locale("veh_color_red"),
|
||||
[151] = locale("veh_color_green"),
|
||||
[152] = locale("veh_color_green"),
|
||||
[153] = locale("veh_color_brown"),
|
||||
[154] = locale("veh_color_tan"),
|
||||
[155] = locale("veh_color_green"),
|
||||
[156] = locale("veh_color_alloy"),
|
||||
[157] = locale("veh_color_blue"),
|
||||
}
|
||||
|
||||
local vehicleClassNames = {
|
||||
[0] = "Compact",
|
||||
[1] = "Sedan",
|
||||
[2] = "SUV",
|
||||
[3] = "Coupe",
|
||||
[4] = "Muscle",
|
||||
[5] = "Sports Classic",
|
||||
[6] = "Sport",
|
||||
[7] = "Super",
|
||||
[8] = "Motorcycle",
|
||||
[9] = "Off-road",
|
||||
[10] = "Industrial",
|
||||
[11] = "Utility",
|
||||
[12] = "Van",
|
||||
[13] = "Cycle",
|
||||
[14] = "Boat",
|
||||
[15] = "Helicopter",
|
||||
[16] = "Plane",
|
||||
[17] = "Service",
|
||||
[18] = "Emergency",
|
||||
[19] = "Military",
|
||||
[20] = "Commercial",
|
||||
[21] = "Train",
|
||||
[22] = "Open wheel"
|
||||
[0] = locale("veh_class_compact"),
|
||||
[1] = locale("veh_class_sedan"),
|
||||
[2] = locale("veh_class_suv"),
|
||||
[3] = locale("veh_class_coupe"),
|
||||
[4] = locale("veh_class_muscle"),
|
||||
[5] = locale("veh_class_sports_classic"),
|
||||
[6] = locale("veh_class_sport"),
|
||||
[7] = locale("veh_class_super"),
|
||||
[8] = locale("veh_class_motorcycle"),
|
||||
[9] = locale("veh_class_off_road"),
|
||||
[10] = locale("veh_class_industrial"),
|
||||
[11] = locale("veh_class_utility"),
|
||||
[12] = locale("veh_class_van"),
|
||||
[13] = locale("veh_class_cycle"),
|
||||
[14] = locale("veh_class_boat"),
|
||||
[15] = locale("veh_class_helicopter"),
|
||||
[16] = locale("veh_class_plane"),
|
||||
[17] = locale("veh_class_service"),
|
||||
[18] = locale("veh_class_emergency"),
|
||||
[19] = locale("veh_class_military"),
|
||||
[20] = locale("veh_class_commercial"),
|
||||
[21] = locale("veh_class_train"),
|
||||
[22] = locale("veh_class_open_wheel")
|
||||
}
|
||||
|
||||
local cruiseSpeedSet = 0
|
||||
@@ -264,7 +264,7 @@ RegisterNetEvent("ND_Vehicles:blip", function(netId, status)
|
||||
SetBlipScale(blip, 0.8)
|
||||
SetBlipAsShortRange(blip, true)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentSubstringPlayerName("Personal vehicle")
|
||||
AddTextComponentSubstringPlayerName(locale("personal_vehicle"))
|
||||
EndTextCommandSetBlipName(blip)
|
||||
end)
|
||||
|
||||
@@ -447,7 +447,7 @@ end
|
||||
|
||||
local vehicleLockKeybind = lib.addKeybind({
|
||||
name = "vehicleKey",
|
||||
description = "Unlock/lock vehicle (double click)",
|
||||
description = locale("keybind_carkey"),
|
||||
defaultKey = "E",
|
||||
onPressed = function(self)
|
||||
local time = GetCloudTimeAsInt()
|
||||
@@ -469,8 +469,8 @@ NDCore.isResourceStarted("ox_inventory", function(started)
|
||||
Wait(1000)
|
||||
vehicleLockKeybind:disable(true)
|
||||
exports.ox_inventory:displayMetadata({
|
||||
vehPlate = "Plate",
|
||||
vehModel = "Model"
|
||||
vehPlate = locale("veh_plate"),
|
||||
vehModel = locale("veh_model")
|
||||
})
|
||||
end)
|
||||
|
||||
@@ -552,7 +552,7 @@ local function hotwireVehicle()
|
||||
|
||||
local success = lib.progressCircle({
|
||||
duration = math.random(10000, 20000),
|
||||
label = "Hotwiring",
|
||||
label = locale("progress_hotwiring"),
|
||||
useWhileDead = false,
|
||||
allowRagdoll = false,
|
||||
allowCuffed = false,
|
||||
@@ -647,8 +647,8 @@ exports("keyControl", function(action, slot)
|
||||
if data.slot == slot then
|
||||
if metadata and not metadata.keyEnabled then
|
||||
return lib.notify({
|
||||
title = "No signal",
|
||||
description = "Vehicle key disabled.",
|
||||
title = locale("no_signal"),
|
||||
description = locale("veh_key_disabled"),
|
||||
type = "error",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -670,8 +670,8 @@ exports("keyControl", function(action, slot)
|
||||
elseif action == "disable" then
|
||||
TriggerServerEvent("ND_Vehicles:disableKey", slot)
|
||||
lib.notify({
|
||||
title = "Key disabled",
|
||||
description = "This vehicle key has been disabled and cannot be used anymore.",
|
||||
title = locale("veh_key_disabled"),
|
||||
description = locale("veh_key_disabled2"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -683,8 +683,8 @@ local function cruiseControl()
|
||||
cruiseSpeedVehicle = GetEntitySpeed(playerVehicle) * 2.236936
|
||||
if not playerVehicle then
|
||||
lib.notify({
|
||||
title = "Cruise control",
|
||||
description = "Vehicle cruise control disabled.",
|
||||
title = locale("cruise_control"),
|
||||
description = locale("cruise_control_disabled"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -693,8 +693,8 @@ local function cruiseControl()
|
||||
end
|
||||
if cruiseSpeedVehicle < cruiseSpeedSet/3 then
|
||||
lib.notify({
|
||||
title = "Cruise control",
|
||||
description = "Vehicle cruise control disabled.",
|
||||
title = locale("cruise_control"),
|
||||
description = locale("cruise_control_disabled"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -709,14 +709,14 @@ end
|
||||
|
||||
lib.addKeybind({
|
||||
name = "vehicleCruiseControl",
|
||||
description = "Toggle vehicle cruise control",
|
||||
description = locale("cruise_control_toggle"),
|
||||
defaultKey = "",
|
||||
onPressed = function(self)
|
||||
if cruiseControlEnabled and cruiseSpeedVehicle-1 > cruiseSpeedSet then
|
||||
cruiseSpeedSet = cruiseSpeedVehicle
|
||||
return lib.notify({
|
||||
title = "Cruise control",
|
||||
description = ("Increased to %d mph."):format(math.floor(cruiseSpeedSet)),
|
||||
title = locale("cruise_control"),
|
||||
description = locale("cruise_control_increase"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -724,8 +724,8 @@ lib.addKeybind({
|
||||
elseif cruiseControlEnabled then
|
||||
cruiseControlEnabled = false
|
||||
return lib.notify({
|
||||
title = "Cruise control",
|
||||
description = "Vehicle cruise control disabled.",
|
||||
title = locale("cruise_control"),
|
||||
description = locale("cruise_control_disabled"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -741,8 +741,8 @@ lib.addKeybind({
|
||||
cruiseSpeedSet = cruiseSpeedVehicle
|
||||
|
||||
lib.notify({
|
||||
title = "Cruise control",
|
||||
description = ("Set to %d mph."):format(math.floor(cruiseSpeedSet)),
|
||||
title = locale("cruise_control"),
|
||||
description = locale("cruise_control_enabled"),
|
||||
type = "inform",
|
||||
position = "bottom-right",
|
||||
duration = 3000
|
||||
@@ -756,7 +756,7 @@ lib.addKeybind({
|
||||
|
||||
lib.addKeybind({
|
||||
name = "vehicleShuffleSeat",
|
||||
description = "Suffle vehicle seat.",
|
||||
description = locale("seat_shuffle"),
|
||||
defaultKey = "",
|
||||
onPressed = function(self)
|
||||
if not cache.vehicle then return end
|
||||
|
||||
Reference in New Issue
Block a user