diff --git a/[SQL]/legacy.sql b/[SQL]/legacy.sql
index ecf145c73..18f4481b3 100644
--- a/[SQL]/legacy.sql
+++ b/[SQL]/legacy.sql
@@ -389,6 +389,7 @@ CREATE TABLE `users` (
`job` varchar(20) DEFAULT 'unemployed',
`job_grade` int(11) DEFAULT 0,
`loadout` longtext DEFAULT NULL,
+ `metadata` LONGTEXT NULL DEFAULT NULL,
`position` longtext NULL DEFAULT NULL,
`firstname` varchar(16) DEFAULT NULL,
`lastname` varchar(16) DEFAULT NULL,
diff --git a/[core]/cron/fxmanifest.lua b/[core]/cron/fxmanifest.lua
index f1a958375..aef7cbe42 100644
--- a/[core]/cron/fxmanifest.lua
+++ b/[core]/cron/fxmanifest.lua
@@ -4,6 +4,6 @@ game 'gta5'
author 'ESX-Framework'
description 'cron'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
server_script 'server/main.lua'
diff --git a/[core]/cron/server/main.lua b/[core]/cron/server/main.lua
index 6dc7f8ed2..4228f0892 100644
--- a/[core]/cron/server/main.lua
+++ b/[core]/cron/server/main.lua
@@ -2,11 +2,11 @@ local Jobs = {}
local LastTime = nil
function RunAt(h, m, cb)
- table.insert(Jobs, {
+ Jobs[#Jobs + 1] = {
h = h,
m = m,
cb = cb
- })
+ }
end
function GetTime()
diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua
index 73114156e..901911380 100644
--- a/[core]/es_extended/client/functions.lua
+++ b/[core]/es_extended/client/functions.lua
@@ -2,8 +2,6 @@ ESX = {}
Core = {}
ESX.PlayerData = {}
ESX.PlayerLoaded = false
-Core.CurrentRequestId = 0
-Core.ServerCallbacks = {}
Core.Input = {}
ESX.UI = {}
ESX.UI.Menu = {}
@@ -187,14 +185,6 @@ ESX.RegisterInput = function(command_name, label, input_group, key, on_press, on
RegisterKeyMapping(on_release ~= nil and "+" .. command_name or command_name, label, input_group, key)
end
-function ESX.TriggerServerCallback(name, cb, ...)
- local Invoke = GetInvokingResource() or "unknown"
- Core.ServerCallbacks[Core.CurrentRequestId] = cb
-
- TriggerServerEvent('esx:triggerServerCallback', name, Core.CurrentRequestId,Invoke, ...)
- Core.CurrentRequestId = Core.CurrentRequestId < 65535 and Core.CurrentRequestId + 1 or 0
-end
-
function ESX.UI.Menu.RegisterType(type, open, close)
ESX.UI.Menu.RegisteredTypes[type] = {
open = open,
@@ -416,6 +406,17 @@ function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked)
local model = type(vehicle) == 'number' and vehicle or joaat(vehicle)
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
networked = networked == nil and true or networked
+
+ local playerCoords = GetEntityCoords(ESX.PlayerData.ped)
+ if not vector or not playerCoords then
+ return
+ end
+ local dist = #(playerCoords - vector)
+ if dist > 424 then -- Onesync infinity Range (https://docs.fivem.net/docs/scripting-reference/onesync/)
+ local executingResource = GetInvokingResource() or "Unknown"
+ return print(("[^1ERROR^7] Resource ^5%s^7 Tried to spawn vehicle on the client but the position is too far away (Out of onesync range)."):format(executing_resource))
+ end
+
CreateThread(function()
ESX.Streaming.RequestModel(model)
@@ -1304,15 +1305,6 @@ function ESX.ShowInventory()
end)
end
-RegisterNetEvent('esx:serverCallback', function(requestId,invoker, ...)
- if Core.ServerCallbacks[requestId] then
- Core.ServerCallbacks[requestId](...)
- Core.ServerCallbacks[requestId] = nil
- else
- print('[^1ERROR^7] Server Callback with requestId ^5'.. requestId ..'^7 Was Called by ^5'.. invoker .. '^7 but does not exist.')
- end
-end)
-
RegisterNetEvent('esx:showNotification')
AddEventHandler('esx:showNotification', function(msg, type, length)
ESX.ShowNotification(msg, type, length)
@@ -1327,4 +1319,27 @@ AddEventHandler('esx:showAdvancedNotification',
RegisterNetEvent('esx:showHelpNotification')
AddEventHandler('esx:showHelpNotification', function(msg, thisFrame, beep, duration)
ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
-end)
\ No newline at end of file
+end)
+
+---@param model number|string
+---@return string
+function ESX.GetVehicleType(model)
+ model = type(model) == 'string' and joaat(model) or model
+
+ if model == `submersible` or model == `submersible2` then
+ return 'submarine'
+ end
+
+ 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
\ No newline at end of file
diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua
index 4dfff72ce..0c851b5f9 100644
--- a/[core]/es_extended/client/main.lua
+++ b/[core]/es_extended/client/main.lua
@@ -2,7 +2,8 @@ local pickups = {}
CreateThread(function()
while not Config.Multichar do
- Wait(0)
+ Wait(100)
+
if NetworkIsPlayerActive(PlayerId()) then
exports.spawnmanager:setAutoSpawn(false)
DoScreenFadeOut(0)
@@ -74,6 +75,15 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
end
end
+ if Config.DisableVehicleSeatShuff then
+ AddEventHandler('esx:enteredVehicle', function(vehicle, plate, seat)
+ if seat == 0 then
+ SetPedIntoVehicle(ESX.PlayerData.ped, vehicle, 0)
+ SetPedConfigFlag(ESX.PlayerData.ped, 184, true)
+ end
+ end)
+ end
+
if Config.DisableHealthRegeneration or Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then
CreateThread(function()
while true do
@@ -101,6 +111,74 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
end)
end
+ -- Disable Dispatch services
+ if Config.DisableDispatchServices then
+ for i = 1, 15 do
+ EnableDispatchService(i, false)
+ end
+ end
+
+ -- Disable Scenarios
+ if Config.DisableScenarios then
+ local scenarios = {
+ 'WORLD_VEHICLE_ATTRACTOR',
+ 'WORLD_VEHICLE_AMBULANCE',
+ 'WORLD_VEHICLE_BICYCLE_BMX',
+ 'WORLD_VEHICLE_BICYCLE_BMX_BALLAS',
+ 'WORLD_VEHICLE_BICYCLE_BMX_FAMILY',
+ 'WORLD_VEHICLE_BICYCLE_BMX_HARMONY',
+ 'WORLD_VEHICLE_BICYCLE_BMX_VAGOS',
+ 'WORLD_VEHICLE_BICYCLE_MOUNTAIN',
+ 'WORLD_VEHICLE_BICYCLE_ROAD',
+ 'WORLD_VEHICLE_BIKE_OFF_ROAD_RACE',
+ 'WORLD_VEHICLE_BIKER',
+ 'WORLD_VEHICLE_BOAT_IDLE',
+ 'WORLD_VEHICLE_BOAT_IDLE_ALAMO',
+ 'WORLD_VEHICLE_BOAT_IDLE_MARQUIS',
+ 'WORLD_VEHICLE_BOAT_IDLE_MARQUIS',
+ 'WORLD_VEHICLE_BROKEN_DOWN',
+ 'WORLD_VEHICLE_BUSINESSMEN',
+ 'WORLD_VEHICLE_HELI_LIFEGUARD',
+ 'WORLD_VEHICLE_CLUCKIN_BELL_TRAILER',
+ 'WORLD_VEHICLE_CONSTRUCTION_SOLO',
+ 'WORLD_VEHICLE_CONSTRUCTION_PASSENGERS',
+ 'WORLD_VEHICLE_DRIVE_PASSENGERS',
+ 'WORLD_VEHICLE_DRIVE_PASSENGERS_LIMITED',
+ 'WORLD_VEHICLE_DRIVE_SOLO',
+ 'WORLD_VEHICLE_FIRE_TRUCK',
+ 'WORLD_VEHICLE_EMPTY',
+ 'WORLD_VEHICLE_MARIACHI',
+ 'WORLD_VEHICLE_MECHANIC',
+ 'WORLD_VEHICLE_MILITARY_PLANES_BIG',
+ 'WORLD_VEHICLE_MILITARY_PLANES_SMALL',
+ 'WORLD_VEHICLE_PARK_PARALLEL',
+ 'WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN',
+ 'WORLD_VEHICLE_PASSENGER_EXIT',
+ 'WORLD_VEHICLE_POLICE_BIKE',
+ 'WORLD_VEHICLE_POLICE_CAR',
+ 'WORLD_VEHICLE_POLICE',
+ 'WORLD_VEHICLE_POLICE_NEXT_TO_CAR',
+ 'WORLD_VEHICLE_QUARRY',
+ 'WORLD_VEHICLE_SALTON',
+ 'WORLD_VEHICLE_SALTON_DIRT_BIKE',
+ 'WORLD_VEHICLE_SECURITY_CAR',
+ 'WORLD_VEHICLE_STREETRACE',
+ 'WORLD_VEHICLE_TOURBUS',
+ 'WORLD_VEHICLE_TOURIST',
+ 'WORLD_VEHICLE_TANDL',
+ 'WORLD_VEHICLE_TRACTOR',
+ 'WORLD_VEHICLE_TRACTOR_BEACH',
+ 'WORLD_VEHICLE_TRUCK_LOGS',
+ 'WORLD_VEHICLE_TRUCKS_TRAILERS',
+ 'WORLD_VEHICLE_DISTANT_EMPTY_GROUND',
+ 'WORLD_HUMAN_PAPARAZZI'
+ }
+
+ for i, v in pairs(scenarios) do
+ SetScenarioTypeEnabled(v, false)
+ end
+ end
+
SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates)
StartServerSyncLoops()
end)
@@ -607,27 +685,8 @@ AddEventHandler("esx:freezePlayer", function(input)
end
end)
-RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
- if not IsModelInCdimage(Model) then
- return TriggerServerEvent("esx:ReturnVehicleType", false, Request)
- end
-
- if Model == `submersible` or Model == `submersible2` then
- return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request)
- end
-
- local VehicleType = GetVehicleClassFromName(Model)
- local types = {
- [8] = "bike",
- [11] = "trailer",
- [13] = "bike",
- [14] = "boat",
- [15] = "heli",
- [16] = "plane",
- [21] = "train",
- }
-
- TriggerServerEvent("esx:ReturnVehicleType", types[VehicleType] or "automobile", Request)
+ESX.RegisterClientCallback("esx:GetVehicleType", function(cb, model)
+ cb(ESX.GetVehicleType(model))
end)
local DoNotUse = {
@@ -646,3 +705,7 @@ for i = 1, #DoNotUse do
print("[^1ERROR^7] YOU ARE USING A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5" .. DoNotUse[i] .. "^7")
end
end
+
+RegisterNetEvent('esx:updatePlayerData', function(key, val)
+ ESX.SetPlayerData(key, val)
+end)
\ No newline at end of file
diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua
index 47f3aa4a1..95e141301 100644
--- a/[core]/es_extended/client/modules/actions.lua
+++ b/[core]/es_extended/client/modules/actions.lua
@@ -112,4 +112,4 @@ if Config.EnableDebug then
print('esx:exitedVehicle', 'vehicle', vehicle, 'plate', plate, 'seat', seat, 'displayName', displayName, 'netId', netId)
end)
-end
\ No newline at end of file
+end
diff --git a/[core]/es_extended/client/modules/callback.lua b/[core]/es_extended/client/modules/callback.lua
new file mode 100644
index 000000000..180c92167
--- /dev/null
+++ b/[core]/es_extended/client/modules/callback.lua
@@ -0,0 +1,40 @@
+local RequestId = 0
+local serverRequests = {}
+
+local clientCallbacks = {}
+
+---@param eventName string
+---@param callback function
+---@param ... any
+ESX.TriggerServerCallback = function(eventName, callback, ...)
+ serverRequests[RequestId] = callback
+
+ TriggerServerEvent('esx:triggerServerCallback', eventName, RequestId, GetInvokingResource() or "unknown", ...)
+
+ RequestId = RequestId + 1
+end
+
+RegisterNetEvent('esx:serverCallback', function(requestId, invoker, ...)
+ if not serverRequests[requestId] then
+ return print(('[^1ERROR^7] Server Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist.'):format(requestId, invoker))
+ end
+
+ serverRequests[requestId](...)
+ serverRequests[requestId] = nil
+end)
+
+---@param eventName string
+---@param callback function
+ESX.RegisterClientCallback = function(eventName, callback)
+ clientCallbacks[eventName] = callback
+end
+
+RegisterNetEvent('esx:triggerClientCallback', function(eventName, requestId, invoker, ...)
+ if not clientCallbacks[eventName] then
+ return print(('[^1ERROR^7] Client Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7'):format(eventName, invoker))
+ end
+
+ clientCallbacks[eventName](function(...)
+ TriggerServerEvent('esx:clientCallback', requestId, invoker, ...)
+ end, ...)
+end)
\ No newline at end of file
diff --git a/[core]/es_extended/common/modules/table.lua b/[core]/es_extended/common/modules/table.lua
index 3741e01ea..b2800c576 100644
--- a/[core]/es_extended/common/modules/table.lua
+++ b/[core]/es_extended/common/modules/table.lua
@@ -133,6 +133,25 @@ function ESX.Table.Join(t, sep)
return str
end
+-- Credits: https://github.com/JonasDev99/qb-garages/blob/b0335d67cb72a6b9ac60f62a87fb3946f5c2f33d/server/main.lua#L5
+function ESX.Table.TableContains(tab, val)
+ if type(val) == "table" then
+ for _, value in pairs(tab) do
+ if ESX.Table.TableContains(val, value) then
+ return true
+ end
+ end
+ return false
+ else
+ for _, value in pairs(tab) do
+ if value == val then
+ return true
+ end
+ end
+ end
+ return false
+end
+
-- Credit: https://stackoverflow.com/a/15706820
-- Description: sort function for pairs
function ESX.Table.Sort(t, order)
@@ -162,4 +181,4 @@ function ESX.Table.Sort(t, order)
return keys[i], t[keys[i]]
end
end
-end
\ No newline at end of file
+end
diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua
index 1c6da954d..cb13fb33c 100644
--- a/[core]/es_extended/config.lua
+++ b/[core]/es_extended/config.lua
@@ -29,15 +29,18 @@ 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 = true -- Enable support for esx_multicharacter
+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.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
diff --git a/[core]/es_extended/es_extended.sql b/[core]/es_extended/es_extended.sql
index bb156c90c..c3ef1d54e 100644
--- a/[core]/es_extended/es_extended.sql
+++ b/[core]/es_extended/es_extended.sql
@@ -15,6 +15,7 @@ CREATE TABLE `users` (
`job` VARCHAR(20) NULL DEFAULT 'unemployed',
`job_grade` INT NULL DEFAULT 0,
`loadout` LONGTEXT NULL DEFAULT NULL,
+ `metadata` LONGTEXT NULL DEFAULT NULL,
`position` longtext NULL DEFAULT NULL,
PRIMARY KEY (`identifier`)
diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua
index 78fd08c6e..2acd5ad24 100644
--- a/[core]/es_extended/fxmanifest.lua
+++ b/[core]/es_extended/fxmanifest.lua
@@ -5,7 +5,7 @@ game 'gta5'
description 'ES Extended'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
shared_scripts {
'locale.lua',
@@ -19,30 +19,39 @@ server_scripts {
'@oxmysql/lib/MySQL.lua',
'config.logs.lua',
'server/common.lua',
+ 'server/modules/callback.lua',
'server/classes/player.lua',
'server/classes/overrides/*.lua',
'server/functions.lua',
'server/onesync.lua',
'server/paycheck.lua',
+
'server/main.lua',
'server/commands.lua',
'common/modules/*.lua',
'common/functions.lua',
- 'server/modules/*.lua'
+ 'server/modules/actions.lua',
+ 'server/modules/npwd.lua'
}
client_scripts {
'client/common.lua',
'client/functions.lua',
'client/wrapper.lua',
+ 'client/modules/callback.lua',
+
'client/main.lua',
'common/modules/*.lua',
'common/functions.lua',
'common/functions.lua',
- 'client/modules/*.lua'
+ 'client/modules/actions.lua',
+ 'client/modules/death.lua',
+ 'client/modules/npwd.lua',
+ 'client/modules/scaleform.lua',
+ 'client/modules/streaming.lua',
}
ui_page {
@@ -65,8 +74,7 @@ files {
}
dependencies {
- '/server:5949',
- '/onesync',
+ '/native:0x6AE51D4B',
'oxmysql',
'spawnmanager',
}
diff --git a/[core]/es_extended/html/css/app.css b/[core]/es_extended/html/css/app.css
index 0bdbc9083..cfd2f67b1 100644
--- a/[core]/es_extended/html/css/app.css
+++ b/[core]/es_extended/html/css/app.css
@@ -1,11 +1,11 @@
@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 {
@@ -20,11 +20,12 @@ html {
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;
+ 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;
+ font-family: "Open Sans", sans-serif;
min-width: 400px;
min-height: 250px;
color: #fff;
@@ -34,7 +35,7 @@ html {
}
.menu .head {
- font-family: 'Open Sans', sans-serif;
+ font-family: "Open Sans", sans-serif;
font-size: 28px;
padding: 10px;
background: #1a1a1a;
@@ -51,14 +52,14 @@ html {
}
.menu .head span {
- font-family: 'Pricedown';
+ font-family: "Pricedown";
font-size: 28px;
padding-left: 15px;
padding-top: 6px;
}
.menu .menu-items .menu-item {
- font-family: 'Open Sans', sans-serif;
+ font-family: "Open Sans", sans-serif;
font-size: 14px;
height: 40px;
display: block;
diff --git a/[core]/es_extended/html/js/app.js b/[core]/es_extended/html/js/app.js
index 26fb67e4a..029ecc00c 100644
--- a/[core]/es_extended/html/js/app.js
+++ b/[core]/es_extended/html/js/app.js
@@ -1,38 +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/wrapper.js b/[core]/es_extended/html/js/wrapper.js
index 0d2087093..92ee2785a 100644
--- a/[core]/es_extended/html/js/wrapper.js
+++ b/[core]/es_extended/html/js/wrapper.js
@@ -1,42 +1,35 @@
(() => {
+ 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) {
+ for (let i = 0; i < str.length; i++) {
+ let count = 0;
+ let chunk = "";
- ESXWrapper.messageId = (ESXWrapper.messageId < 65535) ? ESXWrapper.messageId + 1 : 0;
- const str = JSON.stringify(msg);
+ while (count < ESXWrapper.MessageSize && i < str.length) {
+ chunk += str[i];
- for (let i = 0; i < str.length; i++) {
+ count++;
+ i++;
+ }
- let count = 0;
- let chunk = '';
+ i--;
- while (count < ESXWrapper.MessageSize && i < str.length) {
+ const data = {
+ __type: type,
+ id: ESXWrapper.messageId,
+ chunk: chunk,
+ };
- chunk += str[i];
+ if (i == str.length - 1) data.end = true;
- count++;
- i++;
- }
-
- i--;
-
- const data = {
- __type: type,
- id: ESXWrapper.messageId,
- chunk: chunk
- }
-
- 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/locales/de.lua b/[core]/es_extended/locales/de.lua
index 1401ce14c..9a6ea35c8 100644
--- a/[core]/es_extended/locales/de.lua
+++ b/[core]/es_extended/locales/de.lua
@@ -185,8 +185,8 @@ Locales['de'] = {
['weapon_doubleaction'] = 'double-Action Revolver',
-- Weapon Components
- ['component_clip_default'] = 'standart Griff',
- ['component_clip_extended'] = 'erweiterter Griff',
+ ['component_clip_default'] = 'standart Magazin',
+ ['component_clip_extended'] = 'erweiterters Magazin',
['component_clip_drum'] = 'Trommelmagazin',
['component_clip_box'] = 'Kastenmagazin',
['component_flashlight'] = 'Taschenlampe',
diff --git a/[core]/es_extended/locales/it.lua b/[core]/es_extended/locales/it.lua
new file mode 100644
index 000000000..0bdc015e7
--- /dev/null
+++ b/[core]/es_extended/locales/it.lua
@@ -0,0 +1,365 @@
+Locales['it'] = {
+ -- Inventory
+ ['inventory'] = 'Inventario ( Peso %s / %s )',
+ ['use'] = 'Usa',
+ ['give'] = 'Dai',
+ ['remove'] = 'Butta',
+ ['return'] = 'Ritorna',
+ ['give_to'] = 'Dai a',
+ ['amount'] = 'Quantità',
+ ['giveammo'] = 'Dai munizioni',
+ ['amountammo'] = 'Quantità munizioni',
+ ['noammo'] = 'Non abbastanza!',
+ ['gave_item'] = 'Dando %sx %s a %s',
+ ['received_item'] = 'Ricevuto %sx %s da %s',
+ ['gave_weapon'] = 'Dando %s a %s',
+ ['gave_weapon_ammo'] = 'Dando ~o~%sx %s for %s to %s',
+ ['gave_weapon_withammo'] = 'Dando %s con ~o~%sx %s a %s',
+ ['gave_weapon_hasalready'] = '%s possiede già %s',
+ ['gave_weapon_noweapon'] = '%s non ha quell\' arma',
+ ['received_weapon'] = 'Ricevuto %s da %s',
+ ['received_weapon_ammo'] = 'Ricevuto ~o~%sx %s per il tuo %s da %s',
+ ['received_weapon_withammo'] = 'Ricevuto %s con ~o~%sx %s per %s',
+ ['received_weapon_hasalready'] = '%s ha tentato di darti %s, ma hai già l\'arma',
+ ['received_weapon_noweapon'] = '%s ha tentato di darti munizioni per %s, ma non hai l\'arma',
+ ['gave_account_money'] = 'Dando $%s (%s) a %s',
+ ['received_account_money'] = 'Ricevuto $%s (%s) da %s',
+ ['amount_invalid'] = 'Quantità non valida',
+ ['players_nearby'] = 'Nessun giocatore vicino',
+ ['ex_inv_lim'] = 'Non puoi farlo, eccedi il peso di %s',
+ ['imp_invalid_quantity'] = 'Non puoi farlo, quantità non valida',
+ ['imp_invalid_amount'] = 'Non puoi farlo, importo non valido',
+ ['threw_standard'] = 'Gettando %sx %s',
+ ['threw_account'] = 'Gettando $%s %s',
+ ['threw_weapon'] = 'Gettando %s',
+ ['threw_weapon_ammo'] = 'Gettando %s con ~o~%sx %s',
+ ['threw_weapon_already'] = 'Hai gia quest\' arma',
+ ['threw_cannot_pickup'] = 'Inventario pieno, non puoi raccogliere!',
+ ['threw_pickup_prompt'] = 'Premi E per raccogliere',
+
+ -- Key mapping
+ ['keymap_showinventory'] = 'Apri inventario',
+
+ -- Salary related
+ ['received_salary'] = 'Sei stato pagato: $%s',
+ ['received_help'] = 'Hai ricevuto il reddito di cittadinanza: $%s',
+ ['company_nomoney'] = 'La tua compagnia è troppo povera per pagarti',
+ ['received_paycheck'] = 'Ricveuto stipendio',
+ ['bank'] = 'Banca',
+ ['account_bank'] = 'Conto',
+ ['account_black_money'] = 'Soldi sporchi',
+ ['account_money'] = 'Contanti',
+
+ ['act_imp'] = 'Non puoi farlo',
+ ['in_vehicle'] = 'Non puoi farlo, il giocatore è in un veicolo',
+
+ -- Commands
+ ['command_bring'] = 'Porta il giocatore da te',
+ ['command_car'] = 'Spawna un veicolo',
+ ['command_car_car'] = 'Modello o hash veicolo',
+ ['command_cardel'] = 'Rimuovi i veicoli nelle prossimità',
+ ['command_cardel_radius'] = 'Rimuovi i veicoli nel raggio specificato',
+ ['command_clear'] = 'Pulisci la chat testuale',
+ ['command_clearall'] = 'Pulisci la chat testuale per tutti i giocatori',
+ ['command_clearinventory'] = 'Rimuovi tutti gli oggetti dall\' inventario del giocatore',
+ ['command_clearloadout'] = 'Rimuovi tutte le armi dal loadout del giocatore',
+ ['command_freeze'] = 'Blocca un giocatore',
+ ['command_unfreeze'] = 'Sblocca un giocatore',
+ ['command_giveaccountmoney'] = 'Dai soldi a un\' account specifico',
+ ['command_giveaccountmoney_account'] = 'Account a cui aggiungere',
+ ['command_giveaccountmoney_amount'] = 'Quantità da aggiungere',
+ ['command_giveaccountmoney_invalid'] = 'Nome account non valido',
+ ['command_giveitem'] = 'Dai un oggetto ad un giocatore',
+ ['command_giveitem_item'] = 'Nome oggetto',
+ ['command_giveitem_count'] = 'Quantità',
+ ['command_giveweapon'] = 'Dai un\' arma ad un giocatore',
+ ['command_giveweapon_weapon'] = 'Nome arma',
+ ['command_giveweapon_ammo'] = 'Quantità munizioni',
+ ['command_giveweapon_hasalready'] = 'Il giocatore ha già l\'arma',
+ ['command_giveweaponcomponent'] = 'Dai un componente arma ad un giocatore',
+ ['command_giveweaponcomponent_component'] = 'Nome componente',
+ ['command_giveweaponcomponent_invalid'] = 'Componente arma non valido',
+ ['command_giveweaponcomponent_hasalready'] = 'Il giocatore ha già questo componente arma',
+ ['command_giveweaponcomponent_missingweapon'] = 'Il giocatore non ha l\'arma',
+ ['command_goto'] = 'Teletrasportati da un giocatore',
+ ['command_kill'] = 'Uccidi un giocatore',
+ ['command_save'] = 'Salva forzatamente i dati di un giocatore',
+ ['command_saveall'] = 'Salva forzatamente i dati di tutti igiocatoria',
+ ['command_setaccountmoney'] = 'Aggiorna i soldi dentro un account specifico',
+ ['command_setaccountmoney_amount'] = 'Quantità',
+ ['command_setcoords'] = 'Teletrasportati a delle coordinate specifiche',
+ ['command_setcoords_x'] = 'Valore X',
+ ['command_setcoords_y'] = 'Valore Y',
+ ['command_setcoords_z'] = 'Valore Z',
+ ['command_setjob'] = 'Setta lavoro ad un giocatore',
+ ['command_setjob_job'] = 'Nome',
+ ['command_setjob_grade'] = 'Grado lavoro',
+ ['command_setjob_invalid'] = 'Il lavoro, grado o entrambi sono errati',
+ ['command_setgroup'] = 'Setta un gruppo di permessi ad un giocatore',
+ ['command_setgroup_group'] = 'Nome del gruppo',
+ ['commanderror_argumentmismatch'] = 'Conta argomenti non valida (passati %s, richiesti %s)',
+ ['commanderror_argumentmismatch_number'] = 'Argomento #%s di tipologia errata (passato testo, richiesto numero)',
+ ['commanderror_invaliditem'] = 'Oggetto non valido',
+ ['commanderror_invalidweapon'] = 'Arma non valida',
+ ['commanderror_console'] = 'Comando non eseguibile dalla console',
+ ['commanderror_invalidcommand'] = 'Comando non valido - /%s',
+ ['commanderror_invalidplayerid'] = 'Il giocatore specificato non è online',
+ ['commandgeneric_playerid'] = 'Id server del giocatore',
+ ['command_giveammo_noweapon_found'] = '%s non ha quell\' arma',
+ ['command_giveammo_weapon'] = 'Nome arma',
+ ['command_giveammo_ammo'] = 'Quantità munizioni',
+ ['tpm_nowaypoint'] = 'Nessuna meta impostata',
+ ['tpm_success'] = 'Teletrasportato con successo',
+
+ ['noclip_message'] = 'Noclip %s',
+ ['enabled'] = '~g~abilitato~s~',
+ ['disabled'] = '~r~disabilitato~s~',
+
+ -- Locale settings
+ ['locale_digit_grouping_symbol'] = ',',
+ ['locale_currency'] = '$%s',
+
+ -- Weapons
+
+ -- Melee
+ ['weapon_dagger'] = 'Pugnale Antico',
+ ['weapon_bat'] = 'Mazza',
+ ['weapon_battleaxe'] = 'Ascia',
+ ['weapon_bottle'] = 'Bottiglia',
+ ['weapon_crowbar'] = 'Piede di porco',
+ ['weapon_flashlight'] = 'Torcia',
+ ['weapon_golfclub'] = 'Mazza da golf',
+ ['weapon_hammer'] = 'Martello',
+ ['weapon_hatchet'] = 'Accetta',
+ ['weapon_knife'] = 'Coltello',
+ ['weapon_knuckle'] = 'Tirapugni',
+ ['weapon_machete'] = 'Machete',
+ ['weapon_nightstick'] = 'Manganello',
+ ['weapon_wrench'] = 'Tubo',
+ ['weapon_poolcue'] = 'Stecca',
+ ['weapon_stone_hatchet'] = 'Accetta di pietra',
+ ['weapon_switchblade'] = 'Coltello a serramanico',
+
+ -- Handguns
+ ['weapon_appistol'] = 'Pistola AP',
+ ['weapon_ceramicpistol'] = 'Pistola di ceramica',
+ ['weapon_combatpistol'] = 'Pistola da combattimento',
+ ['weapon_doubleaction'] = 'Revolver doppia azione',
+ ['weapon_navyrevolver'] = 'Revolver Marina',
+ ['weapon_flaregun'] = 'Pistola lanciarazzi',
+ ['weapon_gadgetpistol'] = 'Pistola Gadget',
+ ['weapon_heavypistol'] = 'Pistola pesante',
+ ['weapon_revolver'] = 'Revolver pesante',
+ ['weapon_revolver_mk2'] = 'Revolver pesante MK2',
+ ['weapon_marksmanpistol'] = 'Pistola da tiratore',
+ ['weapon_pistol'] = 'Pistola',
+ ['weapon_pistol_mk2'] = 'Pistola MK2',
+ ['weapon_pistol50'] = 'Pistola .50',
+ ['weapon_snspistol'] = 'Pistola SNS',
+ ['weapon_snspistol_mk2'] = 'Pistola SNS MK2',
+ ['weapon_stungun'] = 'Taser',
+ ['weapon_raypistol'] = 'Up-N-Atomizzatore',
+ ['weapon_vintagepistol'] = 'Pistola Vintage',
+
+ -- Shotguns
+ ['weapon_assaultshotgun'] = 'Fucile a pompa d\'assalto',
+ ['weapon_autoshotgun'] = 'Fucile a pompa automatico',
+ ['weapon_bullpupshotgun'] = 'Fucile a pompa Bullup',
+ ['weapon_combatshotgun'] = 'Fucile a pompa da combattimento',
+ ['weapon_dbshotgun'] = 'Fucile a pompa doppia canna',
+ ['weapon_heavyshotgun'] = 'Fucile a pompa pesante',
+ ['weapon_musket'] = 'Moschetto',
+ ['weapon_pumpshotgun'] = 'Fucile a pompa',
+ ['weapon_pumpshotgun_mk2'] = 'Fucile a pompa MK2',
+ ['weapon_sawnoffshotgun'] = 'Fucile a canne mozza',
+
+ -- SMG & LMG
+ ['weapon_assaultsmg'] = 'SMG d\'assalto',
+ ['weapon_combatmg'] = 'MG da combattimento',
+ ['weapon_combatmg_mk2'] = 'MG da combattimento MK2',
+ ['weapon_combatpdw'] = 'PDW da combattimento',
+ ['weapon_gusenberg'] = 'Mitragliatrice Gusenberg',
+ ['weapon_machinepistol'] = 'Pistola mitragliatrice',
+ ['weapon_mg'] = 'MG',
+ ['weapon_microsmg'] = 'Micro SMG',
+ ['weapon_minismg'] = 'Mini SMG',
+ ['weapon_smg'] = 'SMG',
+ ['weapon_smg_mk2'] = 'SMG MK2',
+ ['weapon_raycarbine'] = 'Hellbringer infernale',
+
+ -- Rifles
+ ['weapon_advancedrifle'] = 'Fucile avanzato',
+ ['weapon_assaultrifle'] = 'Fucile d\'assalto',
+ ['weapon_assaultrifle_mk2'] = 'Fucile d\' assalto MK2',
+ ['weapon_bullpuprifle'] = 'Fucile Bullpup',
+ ['weapon_bullpuprifle_mk2'] = 'Fucile Bullpup MK2',
+ ['weapon_carbinerifle'] = 'Carabina',
+ ['weapon_carbinerifle_mk2'] = 'Carbine MK2',
+ ['weapon_compactrifle'] = 'Fucile compatto',
+ ['weapon_militaryrifle'] = 'Fucile militare',
+ ['weapon_specialcarbine'] = 'Carabina speciale',
+ ['weapon_specialcarbine_mk2'] = 'Carabina speciale MK2',
+
+ -- Sniper
+ ['weapon_heavysniper'] = 'Cecchino pesante',
+ ['weapon_heavysniper_mk2'] = 'Cecchino pesante MK2',
+ ['weapon_marksmanrifle'] = 'Fucile da tiratore',
+ ['weapon_marksmanrifle_mk2'] = 'Fucile da tiratore MK2',
+ ['weapon_sniperrifle'] = 'Cecchino',
+
+ -- Heavy / Launchers
+ ['weapon_compactlauncher'] = 'Lanciagranate compatto',
+ ['weapon_firework'] = 'Cannone pirotecnico',
+ ['weapon_grenadelauncher'] = 'Lanciagranate',
+ ['weapon_hominglauncher'] = 'Lanciarazzi a tracciamento',
+ ['weapon_minigun'] = 'Minigun',
+ ['weapon_railgun'] = 'Railgun',
+ ['weapon_rpg'] = 'Lanciarazzi',
+ ['weapon_rayminigun'] = 'Widowmaker',
+
+ -- Criminal Enterprises DLC
+ ['weapon_metaldetector'] = 'Metal Detector',
+ ['weapon_precisionrifle'] = 'Fucile di precisione',
+ ['weapon_tactilerifle'] = 'Carabina di servizio',
+
+ -- Thrown
+ ['weapon_ball'] = 'Palla',
+ ['weapon_bzgas'] = 'BZ Gas',
+ ['weapon_flare'] = 'Flare',
+ ['weapon_grenade'] = 'Granata',
+ ['weapon_petrolcan'] = 'Tanica',
+ ['weapon_hazardcan'] = 'Tanica pericolosa',
+ ['weapon_molotov'] = 'Molotov',
+ ['weapon_proxmine'] = 'Mina di prossimità',
+ ['weapon_pipebomb'] = 'Esplosivo plastico',
+ ['weapon_snowball'] = 'Palla di neve',
+ ['weapon_stickybomb'] = 'Bomba adesiva',
+ ['weapon_smokegrenade'] = 'Gas lacrimogeno',
+
+ -- Special
+ ['weapon_fireextinguisher'] = 'Estintore',
+ ['weapon_digiscanner'] = 'Scanner digitale',
+ ['weapon_garbagebag'] = 'Sacco della spazzatura',
+ ['weapon_handcuffs'] = 'Manette',
+ ['gadget_nightvision'] = 'Visore termico',
+ ['gadget_parachute'] = 'Paracadute',
+
+ -- Weapon Components
+ ['component_knuckle_base'] = 'Modello basa',
+ ['component_knuckle_pimp'] = 'il Pappone',
+ ['component_knuckle_ballas'] = 'i Ballas',
+ ['component_knuckle_dollar'] = 'il Riccone',
+ ['component_knuckle_diamond'] = 'la Roccia',
+ ['component_knuckle_hate'] = 'l\' Hater',
+ ['component_knuckle_love'] = 'l\' Amante',
+ ['component_knuckle_player'] = 'il Giocatore',
+ ['component_knuckle_king'] = 'il Re',
+ ['component_knuckle_vagos'] = 'i Vagos',
+
+ ['component_luxary_finish'] = 'rifinitura di lusso',
+
+ ['component_handle_default'] = 'impugnatura base',
+ ['component_handle_vip'] = 'impugnatura VIP',
+ ['component_handle_bodyguard'] = 'impugnatura guardia del corpo',
+
+ ['component_vip_finish'] = 'rifinitura VIP',
+ ['component_bodyguard_finish'] = 'rifinitura Guardia del corpo',
+
+ ['component_camo_finish'] = 'mimetica Digitale',
+ ['component_camo_finish2'] = 'mimetica Cespuglio',
+ ['component_camo_finish3'] = 'mimetica Legnosa',
+ ['component_camo_finish4'] = 'mimetica Teschio',
+ ['component_camo_finish5'] = 'mimetica Sessanta Nove',
+ ['component_camo_finish6'] = 'mimetica Perseo',
+ ['component_camo_finish7'] = 'mimetica Leopardata',
+ ['component_camo_finish8'] = 'mimetica Zebra',
+ ['component_camo_finish9'] = 'mimetica Geometrica',
+ ['component_camo_finish10'] = 'mimetica Boom',
+ ['component_camo_finish11'] = 'mimetica Patriottica',
+
+ ['component_camo_slide_finish'] = 'mimetica Digitale Slide',
+ ['component_camo_slide_finish2'] = 'mimetica Cespuglio Slide',
+ ['component_camo_slide_finish3'] = 'mimetica Legnosa Slide',
+ ['component_camo_slide_finish4'] = 'mimetica Teschio Slide',
+ ['component_camo_slide_finish5'] = 'mimetica Sessanta Nove Slide',
+ ['component_camo_slide_finish6'] = 'mimetica Perseo Slide',
+ ['component_camo_slide_finish7'] = 'mimetica Leopardata Slide',
+ ['component_camo_slide_finish8'] = 'mimetica Zebra Slide',
+ ['component_camo_slide_finish9'] = 'mimetica Geometrica Slide',
+ ['component_camo_slide_finish10'] = 'mimetica Boom Slide',
+ ['component_camo_slide_finish11'] = 'mimetica Patriottica Slide',
+
+ ['component_clip_default'] = 'caricatore Standard',
+ ['component_clip_extended'] = 'caricatore Esteso',
+ ['component_clip_drum'] = 'caricatore A Batteria',
+ ['component_clip_box'] = 'caricatore A Scatola',
+
+ ['component_scope_holo'] = 'mirino Olografico',
+ ['component_scope_small'] = 'mirino Piccolo',
+ ['component_scope_medium'] = 'mirino Medio',
+ ['component_scope_large'] = 'mirino Largo',
+ ['component_scope'] = 'mirino Montato',
+ ['component_scope_advanced'] = 'mirino Avanzato',
+ ['component_ironsights'] = 'integrato',
+
+ ['component_suppressor'] = 'silenziatore',
+ ['component_compensator'] = 'compensatore',
+
+ ['component_muzzle_flat'] = 'freno Di Bocca Piatto',
+ ['component_muzzle_tactical'] = 'freno Di Bocca Tattico',
+ ['component_muzzle_fat'] = 'freno Di Bocca Grosso',
+ ['component_muzzle_precision'] = 'freno Di Bocca Di Precisione',
+ ['component_muzzle_heavy'] = 'freno Di Bocca Pesante',
+ ['component_muzzle_slanted'] = 'freno Di Bocca Inclinato',
+ ['component_muzzle_split'] = 'freno Di Bocca Diviso',
+ ['component_muzzle_squared'] = 'freno Di Bocca Quadrato',
+
+ ['component_flashlight'] = 'torcia',
+ ['component_grip'] = 'impugnatura',
+
+ ['component_barrel_default'] = 'canna Standard',
+ ['component_barrel_heavy'] = 'canna Pesante',
+
+ ['component_ammo_tracer'] = 'munizioni Traccianti',
+ ['component_ammo_incendiary'] = 'munizioni Incendiarie',
+ ['component_ammo_hollowpoint'] = 'munizioni a Punta Cava',
+ ['component_ammo_fmj'] = 'munizioni fMj',
+ ['component_ammo_armor'] = 'munizioni penetranti',
+ ['component_ammo_explosive'] = 'munizioni penetranti incendiarie',
+
+ ['component_shells_default'] = 'cartucce Standard',
+ ['component_shells_incendiary'] = 'cartucce alito di Drago',
+ ['component_shells_armor'] = 'cartucce a pallettoni',
+ ['component_shells_hollowpoint'] = 'cartucce a freccette',
+ ['component_shells_explosive'] = 'cartucce esplosive',
+
+ -- Weapon Ammo
+ ['ammo_rounds'] = 'colpo(i)',
+ ['ammo_shells'] = 'cartuccia(e)',
+ ['ammo_charge'] = 'carica',
+ ['ammo_petrol'] = 'Litri di carburante',
+ ['ammo_firework'] = 'fuochi d\'artificio',
+ ['ammo_rockets'] = 'razzo(i)',
+ ['ammo_grenadelauncher'] = 'granata(e)',
+ ['ammo_grenade'] = 'granata(e)',
+ ['ammo_stickybomb'] = 'bomba(e)',
+ ['ammo_pipebomb'] = 'bomba(e)',
+ ['ammo_smokebomb'] = 'bomba(e)',
+ ['ammo_molotov'] = 'bottiglia(e)',
+ ['ammo_proxmine'] = 'mina(e)',
+ ['ammo_bzgas'] = 'latta(e)',
+ ['ammo_ball'] = 'palla(e)',
+ ['ammo_snowball'] = 'palle di neve',
+ ['ammo_flare'] = 'razzo(i)',
+ ['ammo_flaregun'] = 'razzo(i)',
+
+ -- Weapon Tints
+ ['tint_default'] = 'Colore standard',
+ ['tint_green'] = 'color verde',
+ ['tint_gold'] = 'color oro',
+ ['tint_pink'] = 'color rosa',
+ ['tint_army'] = 'color army',
+ ['tint_lspd'] = 'color blu',
+ ['tint_orange'] = 'color arancio',
+ ['tint_platinum'] = 'color platino',
+}
diff --git a/[core]/es_extended/locales/nl.lua b/[core]/es_extended/locales/nl.lua
index bde39f806..86e8ed349 100644
--- a/[core]/es_extended/locales/nl.lua
+++ b/[core]/es_extended/locales/nl.lua
@@ -10,108 +10,114 @@ Locales['nl'] = {
['giveammo'] = 'Geef munitie',
['amountammo'] = 'Hoeveelheid munitie',
['noammo'] = 'Niet genoeg!',
- ['gave_item'] = 'Geeft %sx %s aan %s',
- ['received_item'] = 'Ontvangen %sx %s van %s',
- ['gave_weapon'] = 'Geven %s aan %s',
- ['gave_weapon_ammo'] = 'Geeft ~o~%sx %s voor %s aan %s',
- ['gave_weapon_withammo'] = 'Geeft %s met ~o~%sx %s aan %s',
+ ['gave_item'] = '%sx %s gegeven aan %s',
+ ['received_item'] = '%sx %s ontvangen van %s',
+ ['gave_weapon'] = '%s gegeven aan %s',
+ ['gave_weapon_ammo'] = '~o~%sx %s gegeven voor een %s aan %s',
+ ['gave_weapon_withammo'] = '%s gegeven met ~o~%sx %s aan %s',
['gave_weapon_hasalready'] = '%s heeft al een %s',
- ['gave_weapon_noweapon'] = '%s heeft geen wapen',
- ['received_weapon'] = '%s gekregen van %s',
- ['received_weapon_ammo'] = 'Ontvangen ~o~%sx %s voor uw %s van %s',
- ['received_weapon_withammo'] = 'Ontvangen %s met ~o~%sx %s van %s',
- ['received_weapon_hasalready'] = '%s heeft geprobeerd je een %s, te geven, maar je hebt dit wapen al',
- ['received_weapon_noweapon'] = '%s heeft geprobeerd je munitie te geven voor een %s, maar je hebt dit wapen niet',
- ['gave_account_money'] = 'Geef $%s (%s) aan %s',
- ['received_account_money'] = 'Ontvangen $%s (%s) van %s',
+ ['gave_weapon_noweapon'] = '%s heeft dat wapen niet',
+ ['received_weapon'] = '%s ontvangen van %s',
+ ['received_weapon_ammo'] = '~o~%sx %s ontvangen voor je %s van %s',
+ ['received_weapon_withammo'] = '%s ontvangen met ~o~%sx %s van %s',
+ ['received_weapon_hasalready'] = '%s heeft geprobeerd je een %s te geven, maar je hebt dat wapen al.',
+ ['received_weapon_noweapon'] = '%s heeft geprobeerd je ammo te geven voor een %s, maar je hebt dit wapen niet',
+ ['gave_account_money'] = '€%s (%s) gegeven aan %s',
+ ['received_account_money'] = '€%s (%s) ontvangen van %s',
['amount_invalid'] = 'Ongeldige hoeveelheid',
['players_nearby'] = 'Geen spelers in de buurt',
['ex_inv_lim'] = 'Kan actie niet uitvoeren, overschrijdt max. gewicht van %s',
['imp_invalid_quantity'] = 'Kan actie niet uitvoeren, de hoeveelheid is ongeldig',
- ['imp_invalid_amount'] = 'Kan actie niet uitvoeren, het bedrag is ongeldig',
- ['threw_standard'] = 'Gooien %sx %s',
- ['threw_account'] = 'Gooien $%s %s',
- ['threw_weapon'] = 'Gooien %s',
- ['threw_weapon_ammo'] = 'Gooien %s met ~o~%sx %s',
- ['threw_weapon_already'] = 'Je hebt dit wapen al',
- ['threw_cannot_pickup'] = 'Inventaris is vol, kan niet worden opgehaald!',
- ['threw_pickup_prompt'] = 'Druk op E om op te halen',
+ ['imp_invalid_amount'] = 'Kan actie niet uitvoeren, het aantal is ongeldig',
+ ['threw_standard'] = '%sx %s weggegooid',
+ ['threw_account'] = '€%s %s weggegooid',
+ ['threw_weapon'] = '%s weggegooid',
+ ['threw_weapon_ammo'] = '%s met ~o~%sx %s weggegooid',
+ ['threw_weapon_already'] = 'Je hebt dit wapen al !',
+ ['threw_cannot_pickup'] = 'Inventoraris is vol, Kan niet oppakken!',
+ ['threw_pickup_prompt'] = 'Druk op E om op te pakken',
-- Key mapping
- ['keymap_showinventory'] = 'Toon inventaris',
+ ['keymap_showinventory'] = 'Laat inventaris zien',
-- Salary related
- ['received_salary'] = 'U bent betaald: $%s',
- ['received_help'] = 'U heeft uw bijstandsuitkering ontvangen: $%s',
- ['company_nomoney'] = 'het bedrijf waar u werkt is te arm om uw salaris uit te betalen',
+ ['received_salary'] = 'Je bent betaald: €%s',
+ ['received_help'] = 'Je hebt je uitkering gekregen: €%s',
+ ['company_nomoney'] = 'Het bedrijf waar je bij werkt heeft te weinig geld om je uit te betalen.',
['received_paycheck'] = 'salaris ontvangen',
- ['bank'] = 'Doolhofbank',
+ ['bank'] = 'Maze Bank',
['account_bank'] = 'Bank',
['account_black_money'] = 'Zwart geld',
- ['account_money'] = 'Geld',
+ ['account_money'] = 'Cash',
['act_imp'] = 'Kan actie niet uitvoeren',
- ['in_vehicle'] = 'Kan actie niet uitvoeren, speler zit in voertuig',
+ ['in_vehicle'] = 'Kan actie niet uitvoeren, de speler zit in een voertuig.',
-- Commands
- ['command_bring'] = 'Breng speler naar je toe',
+ ['command_bring'] = 'Breng speler naar jou',
['command_car'] = 'Spawn een voertuig',
- ['command_car_car'] = 'Voertuigmodel of hash',
- ['command_cardel'] = 'Verwijder voertuigen in de buurt',
- ['command_cardel_radius'] = 'Verwijdert alle voertuigen binnen de opgegeven straal',
- ['command_clear'] = 'Chattekst wissen',
- ['command_clearall'] = 'Clear chattekst voor alle spelers',
- ['command_clearinventory'] = 'Verwijder alle items uit de spelersinventaris',
- ['command_clearloadout'] = 'Verwijder alle wapens uit de spelersuitrusting',
- ['command_freeze'] = 'Bevries een speler',
- ['command_unfreeze'] = 'Bevries een speler',
- ['command_giveaccountmoney'] = 'Geef geld aan een gespecificeerde rekening',
+ ['command_car_car'] = 'Voertuig model of hash',
+ ['command_cardel'] = 'Verwijder voertuigen in straal',
+ ['command_cardel_radius'] = 'Verwijderd alle voertuigen in gewenste straal',
+ ['command_clear'] = 'Verwijder chat berichten',
+ ['command_clearall'] = 'Verwijder chat berichten voor alle spelers',
+ ['command_clearinventory'] = 'Verwijder alle items van een speler zijn inventory',
+ ['command_clearloadout'] = 'Verwijder alle wapens die een speler heeft',
+ ['command_freeze'] = 'Freeze een speler',
+ ['command_unfreeze'] = 'Unfreeze een speler',
+ ['command_giveaccountmoney'] = 'Geef geld aan een rekening',
['command_giveaccountmoney_account'] = 'Account om aan toe te voegen',
- ['command_giveaccountmoney_amount'] = 'Toe te voegen bedrag',
- ['command_giveaccountmoney_invalid'] = 'Accountnaam ongeldig',
- ['command_giveitem'] = 'Geef de speler een item',
- ['command_giveitem_item'] = 'Artikelnaam',
- ['command_giveitem_count'] = 'Aantal',
- ['command_giveweapon'] = 'Geef speler een wapen',
- ['command_giveweapon_weapon'] = 'Wapennaam',
- ['command_giveweapon_ammo'] = 'Hoeveelheid munitie',
+ ['command_giveaccountmoney_amount'] = 'Bedrag om toe te voegen',
+ ['command_giveaccountmoney_invalid'] = 'Account Naam ongeldig',
+ ['command_giveitem'] = 'Geef speler een item',
+ ['command_giveitem_item'] = 'Item naam',
+ ['command_giveitem_count'] = 'Hoeveelheid',
+ ['command_giveweapon'] = 'Geef de speler een wapen',
+ ['command_giveweapon_weapon'] = 'Wapen naam',
+ ['command_giveweapon_ammo'] = 'Ammo Hoeveelheid',
['command_giveweapon_hasalready'] = 'Speler heeft dit wapen al',
- ['command_giveweaponcomponent'] = 'Geef wapencomponent aan speler',
- ['command_giveweaponcomponent_component'] = 'Componentnaam',
- ['command_giveweaponcomponent_invalid'] = 'Ongeldige wapencomponent',
- ['command_giveweaponcomponent_hasalready'] = 'Speler heeft deze wapencomponent al',
- ['command_giveweaponcomponent_missingweapon'] = 'Speler heeft dit wapen niet',
+ ['command_giveweaponcomponent'] = 'Geef wapen component aan speler',
+ ['command_giveweaponcomponent_component'] = 'Component naam',
+ ['command_giveweaponcomponent_invalid'] = 'Ongeldig wapen component',
+ ['command_giveweaponcomponent_hasalready'] = 'De speler heeft dit wapen component al',
+ ['command_giveweaponcomponent_missingweapon'] = 'De speler heeft dit wapen niet',
['command_goto'] = 'Teleporteer jezelf naar een speler',
- ['command_kill'] = 'Dood een speler',
- ['command_save'] = 'Geforceerd opslaan van spelersgegevens',
- ['command_saveall'] = 'Forceer alle spelersgegevens opslaan',
- ['command_setaccountmoney'] = 'Stel het geld in op een gespecificeerde rekening',
- ['command_setaccountmoney_amount'] = 'Bedrag',
- ['command_setcoords'] = 'Teleporteer naar opgegeven coördinaten',
- ['command_setcoords_x'] = 'X-waarde',
- ['command_setcoords_y'] = 'Y-waarde',
- ['command_setcoords_z'] = 'Z-waarde',
- ['command_setjob'] = 'Stel de taak van een speler in',
+ ['command_kill'] = 'Vermoord een speler',
+ ['command_save'] = 'Slaag een speler zijn spelerdata geforceerd op',
+ ['command_saveall'] = 'Slaag iedereen zijn spelerdata geforceerd op',
+ ['command_setaccountmoney'] = 'Stel geld in op een account',
+ ['command_setaccountmoney_amount'] = 'Amount',
+ ['command_setcoords'] = 'Telepeer naar coordinaten',
+ ['command_setcoords_x'] = 'X waarde',
+ ['command_setcoords_y'] = 'Y waarde',
+ ['command_setcoords_z'] = 'Z waarde',
+ ['command_setjob'] = 'Zet een speler zijn / haar job',
['command_setjob_job'] = 'Naam',
- ['command_setjob_grade'] = 'Functiecijfer',
- ['command_setjob_invalid'] = 'de baan, het cijfer of beide zijn ongeldig',
+ ['command_setjob_grade'] = 'Job grade',
+ ['command_setjob_invalid'] = 'De job, grade of beide zijn ongeldig',
['command_setgroup'] = 'Stel een toestemmingsgroep voor spelers in',
['command_setgroup_group'] = 'Naam van groep',
['commanderror_argumentmismatch'] = 'Ongeldig aantal argumenten (geslaagd %s, gezocht %s)',
['commanderror_argumentmismatch_number'] = 'Ongeldig argument #%s gegevenstype (doorgegeven string, gewenst nummer)',
['commanderror_invaliditem'] = 'Ongeldig item',
['commanderror_invalidweapon'] = 'Ongeldig wapen',
- ['commanderror_console'] = 'Opdracht kan niet worden uitgevoerd vanaf console',
- ['commanderror_invalidcommand'] = 'Ongeldige opdracht - /%s',
+ ['commanderror_console'] = 'Command kan niet worden uitgevoerd vanaf console.',
+ ['commanderror_invalidcommand'] = 'Ongeldig commando - /%s',
['commanderror_invalidplayerid'] = 'Opgegeven speler is niet online',
- ['commandgeneric_playerid'] = 'Server-ID van de speler',
- ['command_giveammo_noweapon_found'] = '%s does not have that weapon',
- ['command_giveammo_weapon'] = 'Weapon name',
- ['command_giveammo_ammo'] = 'Ammo Quantity',
+ ['commandgeneric_playerid'] = 'Speler server id',
+ ['command_giveammo_noweapon_found'] = '%s heeft dat wapen niet',
+ ['command_giveammo_weapon'] = 'Wapen naam',
+ ['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',
+ ['locale_currency'] = '€%s',
-- Weapons
@@ -170,8 +176,8 @@ Locales['nl'] = {
-- SMG & LMG
['weapon_assaultsmg'] = 'Aanval SMG',
['weapon_combatmg'] = 'Gevecht MG',
- ['weapon_combatmg_mk2'] = 'Vecht tegen MG MK2',
- ['weapon_combatpdw'] = 'Vecht tegen PDW',
+ ['weapon_combatmg_mk2'] = 'Combat MG MK2',
+ ['weapon_combatpdw'] = 'Combat PDW',
['weapon_gusenberg'] = 'Gusenberg-veger',
['weapon_machinepistol'] = 'Machinepistool',
['weapon_mg'] = 'MG',
@@ -211,6 +217,11 @@ Locales['nl'] = {
['weapon_rpg'] = 'Raketwerper',
['weapon_rayminigun'] = 'Weduwemaker',
+ -- Criminal Enterprises DLC
+ ['weapon_metaldetector'] = 'Metaal Detector',
+ ['weapon_precisionrifle'] = 'Precisiegeweer',
+ ['weapon_tactilerifle'] = 'Service Carbine',
+
-- Thrown
['weapon_ball'] = 'Honkbal',
['weapon_bzgas'] = 'BZ-gas',
@@ -278,10 +289,10 @@ Locales['nl'] = {
['component_camo_slide_finish10'] = 'boom Slide camouflage',
['component_camo_slide_finish11'] = 'patriottische diacamouflage',
- ['component_clip_default'] = 'standaard tijdschrift',
- ['component_clip_extended'] = 'uitgebreid tijdschrift',
- ['component_clip_drum'] = 'drummagazine',
- ['component_clip_box'] = 'doos Tijdschrift',
+ ['component_clip_default'] = 'standaard magazijn',
+ ['component_clip_extended'] = 'uitgebreid magazijn',
+ ['component_clip_drum'] = 'drum magazijn',
+ ['component_clip_box'] = 'box magazijn',
['component_scope_holo'] = 'holografisch bereik',
['component_scope_small'] = 'klein bereik',
@@ -306,8 +317,8 @@ Locales['nl'] = {
['component_flashlight'] = 'zaklamp',
['component_grip'] = 'grip',
- ['component_barrel_default'] = 'standaard vat',
- ['component_barrel_heavy'] = 'zware vat',
+ ['component_barrel_default'] = 'standaard handvat',
+ ['component_barrel_heavy'] = 'zware handvat',
['component_ammo_tracer'] = 'tracermunitie',
['component_ammo_incendiary'] = 'brandgevaarlijke munitie',
@@ -324,36 +335,31 @@ Locales['nl'] = {
-- Weapon Ammo
['ammo_rounds'] = 'ronde(n)',
- ['ammo_shells'] = 'shell(s)',
+ ['ammo_shells'] = 'huls/(zen)',
['ammo_charge'] = 'charge',
['ammo_petrol'] = 'liters brandstof',
- ['ammo_firework'] = 'vuurwerk(en)',
- ['ammo_rockets'] = 'raket(en)',
+ ['ammo_firework'] = 'vuurwerkpijl(en)',
+ ['ammo_rockets'] = 'raket(ten)',
['ammo_grenadelauncher'] = 'granaat(en)',
['ammo_grenade'] = 'granaat(en)',
- ['ammo_stickybomb'] = 'bom(en)',
- ['ammo_pipebomb'] = 'bom(en)',
- ['ammo_smokebomb'] = 'bom(en)',
+ ['ammo_stickybomb'] = 'bom(men)',
+ ['ammo_pipebomb'] = 'bom(men)',
+ ['ammo_smokebomb'] = 'bom(men)',
['ammo_molotov'] = 'cocktail(s)',
['ammo_proxmine'] = 'mijn(en)',
['ammo_bzgas'] = 'blik(ken)',
['ammo_ball'] = 'bal(len)',
- ['ammo_snowball'] = 'sneeuwbal(pen)',
+ ['ammo_snowball'] = 'sneeuwbal(len)',
['ammo_flare'] = 'flare(s)',
['ammo_flaregun'] = 'flare(s)',
-- Weapon Tints
['tint_default'] = 'standaard skin',
- ['tint_green'] = 'groene huid',
- ['tint_gold'] = 'gouden huid',
- ['tint_pink'] = 'roze huid',
- ['tint_army'] = 'legerhuid',
- ['tint_lspd'] = 'blauwe huid',
- ['tint_orange'] = 'oranje huid',
- ['tint_platinum'] = 'platina huid',
-
- -- Duty related
- ['stopped_duty'] = 'Je hebt je dienst stopgezet.',
- ['started_duty'] = 'Je bent met je dienst begonnen.',
+ ['tint_green'] = 'groene skin',
+ ['tint_gold'] = 'goude skin',
+ ['tint_pink'] = 'roze skin',
+ ['tint_army'] = 'legerprint',
+ ['tint_lspd'] = 'blauwe skin',
+ ['tint_orange'] = 'oranje skin',
+ ['tint_platinum'] = 'platina skin',
}
-
diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua
index d02757e04..e07884249 100644
--- a/[core]/es_extended/server/classes/player.lua
+++ b/[core]/es_extended/server/classes/player.lua
@@ -4,7 +4,7 @@ local DoesEntityExist = DoesEntityExist
local GetEntityCoords = GetEntityCoords
local GetEntityHeading = GetEntityHeading
-function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords)
+function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords, metadata)
local targetOverrides = Config.PlayerFunctionOverride and Core.PlayerFunctionOverrides[Config.PlayerFunctionOverride] or {}
local self = {}
@@ -22,6 +22,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
self.variables = {}
self.weight = weight
self.maxWeight = Config.MaxWeight
+ self.metadata = metadata
if Config.Multichar then self.license = 'license'.. identifier:sub(identifier:find(':'), identifier:len()) else self.license = 'license:'..identifier end
ExecuteCommand(('add_principal identifier.%s group.%s'):format(self.license, self.group))
@@ -32,6 +33,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
stateBag:set("job", self.job, true)
stateBag:set("group", self.group, true)
stateBag:set("name", self.name, true)
+ stateBag:set("metadata", self.metadata, true)
function self.triggerEvent(eventName, ...)
TriggerClientEvent(eventName, self.source, ...)
@@ -293,14 +295,18 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
if item then
count = ESX.Math.Round(count)
- local newCount = item.count - count
+ if count > 0 then
+ local newCount = item.count - count
- if newCount >= 0 then
- item.count = newCount
- self.weight = self.weight - (item.weight * count)
+ if newCount >= 0 then
+ item.count = newCount
+ self.weight = self.weight - (item.weight * count)
- TriggerEvent('esx:onRemoveInventoryItem', self.source, item.name, item.count)
- self.triggerEvent('esx:removeInventoryItem', item.name, item.count)
+ TriggerEvent('esx:onRemoveInventoryItem', self.source, item.name, item.count)
+ self.triggerEvent('esx:removeInventoryItem', item.name, item.count)
+ end
+ else
+ print(('[^1ERROR^7] Player ID:^5%s Tried remove a Invalid count -> %s of %s'):format(self.playerId, count,name))
end
end
end
@@ -573,6 +579,108 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
self.triggerEvent('esx:showHelpNotification', msg, thisFrame, beep, duration)
end
+ function self.getMeta(index, subIndex)
+ if index then
+
+ if type(index) ~= "string" then
+ return print("[^1ERROR^7] xPlayer.getMeta ^5index^7 should be ^5string^7!")
+ end
+
+ if self.metadata[index] then
+
+ if subIndex and type(self.metadata[index]) == "table" then
+ local _type = type(subIndex)
+
+ if _type == "string" then
+ if self.metadata[index][subIndex] then
+ return self.metadata[index][subIndex]
+ end
+ return
+ end
+
+ if _type == "table" then
+ local returnValues = {}
+ for i = 1, #subIndex do
+ if self.metadata[index][subIndex[i]] then
+ returnValues[subIndex[i]] = self.metadata[index][subIndex[i]]
+ else
+ print(("[^1ERROR^7] xPlayer.getMeta ^5%s^7 not esxist on ^5%s^7!"):format(subIndex[i], index))
+ end
+ end
+
+ return returnValues
+ end
+
+ end
+
+ return self.metadata[index]
+ else
+ return print(("[^1ERROR^7] xPlayer.getMeta ^5%s^7 not exist!"):format(index))
+ end
+
+ end
+
+ return self.metadata
+ end
+
+ function self.setMeta(index, value, subValue)
+ if not index then
+ return print("[^1ERROR^7] xPlayer.setMeta ^5index^7 is Missing!")
+ end
+
+ if type(index) ~= "string" then
+ return print("[^1ERROR^7] xPlayer.setMeta ^5index^7 should be ^5string^7!")
+ end
+
+ if not value then
+ return print(("[^1ERROR^7] xPlayer.setMeta ^5%s^7 is Missing!"):format(value))
+ end
+
+ local _type = type(value)
+
+ if not subValue then
+
+ if _type ~= "number" and _type ~= "string" and _type ~= "table" then
+ return print(("[^1ERROR^7] xPlayer.setMeta ^5%s^7 should be ^5number^7 or ^5string^7 or ^5table^7!"):format(value))
+ end
+
+ self.metadata[index] = value
+ else
+
+ if _type ~= "string" then
+ return print(("[^1ERROR^7] xPlayer.setMeta ^5value^7 should be ^5string^7 as a subIndex!"):format(value))
+ end
+
+ self.metadata[index][value] = subValue
+ end
+
+
+ self.triggerEvent('esx:updatePlayerData', 'metadata', self.metadata)
+ Player(self.source).state:set('metadata', self.metadata, true)
+ end
+
+ function self.clearMeta(index)
+ if not index then
+ return print(("[^1ERROR^7] xPlayer.clearMeta ^5%s^7 is Missing!"):format(index))
+ end
+
+ if type(index) == 'table' then
+ for _, val in pairs(index) do
+ self.clearMeta(val)
+ end
+
+ return
+ end
+
+ if not self.metadata[index] then
+ return print(("[^1ERROR^7] xPlayer.clearMeta ^5%s^7 not exist!"):format(index))
+ end
+
+ self.metadata[index] = nil
+ self.triggerEvent('esx:updatePlayerData', 'metadata', self.metadata)
+ Player(self.source).state:set('metadata', self.metadata, true)
+ end
+
for fnName,fn in pairs(targetOverrides) do
self[fnName] = fn(self)
end
diff --git a/[core]/es_extended/server/common.lua b/[core]/es_extended/server/common.lua
index fcadcc069..57f1479e4 100644
--- a/[core]/es_extended/server/common.lua
+++ b/[core]/es_extended/server/common.lua
@@ -4,16 +4,15 @@ ESX.Jobs = {}
ESX.Items = {}
Core = {}
Core.UsableItemsCallbacks = {}
-Core.ServerCallbacks = {}
-Core.ClientCallbacks = {}
-Core.CurrentRequestId = 0
Core.RegisteredCommands = {}
Core.Pickups = {}
Core.PickupId = 0
Core.PlayerFunctionOverrides = {}
-
+Core.DatabaseConnected = false
Core.playersByIdentifier = {}
+Core.vehicleTypesByModel = {}
+
AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
@@ -40,6 +39,7 @@ local function StartDBSync()
end
MySQL.ready(function()
+ Core.DatabaseConnected = true
if not Config.OxInventory then
local items = MySQL.query.await('SELECT * FROM items')
for k, v in ipairs(items) do
@@ -78,15 +78,6 @@ AddEventHandler('esx:clientLog', function(msg)
end
end)
-RegisterServerEvent('esx:triggerServerCallback')
-AddEventHandler('esx:triggerServerCallback', function(name, requestId,Invoke, ...)
- local source = source
-
- ESX.TriggerServerCallback(name, requestId, source,Invoke, function(...)
- TriggerClientEvent('esx:serverCallback', source, requestId,Invoke, ...)
- end, ...)
-end)
-
RegisterNetEvent("esx:ReturnVehicleType", function(Type, Request)
if Core.ClientCallbacks[Request] then
Core.ClientCallbacks[Request](Type)
diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua
index 3e10f922f..202e1b5ef 100644
--- a/[core]/es_extended/server/functions.lua
+++ b/[core]/es_extended/server/functions.lua
@@ -103,7 +103,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
end
end
- if v.validate == false then
+ if not v.validate then
error = nil
end
@@ -143,32 +143,21 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
end
end
-function ESX.RegisterServerCallback(name, cb)
- Core.ServerCallbacks[name] = cb
-end
-
-function ESX.TriggerServerCallback(name, requestId, source,Invoke, cb, ...)
- if Core.ServerCallbacks[name] then
- Core.ServerCallbacks[name](source, cb, ...)
- else
- print(('[^1ERROR^7] Server callback ^5"%s"^0 does not exist. Please Check ^5%s^7 for Errors!'):format(name, Invoke))
- end
-end
-
function Core.SavePlayer(xPlayer, cb)
local parameters = {
json.encode(xPlayer.getAccounts(true)),
xPlayer.job.name,
- xPlayer.job.grade,
+ xPlayer.job.grade,
xPlayer.group,
json.encode(xPlayer.getCoords()),
json.encode(xPlayer.getInventory(true)),
json.encode(xPlayer.getLoadout(true)),
+ json.encode(xPlayer.getMeta()),
xPlayer.identifier
}
MySQL.prepare(
- 'UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ? WHERE `identifier` = ?',
+ 'UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?',
parameters,
function(affectedRows)
if affectedRows == 1 then
@@ -200,12 +189,13 @@ function Core.SavePlayers(cb)
json.encode(xPlayer.getCoords()),
json.encode(xPlayer.getInventory(true)),
json.encode(xPlayer.getLoadout(true)),
+ json.encode(xPlayer.getMeta()),
xPlayer.identifier
}
end
MySQL.prepare(
- "UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ? WHERE `identifier` = ?",
+ "UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?",
parameters,
function(results)
if not results then
@@ -258,10 +248,21 @@ function ESX.GetIdentifier(playerId)
end
end
-function ESX.GetVehicleType(Vehicle, Player, cb)
- Core.CurrentRequestId = Core.CurrentRequestId < 65535 and Core.CurrentRequestId + 1 or 0
- Core.ClientCallbacks[Core.CurrentRequestId] = cb
- TriggerClientEvent("esx:GetVehicleType", Player, Vehicle, Core.CurrentRequestId)
+---@param model string|number
+---@param player number playerId
+---@param cb function
+
+function ESX.GetVehicleType(model, player, cb)
+ model = type(model) == 'string' and joaat(model) or model
+
+ if Core.vehicleTypesByModel[model] then
+ return cb(Core.vehicleTypesByModel[model])
+ end
+
+ ESX.TriggerClientCallback(player, "esx:GetVehicleType", function(vehicleType)
+ Core.vehicleTypesByModel[model] = vehicleType
+ cb(vehicleType)
+ end, model)
end
function ESX.DiscordLog(name, title, color, message)
diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua
index 456004e12..892b5a5ef 100644
--- a/[core]/es_extended/server/main.lua
+++ b/[core]/es_extended/server/main.lua
@@ -1,8 +1,9 @@
SetMapName('San Andreas')
SetGameType('ESX Legacy')
+local oneSyncState = GetConvar('onesync', 'off')
local newPlayer = 'INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `group` = ?'
-local loadPlayer = 'SELECT `accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`'
+local loadPlayer = 'SELECT `accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`, `metadata`'
if Config.Multichar then
newPlayer = newPlayer .. ', `firstname` = ?, `lastname` = ?, `dateofbirth` = ?, `sex` = ?, `height` = ?'
@@ -55,6 +56,7 @@ function onPlayerJoined(playerId)
if result then
loadESXPlayer(identifier, playerId, false)
else
+
createESXPlayer(identifier, playerId)
end
end
@@ -95,24 +97,31 @@ if not Config.Multichar then
local playerId = source
local identifier = ESX.GetIdentifier(playerId)
+ if oneSyncState == "off" or oneSyncState == "legacy" then
+ return deferrals.done(('[ESX] ESX Requires Onesync Infinity to work. This server currently has Onesync set to: %s'):format(oneSyncState))
+ end
+
+ if not Core.DatabaseConnected then
+ return deferrals.done(('[ESX] ESX Cannot Connect to your database. Please make sure it is correctly configured in your server.cfg'):format(oneSyncState))
+ end
+
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
- deferrals.done(
+ return deferrals.done(
('[ESX] There was an error loading your character!\nError code: identifier-active\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 account.\n\nYour identifier: %s'):format(
identifier))
else
- deferrals.done()
+ return deferrals.done()
end
else
- deferrals.done(
+ return deferrals.done(
'[ESX] There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end)
end
function loadESXPlayer(identifier, playerId, isNew)
- local userData = {accounts = {}, inventory = {}, job = {}, loadout = {}, playerName = GetPlayerName(playerId), weight = 0}
-
+ 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 = {}, {}
@@ -271,8 +280,13 @@ function loadESXPlayer(identifier, playerId, isNew)
end
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.loadout, userData.playerName, userData.coords, userData.metadata)
ESX.Players[playerId] = xPlayer
Core.playersByIdentifier[identifier] = xPlayer
@@ -307,7 +321,8 @@ function loadESXPlayer(identifier, playerId, isNew)
lastName = xPlayer.get("lastName") or "Doe",
dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000",
height = xPlayer.get("height") or 120,
- dead = false
+ dead = false,
+ metadata = xPlayer.getMeta()
}, isNew,
userData.skin)
@@ -579,7 +594,7 @@ 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)})
+ loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
end)
ESX.RegisterServerCallback('esx:isUserAdmin', function(source, cb)
@@ -594,7 +609,7 @@ ESX.RegisterServerCallback('esx:getOtherPlayerData', function(source, 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)})
+ loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
end)
ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
diff --git a/[core]/es_extended/server/modules/callback.lua b/[core]/es_extended/server/modules/callback.lua
new file mode 100644
index 000000000..4c7e17fde
--- /dev/null
+++ b/[core]/es_extended/server/modules/callback.lua
@@ -0,0 +1,43 @@
+local serverCallbacks = {}
+
+local clientRequests = {}
+local RequestId = 0
+
+---@param eventName string
+---@param callback function
+ESX.RegisterServerCallback = function(eventName, callback)
+ serverCallbacks[eventName] = callback
+end
+
+RegisterNetEvent('esx:triggerServerCallback', function(eventName, requestId, invoker, ...)
+ if not serverCallbacks[eventName] then
+ return print(('[^1ERROR^7] Server Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7'):format(eventName, invoker))
+ end
+
+ local source = source
+
+ serverCallbacks[eventName](source, function(...)
+ TriggerClientEvent('esx:serverCallback', source, requestId, invoker, ...)
+ end, ...)
+end)
+
+---@param player number playerId
+---@param eventName string
+---@param callback function
+---@param ... any
+ESX.TriggerClientCallback = function(player, eventName, callback, ...)
+ clientRequests[RequestId] = callback
+
+ TriggerClientEvent('esx:triggerClientCallback', player, eventName, RequestId, GetInvokingResource() or "unknown", ...)
+
+ RequestId = RequestId + 1
+end
+
+RegisterNetEvent('esx:clientCallback', function(requestId, invoker, ...)
+ if not clientRequests[requestId] then
+ return print(('[^1ERROR^7] Client Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist.'):format(requestId, invoker))
+ end
+
+ clientRequests[requestId](...)
+ clientRequests[requestId] = nil
+end)
\ No newline at end of file
diff --git a/[core]/esx_context/fxmanifest.lua b/[core]/esx_context/fxmanifest.lua
index 0c1f12b60..ff68b5323 100644
--- a/[core]/esx_context/fxmanifest.lua
+++ b/[core]/esx_context/fxmanifest.lua
@@ -4,7 +4,7 @@ game 'gta5'
author 'ESX-Framework & Brayden'
description 'Offical ESX Legacy Context Menu'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
ui_page 'index.html'
diff --git a/[core]/esx_context/index.html b/[core]/esx_context/index.html
index cba395b1a..676709631 100644
--- a/[core]/esx_context/index.html
+++ b/[core]/esx_context/index.html
@@ -1,443 +1,462 @@
-
-
-
-
-
-
-
-
- ESX Context HUD
-
-
-
-
-
-
-
-
-
-
- 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.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ ESX Context HUD
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
diff --git a/[core]/esx_identity/fxmanifest.lua b/[core]/esx_identity/fxmanifest.lua
index ba7133f24..618224aab 100644
--- a/[core]/esx_identity/fxmanifest.lua
+++ b/[core]/esx_identity/fxmanifest.lua
@@ -4,7 +4,7 @@ game 'gta5'
description 'ESX Identity'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
shared_scripts {
'@es_extended/imports.lua',
diff --git a/[core]/esx_identity/html/css/style.css b/[core]/esx_identity/html/css/style.css
index 5915443e8..939753f73 100644
--- a/[core]/esx_identity/html/css/style.css
+++ b/[core]/esx_identity/html/css/style.css
@@ -1,152 +1,152 @@
-@import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
+@import url("https://fonts.googleapis.com/css2?family=Oswald&display=swap");
body {
- font-family: sans-serif;
- overflow: hidden;
- display: none;
+ font-family: sans-serif;
+ overflow: hidden;
+ display: none;
}
.dialog {
- width: 332px;
- opacity : 0.95;
- position : absolute;
- margin-left: auto;
- margin-right: auto;
- top : 30.0%;
- padding: 20px;
- left : 50%; /* à 50%/50% du parent référent */
- transform : translate(-50%); /* décalage de 50% de sa propre taille */
- background-color: #152029;
- border-radius : 10px;
- box-shadow: 0 -5px 3px -3px #21303d, 0 5px 3px -3px #21303d;
- border:none;
- margin:5px;
- margin-bottom:20px;
- color: #ffffff;
+ width: 332px;
+ opacity: 0.95;
+ position: absolute;
+ margin-left: auto;
+ margin-right: auto;
+ top: 30%;
+ padding: 20px;
+ left: 50%; /* à 50%/50% du parent référent */
+ transform: translate(-50%); /* décalage de 50% de sa propre taille */
+ background-color: #152029;
+ border-radius: 10px;
+ box-shadow: 0 -5px 3px -3px #21303d, 0 5px 3px -3px #21303d;
+ border: none;
+ margin: 5px;
+ margin-bottom: 20px;
+ 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;
-}
-
-::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
- color: rgba(84,97,105,255);
- font-family: 'Oswald', sans-serif;
- font-weight: 200;
- opacity: 1; /* Firefox */
+ 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 */
}
.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;
+ 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;
+ 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%;
+ 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 d9ca6d934..0e38d430d 100644
--- a/[core]/esx_identity/html/index.html
+++ b/[core]/esx_identity/html/index.html
@@ -1,45 +1,119 @@
-
-
-
-
+
+
+
+
- ESX Identity
-
+ ESX Identity
+
-
-
-
IDENTITY
-
-
If the submit button doesn't work, please ensure that you've entered the fields correctly.
-
-
-
-
+
+
+
IDENTITY
+
+
+ If the submit button doesn't work, please ensure that you've entered
+ the fields correctly.
+
+
+
+
+
diff --git a/[core]/esx_identity/html/js/script.js b/[core]/esx_identity/html/js/script.js
index 5364f8c82..e5ffea115 100644
--- a/[core]/esx_identity/html/js/script.js
+++ b/[core]/esx_identity/html/js/script.js
@@ -1,37 +1,43 @@
$(document).ready(function () {
- $.post('http://esx_identity/ready', JSON.stringify({}));
+ $.post("http://esx_identity/ready", JSON.stringify({}));
- window.addEventListener('message', function (event) {
- if (event.data.type === 'enableui') {
+ window.addEventListener("message", function (event) {
+ if (event.data.type === "enableui") {
event.data.enable ? $(document.body).show() : $(document.body).hide();
}
});
- $('#register').submit(function (event) {
+ $("#register").submit(function (event) {
event.preventDefault();
- const dofVal = $('#dateofbirth').val();
+ const dofVal = $("#dateofbirth").val();
if (!dofVal) return;
const dateCheck = new Date(dofVal);
- const year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(dateCheck);
- const month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(dateCheck);
- const day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(dateCheck);
+ const year = new Intl.DateTimeFormat("en", { year: "numeric" }).format(
+ dateCheck
+ );
+ const month = new Intl.DateTimeFormat("en", { month: "2-digit" }).format(
+ dateCheck
+ );
+ const day = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(
+ dateCheck
+ );
const formattedDate = `${day}/${month}/${year}`;
$.post(
- 'http://esx_identity/register',
+ "http://esx_identity/register",
JSON.stringify({
- firstname: $('#firstname').val(),
- lastname: $('#lastname').val(),
+ firstname: $("#firstname").val(),
+ lastname: $("#lastname").val(),
dateofbirth: formattedDate,
sex: $("input[type='radio'][name='sex']:checked").val(),
- height: $('#height').val(),
+ height: $("#height").val(),
})
);
- $('#register').trigger('reset');
+ $("#register").trigger("reset");
});
});
diff --git a/[core]/esx_identity/locales/nl.lua b/[core]/esx_identity/locales/nl.lua
index baaad8b8c..97a482fb7 100644
--- a/[core]/esx_identity/locales/nl.lua
+++ b/[core]/esx_identity/locales/nl.lua
@@ -1,4 +1,3 @@
-
Locales['nl'] = {
['show_active_character'] = 'Actieve karakter laten zien',
['active_character'] = 'Actief karakter: %s',
@@ -9,16 +8,16 @@ Locales['nl'] = {
['thank_you_for_registering'] = 'Succesvol geregistreerd!',
['debug_xPlayer_get_first_name'] = 'Stuurt je Voornaam',
['debug_xPlayer_get_last_name'] = 'Stuurt je Achternaam',
- ['debug_xPlayer_get_full_name'] = 'Stuurt je volle naam',
+ ['debug_xPlayer_get_full_name'] = 'Stuurt je volledige naam',
['debug_xPlayer_get_sex'] = 'Stuurt je Geslacht',
['debug_xPlayer_get_dob'] = 'Stuurt je Geboortedatum ',
['debug_xPlayer_get_height'] = 'Stuurt je lengte',
- ['error_debug_xPlayer_get_first_name'] = 'Er was een probleem tijdens get verzamelen van je Voornaam.',
- ['error_debug_xPlayer_get_last_name'] = 'Er was een probleem tijdens get verzamelen van je achternaam.',
- ['error_debug_xPlayer_get_full_name'] = 'Er was een probleem tijdens get verzamelen van je volle naam.',
- ['error_debug_xPlayer_get_sex'] = 'Er was een probleem tijdens get verzamelen van je Geslacht.',
- ['error_debug_xPlayer_get_dob'] = 'Er was een probleem tijdens get verzamelen van je Geboortedatum.',
- ['error_debug_xPlayer_get_height'] = 'Er was een probleem tijdens get verzamelen van je lengte.',
+ ['error_debug_xPlayer_get_first_name'] = 'Er was een probleem tijdens het ophalen van je Voornaam.',
+ ['error_debug_xPlayer_get_last_name'] = 'Er was een probleem tijdens het ophalen van je achternaam.',
+ ['error_debug_xPlayer_get_full_name'] = 'Er was een probleem tijdens het ophalen van je volle naam.',
+ ['error_debug_xPlayer_get_sex'] = 'Er was een probleem tijdens het ophalen van je Geslacht.',
+ ['error_debug_xPlayer_get_dob'] = 'Er was een probleem tijdens het ophalen van je Geboortedatum.',
+ ['error_debug_xPlayer_get_height'] = 'Er was een probleem tijdens het ophalen van je lengte.',
['return_debug_xPlayer_get_first_name'] = 'Voornaam: %s',
['return_debug_xPlayer_get_last_name'] = 'Achternaam: %s',
['return_debug_xPlayer_get_full_name'] = 'Naam: %s',
@@ -28,7 +27,7 @@ Locales['nl'] = {
['data_incorrect'] = 'Verkeerde data, probeer opnieuw.',
['invalid_format'] = 'Verkeerde volgorde, probeer opnieuw.',
['no_identifier'] = '[ESX Identity]\nEr was een probleem tijdens het laden van je karakter!\nError Code: identifier-missing\n\nDit komt omdat je identifier mist, contacteer het server beheer.',
- ['missing_identity'] = '[ESX Identity]\nEr was een probleem tijdens het laden van je karakter!\nError Code: identity-missing\n\nHet lijkt erop dat je identiteit mist, reconnect naar de server.',
+ ['missing_identity'] = '[ESX Identity]\nEr was een probleem tijdens het laden van je karakter!\nError Code: identity-missing\n\nHet lijkt erop dat je identiteit mist, reconnect met de server.',
['deleted_identity'] = 'Karakter verwijderd, reconnect om een nieuwe te registreren.',
['already_registered'] = 'Je bent al geregistreerd.',
['invalid_firstname_format'] = 'Ongeldige Volgorde (Voornaam): Probeer het nog een keer.',
diff --git a/[core]/esx_loadingscreen/fxmanifest.lua b/[core]/esx_loadingscreen/fxmanifest.lua
index 5333324be..bf772ad67 100644
--- a/[core]/esx_loadingscreen/fxmanifest.lua
+++ b/[core]/esx_loadingscreen/fxmanifest.lua
@@ -1,5 +1,5 @@
game 'common'
-version '1.9.3'
+version '1.9.4'
fx_version 'cerulean'
author 'ESX-Framework'
lua54 'yes'
diff --git a/[core]/esx_menu_default/fxmanifest.lua b/[core]/esx_menu_default/fxmanifest.lua
index d60daad2a..8bab549c2 100644
--- a/[core]/esx_menu_default/fxmanifest.lua
+++ b/[core]/esx_menu_default/fxmanifest.lua
@@ -4,7 +4,7 @@ game 'gta5'
description 'ESX Menu Default'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
client_scripts {'@es_extended/imports.lua', 'client/main.lua'}
diff --git a/[core]/esx_menu_default/html/css/app.css b/[core]/esx_menu_default/html/css/app.css
index a4312dfea..e7f07e2b8 100644
--- a/[core]/esx_menu_default/html/css/app.css
+++ b/[core]/esx_menu_default/html/css/app.css
@@ -1,11 +1,11 @@
-@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&display=swap');
+@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&display=swap");
::-webkit-scrollbar {
display: none;
}
.menu {
- font-family: 'Poppins', sans-serif;
+ font-family: "Poppins", sans-serif;
min-width: 350px;
color: #fff;
position: absolute;
diff --git a/[core]/esx_menu_default/html/js/app.js b/[core]/esx_menu_default/html/js/app.js
index 2ce7a0f97..d53e3de83 100644
--- a/[core]/esx_menu_default/html/js/app.js
+++ b/[core]/esx_menu_default/html/js/app.js
@@ -1,378 +1,378 @@
-;(function () {
+(function () {
let MenuTpl =
'' +
- ''
- window.ESX_MENU = {}
- ESX_MENU.ResourceName = 'esx_menu_default'
- ESX_MENU.opened = {}
- ESX_MENU.focus = []
- ESX_MENU.pos = {}
+ "{{{label}}}{{#isSlider}} : <{{{sliderLabel}}}>{{/isSlider}}" +
+ "" +
+ "{{/elements}}" +
+ "" +
+ "" +
+ "";
+ window.ESX_MENU = {};
+ ESX_MENU.ResourceName = "esx_menu_default";
+ ESX_MENU.opened = {};
+ ESX_MENU.focus = [];
+ ESX_MENU.pos = {};
ESX_MENU.open = function (namespace, name, data) {
- if (typeof ESX_MENU.opened[namespace] == 'undefined') {
- ESX_MENU.opened[namespace] = {}
+ if (typeof ESX_MENU.opened[namespace] == "undefined") {
+ ESX_MENU.opened[namespace] = {};
}
- if (typeof ESX_MENU.opened[namespace][name] != 'undefined') {
- ESX_MENU.close(namespace, name)
+ if (typeof ESX_MENU.opened[namespace][name] != "undefined") {
+ ESX_MENU.close(namespace, name);
}
- if (typeof ESX_MENU.pos[namespace] == 'undefined') {
- ESX_MENU.pos[namespace] = {}
+ if (typeof ESX_MENU.pos[namespace] == "undefined") {
+ ESX_MENU.pos[namespace] = {};
}
for (let i = 0; i < data.elements.length; i++) {
- if (typeof data.elements[i].type == 'undefined') {
- data.elements[i].type = 'default'
+ if (typeof data.elements[i].type == "undefined") {
+ data.elements[i].type = "default";
}
}
- data._index = ESX_MENU.focus.length
- data._namespace = namespace
- data._name = name
+ data._index = ESX_MENU.focus.length;
+ data._namespace = namespace;
+ data._name = name;
for (let i = 0; i < data.elements.length; i++) {
- data.elements[i]._namespace = namespace
- data.elements[i]._name = name
+ data.elements[i]._namespace = namespace;
+ data.elements[i]._name = name;
}
- ESX_MENU.opened[namespace][name] = data
- ESX_MENU.pos[namespace][name] = 0
+ ESX_MENU.opened[namespace][name] = data;
+ ESX_MENU.pos[namespace][name] = 0;
for (let i = 0; i < data.elements.length; i++) {
if (data.elements[i].selected) {
- ESX_MENU.pos[namespace][name] = i
+ ESX_MENU.pos[namespace][name] = i;
} else {
- data.elements[i].selected = false
+ data.elements[i].selected = false;
}
}
ESX_MENU.focus.push({
namespace: namespace,
- name: name
- })
+ name: name,
+ });
- ESX_MENU.render()
- $('#menu_' + namespace + '_' + name)
- .find('.menu-item.selected')[0]
- .scrollIntoView()
- }
+ ESX_MENU.render();
+ $("#menu_" + namespace + "_" + name)
+ .find(".menu-item.selected")[0]
+ .scrollIntoView();
+ };
ESX_MENU.close = function (namespace, name) {
- delete ESX_MENU.opened[namespace][name]
+ delete ESX_MENU.opened[namespace][name];
for (let i = 0; i < ESX_MENU.focus.length; i++) {
if (
ESX_MENU.focus[i].namespace == namespace &&
ESX_MENU.focus[i].name == name
) {
- ESX_MENU.focus.splice(i, 1)
- break
+ ESX_MENU.focus.splice(i, 1);
+ break;
}
}
- ESX_MENU.render()
- }
+ ESX_MENU.render();
+ };
ESX_MENU.render = function () {
- let menuContainer = document.getElementById('menus')
- let focused = ESX_MENU.getFocused()
- menuContainer.innerHTML = ''
- $(menuContainer).hide()
+ let menuContainer = document.getElementById("menus");
+ let focused = ESX_MENU.getFocused();
+ menuContainer.innerHTML = "";
+ $(menuContainer).hide();
for (let namespace in ESX_MENU.opened) {
for (let name in ESX_MENU.opened[namespace]) {
- let menuData = ESX_MENU.opened[namespace][name]
- let view = JSON.parse(JSON.stringify(menuData))
+ let menuData = ESX_MENU.opened[namespace][name];
+ let view = JSON.parse(JSON.stringify(menuData));
for (let i = 0; i < menuData.elements.length; i++) {
- let element = view.elements[i]
+ let element = view.elements[i];
switch (element.type) {
- case 'default':
- break
+ case "default":
+ break;
- case 'slider': {
- element.isSlider = true
+ case "slider": {
+ element.isSlider = true;
element.sliderLabel =
- typeof element.options == 'undefined'
+ typeof element.options == "undefined"
? element.value
- : element.options[element.value]
+ : element.options[element.value];
- break
+ break;
}
default:
- break
+ break;
}
if (i == ESX_MENU.pos[namespace][name]) {
- element.selected = true
+ element.selected = true;
}
}
- let menu = $(Mustache.render(MenuTpl, view))[0]
- $(menu).hide()
- menuContainer.appendChild(menu)
+ let menu = $(Mustache.render(MenuTpl, view))[0];
+ $(menu).hide();
+ menuContainer.appendChild(menu);
}
}
- if (typeof focused != 'undefined') {
- $('#menu_' + focused.namespace + '_' + focused.name).show()
+ if (typeof focused != "undefined") {
+ $("#menu_" + focused.namespace + "_" + focused.name).show();
}
- $(menuContainer).show()
- }
+ $(menuContainer).show();
+ };
ESX_MENU.submit = function (namespace, name, data) {
$.post(
- 'http://' + ESX_MENU.ResourceName + '/menu_submit',
+ "http://" + ESX_MENU.ResourceName + "/menu_submit",
JSON.stringify({
_namespace: namespace,
_name: name,
current: data,
- elements: ESX_MENU.opened[namespace][name].elements
+ elements: ESX_MENU.opened[namespace][name].elements,
})
- )
- }
+ );
+ };
ESX_MENU.cancel = function (namespace, name) {
$.post(
- 'http://' + ESX_MENU.ResourceName + '/menu_cancel',
+ "http://" + ESX_MENU.ResourceName + "/menu_cancel",
JSON.stringify({
_namespace: namespace,
- _name: name
+ _name: name,
})
- )
- }
+ );
+ };
ESX_MENU.change = function (namespace, name, data) {
$.post(
- 'http://' + ESX_MENU.ResourceName + '/menu_change',
+ "http://" + ESX_MENU.ResourceName + "/menu_change",
JSON.stringify({
_namespace: namespace,
_name: name,
current: data,
- elements: ESX_MENU.opened[namespace][name].elements
+ elements: ESX_MENU.opened[namespace][name].elements,
})
- )
- }
+ );
+ };
ESX_MENU.getFocused = function () {
- return ESX_MENU.focus[ESX_MENU.focus.length - 1]
- }
+ return ESX_MENU.focus[ESX_MENU.focus.length - 1];
+ };
- window.onData = data => {
+ window.onData = (data) => {
switch (data.action) {
- case 'openMenu': {
- ESX_MENU.open(data.namespace, data.name, data.data)
- break
+ case "openMenu": {
+ ESX_MENU.open(data.namespace, data.name, data.data);
+ break;
}
- case 'closeMenu': {
- ESX_MENU.close(data.namespace, data.name)
- break
+ case "closeMenu": {
+ ESX_MENU.close(data.namespace, data.name);
+ break;
}
- case 'controlPressed': {
+ case "controlPressed": {
switch (data.control) {
- case 'ENTER': {
- let focused = ESX_MENU.getFocused()
+ case "ENTER": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- let menu = ESX_MENU.opened[focused.namespace][focused.name]
- let pos = ESX_MENU.pos[focused.namespace][focused.name]
- let elem = menu.elements[pos]
+ if (typeof focused != "undefined") {
+ let menu = ESX_MENU.opened[focused.namespace][focused.name];
+ let pos = ESX_MENU.pos[focused.namespace][focused.name];
+ let elem = menu.elements[pos];
if (menu.elements.length > 0) {
- ESX_MENU.submit(focused.namespace, focused.name, elem)
+ ESX_MENU.submit(focused.namespace, focused.name, elem);
}
}
- break
+ break;
}
- case 'BACKSPACE': {
- let focused = ESX_MENU.getFocused()
+ case "BACKSPACE": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- ESX_MENU.cancel(focused.namespace, focused.name)
+ if (typeof focused != "undefined") {
+ ESX_MENU.cancel(focused.namespace, focused.name);
}
- break
+ break;
}
- case 'TOP': {
- let focused = ESX_MENU.getFocused()
+ case "TOP": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- let menu = ESX_MENU.opened[focused.namespace][focused.name]
- let pos = ESX_MENU.pos[focused.namespace][focused.name]
+ if (typeof focused != "undefined") {
+ let menu = ESX_MENU.opened[focused.namespace][focused.name];
+ let pos = ESX_MENU.pos[focused.namespace][focused.name];
if (pos > 0) {
- ESX_MENU.pos[focused.namespace][focused.name]--
+ ESX_MENU.pos[focused.namespace][focused.name]--;
} else {
ESX_MENU.pos[focused.namespace][focused.name] =
- menu.elements.length - 1
+ menu.elements.length - 1;
}
let elem =
- menu.elements[ESX_MENU.pos[focused.namespace][focused.name]]
+ menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
for (let i = 0; i < menu.elements.length; i++) {
if (i == ESX_MENU.pos[focused.namespace][focused.name]) {
- menu.elements[i].selected = true
+ menu.elements[i].selected = true;
} else {
- menu.elements[i].selected = false
+ menu.elements[i].selected = false;
}
}
- ESX_MENU.change(focused.namespace, focused.name, elem)
- ESX_MENU.render()
+ ESX_MENU.change(focused.namespace, focused.name, elem);
+ ESX_MENU.render();
- $('#menu_' + focused.namespace + '_' + focused.name)
- .find('.menu-item.selected')[0]
- .scrollIntoView()
+ $("#menu_" + focused.namespace + "_" + focused.name)
+ .find(".menu-item.selected")[0]
+ .scrollIntoView();
}
- break
+ break;
}
- case 'DOWN': {
- let focused = ESX_MENU.getFocused()
+ case "DOWN": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- let menu = ESX_MENU.opened[focused.namespace][focused.name]
- let pos = ESX_MENU.pos[focused.namespace][focused.name]
- let length = menu.elements.length
+ if (typeof focused != "undefined") {
+ let menu = ESX_MENU.opened[focused.namespace][focused.name];
+ let pos = ESX_MENU.pos[focused.namespace][focused.name];
+ let length = menu.elements.length;
if (pos < length - 1) {
- ESX_MENU.pos[focused.namespace][focused.name]++
+ ESX_MENU.pos[focused.namespace][focused.name]++;
} else {
- ESX_MENU.pos[focused.namespace][focused.name] = 0
+ ESX_MENU.pos[focused.namespace][focused.name] = 0;
}
let elem =
- menu.elements[ESX_MENU.pos[focused.namespace][focused.name]]
+ menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
for (let i = 0; i < menu.elements.length; i++) {
if (i == ESX_MENU.pos[focused.namespace][focused.name]) {
- menu.elements[i].selected = true
+ menu.elements[i].selected = true;
} else {
- menu.elements[i].selected = false
+ menu.elements[i].selected = false;
}
}
- ESX_MENU.change(focused.namespace, focused.name, elem)
- ESX_MENU.render()
+ ESX_MENU.change(focused.namespace, focused.name, elem);
+ ESX_MENU.render();
- $('#menu_' + focused.namespace + '_' + focused.name)
- .find('.menu-item.selected')[0]
- .scrollIntoView()
+ $("#menu_" + focused.namespace + "_" + focused.name)
+ .find(".menu-item.selected")[0]
+ .scrollIntoView();
}
- break
+ break;
}
- case 'LEFT': {
- let focused = ESX_MENU.getFocused()
+ case "LEFT": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- let menu = ESX_MENU.opened[focused.namespace][focused.name]
- let pos = ESX_MENU.pos[focused.namespace][focused.name]
- let elem = menu.elements[pos]
+ if (typeof focused != "undefined") {
+ let menu = ESX_MENU.opened[focused.namespace][focused.name];
+ let pos = ESX_MENU.pos[focused.namespace][focused.name];
+ let elem = menu.elements[pos];
switch (elem.type) {
- case 'default':
- break
+ case "default":
+ break;
- case 'slider': {
- let min = typeof elem.min == 'undefined' ? 0 : elem.min
+ case "slider": {
+ let min = typeof elem.min == "undefined" ? 0 : elem.min;
if (elem.value > min) {
- elem.value--
- ESX_MENU.change(focused.namespace, focused.name, elem)
+ elem.value--;
+ ESX_MENU.change(focused.namespace, focused.name, elem);
}
- ESX_MENU.render()
- break
+ ESX_MENU.render();
+ break;
}
default:
- break
+ break;
}
- $('#menu_' + focused.namespace + '_' + focused.name)
- .find('.menu-item.selected')[0]
- .scrollIntoView()
+ $("#menu_" + focused.namespace + "_" + focused.name)
+ .find(".menu-item.selected")[0]
+ .scrollIntoView();
}
- break
+ break;
}
- case 'RIGHT': {
- let focused = ESX_MENU.getFocused()
+ case "RIGHT": {
+ let focused = ESX_MENU.getFocused();
- if (typeof focused != 'undefined') {
- let menu = ESX_MENU.opened[focused.namespace][focused.name]
- let pos = ESX_MENU.pos[focused.namespace][focused.name]
- let elem = menu.elements[pos]
+ if (typeof focused != "undefined") {
+ let menu = ESX_MENU.opened[focused.namespace][focused.name];
+ let pos = ESX_MENU.pos[focused.namespace][focused.name];
+ let elem = menu.elements[pos];
switch (elem.type) {
- case 'default':
- break
+ case "default":
+ break;
- case 'slider': {
+ case "slider": {
if (
- typeof elem.options != 'undefined' &&
+ typeof elem.options != "undefined" &&
elem.value < elem.options.length - 1
) {
- elem.value++
- ESX_MENU.change(focused.namespace, focused.name, elem)
+ elem.value++;
+ ESX_MENU.change(focused.namespace, focused.name, elem);
}
- if (typeof elem.max != 'undefined' && elem.value < elem.max) {
- elem.value++
- ESX_MENU.change(focused.namespace, focused.name, elem)
+ if (typeof elem.max != "undefined" && elem.value < elem.max) {
+ elem.value++;
+ ESX_MENU.change(focused.namespace, focused.name, elem);
}
- ESX_MENU.render()
- break
+ ESX_MENU.render();
+ break;
}
default:
- break
+ break;
}
- $('#menu_' + focused.namespace + '_' + focused.name)
- .find('.menu-item.selected')[0]
- .scrollIntoView()
+ $("#menu_" + focused.namespace + "_" + focused.name)
+ .find(".menu-item.selected")[0]
+ .scrollIntoView();
}
- break
+ break;
}
default:
- break
+ break;
}
- break
+ break;
}
}
- }
+ };
window.onload = function (e) {
- window.addEventListener('message', event => {
- onData(event.data)
- })
- }
-})()
+ window.addEventListener("message", (event) => {
+ onData(event.data);
+ });
+ };
+})();
diff --git a/[core]/esx_menu_dialog/fxmanifest.lua b/[core]/esx_menu_dialog/fxmanifest.lua
index c765650f0..55ade7e84 100644
--- a/[core]/esx_menu_dialog/fxmanifest.lua
+++ b/[core]/esx_menu_dialog/fxmanifest.lua
@@ -4,7 +4,7 @@ game 'gta5'
description 'ESX Menu Dialog'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
client_scripts {
'@es_extended/imports.lua',
diff --git a/[core]/esx_menu_dialog/html/css/app.css b/[core]/esx_menu_dialog/html/css/app.css
index db52551b6..c2f590c4c 100644
--- a/[core]/esx_menu_dialog/html/css/app.css
+++ b/[core]/esx_menu_dialog/html/css/app.css
@@ -1,89 +1,89 @@
-
-@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');
+@import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap");
#controls {
- font-family: montserrat;
- font-size: 3em;
- color: #FFF;
- position: absolute;
- bottom: 40;
- right: 40;
+ font-family: montserrat;
+ font-size: 3em;
+ color: #fff;
+ position: absolute;
+ bottom: 40;
+ right: 40;
}
.controls {
- display: none;
+ display: none;
}
.dialog {
- font-family: montserrat;
- background: rgba(33, 33, 33, 0.8);
+ font-family: montserrat;
+ background: rgba(33, 33, 33, 0.8);
color: #fff;
- position: absolute;
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
- overflow: hidden;
- top: 50%;
- left: 50%;
- width: 600px;
- height: 152px;
- transform: translate(-50%, -50%);
+ position: absolute;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ overflow: hidden;
+ top: 50%;
+ left: 50%;
+ width: 600px;
+ height: 152px;
+ transform: translate(-50%, -50%);
}
.head {
- display: flex;
- flex-basis: 100%;
- align-items: center;
- color: #fff;
+ display: flex;
+ flex-basis: 100%;
+ align-items: center;
+ color: #fff;
}
.dialog.big {
- height: 200px;
+ height: 200px;
}
.dialog .head {
- background: rgba(25, 25, 25, 0.9);
- text-align: center;
- height: 40px;
+ background: rgba(25, 25, 25, 0.9);
+ text-align: center;
+ height: 40px;
}
.dialog .head span::before {
- content: "";
- display: inline-block;
- height: 100%;
- vertical-align: middle;
+ content: "";
+ display: inline-block;
+ height: 100%;
+ vertical-align: middle;
}
.dialog input[type="text"] {
- width: 60%;
- height: 32px;
+ width: 60%;
+ height: 32px;
outline: 0;
background: none;
text-align: center;
margin-top: 26px;
margin-left: 125px;
- font-size: large;
+ font-size: large;
transition: all 0.2s ease-in-out;
color: white;
border: 0.5px solid #ffffff3b;
border-radius: 0px;
}
-.dialog input[type="text"]:active, .dialog input[type="text"]:hover {
+.dialog input[type="text"]:active,
+.dialog input[type="text"]:hover {
color: white;
}
.dialog textarea {
- width: 100%;
- height: 128px;
+ width: 100%;
+ height: 128px;
}
.dialog button[name="submit"] {
- width: 17.6%;
- height: 32px;
+ width: 17.6%;
+ height: 32px;
margin-left: 160px;
font-weight: 300;
color: rgb(37, 34, 53);
- border-radius: 10px;
+ border-radius: 10px;
text-transform: uppercase;
background: rgb(50, 79, 208);
outline: 0;
@@ -93,17 +93,17 @@
.dialog button {
z-index: 9999;
- transform: translate(-0%, 50%);
+ transform: translate(-0%, 50%);
}
.dialog button[name="cancel"] {
- width: 17.6%;
- height: 32px;
+ width: 17.6%;
+ height: 32px;
margin-left: 60px;
border: none;
text-transform: uppercase;
font-weight: 200;
- border-radius: 10px;
+ border-radius: 10px;
color: rgb(53, 34, 34);
outline: 0;
background: #c74545;
@@ -124,9 +124,9 @@
.head::before,
.head::after {
- content: "";
- flex-grow: 1;
- background: #00e1ff;
- height: 2px;
- margin: 0px 3px;
+ content: "";
+ flex-grow: 1;
+ background: #00e1ff;
+ height: 2px;
+ margin: 0px 3px;
}
diff --git a/[core]/esx_menu_dialog/html/js/app.js b/[core]/esx_menu_dialog/html/js/app.js
index 85a172b65..5186bcf70 100644
--- a/[core]/esx_menu_dialog/html/js/app.js
+++ b/[core]/esx_menu_dialog/html/js/app.js
@@ -1,170 +1,184 @@
(function () {
- let MenuTpl =
- '' +
- ''
- ;
-
- window.ESX_MENU = {};
- ESX_MENU.ResourceName = 'esx_menu_dialog';
- ESX_MENU.opened = {};
- ESX_MENU.focus = [];
- ESX_MENU.pos = {};
-
- ESX_MENU.open = function (namespace, name, data) {
- if (typeof ESX_MENU.opened[namespace] == 'undefined') {
- ESX_MENU.opened[namespace] = {};
- }
-
- if (typeof ESX_MENU.opened[namespace][name] != 'undefined') {
- ESX_MENU.close(namespace, name);
- }
-
- if (typeof ESX_MENU.pos[namespace] == 'undefined') {
- ESX_MENU.pos[namespace] = {};
- }
-
- if (typeof data.type == 'undefined') {
- data.type = 'default';
- }
-
- if (typeof data.align == 'undefined') {
- data.align = 'top-left';
- }
-
- data._index = ESX_MENU.focus.length;
- data._namespace = namespace;
- data._name = name;
-
- ESX_MENU.opened[namespace][name] = data;
- ESX_MENU.pos[namespace][name] = 0;
-
- ESX_MENU.focus.push({
- namespace: namespace,
- name: name
- });
-
- document.onkeyup = function (key) {
- if (key.which == 27) { // Escape key
- SendMessage(ESX_MENU.ResourceName, 'menu_cancel', data);
- } else if (key.which == 13) { // Enter key
- SendMessage(ESX_MENU.ResourceName, 'menu_submit', data);
- }
- };
-
- ESX_MENU.render();
- };
-
- ESX_MENU.close = function (namespace, name) {
- delete ESX_MENU.opened[namespace][name];
-
- for (let i = 0; i < ESX_MENU.focus.length; i++) {
- if (ESX_MENU.focus[i].namespace == namespace && ESX_MENU.focus[i].name == name) {
- ESX_MENU.focus.splice(i, 1);
- break;
- }
- }
-
- ESX_MENU.render();
- };
-
- ESX_MENU.render = function () {
- let menuContainer = $('#menus')[0];
- $(menuContainer).find('button[name="submit"]').unbind('click');
- $(menuContainer).find('button[name="cancel"]').unbind('click');
- $(menuContainer).find('[name="value"]').unbind('input propertychange');
- menuContainer.innerHTML = '';
- $(menuContainer).hide();
-
- for (let namespace in ESX_MENU.opened) {
- for (let name in ESX_MENU.opened[namespace]) {
- let menuData = ESX_MENU.opened[namespace][name];
- let view = JSON.parse(JSON.stringify(menuData));
-
- switch (menuData.type) {
-
- case 'default': {
- view.isDefault = true;
- break;
- }
-
- case 'big': {
- view.isBig = true;
- break;
- }
-
- default: break;
- }
-
- let menu = $(Mustache.render(MenuTpl, view))[0];
-
- $(menu).css('z-index', 1000 + view._index);
-
- $(menu).find('button[name="submit"]').click(function () {
- ESX_MENU.submit(this.namespace, this.name, this.data);
- }.bind({ namespace: namespace, name: name, data: menuData }));
-
- $(menu).find('button[name="cancel"]').click(function () {
- ESX_MENU.cancel(this.namespace, this.name, this.data);
- }.bind({ namespace: namespace, name: name, data: menuData }));
-
- $(menu).find('[name="value"]').bind('input propertychange', function () {
- this.data.value = $(menu).find('[name="value"]').val();
- ESX_MENU.change(this.namespace, this.name, this.data);
- }.bind({ namespace: namespace, name: name, data: menuData }));
-
- if (typeof menuData.value != 'undefined') {
- $(menu).find('[name="value"]').val(menuData.value);
- }
-
- menuContainer.appendChild(menu);
- }
- }
-
- $(menuContainer).show();
- $("#inputText").focus();
- };
-
- ESX_MENU.submit = function (namespace, name, data) {
- SendMessage(ESX_MENU.ResourceName, 'menu_submit', data);
- };
-
- ESX_MENU.cancel = function (namespace, name, data) {
- SendMessage(ESX_MENU.ResourceName, 'menu_cancel', data);
- };
-
- ESX_MENU.change = function (namespace, name, data) {
- SendMessage(ESX_MENU.ResourceName, 'menu_change', data);
- };
-
- ESX_MENU.getFocused = function () {
- return ESX_MENU.focus[ESX_MENU.focus.length - 1];
- };
-
- window.onData = (data) => {
- switch (data.action) {
-
- case 'openMenu': {
- ESX_MENU.open(data.namespace, data.name, data.data);
- break;
- }
-
- case 'closeMenu': {
- ESX_MENU.close(data.namespace, data.name);
- break;
- }
- }
- };
-
- window.onload = function (e) {
- window.addEventListener('message', (event) => {
- onData(event.data);
- });
- };
-
+ let MenuTpl =
+ '" +
+ "";
+ window.ESX_MENU = {};
+ ESX_MENU.ResourceName = "esx_menu_dialog";
+ ESX_MENU.opened = {};
+ ESX_MENU.focus = [];
+ ESX_MENU.pos = {};
+
+ ESX_MENU.open = function (namespace, name, data) {
+ if (typeof ESX_MENU.opened[namespace] == "undefined") {
+ ESX_MENU.opened[namespace] = {};
+ }
+
+ if (typeof ESX_MENU.opened[namespace][name] != "undefined") {
+ ESX_MENU.close(namespace, name);
+ }
+
+ if (typeof ESX_MENU.pos[namespace] == "undefined") {
+ ESX_MENU.pos[namespace] = {};
+ }
+
+ if (typeof data.type == "undefined") {
+ data.type = "default";
+ }
+
+ if (typeof data.align == "undefined") {
+ data.align = "top-left";
+ }
+
+ data._index = ESX_MENU.focus.length;
+ data._namespace = namespace;
+ data._name = name;
+
+ ESX_MENU.opened[namespace][name] = data;
+ ESX_MENU.pos[namespace][name] = 0;
+
+ ESX_MENU.focus.push({
+ namespace: namespace,
+ name: name,
+ });
+
+ document.onkeyup = function (key) {
+ if (key.which == 27) {
+ // Escape key
+ SendMessage(ESX_MENU.ResourceName, "menu_cancel", data);
+ } else if (key.which == 13) {
+ // Enter key
+ SendMessage(ESX_MENU.ResourceName, "menu_submit", data);
+ }
+ };
+
+ ESX_MENU.render();
+ };
+
+ ESX_MENU.close = function (namespace, name) {
+ delete ESX_MENU.opened[namespace][name];
+
+ for (let i = 0; i < ESX_MENU.focus.length; i++) {
+ if (
+ ESX_MENU.focus[i].namespace == namespace &&
+ ESX_MENU.focus[i].name == name
+ ) {
+ ESX_MENU.focus.splice(i, 1);
+ break;
+ }
+ }
+
+ ESX_MENU.render();
+ };
+
+ ESX_MENU.render = function () {
+ let menuContainer = $("#menus")[0];
+ $(menuContainer).find('button[name="submit"]').unbind("click");
+ $(menuContainer).find('button[name="cancel"]').unbind("click");
+ $(menuContainer).find('[name="value"]').unbind("input propertychange");
+ menuContainer.innerHTML = "";
+ $(menuContainer).hide();
+
+ for (let namespace in ESX_MENU.opened) {
+ for (let name in ESX_MENU.opened[namespace]) {
+ let menuData = ESX_MENU.opened[namespace][name];
+ let view = JSON.parse(JSON.stringify(menuData));
+
+ switch (menuData.type) {
+ case "default": {
+ view.isDefault = true;
+ break;
+ }
+
+ case "big": {
+ view.isBig = true;
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ let menu = $(Mustache.render(MenuTpl, view))[0];
+
+ $(menu).css("z-index", 1000 + view._index);
+
+ $(menu)
+ .find('button[name="submit"]')
+ .click(
+ function () {
+ ESX_MENU.submit(this.namespace, this.name, this.data);
+ }.bind({ namespace: namespace, name: name, data: menuData })
+ );
+
+ $(menu)
+ .find('button[name="cancel"]')
+ .click(
+ function () {
+ ESX_MENU.cancel(this.namespace, this.name, this.data);
+ }.bind({ namespace: namespace, name: name, data: menuData })
+ );
+
+ $(menu)
+ .find('[name="value"]')
+ .bind(
+ "input propertychange",
+ function () {
+ this.data.value = $(menu).find('[name="value"]').val();
+ ESX_MENU.change(this.namespace, this.name, this.data);
+ }.bind({ namespace: namespace, name: name, data: menuData })
+ );
+
+ if (typeof menuData.value != "undefined") {
+ $(menu).find('[name="value"]').val(menuData.value);
+ }
+
+ menuContainer.appendChild(menu);
+ }
+ }
+
+ $(menuContainer).show();
+ $("#inputText").focus();
+ };
+
+ ESX_MENU.submit = function (namespace, name, data) {
+ SendMessage(ESX_MENU.ResourceName, "menu_submit", data);
+ };
+
+ ESX_MENU.cancel = function (namespace, name, data) {
+ SendMessage(ESX_MENU.ResourceName, "menu_cancel", data);
+ };
+
+ ESX_MENU.change = function (namespace, name, data) {
+ SendMessage(ESX_MENU.ResourceName, "menu_change", data);
+ };
+
+ ESX_MENU.getFocused = function () {
+ return ESX_MENU.focus[ESX_MENU.focus.length - 1];
+ };
+
+ window.onData = (data) => {
+ switch (data.action) {
+ case "openMenu": {
+ ESX_MENU.open(data.namespace, data.name, data.data);
+ break;
+ }
+
+ case "closeMenu": {
+ ESX_MENU.close(data.namespace, data.name);
+ break;
+ }
+ }
+ };
+
+ window.onload = function (e) {
+ window.addEventListener("message", (event) => {
+ onData(event.data);
+ });
+ };
})();
diff --git a/[core]/esx_menu_dialog/html/ui.html b/[core]/esx_menu_dialog/html/ui.html
index d05f3bed5..22df83921 100644
--- a/[core]/esx_menu_dialog/html/ui.html
+++ b/[core]/esx_menu_dialog/html/ui.html
@@ -1,19 +1,26 @@
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/[core]/esx_menu_list/client/main.lua b/[core]/esx_menu_list/client/main.lua
index aad1f8d71..4d0af0c93 100644
--- a/[core]/esx_menu_list/client/main.lua
+++ b/[core]/esx_menu_list/client/main.lua
@@ -29,7 +29,7 @@ CreateThread(function()
})
for k,v in pairs(OpenedMenus) do
- if v == true then
+ if v then
OpenedMenuCount = OpenedMenuCount + 1
end
end
diff --git a/[core]/esx_menu_list/fxmanifest.lua b/[core]/esx_menu_list/fxmanifest.lua
index 17e80e956..292f5c81b 100644
--- a/[core]/esx_menu_list/fxmanifest.lua
+++ b/[core]/esx_menu_list/fxmanifest.lua
@@ -4,7 +4,7 @@ game 'gta5'
description 'ESX Menu List'
lua54 'yes'
-version '1.9.3'
+version '1.9.4'
client_scripts {
'@es_extended/imports.lua',
diff --git a/[core]/esx_menu_list/html/css/app.css b/[core]/esx_menu_list/html/css/app.css
index fc2f712ff..1e7bc9ce3 100644
--- a/[core]/esx_menu_list/html/css/app.css
+++ b/[core]/esx_menu_list/html/css/app.css
@@ -1,56 +1,55 @@
@font-face {
- font-family: bankgothic;
- src: url('../fonts/bankgothic.ttf');
+ font-family: bankgothic;
+ src: url("../fonts/bankgothic.ttf");
}
@font-face {
- font-family: pcdown;
- src: url('../fonts/pdown.ttf');
+ font-family: pcdown;
+ src: url("../fonts/pdown.ttf");
}
.menu {
- font-family: bankgothic;
- position: absolute;
- left: 50%;
- top: 40%;
- transform: translate(-50%, -50%);
- overflow-y: auto;
- max-height: 90%;
+ font-family: bankgothic;
+ position: absolute;
+ left: 50%;
+ top: 40%;
+ transform: translate(-50%, -50%);
+ overflow-y: auto;
+ max-height: 90%;
}
.menu button {
- font-family: bankgothic;
+ font-family: bankgothic;
}
-.menu>table {
- border-collapse: separate;
- border-spacing: 0 5px;
- min-width: 400px;
- background: rgba(33, 33, 33, 0.0);
+.menu > table {
+ border-collapse: separate;
+ border-spacing: 0 5px;
+ min-width: 400px;
+ background: rgba(33, 33, 33, 0);
}
-.menu>table>thead {
- background: rgba(10, 10, 10, 0.9);
- text-align: center;
- height: 20px;
- line-height: 20px;
- margin-bottom: 20px;
- color: #fff;
+.menu > table > thead {
+ background: rgba(10, 10, 10, 0.9);
+ text-align: center;
+ height: 20px;
+ line-height: 20px;
+ margin-bottom: 20px;
+ color: #fff;
}
.menu td {
-
- text-align: center;
- padding: 8px;
- margin: 20px;
+ text-align: center;
+ padding: 8px;
+ margin: 20px;
}
.menu tbody tr:nth-child(even) {
- color: #fff;
- background: rgba(40, 40, 40, 0.8);
+ color: #fff;
+ background: rgba(40, 40, 40, 0.8);
}
.menu tbody tr:nth-child(odd) {
- color: #fff;
- background: rgba(40, 40, 40, 0.8);
-}
\ No newline at end of file
+ color: #fff;
+ background: rgba(40, 40, 40, 0.8);
+}
diff --git a/[core]/esx_menu_list/html/js/app.js b/[core]/esx_menu_list/html/js/app.js
index fd1138580..72e0e3ee1 100644
--- a/[core]/esx_menu_list/html/js/app.js
+++ b/[core]/esx_menu_list/html/js/app.js
@@ -1,192 +1,209 @@
-(function(){
-
- let MenuTpl =
- ''
- ;
-
- window.ESX_MENU = {};
- ESX_MENU.ResourceName = 'esx_menu_list';
- ESX_MENU.opened = {};
- ESX_MENU.focus = [];
- ESX_MENU.data = {};
-
- ESX_MENU.open = function(namespace, name, data) {
-
- if (typeof ESX_MENU.opened[namespace] == 'undefined') {
- ESX_MENU.opened[namespace] = {};
- }
-
- if (typeof ESX_MENU.opened[namespace][name] != 'undefined') {
- ESX_MENU.close(namespace, name);
- }
-
- data._namespace = namespace;
- data._name = name;
-
- ESX_MENU.opened[namespace][name] = data;
-
- ESX_MENU.focus.push({
- namespace: namespace,
- name : name
- });
-
- ESX_MENU.render();
- };
-
- ESX_MENU.close = function(namespace, name) {
- delete ESX_MENU.opened[namespace][name];
-
- for (let i=0; i' + matches[k][1] + '');
- }
-
- view.rows[i].cols.push({data: data, content: col});
- }
- }
-
- let menu = $(Mustache.render(MenuTpl, view));
-
- menu.find('button[data-namespace][data-name]').click(function() {
- ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))].currentRow = parseInt($(this).data('id')) + 1;
- ESX_MENU.submit($(this).data('namespace'), $(this).data('name'), {
- data : ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))],
- value: $(this).data('value')
- });
- });
-
- menu.hide();
-
- menuContainer.appendChild(menu[0]);
- }
- }
-
- if (typeof focused != 'undefined') {
- $('#menu_' + focused.namespace + '_' + focused.name).show();
- }
-
- $(menuContainer).show();
- };
-
- ESX_MENU.submit = function(namespace, name, data){
- $.post('http://' + ESX_MENU.ResourceName + '/menu_submit', JSON.stringify({
- _namespace: namespace,
- _name : name,
- data : data.data,
- value : data.value
- }));
- };
-
- ESX_MENU.cancel = function(namespace, name){
- $.post('http://' + ESX_MENU.ResourceName + '/menu_cancel', JSON.stringify({
- _namespace: namespace,
- _name : name
- }));
- };
-
- ESX_MENU.getFocused = function(){
- return ESX_MENU.focus[ESX_MENU.focus.length - 1];
- };
-
- window.onData = (data) => {
- switch(data.action){
- case 'openMenu' : {
- ESX_MENU.open(data.namespace, data.name, data.data);
- break;
- }
-
- case 'closeMenu' : {
- ESX_MENU.close(data.namespace, data.name);
- break;
- }
- }
- };
-
- window.onload = function(e){
- window.addEventListener('message', (event) => {
- onData(event.data);
- });
- };
-
- document.onkeyup = function(data) {
- if(data.which == 27) {
- let focused = ESX_MENU.getFocused();
- ESX_MENU.cancel(focused.namespace, focused.name);
- }
- };
-
-})();
\ No newline at end of file
+(function () {
+ let MenuTpl =
+ '";
+ window.ESX_MENU = {};
+ ESX_MENU.ResourceName = "esx_menu_list";
+ ESX_MENU.opened = {};
+ ESX_MENU.focus = [];
+ ESX_MENU.data = {};
+
+ ESX_MENU.open = function (namespace, name, data) {
+ if (typeof ESX_MENU.opened[namespace] == "undefined") {
+ ESX_MENU.opened[namespace] = {};
+ }
+
+ if (typeof ESX_MENU.opened[namespace][name] != "undefined") {
+ ESX_MENU.close(namespace, name);
+ }
+
+ data._namespace = namespace;
+ data._name = name;
+
+ ESX_MENU.opened[namespace][name] = data;
+
+ ESX_MENU.focus.push({
+ namespace: namespace,
+ name: name,
+ });
+
+ ESX_MENU.render();
+ };
+
+ ESX_MENU.close = function (namespace, name) {
+ delete ESX_MENU.opened[namespace][name];
+
+ for (let i = 0; i < ESX_MENU.focus.length; i++) {
+ if (
+ ESX_MENU.focus[i].namespace == namespace &&
+ ESX_MENU.focus[i].name == name
+ ) {
+ ESX_MENU.focus.splice(i, 1);
+ break;
+ }
+ }
+
+ ESX_MENU.render();
+ };
+
+ ESX_MENU.render = function () {
+ let menuContainer = document.getElementById("menus");
+ let focused = ESX_MENU.getFocused();
+ menuContainer.innerHTML = "";
+
+ $(menuContainer).hide();
+
+ for (let namespace in ESX_MENU.opened) {
+ if (typeof ESX_MENU.data[namespace] == "undefined") {
+ ESX_MENU.data[namespace] = {};
+ }
+
+ for (let name in ESX_MENU.opened[namespace]) {
+ ESX_MENU.data[namespace][name] = [];
+
+ let menuData = ESX_MENU.opened[namespace][name];
+ let view = {
+ _namespace: menuData._namespace,
+ _name: menuData._name,
+ head: [],
+ rows: [],
+ };
+
+ for (let i = 0; i < menuData.head.length; i++) {
+ let item = { content: menuData.head[i] };
+ view.head.push(item);
+ }
+
+ for (let i = 0; i < menuData.rows.length; i++) {
+ let row = menuData.rows[i];
+ let data = row.data;
+
+ ESX_MENU.data[namespace][name].push(data);
+
+ view.rows.push({ cols: [] });
+
+ for (let j = 0; j < row.cols.length; j++) {
+ let col = menuData.rows[i].cols[j];
+ let regex = /\{\{(.*?)\|(.*?)\}\}/g;
+ let matches = [];
+ let match;
+
+ while ((match = regex.exec(col)) != null) {
+ matches.push(match);
+ }
+
+ for (let k = 0; k < matches.length; k++) {
+ col = col.replace(
+ "{{" + matches[k][1] + "|" + matches[k][2] + "}}",
+ '' +
+ matches[k][1] +
+ " "
+ );
+ }
+
+ view.rows[i].cols.push({ data: data, content: col });
+ }
+ }
+
+ let menu = $(Mustache.render(MenuTpl, view));
+
+ menu.find("button[data-namespace][data-name]").click(function () {
+ ESX_MENU.data[$(this).data("namespace")][$(this).data("name")][
+ parseInt($(this).data("id"))
+ ].currentRow = parseInt($(this).data("id")) + 1;
+ ESX_MENU.submit($(this).data("namespace"), $(this).data("name"), {
+ data: ESX_MENU.data[$(this).data("namespace")][
+ $(this).data("name")
+ ][parseInt($(this).data("id"))],
+ value: $(this).data("value"),
+ });
+ });
+
+ menu.hide();
+
+ menuContainer.appendChild(menu[0]);
+ }
+ }
+
+ if (typeof focused != "undefined") {
+ $("#menu_" + focused.namespace + "_" + focused.name).show();
+ }
+
+ $(menuContainer).show();
+ };
+
+ ESX_MENU.submit = function (namespace, name, data) {
+ $.post(
+ "http://" + ESX_MENU.ResourceName + "/menu_submit",
+ JSON.stringify({
+ _namespace: namespace,
+ _name: name,
+ data: data.data,
+ value: data.value,
+ })
+ );
+ };
+
+ ESX_MENU.cancel = function (namespace, name) {
+ $.post(
+ "http://" + ESX_MENU.ResourceName + "/menu_cancel",
+ JSON.stringify({
+ _namespace: namespace,
+ _name: name,
+ })
+ );
+ };
+
+ ESX_MENU.getFocused = function () {
+ return ESX_MENU.focus[ESX_MENU.focus.length - 1];
+ };
+
+ window.onData = (data) => {
+ switch (data.action) {
+ case "openMenu": {
+ ESX_MENU.open(data.namespace, data.name, data.data);
+ break;
+ }
+
+ case "closeMenu": {
+ ESX_MENU.close(data.namespace, data.name);
+ break;
+ }
+ }
+ };
+
+ window.onload = function (e) {
+ window.addEventListener("message", (event) => {
+ onData(event.data);
+ });
+ };
+
+ document.onkeyup = function (data) {
+ if (data.which == 27) {
+ let focused = ESX_MENU.getFocused();
+ ESX_MENU.cancel(focused.namespace, focused.name);
+ }
+ };
+})();
diff --git a/[core]/esx_menu_list/html/ui.html b/[core]/esx_menu_list/html/ui.html
index af5fd03b6..62f6bda96 100644
--- a/[core]/esx_menu_list/html/ui.html
+++ b/[core]/esx_menu_list/html/ui.html
@@ -1,16 +1,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+