From 9049c98d76674bd8e253beee327207a8e7a1b5e8 Mon Sep 17 00:00:00 2001
From: TheFantomas <117121911+TheFantomas@users.noreply.github.com>
Date: Sun, 9 Jul 2023 17:00:36 +0200
Subject: [PATCH] formatting(all): Format with prettier and lua formatter
---
.editorconfig | 10 +
[core]/cron/server/main.lua | 10 +-
[core]/es_extended/client/functions.lua | 108 ++-
[core]/es_extended/config.lua | 84 +-
[core]/es_extended/config.weapons.lua | 16 +-
[core]/es_extended/html/css/app.css | 99 ++-
[core]/es_extended/html/js/app.js | 62 +-
[core]/es_extended/html/js/mustache.min.js | 348 +++++++-
[core]/es_extended/html/js/wrapper.js | 49 +-
[core]/es_extended/html/ui.html | 18 +-
[core]/es_extended/locales/fr.lua | 2 +-
[core]/es_extended/locales/nl.lua | 4 +-
[core]/es_extended/locales/sl.lua | 4 +-
[core]/es_extended/server/commands.lua | 14 +-
[core]/es_extended/server/functions.lua | 4 +-
[core]/es_extended/server/main.lua | 483 ++++++-----
[core]/esx_context/index.html | 816 +++++++++---------
[core]/esx_identity/config.lua | 14 +-
[core]/esx_identity/html/css/style.css | 208 ++---
[core]/esx_identity/html/index.html | 112 +--
[core]/esx_identity/html/js/script.js | 61 +-
[core]/esx_loadingscreen/css/index.css | 132 +--
[core]/esx_loadingscreen/index.html | 39 +-
[core]/esx_loadingscreen/js/index.js | 14 +-
[core]/esx_menu_default/html/css/app.css | 116 +--
[core]/esx_menu_default/html/js/app.js | 728 ++++++++--------
.../esx_menu_default/html/js/mustache.min.js | 348 +++++++-
[core]/esx_menu_default/html/ui.html | 33 +-
[core]/esx_menu_dialog/html/css/app.css | 162 ++--
[core]/esx_menu_dialog/html/js/app.js | 305 ++++---
.../esx_menu_dialog/html/js/mustache.min.js | 348 +++++++-
[core]/esx_menu_dialog/html/ui.html | 35 +-
[core]/esx_menu_list/html/css/app.css | 58 +-
[core]/esx_menu_list/html/js/app.js | 358 ++++----
[core]/esx_menu_list/html/js/mustache.min.js | 348 +++++++-
[core]/esx_menu_list/html/ui.html | 20 +-
[core]/esx_multicharacter/client/main.lua | 2 +-
[core]/esx_multicharacter/html/css/main.css | 96 +--
[core]/esx_multicharacter/html/js/app.js | 118 ++-
[core]/esx_multicharacter/html/ui.html | 47 +-
[core]/esx_notify/nui/css/style.css | 88 +-
[core]/esx_notify/nui/index.html | 27 +-
[core]/esx_notify/nui/js/script.js | 86 +-
[core]/esx_progressbar/nui/css/style.css | 12 +-
[core]/esx_progressbar/nui/index.html | 157 ++--
[core]/esx_progressbar/nui/js/script.js | 96 +--
[core]/esx_textui/nui/css/style.css | 84 +-
[core]/esx_textui/nui/index.html | 55 +-
[core]/esx_textui/nui/js/script.js | 112 +--
49 files changed, 3915 insertions(+), 2635 deletions(-)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..383d3ca5
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+trim_trailing_whitespace = true
+max_line_length = 300
+indent_size = 4
+indent_style = space
\ No newline at end of file
diff --git a/[core]/cron/server/main.lua b/[core]/cron/server/main.lua
index d82214a7..fb47a435 100644
--- a/[core]/cron/server/main.lua
+++ b/[core]/cron/server/main.lua
@@ -3,8 +3,8 @@ local LastTime = nil
function RunAt(h, m, cb)
Jobs[#Jobs + 1] = {
- h = h,
- m = m,
+ h = h,
+ m = m,
cb = cb
}
end
@@ -15,7 +15,11 @@ function GetTime()
local h = tonumber(os.date('%H', timestamp))
local m = tonumber(os.date('%M', timestamp))
- return { d = d, h = h, m = m }
+ return {
+ d = d,
+ h = h,
+ m = m
+ }
end
function OnTime(d, h, m)
diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua
index 47466708..7ba5dcc3 100644
--- a/[core]/es_extended/client/functions.lua
+++ b/[core]/es_extended/client/functions.lua
@@ -26,7 +26,7 @@ end
function ESX.SearchInventory(items, count)
if type(items) == 'string' then
- items = {items}
+ items = { items }
end
local returnData = {}
@@ -154,7 +154,7 @@ if GetResourceState("esx_context") ~= "missing" then
end
function ESX.RefreshContext(...)
- exports["esx_context"]:Refresh(...)
+ exports["esx_context"]:Refresh(...)
end
else
function ESX.OpenContext()
@@ -203,7 +203,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
menu.change = change
menu.close = function()
-
ESX.UI.Menu.RegisteredTypes[type].close(namespace, name)
for i = 1, #ESX.UI.Menu.Opened, 1 do
@@ -218,11 +217,9 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
if close then
close()
end
-
end
menu.update = function(query, newData)
-
for i = 1, #menu.data.elements, 1 do
local match = true
@@ -238,7 +235,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
end
end
end
-
end
menu.refresh = function()
@@ -266,7 +262,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
break
end
end
-
end
end
end
@@ -496,7 +491,6 @@ function ESX.Game.GetPlayers(onlyOtherPlayers, returnKeyValue, returnPeds)
return players
end
-
function ESX.Game.GetClosestObject(coords, modelFilter)
return ESX.Game.GetClosestEntity(ESX.Game.GetObjects(), false, coords, modelFilter)
end
@@ -604,19 +598,19 @@ function ESX.Game.GetVehicleProperties(vehicle)
local interiorColor = GetVehicleInteriorColour(vehicle)
local customPrimaryColor = nil
if hasCustomPrimaryColor then
- customPrimaryColor = {GetVehicleCustomPrimaryColour(vehicle)}
+ customPrimaryColor = { GetVehicleCustomPrimaryColour(vehicle) }
end
local hasCustomXenonColor, customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle)
local customXenonColor = nil
if hasCustomXenonColor then
- customXenonColor = {customXenonColorR, customXenonColorG, customXenonColorB}
+ customXenonColor = { customXenonColorR, customXenonColorG, customXenonColorB }
end
local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle)
local customSecondaryColor = nil
if hasCustomSecondaryColor then
- customSecondaryColor = {GetVehicleCustomSecondaryColour(vehicle)}
+ customSecondaryColor = { GetVehicleCustomSecondaryColour(vehicle) }
end
local extras = {}
@@ -634,11 +628,11 @@ function ESX.Game.GetVehicleProperties(vehicle)
local doorsBroken, windowsBroken, tyreBurst = {}, {}, {}
local numWheels = tostring(GetVehicleNumberOfWheels(vehicle))
- local TyresIndex = { -- Wheel index list according to the number of vehicle wheels.
- ['2'] = {0, 4}, -- Bike and cycle.
- ['3'] = {0, 1, 4, 5}, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
- ['4'] = {0, 1, 4, 5}, -- Vehicle with 4 wheels.
- ['6'] = {0, 1, 2, 3, 4, 5} -- Vehicle with 6 wheels.
+ local TyresIndex = { -- Wheel index list according to the number of vehicle wheels.
+ ['2'] = { 0, 4 }, -- Bike and cycle.
+ ['3'] = { 0, 1, 4, 5 }, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
+ ['4'] = { 0, 1, 4, 5 }, -- Vehicle with 4 wheels.
+ ['6'] = { 0, 1, 2, 3, 4, 5 } -- Vehicle with 6 wheels.
}
if TyresIndex[numWheels] then
@@ -647,7 +641,7 @@ function ESX.Game.GetVehicleProperties(vehicle)
end
end
- for windowId = 0, 7 do -- 13
+ for windowId = 0, 7 do -- 13
RollUpWindow(vehicle, windowId) --fix when you put the car away with the window down
windowsBroken[tostring(windowId)] = not IsVehicleWindowIntact(vehicle, windowId)
end
@@ -690,8 +684,8 @@ function ESX.Game.GetVehicleProperties(vehicle)
xenonColor = GetVehicleXenonLightsColor(vehicle),
customXenonColor = customXenonColor,
- neonEnabled = {IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1),
- IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3)},
+ neonEnabled = { IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1),
+ IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3) },
neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)),
extras = extras,
@@ -723,7 +717,7 @@ function ESX.Game.GetVehicleProperties(vehicle)
modXenon = IsToggleModOn(vehicle, 22),
modFrontWheels = GetVehicleMod(vehicle, 23),
- modCustomFrontWheels = GetVehicleModVariation(vehicle, 23),
+ modCustomFrontWheels = GetVehicleModVariation(vehicle, 23),
modBackWheels = GetVehicleMod(vehicle, 24),
modCustomBackWheels = GetVehicleModVariation(vehicle, 24),
@@ -836,7 +830,7 @@ function ESX.Game.SetVehicleProperties(vehicle, props)
end
end
- if props.driftTyresEnabled then
+ if props.driftTyresEnabled then
SetDriftTyresEnabled(vehicle, true)
end
@@ -921,8 +915,8 @@ function ESX.Game.SetVehicleProperties(vehicle, props)
if props.modFrontWheels ~= nil then
SetVehicleMod(vehicle, 23, props.modFrontWheels, false)
end
- if props.modCustomFrontWheels ~= nil then
- SetVehicleMod(vehicle, 23, props.modCustomFrontWheels, false)
+ if props.modCustomFrontWheels ~= nil then
+ SetVehicleMod(vehicle, 23, props.modCustomFrontWheels, false)
end
if props.modBackWheels ~= nil then
SetVehicleMod(vehicle, 24, props.modBackWheels, false)
@@ -1074,7 +1068,7 @@ function ESX.ShowInventory()
local playerPed = ESX.PlayerData.ped
local elements = {
- {unselectable = true, icon = 'fas fa-box', title = 'Player Inventory'}
+ { unselectable = true, icon = 'fas fa-box', title = 'Player Inventory' }
}
local currentWeight = 0
@@ -1083,7 +1077,7 @@ function ESX.ShowInventory()
local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank'
- elements[#elements+1] = {
+ elements[#elements + 1] = {
icon = 'fas fa-money-bill-wave',
title = ('%s: %s'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
count = ESX.PlayerData.accounts[i].money,
@@ -1100,7 +1094,7 @@ function ESX.ShowInventory()
if v.count > 0 then
currentWeight = currentWeight + (v.weight * v.count)
- elements[#elements+1] = {
+ elements[#elements + 1] = {
icon = 'fas fa-box',
title = ('%s x%s'):format(v.label, v.count),
count = v.count,
@@ -1119,7 +1113,7 @@ function ESX.ShowInventory()
if HasPedGotWeapon(playerPed, weaponHash, false) then
local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)
- elements[#elements+1] = {
+ elements[#elements + 1] = {
icon = 'fas fa-gun',
title = v.ammo and ('%s - %s %s'):format(v.label, ammo, v.ammo.label) or v.label,
count = 1,
@@ -1134,10 +1128,10 @@ function ESX.ShowInventory()
end
end
- elements[#elements+1] = {
+ elements[#elements + 1] = {
unselectable = true,
icon = "fas fa-weight",
- title = "Current Weight: "..currentWeight
+ title = "Current Weight: " .. currentWeight
}
ESX.CloseContext()
@@ -1148,7 +1142,7 @@ function ESX.ShowInventory()
local elements2 = {}
if element.usable then
- elements2[#elements2+1] = {
+ elements2[#elements2 + 1] = {
icon = "fas fa-utensils",
title = TranslateCap('use'),
action = 'use',
@@ -1159,7 +1153,7 @@ function ESX.ShowInventory()
if element.canRemove then
if player ~= -1 and distance <= 3.0 then
- elements2[#elements2+1] = {
+ elements2[#elements2 + 1] = {
icon = "fas fa-hands",
title = TranslateCap('give'),
action = 'give',
@@ -1168,7 +1162,7 @@ function ESX.ShowInventory()
}
end
- elements2[#elements2+1] = {
+ elements2[#elements2 + 1] = {
icon = "fas fa-trash",
title = TranslateCap('remove'),
action = 'remove',
@@ -1178,7 +1172,7 @@ function ESX.ShowInventory()
end
if element.type == 'item_weapon' and element.canGiveAmmo and element.ammo > 0 and player ~= -1 and distance <= 3.0 then
- elements2[#elements2+1] = {
+ elements2[#elements2 + 1] = {
icon = "fas fa-gun",
title = TranslateCap('giveammo'),
action = 'give_ammo',
@@ -1187,7 +1181,7 @@ function ESX.ShowInventory()
}
end
- elements2[#elements2+1] = {
+ elements2[#elements2 + 1] = {
icon = "fas fa-arrow-left",
title = TranslateCap('return'),
action = 'return'
@@ -1202,7 +1196,7 @@ function ESX.ShowInventory()
if #playersNearby > 0 then
local players = {}
local elements3 = {
- {unselectable = true, icon = "fas fa-users", title = "Nearby Players"}
+ { unselectable = true, icon = "fas fa-users", title = "Nearby Players" }
}
for _, playerNearby in ipairs(playersNearby) do
@@ -1211,7 +1205,7 @@ function ESX.ShowInventory()
ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers)
for playerId, playerName in pairs(returnedPlayers) do
- elements3[#elements3+1] = {
+ elements3[#elements3 + 1] = {
icon = "fas fa-user",
title = playerName,
playerId = playerId
@@ -1232,9 +1226,9 @@ function ESX.ShowInventory()
ESX.CloseContext()
else
local elementsG = {
- {unselectable = true, icon = "fas fa-trash", title = element.title},
- {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
- {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
+ { unselectable = true, icon = "fas fa-trash", title = element.title },
+ { icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000 },
+ { icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsG, function(menuG, _)
@@ -1271,9 +1265,9 @@ function ESX.ShowInventory()
TriggerServerEvent('esx:removeInventoryItem', type, item)
else
local elementsR = {
- {unselectable = true, icon = "fas fa-trash", title = element.title},
- {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000},
- {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
+ { unselectable = true, icon = "fas fa-trash", title = element.title },
+ { icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000 },
+ { icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsR, function(menuR, _)
@@ -1306,9 +1300,9 @@ function ESX.ShowInventory()
if closestPlayer ~= -1 and closestDistance < 3.0 then
if pedAmmo > 0 then
local elementsGA = {
- {unselectable = true, icon = "fas fa-trash", title = element.title},
- {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
- {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
+ { unselectable = true, icon = "fas fa-trash", title = element.title },
+ { icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000 },
+ { icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsGA, function(menuGA, _)
@@ -1360,20 +1354,20 @@ end)
function ESX.GetVehicleType(model)
model = type(model) == 'string' and joaat(model) or model
- if model == `submersible` or model == `submersible2` then
+ if model == `submersible` or model == `submersible2` then
return 'submarine'
- end
+ end
- local vehicleType = GetVehicleClassFromName(model)
- local types = {
- [8] = "bike",
- [11] = "trailer",
- [13] = "bike",
- [14] = "boat",
- [15] = "heli",
- [16] = "plane",
- [21] = "train",
- }
+ local vehicleType = GetVehicleClassFromName(model)
+ local types = {
+ [8] = "bike",
+ [11] = "trailer",
+ [13] = "bike",
+ [14] = "boat",
+ [15] = "heli",
+ [16] = "plane",
+ [21] = "train",
+ }
return types[vehicleType] or "automobile"
end
diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua
index 6bafa027..a2bf5b6a 100644
--- a/[core]/es_extended/config.lua
+++ b/[core]/es_extended/config.lua
@@ -33,56 +33,56 @@ Config.AdminGroups = {
}
-Config.EnablePaycheck = true -- enable paycheck
-Config.LogPaycheck = false -- Logs paychecks to a nominated Discord channel via webhook (default is false)
-Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
-Config.MaxWeight = 24 -- the max inventory weight without backpack
+Config.EnablePaycheck = true -- enable paycheck
+Config.LogPaycheck = false -- Logs paychecks to a nominated Discord channel via webhook (default is false)
+Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
+Config.MaxWeight = 24 -- the max inventory weight without backpack
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
-Config.EnableDebug = false -- Use Debug options?
-Config.EnableDefaultInventory = true -- Display the default Inventory ( F2 )
-Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
-Config.EnablePVP = true -- Allow Player to player combat
+Config.EnableDebug = false -- Use Debug options?
+Config.EnableDefaultInventory = true -- Display the default Inventory ( F2 )
+Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
+Config.EnablePVP = true -- Allow Player to player combat
Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing"
-Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar)
-Config.DistanceGive = 4.0 -- Max distance when giving items, weapons etc.
+Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar)
+Config.DistanceGive = 4.0 -- Max distance when giving items, weapons etc.
-Config.AdminLogging = false -- Logs the usage of certain commands by those with group.admin ace permissions (default is false)
+Config.AdminLogging = false -- Logs the usage of certain commands by those with group.admin ace permissions (default is false)
-Config.DisableHealthRegeneration = false -- Player will no longer regenerate health
-Config.DisableVehicleRewards = false -- Disables Player Recieving weapons from vehicles
-Config.DisableNPCDrops = false -- stops NPCs from dropping weapons on death
-Config.DisableDispatchServices = false -- Disable Dispatch services
-Config.DisableScenarios = false -- Disable Scenarios
-Config.DisableWeaponWheel = false -- Disables default weapon wheel
-Config.DisableAimAssist = false -- disables AIM assist (mainly on controllers)
-Config.DisableVehicleSeatShuff = false -- Disables vehicle seat shuff
+Config.DisableHealthRegeneration = false -- Player will no longer regenerate health
+Config.DisableVehicleRewards = false -- Disables Player Recieving weapons from vehicles
+Config.DisableNPCDrops = false -- stops NPCs from dropping weapons on death
+Config.DisableDispatchServices = false -- Disable Dispatch services
+Config.DisableScenarios = false -- Disable Scenarios
+Config.DisableWeaponWheel = false -- Disables default weapon wheel
+Config.DisableAimAssist = false -- disables AIM assist (mainly on controllers)
+Config.DisableVehicleSeatShuff = false -- Disables vehicle seat shuff
Config.RemoveHudCommonents = {
- [1] = false, --WANTED_STARS,
- [2] = false, --WEAPON_ICON
- [3] = false, --CASH
- [4] = false, --MP_CASH
- [5] = false, --MP_MESSAGE
- [6] = false, --VEHICLE_NAME
- [7] = false, -- AREA_NAME
- [8] = false, -- VEHICLE_CLASS
- [9] = false, --STREET_NAME
- [10] = false, --HELP_TEXT
- [11] = false, --FLOATING_HELP_TEXT_1
- [12] = false, --FLOATING_HELP_TEXT_2
- [13] = false, --CASH_CHANGE
- [14] = false, --RETICLE
- [15] = false, --SUBTITLE_TEXT
- [16] = false, --RADIO_STATIONS
- [17] = false, --SAVING_GAME,
- [18] = false, --GAME_STREAM
- [19] = false, --WEAPON_WHEEL
- [20] = false, --WEAPON_WHEEL_STATS
- [21] = false, --HUD_COMPONENTS
- [22] = false, --HUD_WEAPONS
+ [1] = false, --WANTED_STARS,
+ [2] = false, --WEAPON_ICON
+ [3] = false, --CASH
+ [4] = false, --MP_CASH
+ [5] = false, --MP_MESSAGE
+ [6] = false, --VEHICLE_NAME
+ [7] = false, -- AREA_NAME
+ [8] = false, -- VEHICLE_CLASS
+ [9] = false, --STREET_NAME
+ [10] = false, --HELP_TEXT
+ [11] = false, --FLOATING_HELP_TEXT_1
+ [12] = false, --FLOATING_HELP_TEXT_2
+ [13] = false, --CASH_CHANGE
+ [14] = false, --RETICLE
+ [15] = false, --SUBTITLE_TEXT
+ [16] = false, --RADIO_STATIONS
+ [17] = false, --SAVING_GAME,
+ [18] = false, --GAME_STREAM
+ [19] = false, --WEAPON_WHEEL
+ [20] = false, --WEAPON_WHEEL_STATS
+ [21] = false, --HUD_COMPONENTS
+ [22] = false, --HUD_WEAPONS
}
-Config.SpawnVehMaxUpgrades = true -- admin vehicles spawn with max vehcle settings
+Config.SpawnVehMaxUpgrades = true -- admin vehicles spawn with max vehcle settings
Config.CustomAIPlates = '........' -- Custom plates for AI vehicles
-- Pattern string format
--1 will lead to a random number from 0-9.
diff --git a/[core]/es_extended/config.weapons.lua b/[core]/es_extended/config.weapons.lua
index cd9bc1ec..83bdd8d7 100644
--- a/[core]/es_extended/config.weapons.lua
+++ b/[core]/es_extended/config.weapons.lua
@@ -317,7 +317,7 @@ Config.Weapons = {
{ name = 'grip', label = TranslateCap('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP` }
}
},
- { name = 'WEAPON_MUSKET', label = TranslateCap('weapon_musket'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_SHOTGUN` } },
+ { name = 'WEAPON_MUSKET', label = TranslateCap('weapon_musket'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_SHOTGUN` } },
{
name = 'WEAPON_PUMPSHOTGUN',
label = TranslateCap('weapon_pumpshotgun'),
@@ -937,14 +937,14 @@ Config.Weapons = {
}
},
-- Heavy / Launchers
- { name = 'WEAPON_COMPACTLAUNCHER', label = TranslateCap('weapon_compactlauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER` } },
+ { name = 'WEAPON_COMPACTLAUNCHER', label = TranslateCap('weapon_compactlauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER` } },
{ name = 'WEAPON_FIREWORK', label = TranslateCap('weapon_firework'), components = {}, ammo = { label = TranslateCap('ammo_firework'), hash = `AMMO_FIREWORK` } },
- { name = 'WEAPON_GRENADELAUNCHER', label = TranslateCap('weapon_grenadelauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER` } },
- { name = 'WEAPON_HOMINGLAUNCHER', label = TranslateCap('weapon_hominglauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rockets'), hash = `AMMO_HOMINGLAUNCHER` } },
- { name = 'WEAPON_MINIGUN', label = TranslateCap('weapon_minigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_MINIGUN` } },
- { name = 'WEAPON_RAILGUN', label = TranslateCap('weapon_railgun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_RAILGUN` } },
- { name = 'WEAPON_RPG', label = TranslateCap('weapon_rpg'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rockets'), hash = `AMMO_RPG` } },
- { name = 'WEAPON_RAYMINIGUN', label = TranslateCap('weapon_rayminigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_MINIGUN` } },
+ { name = 'WEAPON_GRENADELAUNCHER', label = TranslateCap('weapon_grenadelauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER` } },
+ { name = 'WEAPON_HOMINGLAUNCHER', label = TranslateCap('weapon_hominglauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rockets'), hash = `AMMO_HOMINGLAUNCHER` } },
+ { name = 'WEAPON_MINIGUN', label = TranslateCap('weapon_minigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_MINIGUN` } },
+ { name = 'WEAPON_RAILGUN', label = TranslateCap('weapon_railgun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_RAILGUN` } },
+ { name = 'WEAPON_RPG', label = TranslateCap('weapon_rpg'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rockets'), hash = `AMMO_RPG` } },
+ { name = 'WEAPON_RAYMINIGUN', label = TranslateCap('weapon_rayminigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = { label = TranslateCap('ammo_rounds'), hash = `AMMO_MINIGUN` } },
-- Thrown
{ name = 'WEAPON_BALL', label = TranslateCap('weapon_ball'), components = {}, ammo = { label = TranslateCap('ammo_ball'), hash = `AMMO_BALL` } },
{ name = 'WEAPON_BZGAS', label = TranslateCap('weapon_bzgas'), components = {}, ammo = { label = TranslateCap('ammo_bzgas'), hash = `AMMO_BZGAS` } },
diff --git a/[core]/es_extended/html/css/app.css b/[core]/es_extended/html/css/app.css
index cfd2f67b..6d4b095c 100644
--- a/[core]/es_extended/html/css/app.css
+++ b/[core]/es_extended/html/css/app.css
@@ -1,76 +1,75 @@
@font-face {
- font-family: "Pricedown";
- src: url("../fonts/pdown.ttf");
+ font-family: "Pricedown";
+ src: url("../fonts/pdown.ttf");
}
@font-face {
- font-family: "bankgothic";
- src: url("../fonts/bankgothic.ttf");
+ font-family: "bankgothic";
+ src: url("../fonts/bankgothic.ttf");
}
html {
- overflow: hidden;
+ overflow: hidden;
}
#inventory_notifications {
- font-family: bankgothic;
- position: absolute;
- right: 40;
- bottom: 40;
- font-size: 2em;
- font-weight: bold;
- color: #fff;
- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
- 1px 1px 0 #000;
+ font-family: bankgothic;
+ position: absolute;
+ right: 40;
+ bottom: 40;
+ font-size: 2em;
+ font-weight: bold;
+ color: #fff;
+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.menu {
- font-family: "Open Sans", sans-serif;
- min-width: 400px;
- min-height: 250px;
- color: #fff;
- position: absolute;
- left: 40;
- top: 0;
+ font-family: "Open Sans", sans-serif;
+ min-width: 400px;
+ min-height: 250px;
+ color: #fff;
+ position: absolute;
+ left: 40;
+ top: 0;
}
.menu .head {
- font-family: "Open Sans", sans-serif;
- font-size: 28px;
- padding: 10px;
- background: #1a1a1a;
- border-bottom: 3px solid #bc1635;
- border-radius: 10px 10px 0 0;
- -webkit-border-radius: 10px 10px 0 0;
- -moz-border-radius: 10px 10px 0 0;
- -o-border-radius: 10px 10px 0 0;
- box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
- -webkit-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
- -moz-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
- -o-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
- box-shadow: 1px 1px 10px 4px rgba(0, 0, 0, 0.4);
+ font-family: "Open Sans", sans-serif;
+ font-size: 28px;
+ padding: 10px;
+ background: #1a1a1a;
+ border-bottom: 3px solid #bc1635;
+ border-radius: 10px 10px 0 0;
+ -webkit-border-radius: 10px 10px 0 0;
+ -moz-border-radius: 10px 10px 0 0;
+ -o-border-radius: 10px 10px 0 0;
+ box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
+ -webkit-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
+ -moz-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
+ -o-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28);
+ box-shadow: 1px 1px 10px 4px rgba(0, 0, 0, 0.4);
}
.menu .head span {
- font-family: "Pricedown";
- font-size: 28px;
- padding-left: 15px;
- padding-top: 6px;
+ font-family: "Pricedown";
+ font-size: 28px;
+ padding-left: 15px;
+ padding-top: 6px;
}
.menu .menu-items .menu-item {
- font-family: "Open Sans", sans-serif;
- font-size: 14px;
- height: 40px;
- display: block;
- background-color: #f1f1f1;
- box-shadow: inset 1px 0px 0px 1px #b8b8b8;
- height: 32px;
- line-height: 32px;
- color: #3a3a3a;
- text-align: center;
+ font-family: "Open Sans", sans-serif;
+ font-size: 14px;
+ height: 40px;
+ display: block;
+ background-color: #f1f1f1;
+ box-shadow: inset 1px 0px 0px 1px #b8b8b8;
+ height: 32px;
+ line-height: 32px;
+ color: #3a3a3a;
+ text-align: center;
}
.menu .menu-items .menu-item.selected {
- background-color: #ccc;
+ background-color: #ccc;
}
diff --git a/[core]/es_extended/html/js/app.js b/[core]/es_extended/html/js/app.js
index 029ecc00..4a95fe12 100644
--- a/[core]/es_extended/html/js/app.js
+++ b/[core]/es_extended/html/js/app.js
@@ -1,40 +1,40 @@
(() => {
- ESX = {};
+ ESX = {};
- ESX.inventoryNotification = function (add, label, count) {
- let notif = "";
+ ESX.inventoryNotification = function (add, label, count) {
+ let notif = "";
- if (add) {
- notif += "+";
- } else {
- notif += "-";
- }
+ if (add) {
+ notif += "+";
+ } else {
+ notif += "-";
+ }
- if (count) {
- notif += count + " " + label;
- } else {
- notif += " " + label;
- }
+ if (count) {
+ notif += count + " " + label;
+ } else {
+ notif += " " + label;
+ }
- let elem = $("
" + notif + "
");
- $("#inventory_notifications").append(elem);
+ let elem = $("" + notif + "
");
+ $("#inventory_notifications").append(elem);
- $(elem)
- .delay(3000)
- .fadeOut(1000, function () {
- elem.remove();
- });
- };
+ $(elem)
+ .delay(3000)
+ .fadeOut(1000, function () {
+ elem.remove();
+ });
+ };
- window.onData = (data) => {
- if (data.action === "inventoryNotification") {
- ESX.inventoryNotification(data.add, data.item, data.count);
- }
- };
+ window.onData = (data) => {
+ if (data.action === "inventoryNotification") {
+ ESX.inventoryNotification(data.add, data.item, data.count);
+ }
+ };
- window.onload = function (e) {
- window.addEventListener("message", (event) => {
- onData(event.data);
- });
- };
+ window.onload = function (e) {
+ window.addEventListener("message", (event) => {
+ onData(event.data);
+ });
+ };
})();
diff --git a/[core]/es_extended/html/js/mustache.min.js b/[core]/es_extended/html/js/mustache.min.js
index 520cfcb9..f3656597 100644
--- a/[core]/es_extended/html/js/mustache.min.js
+++ b/[core]/es_extended/html/js/mustache.min.js
@@ -1 +1,347 @@
-(function defineMustache(global,factory){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{global.Mustache={};factory(global.Mustache)}})(this,function mustacheFactory(mustache){var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function scanUntil(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function push(view){return new Context(view,this)};Context.prototype.lookup=function lookup(name){var cache=this.cache;var value;if(cache.hasOwnProperty(name)){value=cache[name]}else{var context=this,names,index,lookupHit=false;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index")value=this.renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this.unescapedValue(token,context);else if(symbol==="name")value=this.escapedValue(token,context);else if(symbol==="text")value=this.rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype.renderSection=function renderSection(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j": ">", '"': """, "'": "'", "/": "/", "`": "`", "=": "=" };
+ function escapeHtml(string) {
+ return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
+ return entityMap[s];
+ });
+ }
+ var whiteRe = /\s*/;
+ var spaceRe = /\s+/;
+ var equalsRe = /\s*=/;
+ var curlyRe = /\s*\}/;
+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
+ function parseTemplate(template, tags) {
+ if (!template) return [];
+ var sections = [];
+ var tokens = [];
+ var spaces = [];
+ var hasTag = false;
+ var nonSpace = false;
+ function stripSpace() {
+ if (hasTag && !nonSpace) {
+ while (spaces.length) delete tokens[spaces.pop()];
+ } else {
+ spaces = [];
+ }
+ hasTag = false;
+ nonSpace = false;
+ }
+ var openingTagRe, closingTagRe, closingCurlyRe;
+ function compileTags(tagsToCompile) {
+ if (typeof tagsToCompile === "string") tagsToCompile = tagsToCompile.split(spaceRe, 2);
+ if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) throw new Error("Invalid tags: " + tagsToCompile);
+ openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
+ closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
+ closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
+ }
+ compileTags(tags || mustache.tags);
+ var scanner = new Scanner(template);
+ var start, type, value, chr, token, openSection;
+ while (!scanner.eos()) {
+ start = scanner.pos;
+ value = scanner.scanUntil(openingTagRe);
+ if (value) {
+ for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
+ chr = value.charAt(i);
+ if (isWhitespace(chr)) {
+ spaces.push(tokens.length);
+ } else {
+ nonSpace = true;
+ }
+ tokens.push(["text", chr, start, start + 1]);
+ start += 1;
+ if (chr === "\n") stripSpace();
+ }
+ }
+ if (!scanner.scan(openingTagRe)) break;
+ hasTag = true;
+ type = scanner.scan(tagRe) || "name";
+ scanner.scan(whiteRe);
+ if (type === "=") {
+ value = scanner.scanUntil(equalsRe);
+ scanner.scan(equalsRe);
+ scanner.scanUntil(closingTagRe);
+ } else if (type === "{") {
+ value = scanner.scanUntil(closingCurlyRe);
+ scanner.scan(curlyRe);
+ scanner.scanUntil(closingTagRe);
+ type = "&";
+ } else {
+ value = scanner.scanUntil(closingTagRe);
+ }
+ if (!scanner.scan(closingTagRe)) throw new Error("Unclosed tag at " + scanner.pos);
+ token = [type, value, start, scanner.pos];
+ tokens.push(token);
+ if (type === "#" || type === "^") {
+ sections.push(token);
+ } else if (type === "/") {
+ openSection = sections.pop();
+ if (!openSection) throw new Error('Unopened section "' + value + '" at ' + start);
+ if (openSection[1] !== value) throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
+ } else if (type === "name" || type === "{" || type === "&") {
+ nonSpace = true;
+ } else if (type === "=") {
+ compileTags(value);
+ }
+ }
+ openSection = sections.pop();
+ if (openSection) throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
+ return nestTokens(squashTokens(tokens));
+ }
+ function squashTokens(tokens) {
+ var squashedTokens = [];
+ var token, lastToken;
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
+ token = tokens[i];
+ if (token) {
+ if (token[0] === "text" && lastToken && lastToken[0] === "text") {
+ lastToken[1] += token[1];
+ lastToken[3] = token[3];
+ } else {
+ squashedTokens.push(token);
+ lastToken = token;
+ }
+ }
+ }
+ return squashedTokens;
+ }
+ function nestTokens(tokens) {
+ var nestedTokens = [];
+ var collector = nestedTokens;
+ var sections = [];
+ var token, section;
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
+ token = tokens[i];
+ switch (token[0]) {
+ case "#":
+ case "^":
+ collector.push(token);
+ sections.push(token);
+ collector = token[4] = [];
+ break;
+ case "/":
+ section = sections.pop();
+ section[5] = token[2];
+ collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
+ break;
+ default:
+ collector.push(token);
+ }
+ }
+ return nestedTokens;
+ }
+ function Scanner(string) {
+ this.string = string;
+ this.tail = string;
+ this.pos = 0;
+ }
+ Scanner.prototype.eos = function eos() {
+ return this.tail === "";
+ };
+ Scanner.prototype.scan = function scan(re) {
+ var match = this.tail.match(re);
+ if (!match || match.index !== 0) return "";
+ var string = match[0];
+ this.tail = this.tail.substring(string.length);
+ this.pos += string.length;
+ return string;
+ };
+ Scanner.prototype.scanUntil = function scanUntil(re) {
+ var index = this.tail.search(re),
+ match;
+ switch (index) {
+ case -1:
+ match = this.tail;
+ this.tail = "";
+ break;
+ case 0:
+ match = "";
+ break;
+ default:
+ match = this.tail.substring(0, index);
+ this.tail = this.tail.substring(index);
+ }
+ this.pos += match.length;
+ return match;
+ };
+ function Context(view, parentContext) {
+ this.view = view;
+ this.cache = { ".": this.view };
+ this.parent = parentContext;
+ }
+ Context.prototype.push = function push(view) {
+ return new Context(view, this);
+ };
+ Context.prototype.lookup = function lookup(name) {
+ var cache = this.cache;
+ var value;
+ if (cache.hasOwnProperty(name)) {
+ value = cache[name];
+ } else {
+ var context = this,
+ names,
+ index,
+ lookupHit = false;
+ while (context) {
+ if (name.indexOf(".") > 0) {
+ value = context.view;
+ names = name.split(".");
+ index = 0;
+ while (value != null && index < names.length) {
+ if (index === names.length - 1) lookupHit = hasProperty(value, names[index]);
+ value = value[names[index++]];
+ }
+ } else {
+ value = context.view[name];
+ lookupHit = hasProperty(context.view, name);
+ }
+ if (lookupHit) break;
+ context = context.parent;
+ }
+ cache[name] = value;
+ }
+ if (isFunction(value)) value = value.call(this.view);
+ return value;
+ };
+ function Writer() {
+ this.cache = {};
+ }
+ Writer.prototype.clearCache = function clearCache() {
+ this.cache = {};
+ };
+ Writer.prototype.parse = function parse(template, tags) {
+ var cache = this.cache;
+ var tokens = cache[template];
+ if (tokens == null) tokens = cache[template] = parseTemplate(template, tags);
+ return tokens;
+ };
+ Writer.prototype.render = function render(template, view, partials) {
+ var tokens = this.parse(template);
+ var context = view instanceof Context ? view : new Context(view);
+ return this.renderTokens(tokens, context, partials, template);
+ };
+ Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate) {
+ var buffer = "";
+ var token, symbol, value;
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
+ value = undefined;
+ token = tokens[i];
+ symbol = token[0];
+ if (symbol === "#") value = this.renderSection(token, context, partials, originalTemplate);
+ else if (symbol === "^") value = this.renderInverted(token, context, partials, originalTemplate);
+ else if (symbol === ">") value = this.renderPartial(token, context, partials, originalTemplate);
+ else if (symbol === "&") value = this.unescapedValue(token, context);
+ else if (symbol === "name") value = this.escapedValue(token, context);
+ else if (symbol === "text") value = this.rawValue(token);
+ if (value !== undefined) buffer += value;
+ }
+ return buffer;
+ };
+ Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate) {
+ var self = this;
+ var buffer = "";
+ var value = context.lookup(token[1]);
+ function subRender(template) {
+ return self.render(template, context, partials);
+ }
+ if (!value) return;
+ if (isArray(value)) {
+ for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
+ buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);
+ }
+ } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
+ buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);
+ } else if (isFunction(value)) {
+ if (typeof originalTemplate !== "string") throw new Error("Cannot use higher-order sections without the original template");
+ value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
+ if (value != null) buffer += value;
+ } else {
+ buffer += this.renderTokens(token[4], context, partials, originalTemplate);
+ }
+ return buffer;
+ };
+ Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate) {
+ var value = context.lookup(token[1]);
+ if (!value || (isArray(value) && value.length === 0)) return this.renderTokens(token[4], context, partials, originalTemplate);
+ };
+ Writer.prototype.renderPartial = function renderPartial(token, context, partials) {
+ if (!partials) return;
+ var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
+ if (value != null) return this.renderTokens(this.parse(value), context, partials, value);
+ };
+ Writer.prototype.unescapedValue = function unescapedValue(token, context) {
+ var value = context.lookup(token[1]);
+ if (value != null) return value;
+ };
+ Writer.prototype.escapedValue = function escapedValue(token, context) {
+ var value = context.lookup(token[1]);
+ if (value != null) return mustache.escape(value);
+ };
+ Writer.prototype.rawValue = function rawValue(token) {
+ return token[1];
+ };
+ mustache.name = "mustache.js";
+ mustache.version = "2.3.0";
+ mustache.tags = ["{{", "}}"];
+ var defaultWriter = new Writer();
+ mustache.clearCache = function clearCache() {
+ return defaultWriter.clearCache();
+ };
+ mustache.parse = function parse(template, tags) {
+ return defaultWriter.parse(template, tags);
+ };
+ mustache.render = function render(template, view, partials) {
+ if (typeof template !== "string") {
+ throw new TypeError('Invalid template! Template should be a "string" ' + 'but "' + typeStr(template) + '" was given as the first ' + "argument for mustache#render(template, view, partials)");
+ }
+ return defaultWriter.render(template, view, partials);
+ };
+ mustache.to_html = function to_html(template, view, partials, send) {
+ var result = mustache.render(template, view, partials);
+ if (isFunction(send)) {
+ send(result);
+ } else {
+ return result;
+ }
+ };
+ mustache.escape = escapeHtml;
+ mustache.Scanner = Scanner;
+ mustache.Context = Context;
+ mustache.Writer = Writer;
+ return mustache;
+});
diff --git a/[core]/es_extended/html/js/wrapper.js b/[core]/es_extended/html/js/wrapper.js
index e4c47650..ee20f261 100644
--- a/[core]/es_extended/html/js/wrapper.js
+++ b/[core]/es_extended/html/js/wrapper.js
@@ -1,35 +1,34 @@
(() => {
- let ESXWrapper = {};
- ESXWrapper.MessageSize = 1024;
- ESXWrapper.messageId = 0;
+ let ESXWrapper = {};
+ ESXWrapper.MessageSize = 1024;
+ ESXWrapper.messageId = 0;
- window.SendMessage = function (namespace, type, msg) {
- ESXWrapper.messageId =
- ESXWrapper.messageId < 65535 ? ESXWrapper.messageId + 1 : 0;
- const str = JSON.stringify(msg);
+ window.SendMessage = function (namespace, type, msg) {
+ ESXWrapper.messageId = ESXWrapper.messageId < 65535 ? ESXWrapper.messageId + 1 : 0;
+ const str = JSON.stringify(msg);
- for (let i = 0; i < str.length; i++) {
- let count = 0;
- let chunk = "";
+ for (let i = 0; i < str.length; i++) {
+ let count = 0;
+ let chunk = "";
- while (count < ESXWrapper.MessageSize && i < str.length) {
- chunk += str[i];
+ while (count < ESXWrapper.MessageSize && i < str.length) {
+ chunk += str[i];
- count++;
- i++;
- }
+ count++;
+ i++;
+ }
- i--;
+ i--;
- const data = {
- __type: type,
- id: ESXWrapper.messageId,
- chunk: chunk,
- };
+ const data = {
+ __type: type,
+ id: ESXWrapper.messageId,
+ chunk: chunk,
+ };
- if (i === str.length - 1) data.end = true;
+ if (i === str.length - 1) data.end = true;
- $.post("http://" + namespace + "/__chunk", JSON.stringify(data));
- }
- };
+ $.post("http://" + namespace + "/__chunk", JSON.stringify(data));
+ }
+ };
})();
diff --git a/[core]/es_extended/html/ui.html b/[core]/es_extended/html/ui.html
index 86ad62be..bbc9c005 100644
--- a/[core]/es_extended/html/ui.html
+++ b/[core]/es_extended/html/ui.html
@@ -1,12 +1,12 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/[core]/es_extended/locales/fr.lua b/[core]/es_extended/locales/fr.lua
index e3c3166e..bc5289d5 100644
--- a/[core]/es_extended/locales/fr.lua
+++ b/[core]/es_extended/locales/fr.lua
@@ -113,7 +113,7 @@ Locales["fr"] = {
["command_giveammo_weapon"] = "Nom de l'arme",
["command_giveammo_ammo"] = "Quantité de munitions",
["tpm_nowaypoint"] = "Aucun point n'est défini sur la carte",
- ["tpm_success"] = "Vous avez bien été téléporté",
+ ["tpm_success"] = "Vous avez bien été téléporté",
["noclip_message"] = "Le mode noclip a été %s",
["enabled"] = "~g~activé~s~",
diff --git a/[core]/es_extended/locales/nl.lua b/[core]/es_extended/locales/nl.lua
index 9de0115e..af4b920f 100644
--- a/[core]/es_extended/locales/nl.lua
+++ b/[core]/es_extended/locales/nl.lua
@@ -111,11 +111,11 @@ Locales["nl"] = {
['command_giveammo_ammo'] = 'Ammo Hoeveelheid',
['tpm_nowaypoint'] = 'Geen waypoint gezet.',
['tpm_success'] = 'Successvol geteleporteerd',
-
+
['noclip_message'] = 'Noclip is %s',
['enabled'] = '~g~aangezet~s~',
['disabled'] = '~r~uitgezet~s~',
-
+
-- Locale settings
["locale_digit_grouping_symbol"] = ",",
["locale_currency"] = "€%s",
diff --git a/[core]/es_extended/locales/sl.lua b/[core]/es_extended/locales/sl.lua
index 4a485fd3..0e5de612 100644
--- a/[core]/es_extended/locales/sl.lua
+++ b/[core]/es_extended/locales/sl.lua
@@ -111,11 +111,11 @@ Locales["sl"] = {
['command_giveammo_ammo'] = 'Kolicina streliva',
['tpm_nowaypoint'] = 'Ni nastavljene poti!.',
['tpm_success'] = 'Uspesno teleportiran',
-
+
['noclip_message'] = 'Noclip je bil %s',
['enabled'] = '~g~Vkljucen~s~',
['disabled'] = '~r~Izkljucen~s~',
-
+
-- Locale settings
["locale_digit_grouping_symbol"] = ",",
["locale_currency"] = "€%s",
diff --git a/[core]/es_extended/server/commands.lua b/[core]/es_extended/server/commands.lua
index 7e160870..86c64b46 100644
--- a/[core]/es_extended/server/commands.lua
+++ b/[core]/es_extended/server/commands.lua
@@ -286,12 +286,12 @@ if not Config.OxInventory then
if Config.AdminLogging then
ESX.DiscordLogFields("UserActions", "Give Weapon Component /giveweaponcomponent Triggered!",
"pink", {
- { name = "Player", value = xPlayer.name, inline = true },
- { name = "ID", value = xPlayer.source, inline = true },
- { name = "Target", value = args.playerId.name, inline = true },
- { name = "Weapon", value = args.weaponName, inline = true },
- { name = "Component", value = args.componentName, inline = true },
- })
+ { name = "Player", value = xPlayer.name, inline = true },
+ { name = "ID", value = xPlayer.source, inline = true },
+ { name = "Target", value = args.playerId.name, inline = true },
+ { name = "Weapon", value = args.weaponName, inline = true },
+ { name = "Component", value = args.componentName, inline = true },
+ })
end
end
else
@@ -552,6 +552,6 @@ ESX.RegisterCommand('players', "admin", function()
for i = 1, #(xPlayers) do
local xPlayer = xPlayers[i]
print(('^1[^2ID: ^5%s^0 | ^2Name : ^5%s^0 | ^2Group : ^5%s^0 | ^2Identifier : ^5%s^1]^0\n'):format(
- xPlayer.source, xPlayer.getName(), xPlayer.getGroup(), xPlayer.identifier))
+ xPlayer.source, xPlayer.getName(), xPlayer.getGroup(), xPlayer.identifier))
end
end, true)
diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua
index 7e15b197..d70369a1 100644
--- a/[core]/es_extended/server/functions.lua
+++ b/[core]/es_extended/server/functions.lua
@@ -115,7 +115,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
newArgs[v.name] = string.sub(merge, lenght)
end
end
-
+
--backwards compatibility
if not v.validate and not v.type then
error = nil
@@ -403,7 +403,7 @@ function ESX.RefreshJobs()
if not Jobs then
-- Fallback data, if no jobs exist
- ESX.Jobs['unemployed'] = {label = 'Unemployed', grades = {['0'] = {grade = 0, label = 'Unemployed', salary = 200, skin_male = {}, skin_female = {}}}}
+ ESX.Jobs['unemployed'] = { label = 'Unemployed', grades = { ['0'] = { grade = 0, label = 'Unemployed', salary = 200, skin_male = {}, skin_female = {} } } }
else
ESX.Jobs = Jobs
end
diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua
index 607b86a3..d1bc6e0f 100644
--- a/[core]/es_extended/server/main.lua
+++ b/[core]/es_extended/server/main.lua
@@ -52,11 +52,10 @@ function onPlayerJoined(playerId)
('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(
identifier))
else
- local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', {identifier})
+ local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
if result then
loadESXPlayer(identifier, playerId, false)
else
-
createESXPlayer(identifier, playerId)
end
end
@@ -80,12 +79,12 @@ function createESXPlayer(identifier, playerId, data)
end
if not Config.Multichar then
- MySQL.prepare(newPlayer, {json.encode(accounts), identifier, defaultGroup}, function()
+ MySQL.prepare(newPlayer, { json.encode(accounts), identifier, defaultGroup }, function()
loadESXPlayer(identifier, playerId, true)
end)
else
MySQL.prepare(newPlayer,
- {json.encode(accounts), identifier, defaultGroup, data.firstname, data.lastname, data.dateofbirth, data.sex, data.height}, function()
+ { json.encode(accounts), identifier, defaultGroup, data.firstname, data.lastname, data.dateofbirth, data.sex, data.height }, function()
loadESXPlayer(identifier, playerId, true)
end)
end
@@ -104,7 +103,7 @@ if not Config.Multichar then
if not Core.DatabaseConnected then
return deferrals.done('[ESX] OxMySQL Was Unable To Connect to your database. Please make sure it is turned on and correctly configured in your server.cfg')
end
-
+
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
return deferrals.done(
@@ -121,249 +120,248 @@ if not Config.Multichar then
end
function loadESXPlayer(identifier, playerId, isNew)
- local userData = {
- accounts = {},
- inventory = {},
- job = {},
- loadout = {},
- playerName = GetPlayerName(playerId),
- weight = 0,
- metadata = {}
- }
- local result = MySQL.prepare.await(loadPlayer, { identifier })
- local job, grade, jobObject, gradeObject = result.job, tostring(result.job_grade)
- local foundAccounts, foundItems = {}, {}
+ local userData = {
+ accounts = {},
+ inventory = {},
+ job = {},
+ loadout = {},
+ playerName = GetPlayerName(playerId),
+ weight = 0,
+ metadata = {}
+ }
+ local result = MySQL.prepare.await(loadPlayer, { identifier })
+ local job, grade, jobObject, gradeObject = result.job, tostring(result.job_grade)
+ local foundAccounts, foundItems = {}, {}
- -- Accounts
- if result.accounts and result.accounts ~= '' then
- local accounts = json.decode(result.accounts)
+ -- Accounts
+ if result.accounts and result.accounts ~= '' then
+ local accounts = json.decode(result.accounts)
- for account, money in pairs(accounts) do
- foundAccounts[account] = money
- end
- end
+ for account, money in pairs(accounts) do
+ foundAccounts[account] = money
+ end
+ end
- for account, data in pairs(Config.Accounts) do
- if data.round == nil then
- data.round = true
- end
- local index = #userData.accounts + 1
- userData.accounts[index] = {
- name = account,
- money = foundAccounts[account] or Config.StartingAccountMoney[account] or 0,
- label = data.label,
- round = data.round,
- index = index
- }
- end
+ for account, data in pairs(Config.Accounts) do
+ if data.round == nil then
+ data.round = true
+ end
+ local index = #userData.accounts + 1
+ userData.accounts[index] = {
+ name = account,
+ money = foundAccounts[account] or Config.StartingAccountMoney[account] or 0,
+ label = data.label,
+ round = data.round,
+ index = index
+ }
+ end
- -- Job
- if ESX.DoesJobExist(job, grade) then
- jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade]
- else
- print(('[^3WARNING^7] Ignoring invalid job for ^5%s^7 [job: ^5%s^7, grade: ^5%s^7]'):format(identifier, job, grade))
- job, grade = 'unemployed', '0'
- jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade]
- end
+ -- Job
+ if ESX.DoesJobExist(job, grade) then
+ jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade]
+ else
+ print(('[^3WARNING^7] Ignoring invalid job for ^5%s^7 [job: ^5%s^7, grade: ^5%s^7]'):format(identifier, job, grade))
+ job, grade = 'unemployed', '0'
+ jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade]
+ end
- userData.job.id = jobObject.id
- userData.job.name = jobObject.name
- userData.job.label = jobObject.label
+ userData.job.id = jobObject.id
+ userData.job.name = jobObject.name
+ userData.job.label = jobObject.label
- userData.job.grade = tonumber(grade)
- userData.job.grade_name = gradeObject.name
- userData.job.grade_label = gradeObject.label
- userData.job.grade_salary = gradeObject.salary
+ userData.job.grade = tonumber(grade)
+ userData.job.grade_name = gradeObject.name
+ userData.job.grade_label = gradeObject.label
+ userData.job.grade_salary = gradeObject.salary
- userData.job.skin_male = {}
- userData.job.skin_female = {}
+ userData.job.skin_male = {}
+ userData.job.skin_female = {}
- if gradeObject.skin_male then
- userData.job.skin_male = json.decode(gradeObject.skin_male)
- end
- if gradeObject.skin_female then
- userData.job.skin_female = json.decode(gradeObject.skin_female)
- end
+ if gradeObject.skin_male then
+ userData.job.skin_male = json.decode(gradeObject.skin_male)
+ end
+ if gradeObject.skin_female then
+ userData.job.skin_female = json.decode(gradeObject.skin_female)
+ end
- -- Inventory
- if not Config.OxInventory then
- if result.inventory and result.inventory ~= '' then
- local inventory = json.decode(result.inventory)
+ -- Inventory
+ if not Config.OxInventory then
+ if result.inventory and result.inventory ~= '' then
+ local inventory = json.decode(result.inventory)
- for name, count in pairs(inventory) do
- local item = ESX.Items[name]
+ for name, count in pairs(inventory) do
+ local item = ESX.Items[name]
- if item then
- foundItems[name] = count
- else
- print(('[^3WARNING^7] Ignoring invalid item ^5"%s"^7 for ^5"%s^7"'):format(name, identifier))
- end
- end
- end
+ if item then
+ foundItems[name] = count
+ else
+ print(('[^3WARNING^7] Ignoring invalid item ^5"%s"^7 for ^5"%s^7"'):format(name, identifier))
+ end
+ end
+ end
- for name, item in pairs(ESX.Items) do
- local count = foundItems[name] or 0
- if count > 0 then
- userData.weight = userData.weight + (item.weight * count)
- end
+ for name, item in pairs(ESX.Items) do
+ local count = foundItems[name] or 0
+ if count > 0 then
+ userData.weight = userData.weight + (item.weight * count)
+ end
- table.insert(userData.inventory,
- {
- name = name,
- count = count,
- label = item.label,
- weight = item.weight,
- usable = Core.UsableItemsCallbacks[name] ~= nil,
- rare = item.rare,
- canRemove = item.canRemove
- })
- end
+ table.insert(userData.inventory,
+ {
+ name = name,
+ count = count,
+ label = item.label,
+ weight = item.weight,
+ usable = Core.UsableItemsCallbacks[name] ~= nil,
+ rare = item.rare,
+ canRemove = item.canRemove
+ })
+ end
- table.sort(userData.inventory, function(a, b)
- return a.label < b.label
- end)
- else
- if result.inventory and result.inventory ~= '' then
- userData.inventory = json.decode(result.inventory)
- else
- userData.inventory = {}
- end
- end
+ table.sort(userData.inventory, function(a, b)
+ return a.label < b.label
+ end)
+ else
+ if result.inventory and result.inventory ~= '' then
+ userData.inventory = json.decode(result.inventory)
+ else
+ userData.inventory = {}
+ end
+ end
- -- Group
- if result.group then
- if result.group == "superadmin" then
- userData.group = "admin"
- print("[^3WARNING^7] ^5Superadmin^7 detected, setting group to ^5admin^7")
- else
- userData.group = result.group
- end
- else
- userData.group = 'user'
- end
+ -- Group
+ if result.group then
+ if result.group == "superadmin" then
+ userData.group = "admin"
+ print("[^3WARNING^7] ^5Superadmin^7 detected, setting group to ^5admin^7")
+ else
+ userData.group = result.group
+ end
+ else
+ userData.group = 'user'
+ end
- -- Loadout
- if not Config.OxInventory then
- if result.loadout and result.loadout ~= '' then
- local loadout = json.decode(result.loadout)
+ -- Loadout
+ if not Config.OxInventory then
+ if result.loadout and result.loadout ~= '' then
+ local loadout = json.decode(result.loadout)
- for name, weapon in pairs(loadout) do
- local label = ESX.GetWeaponLabel(name)
+ for name, weapon in pairs(loadout) do
+ local label = ESX.GetWeaponLabel(name)
- if label then
- if not weapon.components then
- weapon.components = {}
- end
- if not weapon.tintIndex then
- weapon.tintIndex = 0
- end
+ if label then
+ if not weapon.components then
+ weapon.components = {}
+ end
+ if not weapon.tintIndex then
+ weapon.tintIndex = 0
+ end
- table.insert(userData.loadout,
- {
- name = name,
- ammo = weapon.ammo,
- label = label,
- components = weapon.components,
- tintIndex = weapon.tintIndex
- })
- end
- end
- end
- end
+ table.insert(userData.loadout,
+ {
+ name = name,
+ ammo = weapon.ammo,
+ label = label,
+ components = weapon.components,
+ tintIndex = weapon.tintIndex
+ })
+ end
+ end
+ end
+ end
- -- Position
- userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(#Config.DefaultSpawns)]
+ -- Position
+ userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(#Config.DefaultSpawns)]
- -- Skin
- if result.skin and result.skin ~= '' then
- userData.skin = json.decode(result.skin)
- else
- if userData.sex == 'f' then
- userData.skin = { sex = 1 }
- else
- userData.skin = { sex = 0 }
- end
- end
+ -- Skin
+ if result.skin and result.skin ~= '' then
+ userData.skin = json.decode(result.skin)
+ else
+ if userData.sex == 'f' then
+ userData.skin = { sex = 1 }
+ else
+ userData.skin = { sex = 0 }
+ end
+ end
- -- Identity
- if result.firstname and result.firstname ~= '' then
- userData.firstname = result.firstname
- userData.lastname = result.lastname
- userData.playerName = userData.firstname .. ' ' .. userData.lastname
- if result.dateofbirth then
- userData.dateofbirth = result.dateofbirth
- end
- if result.sex then
- userData.sex = result.sex
- end
- if result.height then
- userData.height = result.height
- end
- end
+ -- Identity
+ if result.firstname and result.firstname ~= '' then
+ userData.firstname = result.firstname
+ userData.lastname = result.lastname
+ userData.playerName = userData.firstname .. ' ' .. userData.lastname
+ if result.dateofbirth then
+ userData.dateofbirth = result.dateofbirth
+ end
+ if result.sex then
+ userData.sex = result.sex
+ end
+ if result.height then
+ userData.height = result.height
+ end
+ end
- if result.metadata and result.metadata ~= '' then
- local metadata = json.decode(result.metadata)
- userData.metadata = metadata
- end
+ if result.metadata and result.metadata ~= '' then
+ local metadata = json.decode(result.metadata)
+ userData.metadata = metadata
+ end
- local xPlayer = CreateExtendedPlayer(playerId, identifier, userData.group, userData.accounts, userData.inventory, userData.weight, userData.job, userData.loadout, userData.playerName, userData.coords, userData.metadata)
- ESX.Players[playerId] = xPlayer
- Core.playersByIdentifier[identifier] = xPlayer
+ local xPlayer = CreateExtendedPlayer(playerId, identifier, userData.group, userData.accounts, userData.inventory, userData.weight, userData.job, userData.loadout, userData.playerName, userData.coords, userData.metadata)
+ ESX.Players[playerId] = xPlayer
+ Core.playersByIdentifier[identifier] = xPlayer
- if userData.firstname then
- xPlayer.set('firstName', userData.firstname)
- xPlayer.set('lastName', userData.lastname)
- if userData.dateofbirth then
- xPlayer.set('dateofbirth', userData.dateofbirth)
- end
- if userData.sex then
- xPlayer.set('sex', userData.sex)
- end
- if userData.height then
- xPlayer.set('height', userData.height)
- end
- end
+ if userData.firstname then
+ xPlayer.set('firstName', userData.firstname)
+ xPlayer.set('lastName', userData.lastname)
+ if userData.dateofbirth then
+ xPlayer.set('dateofbirth', userData.dateofbirth)
+ end
+ if userData.sex then
+ xPlayer.set('sex', userData.sex)
+ end
+ if userData.height then
+ xPlayer.set('height', userData.height)
+ end
+ end
- TriggerEvent('esx:playerLoaded', playerId, xPlayer, isNew)
+ TriggerEvent('esx:playerLoaded', playerId, xPlayer, isNew)
- xPlayer.triggerEvent('esx:playerLoaded',
- {
- accounts = xPlayer.getAccounts(),
- coords = userData.coords,
- identifier = xPlayer.getIdentifier(),
- inventory = xPlayer.getInventory(),
- job = xPlayer.getJob(),
- loadout = xPlayer.getLoadout(),
- maxWeight = xPlayer.getMaxWeight(),
- money = xPlayer.getMoney(),
- sex = xPlayer.get("sex") or "m",
- firstName = xPlayer.get("firstName") or "John",
- lastName = xPlayer.get("lastName") or "Doe",
- dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000",
- height = xPlayer.get("height") or 120,
- dead = false,
- metadata = xPlayer.getMeta()
- }, isNew,
- userData.skin)
+ xPlayer.triggerEvent('esx:playerLoaded',
+ {
+ accounts = xPlayer.getAccounts(),
+ coords = userData.coords,
+ identifier = xPlayer.getIdentifier(),
+ inventory = xPlayer.getInventory(),
+ job = xPlayer.getJob(),
+ loadout = xPlayer.getLoadout(),
+ maxWeight = xPlayer.getMaxWeight(),
+ money = xPlayer.getMoney(),
+ sex = xPlayer.get("sex") or "m",
+ firstName = xPlayer.get("firstName") or "John",
+ lastName = xPlayer.get("lastName") or "Doe",
+ dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000",
+ height = xPlayer.get("height") or 120,
+ dead = false,
+ metadata = xPlayer.getMeta()
+ }, isNew,
+ userData.skin)
- if not Config.OxInventory then
- xPlayer.triggerEvent('esx:createMissingPickups', Core.Pickups)
- else
- exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory)
+ if not Config.OxInventory then
+ xPlayer.triggerEvent('esx:createMissingPickups', Core.Pickups)
+ else
+ exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory)
- if isNew then
- for account, money in pairs(Config.StartingAccountMoney) do
- if account == 'money' or account == 'black_money' then
- exports.ox_inventory:AddItem(playerId, account, money)
- end
- end
- end
- end
- xPlayer.triggerEvent('esx:registerSuggestions', Core.RegisteredCommands)
- print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
+ if isNew then
+ for account, money in pairs(Config.StartingAccountMoney) do
+ if account == 'money' or account == 'black_money' then
+ exports.ox_inventory:AddItem(playerId, account, money)
+ end
+ end
+ end
+ end
+ xPlayer.triggerEvent('esx:registerSuggestions', Core.RegisteredCommands)
+ print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
end
-
AddEventHandler('chatMessage', function(playerId, _, message)
local xPlayer = ESX.GetPlayerFromId(playerId)
if message:sub(1, 1) == '/' and playerId > 0 then
@@ -621,8 +619,16 @@ end
ESX.RegisterServerCallback('esx:getPlayerData', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
- cb({identifier = xPlayer.identifier, accounts = xPlayer.getAccounts(), inventory = xPlayer.getInventory(), job = xPlayer.getJob(),
- loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
+ cb({
+ identifier = xPlayer.identifier,
+ accounts = xPlayer.getAccounts(),
+ inventory = xPlayer.getInventory(),
+ job = xPlayer.getJob(),
+ loadout = xPlayer.getLoadout(),
+ money = xPlayer.getMoney(),
+ position = xPlayer.getCoords(true),
+ metadata = xPlayer.getMeta()
+ })
end)
ESX.RegisterServerCallback('esx:isUserAdmin', function(source, cb)
@@ -636,8 +642,16 @@ end)
ESX.RegisterServerCallback('esx:getOtherPlayerData', function(_, cb, target)
local xPlayer = ESX.GetPlayerFromId(target)
- cb({identifier = xPlayer.identifier, accounts = xPlayer.getAccounts(), inventory = xPlayer.getInventory(), job = xPlayer.getJob(),
- loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
+ cb({
+ identifier = xPlayer.identifier,
+ accounts = xPlayer.getAccounts(),
+ inventory = xPlayer.getInventory(),
+ job = xPlayer.getJob(),
+ loadout = xPlayer.getLoadout(),
+ money = xPlayer.getMoney(),
+ position = xPlayer.getCoords(true),
+ metadata = xPlayer.getMeta()
+ })
end)
ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
@@ -656,20 +670,20 @@ ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
cb(players)
end)
-ESX.RegisterServerCallback("esx:spawnVehicle", function(source,cb,vehData)
- local ped = GetPlayerPed(source)
- ESX.OneSync.SpawnVehicle(vehData.model or `ADDER`, vehData.coords or GetEntityCoords(ped), vehData.coords.w or 0.0, vehData.props or {}, function(id)
- if vehData.warp then
+ESX.RegisterServerCallback("esx:spawnVehicle", function(source, cb, vehData)
+ local ped = GetPlayerPed(source)
+ ESX.OneSync.SpawnVehicle(vehData.model or `ADDER`, vehData.coords or GetEntityCoords(ped), vehData.coords.w or 0.0, vehData.props or {}, function(id)
+ if vehData.warp then
local vehicle = NetworkGetEntityFromNetworkId(id)
- local timeout = 0
- while GetVehiclePedIsIn(ped) ~= vehicle and timeout <= 15 do
- Wait(0)
- TaskWarpPedIntoVehicle(ped, vehicle, -1)
- timeout += 1
- end
- end
- cb(id)
- end)
+ local timeout = 0
+ while GetVehiclePedIsIn(ped) ~= vehicle and timeout <= 15 do
+ Wait(0)
+ TaskWarpPedIntoVehicle(ped, vehicle, -1)
+ timeout += 1
+ end
+ end
+ cb(id)
+ end)
end)
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
@@ -684,4 +698,3 @@ end)
AddEventHandler('txAdmin:events:serverShuttingDown', function()
Core.SavePlayers()
end)
-
diff --git a/[core]/esx_context/index.html b/[core]/esx_context/index.html
index cd967955..9e40e850 100644
--- a/[core]/esx_context/index.html
+++ b/[core]/esx_context/index.html
@@ -1,462 +1,452 @@
-
-
-
-
+
+
+
+
-
-
- ESX Context HUD
+
+
+ ESX Context HUD
-
-
+ /* Show the checkmark when checked */
+ .container input:checked ~ .checkmark:after {
+ display: block;
+ }
+
+
-
-
-
-
-
-
Unselectable Item
-
Testing, testing a description here.
+
+
+
+
+
+ Unselectable Item
+ Testing, testing a description here.
+
+
+
+
+
+ Disabled Item
+ Testing, testing a description here.
+
+
+
+
+
+ Item
+ Testing, testing a description here. Generic words to force overflow.
+
+
-
-
-
-
- Disabled Item
- Testing, testing a description here.
-
-
-
-
-
- Item
- Testing, testing a description here. Generic words to force
- overflow.
-
-
-
-
-
+ // Open([
+ // {
+ // unselectable:true,
+ // icon:"fas fa-info-circle",
+ // title:"Unselectable Item (Header/Label?)",
+ // },
+ // {
+ // icon:"fas fa-check",
+ // title:"Item A",
+ // description:"Some description here. Add some words to make the text overflow."
+ // },
+ // {
+ // disabled:true,
+ // icon:"fas fa-times",
+ // title:"Disabled Item",
+ // description:"Some description here. Add some words to make the text overflow."
+ // },
+ // {
+ // icon:"fas fa-check",
+ // title:"Item B",
+ // description:"Some description here. Add some words to make the text overflow."
+ // },
+ // {
+ // input:true,
+ // icon:"fas fa-times",
+ // title:"Input Text",
+ // inputType:"text",
+ // inputPlaceholder:"Placeholder..."
+ // },
+ // {
+ // input:true,
+ // icon:"",
+ // title:"Input Number",
+ // inputType:"number",
+ // inputPlaceholder:"Placeholder...",
+ // inputValue:0,
+ // inputMin:0,
+ // inputMax:50
+ // },
+ // {
+ // input:true,
+ // icon:"",
+ // title:"Input Radio",
+ // inputType:"radio",
+ // inputPlaceholder:"turbocharger",
+ // inputValue:"supercharger",
+ // inputValues:[
+ // {
+ // value:"turbocharger",
+ // title:"Turbocharger"
+ // },
+ // {
+ // value:"supercharger",
+ // title:"Supercharger"
+ // },
+ // ]
+ // }
+ // ])
+
+
diff --git a/[core]/esx_identity/config.lua b/[core]/esx_identity/config.lua
index 2c16096b..7e450c23 100644
--- a/[core]/esx_identity/config.lua
+++ b/[core]/esx_identity/config.lua
@@ -13,11 +13,11 @@ Config.UseDeferrals = false
Config.DateFormat = 'DD/MM/YYYY'
-- These values are for the second input validation in server/main.lua
-Config.MaxNameLength = 20 -- Max Name Length.
-Config.MinHeight = 120 -- 120 cm lowest height
-Config.MaxHeight = 220 -- 220 cm max height.
-Config.LowestYear = 1900 -- 112 years old is the oldest you can be.
-Config.HighestYear = 2005 -- 18 years old is the youngest you can be.
+Config.MaxNameLength = 20 -- Max Name Length.
+Config.MinHeight = 120 -- 120 cm lowest height
+Config.MaxHeight = 220 -- 220 cm max height.
+Config.LowestYear = 1900 -- 112 years old is the oldest you can be.
+Config.HighestYear = 2005 -- 18 years old is the youngest you can be.
-Config.FullCharDelete = true -- Delete all reference to character.
-Config.EnableDebugging = ESX.GetConfig().EnableDebug -- prints for debugging :)
+Config.FullCharDelete = true -- Delete all reference to character.
+Config.EnableDebugging = ESX.GetConfig().EnableDebug -- prints for debugging :)
diff --git a/[core]/esx_identity/html/css/style.css b/[core]/esx_identity/html/css/style.css
index 1a7fff35..45f2404a 100644
--- a/[core]/esx_identity/html/css/style.css
+++ b/[core]/esx_identity/html/css/style.css
@@ -1,153 +1,153 @@
@import url("https://fonts.googleapis.com/css2?family=Oswald&display=swap");
body {
- font-family: sans-serif;
- overflow: hidden;
- background-color: transparent;
+ font-family: sans-serif;
+ overflow: hidden;
+ background-color: transparent;
}
.none {
- display: none;
+ display: none;
}
.dialog {
- width: 332px;
- opacity: 0.95;
- padding: 20px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background-color: #152029;
- border-radius: 10px;
- box-shadow: 0 -5px 3px -3px #21303d, 0 5px 3px -3px #21303d;
- border: none;
- color: #ffffff;
+ width: 332px;
+ opacity: 0.95;
+ padding: 20px;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #152029;
+ border-radius: 10px;
+ box-shadow: 0 -5px 3px -3px #21303d, 0 5px 3px -3px #21303d;
+ border: none;
+ color: #ffffff;
}
.title {
- font-family: "Oswald", sans-serif;
- font-size: 22px;
- text-align: center;
- padding: 5px;
- margin-bottom: 20px;
+ font-family: "Oswald", sans-serif;
+ font-size: 22px;
+ text-align: center;
+ padding: 5px;
+ margin-bottom: 20px;
}
input {
- margin-bottom: 15px;
- border: none;
- border-bottom: 2px solid #58636c;
- width: 100%;
- outline: none;
- padding: 10px;
- padding-left: 0;
- font-family: "Oswald", sans-serif;
- color: #ffffff;
- text-align: left;
- background-color: #152029;
+ margin-bottom: 15px;
+ border: none;
+ border-bottom: 2px solid #58636c;
+ width: 100%;
+ outline: none;
+ padding: 10px;
+ padding-left: 0;
+ font-family: "Oswald", sans-serif;
+ color: #ffffff;
+ text-align: left;
+ background-color: #152029;
}
::placeholder {
- /* Chrome, Firefox, Opera, Safari 10.1+ */
- color: rgba(84, 97, 105, 255);
- font-family: "Oswald", sans-serif;
- font-weight: 200;
- opacity: 1;
- /* Firefox */
+ /* Chrome, Firefox, Opera, Safari 10.1+ */
+ color: rgba(84, 97, 105, 255);
+ font-family: "Oswald", sans-serif;
+ font-weight: 200;
+ opacity: 1;
+ /* Firefox */
}
.radio-toolbar input[type="radio"] {
- opacity: 0;
- position: absolute;
- width: 36%;
+ opacity: 0;
+ position: absolute;
+ width: 36%;
}
.radio-toolbar label {
- display: inline-block;
- margin-top: 5px;
- background-color: rgba(15, 15, 15, 0.9);
- padding: 10px 20px;
- font-family: "Oswald", sans-serif;
- font-weight: 500;
- font-size: 16px;
- color: #ffffff;
- border: none;
- border-radius: 5px;
- width: 36%;
+ display: inline-block;
+ margin-top: 5px;
+ background-color: rgba(15, 15, 15, 0.9);
+ padding: 10px 20px;
+ font-family: "Oswald", sans-serif;
+ font-weight: 500;
+ font-size: 16px;
+ color: #ffffff;
+ border: none;
+ border-radius: 5px;
+ width: 36%;
}
-.radio-toolbar input[type="radio"]:checked+label {
- width: 36%;
- background-color: rgba(15, 15, 15, 0.9);
- border: none;
- border-bottom: 1px solid #93a3b6;
- border-radius: 5px;
- color: #ffffff;
+.radio-toolbar input[type="radio"]:checked + label {
+ width: 36%;
+ background-color: rgba(15, 15, 15, 0.9);
+ border: none;
+ border-bottom: 1px solid #93a3b6;
+ border-radius: 5px;
+ color: #ffffff;
}
-.radio-toolbar input[type="radio"]:focus+label {
- background-color: rgba(15, 15, 15, 0.9);
- border: none;
- border-bottom: 1px solid #93a3b6;
- border-radius: 5px;
- color: #ffffff;
+.radio-toolbar input[type="radio"]:focus + label {
+ background-color: rgba(15, 15, 15, 0.9);
+ border: none;
+ border-bottom: 1px solid #93a3b6;
+ border-radius: 5px;
+ color: #ffffff;
}
.radio-toolbar label:hover {
- background-color: rgba(28, 24, 24, 0.931);
- width: 36%;
- color: #ffffff;
+ background-color: rgba(28, 24, 24, 0.931);
+ width: 36%;
+ color: #ffffff;
}
button {
- display: block;
- margin-top: 35px;
- /*padding: 10px;*/
- background-color: #4569c6;
- outline: none;
- border: 2px double rgba(40, 40, 40, 0.9);
- color: #ffffff;
- height: 30px;
- width: 100%;
+ display: block;
+ margin-top: 35px;
+ /*padding: 10px;*/
+ background-color: #4569c6;
+ outline: none;
+ border: 2px double rgba(40, 40, 40, 0.9);
+ color: #ffffff;
+ height: 30px;
+ width: 100%;
}
h1 {
- display: block;
- margin-top: 5px;
- margin-right: 5px;
- padding: 10px;
- background-color: rgba(15, 15, 15, 0.9);
- color: #ffffff;
- width: 93%;
- text-align: center;
+ display: block;
+ margin-top: 5px;
+ margin-right: 5px;
+ padding: 10px;
+ background-color: rgba(15, 15, 15, 0.9);
+ color: #ffffff;
+ width: 93%;
+ text-align: center;
}
.range-wrap {
- position: relative;
- margin: 0 auto 3rem;
+ position: relative;
+ margin: 0 auto 3rem;
}
.range {
- width: 100%;
+ width: 100%;
}
.bubble {
- background: rgba(15, 15, 15, 0.9);
- color: #ffffff;
- padding: 4px 12px;
- position: absolute;
- border-radius: 4px;
- left: 50%;
- transform: translateX(-50%);
+ background: rgba(15, 15, 15, 0.9);
+ color: #ffffff;
+ padding: 4px 12px;
+ position: absolute;
+ border-radius: 4px;
+ left: 50%;
+ transform: translateX(-50%);
}
.bubble::after {
- content: "";
- position: absolute;
- width: 2px;
- height: 2px;
- background: rgba(15, 15, 15, 0.9);
- color: black;
- top: -1px;
- left: 50%;
-}
\ No newline at end of file
+ content: "";
+ position: absolute;
+ width: 2px;
+ height: 2px;
+ background: rgba(15, 15, 15, 0.9);
+ color: black;
+ top: -1px;
+ left: 50%;
+}
diff --git a/[core]/esx_identity/html/index.html b/[core]/esx_identity/html/index.html
index 1d5a9ad3..f1320ea7 100644
--- a/[core]/esx_identity/html/index.html
+++ b/[core]/esx_identity/html/index.html
@@ -1,77 +1,49 @@
+
+
+
-
-
-
+
ESX Identity
+
-
ESX Identity
-
+
+