mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
Minor changes, missing semicolons in JS
This commit is contained in:
@@ -76,9 +76,6 @@ files {
|
||||
'html/fonts/pdown.ttf',
|
||||
'html/fonts/bankgothic.ttf',
|
||||
|
||||
'html/img/keys/enter.png',
|
||||
'html/img/keys/return.png',
|
||||
|
||||
'html/img/accounts/bank.png',
|
||||
'html/img/accounts/black_money.png'
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ ESX.GetWeaponLabel = function(name)
|
||||
|
||||
for i=1, #weapons, 1 do
|
||||
if weapons[i].name == name then
|
||||
return weapons[i].label
|
||||
return weapons[i].label
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+4
-4
@@ -160,6 +160,7 @@ AddEventHandler('esx:setAccountMoney', function(account)
|
||||
for i=1, #ESX.PlayerData.accounts, 1 do
|
||||
if ESX.PlayerData.accounts[i].name == account.name then
|
||||
ESX.PlayerData.accounts[i] = account
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -179,7 +180,7 @@ RegisterNetEvent('esx:addInventoryItem')
|
||||
AddEventHandler('esx:addInventoryItem', function(item, count)
|
||||
for i=1, #ESX.PlayerData.inventory, 1 do
|
||||
if ESX.PlayerData.inventory[i].name == item.name then
|
||||
ESX.PlayerData.inventory[i] = item
|
||||
ESX.PlayerData.inventory[i] = item
|
||||
end
|
||||
end
|
||||
|
||||
@@ -194,7 +195,7 @@ RegisterNetEvent('esx:removeInventoryItem')
|
||||
AddEventHandler('esx:removeInventoryItem', function(item, count)
|
||||
for i=1, #ESX.PlayerData.inventory, 1 do
|
||||
if ESX.PlayerData.inventory[i].name == item.name then
|
||||
ESX.PlayerData.inventory[i] = item
|
||||
ESX.PlayerData.inventory[i] = item
|
||||
end
|
||||
end
|
||||
|
||||
@@ -407,7 +408,6 @@ AddEventHandler('esx:deleteVehicle', function()
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- Pause menu disable HUD display
|
||||
if Config.EnableHud then
|
||||
Citizen.CreateThread(function()
|
||||
@@ -544,7 +544,7 @@ Citizen.CreateThread(function()
|
||||
|
||||
for k,v in pairs(Pickups) do
|
||||
|
||||
local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, v.coords.x, v.coords.y, v.coords.z, true)
|
||||
local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, v.coords.x, v.coords.y, v.coords.z, true)
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if distance <= 5.0 then
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
Config = {}
|
||||
Config.Locale = 'fr'
|
||||
Config.Locale = 'sv'
|
||||
|
||||
Config.Accounts = { 'bank', 'black_money' }
|
||||
Config.AccountLabels = { bank = _U('bank'), black_money = _U('black_money') }
|
||||
@@ -9,7 +9,9 @@ Config.ShowDotAbovePlayer = false
|
||||
Config.DisableWantedLevel = true
|
||||
Config.EnableWeaponPickup = true
|
||||
Config.EnableHud = true -- enable the default hud? Display current job and accounts (black, bank & cash)
|
||||
|
||||
Config.RemoveInventoryItemDelay = 5 * 60000
|
||||
Config.PaycheckInterval = 7 * 60000
|
||||
Config.MaxPlayers = 32
|
||||
|
||||
Config.EnableDebug = false
|
||||
|
||||
@@ -44,7 +44,6 @@ CREATE TABLE `jobs` (
|
||||
INSERT INTO `jobs` VALUES ('unemployed','Unemployed');
|
||||
|
||||
CREATE TABLE `user_accounts` (
|
||||
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(255) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
@@ -54,7 +53,6 @@ CREATE TABLE `user_accounts` (
|
||||
);
|
||||
|
||||
CREATE TABLE `user_inventory` (
|
||||
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(255) NOT NULL,
|
||||
`item` varchar(255) NOT NULL,
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
@font-face {
|
||||
font-family: 'Pricedown';
|
||||
src: url('../fonts/pdown.ttf')/* TTF file for CSS3 browsers */
|
||||
src: url('../fonts/pdown.ttf')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'bankgothic';
|
||||
src: url('../fonts/bankgothic.ttf')/* TTF file for CSS3 browsers */
|
||||
src: url('../fonts/bankgothic.ttf')
|
||||
}
|
||||
|
||||
html {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 941 B |
Binary file not shown.
|
Before Width: | Height: | Size: 376 B |
+47
-52
@@ -1,65 +1,64 @@
|
||||
(() => {
|
||||
|
||||
ESX = {};
|
||||
ESX = {};
|
||||
ESX.HUDElements = [];
|
||||
|
||||
ESX.setHUDDisplay = function(opacity){
|
||||
ESX.setHUDDisplay = function (opacity) {
|
||||
$('#hud').css('opacity', opacity);
|
||||
}
|
||||
|
||||
ESX.insertHUDElement = function(name, index, priority, html, data){
|
||||
};
|
||||
|
||||
ESX.insertHUDElement = function (name, index, priority, html, data) {
|
||||
ESX.HUDElements.push({
|
||||
name : name,
|
||||
index : index,
|
||||
priority : priority,
|
||||
html : html,
|
||||
data : data
|
||||
})
|
||||
name: name,
|
||||
index: index,
|
||||
priority: priority,
|
||||
html: html,
|
||||
data: data
|
||||
});
|
||||
|
||||
ESX.HUDElements.sort((a,b) => {
|
||||
ESX.HUDElements.sort((a, b) => {
|
||||
return a.index - b.index || b.priority - a.priority;
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
ESX.updateHUDElement = function (name, data) {
|
||||
|
||||
ESX.updateHUDElement = function(name, data){
|
||||
|
||||
for(let i=0; i<ESX.HUDElements.length; i++)
|
||||
if(ESX.HUDElements[i].name == name)
|
||||
for (let i = 0; i < ESX.HUDElements.length; i++) {
|
||||
if (ESX.HUDElements[i].name == name) {
|
||||
ESX.HUDElements[i].data = data;
|
||||
}
|
||||
}
|
||||
|
||||
ESX.refreshHUD();
|
||||
}
|
||||
};
|
||||
|
||||
ESX.deleteHUDElement = function(name){
|
||||
|
||||
for(let i=0; i<ESX.HUDElements.length; i++)
|
||||
if(ESX.HUDElements[i].name == name)
|
||||
ESX.deleteHUDElement = function (name) {
|
||||
for (let i = 0; i < ESX.HUDElements.length; i++) {
|
||||
if (ESX.HUDElements[i].name == name) {
|
||||
ESX.HUDElements.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
ESX.refreshHUD();
|
||||
}
|
||||
|
||||
ESX.refreshHUD = function(){
|
||||
};
|
||||
|
||||
ESX.refreshHUD = function () {
|
||||
$('#hud').html('');
|
||||
|
||||
for(let i=0; i<ESX.HUDElements.length; i++){
|
||||
for (let i = 0; i < ESX.HUDElements.length; i++) {
|
||||
let html = Mustache.render(ESX.HUDElements[i].html, ESX.HUDElements[i].data);
|
||||
$('#hud').append(html);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
ESX.inventoryNotification = function(add, item, count){
|
||||
|
||||
ESX.inventoryNotification = function (add, item, count) {
|
||||
let notif = '';
|
||||
|
||||
if(add)
|
||||
if (add) {
|
||||
notif += '+';
|
||||
else
|
||||
} else {
|
||||
notif += '-';
|
||||
}
|
||||
|
||||
notif += count + ' ' + item.label;
|
||||
|
||||
@@ -67,47 +66,43 @@
|
||||
|
||||
$('#inventory_notifications').append(elem);
|
||||
|
||||
$(elem).delay(3000).fadeOut(1000, function(){
|
||||
$(elem).delay(3000).fadeOut(1000, function () {
|
||||
elem.remove();
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
window.onData = (data) => {
|
||||
|
||||
switch(data.action){
|
||||
|
||||
case 'setHUDDisplay' : {
|
||||
switch (data.action) {
|
||||
case 'setHUDDisplay': {
|
||||
ESX.setHUDDisplay(data.opacity);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'insertHUDElement' : {
|
||||
case 'insertHUDElement': {
|
||||
ESX.insertHUDElement(data.name, data.index, data.priority, data.html, data.data);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'updateHUDElement' : {
|
||||
case 'updateHUDElement': {
|
||||
ESX.updateHUDElement(data.name, data.data);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'deleteHUDElement' : {
|
||||
case 'deleteHUDElement': {
|
||||
ESX.deleteHUDElement(data.name);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'inventoryNotification' : {
|
||||
ESX.inventoryNotification(data.add, data.item, data.count)
|
||||
case 'inventoryNotification': {
|
||||
ESX.inventoryNotification(data.add, data.item, data.count);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
window.onload = function(e){
|
||||
window.onload = function (e) {
|
||||
window.addEventListener('message', (event) => {
|
||||
onData(event.data)
|
||||
onData(event.data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})()
|
||||
})();
|
||||
Reference in New Issue
Block a user