Merge branch 'esx-framework:main' into main

This commit is contained in:
thefourCraft
2023-01-04 00:32:35 +02:00
committed by GitHub
15 changed files with 264 additions and 140 deletions
+5 -15
View File
@@ -329,7 +329,8 @@ INSERT INTO `licenses` (`type`, `label`) VALUES
('drive', 'Drivers License'),
('drive_bike', 'Motorcycle License'),
('drive_truck', 'Commercial Drivers License'),
('weed_processing', 'Weed Processing License');
('weed_processing', 'Weed Processing License'),
('boat', 'Boat License');
-- --------------------------------------------------------
@@ -709,12 +710,13 @@ INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
--
CREATE TABLE `vehicle_sold` (
`id` INT(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`client` varchar(50) NOT NULL,
`model` varchar(50) NOT NULL,
`plate` varchar(50) NOT NULL,
`soldby` varchar(50) NOT NULL,
`date` varchar(50) NOT NULL
`date` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
--
@@ -846,24 +848,12 @@ ALTER TABLE `user_licenses`
ALTER TABLE `vehicle_categories`
ADD PRIMARY KEY (`name`);
--
-- Indexes for table `vehicle_sold`
--
ALTER TABLE `vehicle_sold`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `whitelist`
--
ALTER TABLE `whitelist`
ADD PRIMARY KEY (`identifier`);
--
-- Indexes for table `vehicle_sold`
--
ALTER TABLE `vehicle_sold`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `addon_account_data`
--
+10 -10
View File
@@ -99,14 +99,14 @@ if not Config.Multichar then
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
deferrals.done(
('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(
('[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()
end
else
deferrals.done(
'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.')
'[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
@@ -133,9 +133,9 @@ function loadESXPlayer(identifier, playerId, isNew)
end
local index = #userData.accounts + 1
userData.accounts[index] = {
name = account,
name = account,
money = foundAccounts[account] or Config.StartingAccountMoney[account] or 0,
label = data.label,
label = data.label,
round = data.round,
index = index
}
@@ -299,13 +299,13 @@ function loadESXPlayer(identifier, playerId, isNew)
xPlayer.triggerEvent('esx:playerLoaded',
{
accounts = xPlayer.getAccounts(),
coords = xPlayer.getCoords(),
identifier = xPlayer.getIdentifier(),
accounts = xPlayer.getAccounts(),
coords = xPlayer.getCoords(),
identifier = xPlayer.getIdentifier(),
inventory = xPlayer.getInventory(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
maxWeight = xPlayer.getMaxWeight(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
maxWeight = xPlayer.getMaxWeight(),
money = xPlayer.getMoney(),
sex = xPlayer.get("sex") or "m",
firstName = xPlayer.get("firstName") or "John",
+68 -64
View File
@@ -12,102 +12,106 @@
* This copyright should appear in every part of the project code
*/
html,body {
margin: 0;
padding: 0;
font-family: 'Quicksand', sans-serif;
overflow: hidden;
html,
body {
margin: 0;
padding: 0;
font-family: "Quicksand", sans-serif;
overflow: hidden;
}
#esx_intro {
z-index: 2;
z-index: 2;
}
#esx_loop {
z-index: 1;
z-index: 1;
}
#loading_txt {
bottom: 5%;
left: 50%;
margin-left: -80px;
position: absolute;
z-index: 999;
bottom: 5%;
left: 50%;
margin-left: -80px;
position: absolute;
z-index: 999;
-webkit-animation: fadein 5s;
-moz-animation: fadein 5s;
-ms-animation: fadein 5s;
-o-animation: fadein 5s;
animation: fadein 5s;
-webkit-animation: fadein 5s;
-moz-animation: fadein 5s;
-ms-animation: fadein 5s;
-o-animation: fadein 5s;
animation: fadein 5s;
}
p {
color: white;
font-size: 32px;
color: white;
font-size: 32px;
}
.text_thing:after {
content: ' .';
animation: dots 2s steps(5, end) infinite;
content: " .";
animation: dots 2s steps(5, end) infinite;
}
@keyframes dots {
0%, 20% {
color: rgba(0,0,0,0);
text-shadow:
.25em 0 0 rgba(0,0,0,0),
.5em 0 0 rgba(0,0,0,0);
}
40% {
color: white;
text-shadow:
.25em 0 0 rgba(0,0,0,0),
.5em 0 0 rgba(0,0,0,0);
}
60% {
text-shadow:
.25em 0 0 white,
.5em 0 0 rgba(0,0,0,0);
}
80%, 100% {
text-shadow:
.25em 0 0 white,
.5em 0 0 white;
}
0%,
20% {
color: rgba(0, 0, 0, 0);
text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
}
40% {
color: white;
text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
}
60% {
text-shadow: 0.25em 0 0 white, 0.5em 0 0 rgba(0, 0, 0, 0);
}
80%,
100% {
text-shadow: 0.25em 0 0 white, 0.5em 0 0 white;
}
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from {
opacity: 0;
}
to {
opacity: 1;
}
}
+18 -21
View File
@@ -1,28 +1,25 @@
<html lang="en">
<head>
<head>
<link rel="stylesheet" href="css/index.css" type="text/css" />
<link href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
<link
href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap"
rel="stylesheet"
/>
<script src="./js/index.js" type="text/javascript"></script>
</head>
<body>
</head>
<body>
<div id="wrapper">
<div id="loading_txt">
<p class="text_thing">Loading</p>
</div>
<div id="loading_txt">
<p class="text_thing">Loading</p>
</div>
<video id="esx_intro" width="100%" autoplay>
<source src="vid/esx_intro.mp4" type="video/webm">
</video>
<video id="esx_loop" width="100%" loop>
<source src="vid/esx_loop.mp4" type="video/webm">
</video>
<video id="esx_intro" width="100%" autoplay>
<source src="vid/esx_intro.mp4" type="video/webm" />
</video>
<video id="esx_loop" width="100%" loop>
<source src="vid/esx_loop.mp4" type="video/webm" />
</video>
</div>
</body>
</html>
</body>
</html>
+9 -9
View File
@@ -10,13 +10,13 @@
// If you redistribute this software, you must link to ORIGINAL repository at https://github.com/esx-framework/esx-reborn
// This copyright should appear in every part of the project code
$(document).ready(function(){
const introTag = document.getElementById('esx_intro');
const loopTag = document.getElementById('esx_loop');
document.addEventListener("DOMContentLoaded", () => {
const introTag = document.getElementById("esx_intro");
const loopTag = document.getElementById("esx_loop");
introTag.onended = (event) => {
introTag.style.display = "none";
loopTag.loop = true; // true
loopTag.play()
};
})
introTag.onended = () => {
introTag.style.display = "none";
loopTag.loop = true; // true
loopTag.play();
};
});
+19 -3
View File
@@ -140,6 +140,24 @@ if ESX.GetConfig().Multichar then
})
end
function CharacterDeleteConfirmation(Characters, slots, SelectedCharacter, value)
local elements = {
{title = TranslateCap('char_delete_confirmation'), icon = "fa-solid fa-users", description = TranslateCap('char_delete_confirmation_description'), unselectable = true},
{title = TranslateCap('char_delete'), icon ="fa-solid fa-xmark", description = TranslateCap('char_delete_yes_description'), action = 'delete', value = value},
{title = TranslateCap('return'), unselectable = false, icon = "fa-solid fa-arrow-left", description = TranslateCap('char_delete_no_description'), action = "return"}
}
ESX.OpenContext("left", elements, function(element, Action)
if Action.action == "delete" then
ESX.CloseContext()
TriggerServerEvent('esx_multicharacter:DeleteCharacter', Action.value)
spawned = false
elseif Action.action == "return" then
CharacterOptions(Characters, slots, SelectedCharacter)
end
end, nil, false)
end
function CharacterOptions(Characters, slots, SelectedCharacter)
local elements = {{title = TranslateCap('character', Characters[SelectedCharacter.value].firstname .. " ".. Characters[SelectedCharacter.value].lastname),icon = "fa-regular fa-user", unselectable = true},
{title = TranslateCap('return'), unselectable = false,icon = "fa-solid fa-arrow-left",description = TranslateCap('return_description'), action = "return"}}
@@ -157,9 +175,7 @@ if ESX.GetConfig().Multichar then
ESX.CloseContext()
TriggerServerEvent('esx_multicharacter:CharacterChosen', Action.value, false)
elseif Action.action == "delete" then
ESX.CloseContext()
TriggerServerEvent('esx_multicharacter:DeleteCharacter', Action.value)
spawned = false
CharacterDeleteConfirmation(Characters, slots, SelectedCharacter, Action.value)
elseif Action.action == "return" then
SelectCharacterMenu(Characters, slots)
end
+4
View File
@@ -10,6 +10,10 @@ Locales["en"] = {
["char_disabled_description"] = "This Character Is Unusable.",
["char_delete"] = "Delete",
["char_delete_description"] = "Permanently Remove This Character.",
["char_delete_confirmation"] = "Delete Confirmation",
["char_delete_confirmation_description"] = "Are you sure removing selected character?",
["char_delete_yes_description"] = "Yes, I am sure removing selected character",
["char_delete_no_description"] = "No, return to character options",
["character"] = "Character: %s",
["return"] = "Return",
["return_description"] = "Return To Character Selection.",
+3 -3
View File
@@ -29,11 +29,11 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
local identifier = ESX.GetIdentifier(playerId)
if ESX.Table.SizeOf(AllowList) == 0 then
kickReason = TranslateCap('allowlist_empty')
kickReason = "[ESX] " .. TranslateCap('allowlist_empty')
elseif not identifier then
kickReason = TranslateCap('license_missing')
kickReason = "[ESX] " .. TranslateCap('license_missing')
elseif not AllowList[identifier] then
kickReason = TranslateCap('not_allowlist')
kickReason = "[ESX] " .. TranslateCap('not_allowlist')
end
if kickReason then
+1 -1
View File
@@ -199,7 +199,7 @@ end)
local function loadNPC(index, netID)
CreateThread(function()
while not NetworkDoesEntityExistWithNetworkId(netID) do
Wait(1)
Wait(200)
end
local npc = NetworkGetEntityFromNetworkId(netID)
+97
View File
@@ -292,5 +292,102 @@
"tableFullLanguage":"Italian"
}
}
},
"ES":{
"DYNAMIC_FORM_DATA":[
{
"componentName":"moreGraph",
"elementID":"#wrapper",
"title":"",
"closeButtonText":"Cerrar",
"bankTitle":"Banco Fleeca",
"mainExitButtonText": "Cerrar sesión"
},
{
"elementID":"#cpincode",
"name":"cpincode",
"buttonText":"Aprobar",
"inputPlaceholder": "Introduzca 4 dígitos...",
"title":"CONFIGURACIÓN DEL PIN",
"description": "Aquí puede establecer o cambiar el código PIN.",
"type":"password"
},
{
"elementID":"#withdraw",
"name":"withdraw",
"buttonText":"Aprobar",
"inputPlaceholder": "Importe",
"title":"RETIRAR",
"description": "Aquí puede retirar su dinero del banco.",
"type":"number"
},
{
"elementID":"#deposit",
"name":"deposit",
"buttonText":"Aprobación",
"inputPlaceholder": "Importe",
"title":"DEPOSITO",
"description": "Aquí puede ingresar su dinero en el banco.",
"type":"number"
},
{
"elementID":"#transfer",
"name":"transfer",
"buttonText":"Transfererir",
"inputPlaceholder": "Importe",
"inputPlaceholder2": "ID del jugador",
"title":"TRANSFERENCIA",
"description": "Aquí puedes transferir tu dinero a otra persona."
},
{
"componentName":"trans",
"elementID":"#third-column",
"title":"HISTORIAL DE TRANSACCIONES",
"description": "Aquí puede ver su historial de transacciones.",
"moreHistoryText": "Mostrar más historial",
"moreGraphText": "Mostrar el gráfico"
},
{
"componentName":"pincodePanel",
"elementID":"#wrapper",
"title":"Introducir PIN",
"deleteButtonText": "<i class='fa-solid fa-ban'></i>",
"loginButtonText": "<i class='fa-solid fa-right-to-bracket'></i>",
"closeButtonText": "Close"
},
{
"componentName":"atmComponent",
"elementID":"#wrapper",
"title":"Banco Fleeca",
"closeButtonText":"Cerrar sesión"
}
],
"LAUNGAGE": {
"your_money_title":"Saldo",
"your_money_desc":"Aquí puedes ver tu saldo actual y tu efectivo.",
"your_money_cash_label":"Su dinero en mano",
"your_money_bank_label":"Su saldo bancario",
"withdraw":"RETIRAR",
"deposit":"DEPÓSITO",
"transfer":"TRANSFERENCIA",
"transferReceive":"TRANSFERENCIA RECIBIDA",
"moneyFormat":"$__replaceData__",
"graphTitle":"Su saldo",
"moreGraphTitle": "Gráfico grande",
"moreHistoryTitle":"Mostrar más historial",
"inputErrorTitle":"Data is incorrect",
"inputErrorMessage":"No puede estar vacío ni tener un valor inferior a 1.",
"showPincodeErrorTitle":"PIN incorrecto",
"showPincodeErrorMessage":"El pin debe tener al menos 4 caracteres.",
"tableLang":{
"typeLabel": "Tipo de transacción",
"balanceLabel":"Saldo",
"amountLabel":"Importe",
"timeLabel":"Tiempo",
"searchInputPlaceholder":"Buscar...",
"_comment": "tableFullLanguage options: English,Hungarian you can find here all lang: https://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/",
"tableFullLanguage":"Spanish"
}
}
}
}
@@ -108,6 +108,7 @@ end)
RegisterNetEvent('esx_basicneeds:onEat')
AddEventHandler('esx_basicneeds:onEat', function(prop_name)
local Invoke = GetInvokingResource()
print(('[^3WARNING^7] ^5%s^7 used ^5esx_basicneeds:onEat^7, this method is deprecated and should not be used! Refer to ^5https://documentation.esx-framework.org/addons/esx_basicneeds/events/oneat^7 for more info!'):format(Invoke))
if not prop_name then
@@ -119,8 +120,10 @@ end)
RegisterNetEvent('esx_basicneeds:onDrink')
AddEventHandler('esx_basicneeds:onDrink', function(prop_name)
local Invoke = GetInvokingResource()
print(('[^3WARNING^7] ^5%s^7 used ^5esx_basicneeds:onDrink^7, this method is deprecated and should not be used! Refer to ^5https://documentation.esx-framework.org/addons/esx_basicneeds/events/ondrink^7 for more info!'):format(Invoke))
if not prop_name then
prop_name = 'prop_ld_flow_bottle'
end
+5 -6
View File
@@ -2,9 +2,7 @@ local Vehicles, myCar = {}, {}
local lsMenuIsShowed, HintDisplayed, isInLSMarker = false, false, false
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer
AddEventHandler('esx:playerLoaded', function()
ESX.TriggerServerCallback('esx_lscustom:getVehiclesPrices', function(vehicles)
Vehicles = vehicles
end)
@@ -13,8 +11,9 @@ end)
RegisterNetEvent('esx_lscustom:installMod')
AddEventHandler('esx_lscustom:installMod', function()
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local NetId = NetworkGetNetworkIdFromEntity(vehicle)
myCar = ESX.Game.GetVehicleProperties(vehicle)
TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar)
TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar, NetId)
end)
RegisterNetEvent('esx_lscustom:restoreMods', function(netId, props)
@@ -79,8 +78,8 @@ function OpenLSMenu(elems, menuName, menuTitle, parent)
if data.current.label == TranslateCap('by_default') or string.match(data.current.label, TranslateCap('installed')) then
ESX.ShowNotification(TranslateCap('already_own', data.current.label))
myCar = ESX.Game.GetVehicleProperties(vehicle)
TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar)
myCar = ESX.Game.GetVehicleProperties(vehicle)
TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar, NetworkGetNetworkIdFromEntity(vehicle))
else
local vehiclePrice = 50000
+1 -1
View File
@@ -495,7 +495,7 @@ Config.Menus = {
label = TranslateCap('transmission'),
parent = 'upgrades',
modType = 13,
price = {13.95, 20.93, 46.51}
price = {13.95, 20.93, 46.51, 63.55}
},
modSuspension = {
label = TranslateCap('suspension'),
+19 -5
View File
@@ -4,10 +4,10 @@ local Customs = {}
RegisterNetEvent('esx_lscustom:startModing', function(props, netId)
local src = tostring(source)
if Customs[src] then
Customs[src][props.plate] = {props = props, netId = netId}
Customs[src][tostring(props.plate)] = {props = props, netId = netId}
else
Customs[src] = {}
Customs[src][props.plate] = {props = props, netId = netId}
Customs[src][tostring(props.plate)] = {props = props, netId = netId}
end
end)
@@ -70,16 +70,30 @@ AddEventHandler('esx_lscustom:buyMod', function(price)
end)
RegisterServerEvent('esx_lscustom:refreshOwnedVehicle')
AddEventHandler('esx_lscustom:refreshOwnedVehicle', function(vehicleProps)
AddEventHandler('esx_lscustom:refreshOwnedVehicle', function(vehicleProps, netId)
local src = tostring(source)
local xPlayer = ESX.GetPlayerFromId(source)
MySQL.single('SELECT vehicle FROM owned_vehicles WHERE plate = ?', {vehicleProps.plate},
function(result)
if result then
local vehicle = json.decode(result.vehicle)
if vehicleProps.model == vehicle.model then
MySQL.update('UPDATE owned_vehicles SET vehicle = ? WHERE plate = ?', {json.encode(vehicleProps), vehicleProps.plate})
Customs[tostring(source)][tostring(vehicleProps.plate)].props = vehicleProps
if Customs[src] then
if Customs[src][tostring(vehicleProps.plate)] then
Customs[src][tostring(vehicleProps.plate)].props = vehicleProps
else
Customs[src][tostring(vehicleProps.plate)] = {props = vehicleProps, netId = netId}
end
else
Customs[src] = {}
Customs[src][tostring(vehicleProps.plate)] = {props = vehicleProps, netId = netId}
end
local veh = NetworkGetEntityFromNetworkId(netId)
local Veh_State = Entity(veh).state.VehicleProperties
if Veh_State then
Entity(veh).state:set("VehicleProperties", vehicleProps, true)
end
else
print(('[^3WARNING^7] Player ^5%s^7 Attempted To upgrade with mismatching vehicle model'):format(xPlayer.source))
end
+2 -2
View File
@@ -1,6 +1,6 @@
RegisterNetEvent('esx:playerLoaded') -- Store the players data
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew)
print("Player Loaded. New | " .. isNew)
print(('Player Loaded. New | %s'):format(isNew))
ESX.PlayerData = xPlayer
ESX.PlayerLoaded = true
end)
@@ -23,7 +23,7 @@ end)
function OnPlayerData(key, val, last)
if type(val) == 'table' then val = json.encode(val) end
print('PlayerData.'..key..' was set to '..val)
print(('PlayerData.%s was set to %s'):format(key, val))
if key == 'job' then
if last.name ~= val.name then
print('You are now in a different job')