From 9834a78f6db5b7a3b0e7e8220c76d72e992bb812 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 17:33:38 +0100 Subject: [PATCH 01/30] feat(es_extended): Support For Custom Xenon Colours --- [esx]/es_extended/client/functions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua index 299e21ea..f31ef975 100644 --- a/[esx]/es_extended/client/functions.lua +++ b/[esx]/es_extended/client/functions.lua @@ -692,6 +692,12 @@ function ESX.Game.GetVehicleProperties(vehicle) customPrimaryColor = {r, g, b} end + local customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle) + local customXenonColor = nil + if customXenonColorR and customXenonColorG and customXenonColorB then + customXenonColor = {customXenonColorR, customXenonColorG, customXenonColorB} + end + local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle) local customSecondaryColor = nil if hasCustomSecondaryColor then @@ -771,6 +777,7 @@ function ESX.Game.GetVehicleProperties(vehicle) wheels = GetVehicleWheelType(vehicle), windowTint = GetVehicleWindowTint(vehicle), xenonColor = GetVehicleXenonLightsColor(vehicle), + customXenonColor = customXenonColor, neonEnabled = {IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1), IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3)}, @@ -912,6 +919,10 @@ function ESX.Game.SetVehicleProperties(vehicle, props) if props.xenonColor then SetVehicleXenonLightsColor(vehicle, props.xenonColor) end + if props.customXenonColor then + SetVehicleXenonLightsCustomColor(vehicle, props.customXenonColor[1], props.customXenonColor[2], + props.customXenonColor[3]) + end if props.modSmokeEnabled then ToggleVehicleMod(vehicle, 20, true) end From abb107cc9f7b6a36ed43d94d4c279269153e514d Mon Sep 17 00:00:00 2001 From: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Fri, 9 Sep 2022 20:33:01 +0200 Subject: [PATCH 02/30] fix: idk man this broke something dont ask --- [esx]/esx_menu_list/client/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/[esx]/esx_menu_list/client/main.lua b/[esx]/esx_menu_list/client/main.lua index 65721d0f..aad1f8d7 100644 --- a/[esx]/esx_menu_list/client/main.lua +++ b/[esx]/esx_menu_list/client/main.lua @@ -12,7 +12,9 @@ CreateThread(function() name = name, data = data }) + SetTimeout(200, function() SetNuiFocus(true, true) + end) end local function closeMenu(namespace, name) @@ -58,4 +60,4 @@ CreateThread(function() cb('OK') end) -end) \ No newline at end of file +end) From b52296026d9e992e4c36648bd849ade0c773319e Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 21:42:06 +0100 Subject: [PATCH 03/30] feat(es_extended): Add Support for Account Rounding to OX override --- .../server/classes/overrides/oxinventory.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/[esx]/es_extended/server/classes/overrides/oxinventory.lua b/[esx]/es_extended/server/classes/overrides/oxinventory.lua index b1178e30..ae8a5029 100644 --- a/[esx]/es_extended/server/classes/overrides/oxinventory.lua +++ b/[esx]/es_extended/server/classes/overrides/oxinventory.lua @@ -48,8 +48,8 @@ Core.PlayerFunctionOverrides.OxInventory = { local account = self.getAccount(accountName) if account then - local newMoney = ESX.Math.Round(money) - account.money = newMoney + money = account.round and ESX.Math.Round(money) or money + self.accounts[account.index].money = money self.triggerEvent('esx:setAccountMoney', account) @@ -67,10 +67,9 @@ Core.PlayerFunctionOverrides.OxInventory = { local account = self.getAccount(accountName) if account then - local newMoney = account.money + ESX.Math.Round(money) - account.money = newMoney - - self.triggerEvent('esx:setAccountMoney', account) + money = account.round and ESX.Math.Round(money) or money + self.accounts[account.index].money += money + self.triggerEvent('esx:setAccountMoney', account) if Inventory.accounts[accountName] then Inventory.AddItem(self.source, accountName, money) @@ -86,9 +85,8 @@ Core.PlayerFunctionOverrides.OxInventory = { local account = self.getAccount(accountName) if account then - local newMoney = account.money - ESX.Math.Round(money) - account.money = newMoney - + money = account.round and ESX.Math.Round(money) or money + self.accounts[account.index].money -= money self.triggerEvent('esx:setAccountMoney', account) if Inventory.accounts[accountName] then From 2851032034f93eb48863b909f2bfdb9c7b3fa76f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:14:08 +0100 Subject: [PATCH 04/30] feat(es_extended): New Server Events for account syncing --- .../server/classes/overrides/oxinventory.lua | 15 +++++++++------ [esx]/es_extended/server/classes/player.lua | 12 +++++++++--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/[esx]/es_extended/server/classes/overrides/oxinventory.lua b/[esx]/es_extended/server/classes/overrides/oxinventory.lua index ae8a5029..d983b714 100644 --- a/[esx]/es_extended/server/classes/overrides/oxinventory.lua +++ b/[esx]/es_extended/server/classes/overrides/oxinventory.lua @@ -43,7 +43,8 @@ Core.PlayerFunctionOverrides.OxInventory = { end, setAccountMoney = function(self) - return function(accountName,money) + return function(accountName,money, reason) + reason = reason or 'unknown' if money >= 0 then local account = self.getAccount(accountName) @@ -52,7 +53,7 @@ Core.PlayerFunctionOverrides.OxInventory = { self.accounts[account.index].money = money self.triggerEvent('esx:setAccountMoney', account) - + TriggerEvent('esx:setAccountMoney', self.source, accountName, money, reason) if Inventory.accounts[accountName] then Inventory.SetItem(self.source, accountName, money) end @@ -62,7 +63,8 @@ Core.PlayerFunctionOverrides.OxInventory = { end, addAccountMoney = function(self) - return function(accountName,money) + return function(accountName,money, reason) + reason = reason or 'unknown' if money > 0 then local account = self.getAccount(accountName) @@ -70,7 +72,7 @@ Core.PlayerFunctionOverrides.OxInventory = { money = account.round and ESX.Math.Round(money) or money self.accounts[account.index].money += money self.triggerEvent('esx:setAccountMoney', account) - + TriggerEvent('esx:addAccountMoney', self.source, accountName, money, reason) if Inventory.accounts[accountName] then Inventory.AddItem(self.source, accountName, money) end @@ -80,7 +82,8 @@ Core.PlayerFunctionOverrides.OxInventory = { end, removeAccountMoney = function(self) - return function(accountName,money) + return function(accountName,money, reason) + reason = reason or 'unknown' if money > 0 then local account = self.getAccount(accountName) @@ -88,7 +91,7 @@ Core.PlayerFunctionOverrides.OxInventory = { money = account.round and ESX.Math.Round(money) or money self.accounts[account.index].money -= money self.triggerEvent('esx:setAccountMoney', account) - + TriggerEvent('esx:removeAccountMoney', self.source, accountName, money, reason) if Inventory.accounts[accountName] then Inventory.RemoveItem(self.source, accountName, money) end diff --git a/[esx]/es_extended/server/classes/player.lua b/[esx]/es_extended/server/classes/player.lua index 071cce15..6361537f 100644 --- a/[esx]/es_extended/server/classes/player.lua +++ b/[esx]/es_extended/server/classes/player.lua @@ -171,7 +171,8 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, self.name = newName end - function self.setAccountMoney(accountName, money) + function self.setAccountMoney(accountName, money, reason) + reason = reason or 'unknown' if not tonumber(money) then print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) return @@ -184,6 +185,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, self.accounts[account.index].money = money self.triggerEvent('esx:setAccountMoney', account) + TriggerEvent('esx:setAccountMoney', self.source, accountName, money, reason) else print(('[^1ERROR^7] Tried To Set Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end @@ -192,7 +194,8 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end end - function self.addAccountMoney(accountName, money) + function self.addAccountMoney(accountName, money, reason) + reason = reason or 'Unknown' if not tonumber(money) then print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) return @@ -204,6 +207,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, self.accounts[account.index].money += money self.triggerEvent('esx:setAccountMoney', account) + TriggerEvent('esx:addAccountMoney', self.source, accountName, money, reason) else print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end @@ -212,7 +216,8 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end end - function self.removeAccountMoney(accountName, money) + function self.removeAccountMoney(accountName, money, reason) + reason = reason or 'Unknown' if not tonumber(money) then print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) return @@ -225,6 +230,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, self.accounts[account.index].money -= money self.triggerEvent('esx:setAccountMoney', account) + TriggerEvent('esx:removeAccountMoney', self.source, accountName, money, reason) else print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end From 254f1c29b879b4f7ecd96223a89340db684d4043 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:23:44 +0100 Subject: [PATCH 05/30] feat(es_extended): Added Reasons for Account Changes --- [esx]/es_extended/server/commands.lua | 4 ++-- [esx]/es_extended/server/main.lua | 8 ++++---- [esx]/es_extended/server/paycheck.lua | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/[esx]/es_extended/server/commands.lua b/[esx]/es_extended/server/commands.lua index 9fc8ffc8..13c29c70 100644 --- a/[esx]/es_extended/server/commands.lua +++ b/[esx]/es_extended/server/commands.lua @@ -40,7 +40,7 @@ end, false, {help = _U('command_cardel'), validate = false, arguments = { ESX.RegisterCommand('setaccountmoney', 'admin', function(xPlayer, args, showError) if args.playerId.getAccount(args.account) then - args.playerId.setAccountMoney(args.account, args.amount) + args.playerId.setAccountMoney(args.account, args.amount, "Government Grant") else showError(_U('command_giveaccountmoney_invalid')) end @@ -52,7 +52,7 @@ end, true, {help = _U('command_setaccountmoney'), validate = true, arguments = { ESX.RegisterCommand('giveaccountmoney', 'admin', function(xPlayer, args, showError) if args.playerId.getAccount(args.account) then - args.playerId.addAccountMoney(args.account, args.amount) + args.playerId.addAccountMoney(args.account, args.amount, "Government Grant") else showError(_U('command_giveaccountmoney_invalid')) end diff --git a/[esx]/es_extended/server/main.lua b/[esx]/es_extended/server/main.lua index 2a46a02f..836fb7c8 100644 --- a/[esx]/es_extended/server/main.lua +++ b/[esx]/es_extended/server/main.lua @@ -398,8 +398,8 @@ if not Config.OxInventory then end elseif type == 'item_account' then if itemCount > 0 and sourceXPlayer.getAccount(itemName).money >= itemCount then - sourceXPlayer.removeAccountMoney(itemName, itemCount) - targetXPlayer.addAccountMoney(itemName, itemCount) + sourceXPlayer.removeAccountMoney(itemName, itemCount, "Gave to " .. targetXPlayer.name) + targetXPlayer.addAccountMoney(itemName, itemCount, "Received from " .. sourceXPlayer.name) sourceXPlayer.showNotification(_U('gave_account_money', ESX.Math.GroupDigits(itemCount), Config.Accounts[itemName].label, targetXPlayer.name)) targetXPlayer.showNotification(_U('received_account_money', ESX.Math.GroupDigits(itemCount), Config.Accounts[itemName].label, @@ -495,7 +495,7 @@ if not Config.OxInventory then if (itemCount > account.money or account.money < 1) then xPlayer.showNotification(_U('imp_invalid_amount')) else - xPlayer.removeAccountMoney(itemName, itemCount) + xPlayer.removeAccountMoney(itemName, itemCount, "Threw away") local pickupLabel = ('%s [%s]'):format(account.label, _U('locale_currency', ESX.Math.GroupDigits(itemCount))) ESX.CreatePickup('item_account', itemName, itemCount, pickupLabel, playerId) xPlayer.showNotification(_U('threw_account', ESX.Math.GroupDigits(itemCount), string.lower(account.label))) @@ -551,7 +551,7 @@ if not Config.OxInventory then end elseif pickup.type == 'item_account' then success = true - xPlayer.addAccountMoney(pickup.name, pickup.count) + xPlayer.addAccountMoney(pickup.name, pickup.count, "Picked up") elseif pickup.type == 'item_weapon' then if xPlayer.hasWeapon(pickup.name) then xPlayer.showNotification(_U('threw_weapon_already')) diff --git a/[esx]/es_extended/server/paycheck.lua b/[esx]/es_extended/server/paycheck.lua index e13e1df0..d4ff11e3 100644 --- a/[esx]/es_extended/server/paycheck.lua +++ b/[esx]/es_extended/server/paycheck.lua @@ -10,7 +10,7 @@ function StartPayCheck() if salary > 0 then if job == 'unemployed' then -- unemployed - xPlayer.addAccountMoney('bank', salary) + xPlayer.addAccountMoney('bank', salary, "Welfare Check") TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_help', salary), 'CHAR_BANK_MAZE', 9) elseif Config.EnableSocietyPayouts then -- possibly a society @@ -18,7 +18,7 @@ function StartPayCheck() if society ~= nil then -- verified society TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) if account.money >= salary then -- does the society money to pay its employees? - xPlayer.addAccountMoney('bank', salary) + xPlayer.addAccountMoney('bank', salary, "Paycheck") account.removeMoney(salary) TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), @@ -28,13 +28,13 @@ function StartPayCheck() end end) else -- not a society - xPlayer.addAccountMoney('bank', salary) + xPlayer.addAccountMoney('bank', salary, "Paycheck") TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9) end end) else -- generic job - xPlayer.addAccountMoney('bank', salary) + xPlayer.addAccountMoney('bank', salary, "Paycheck") TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9) end From bae3e4d4c12afcb6045707c7fea8cfc3514b7c44 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:25:04 +0100 Subject: [PATCH 06/30] feat(esx_accessories): Added Reason for removing money --- [esx_addons]/esx_accessories/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_accessories/server/main.lua b/[esx_addons]/esx_accessories/server/main.lua index 23e7fbdb..c8331b61 100644 --- a/[esx_addons]/esx_accessories/server/main.lua +++ b/[esx_addons]/esx_accessories/server/main.lua @@ -2,7 +2,7 @@ RegisterServerEvent('esx_accessories:pay') AddEventHandler('esx_accessories:pay', function() local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeMoney(Config.Price) + xPlayer.removeMoney(Config.Price, "Accessory Purchase") TriggerClientEvent('esx:showNotification', source, _U('you_paid', ESX.Math.GroupDigits(Config.Price))) end) From 159ec7712be4f7ce53283b552f8e556eebb4d9c4 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:26:57 +0100 Subject: [PATCH 07/30] feat(esx_ambulancejob): Reasons for Account Changing --- [esx_addons]/esx_ambulancejob/server/main.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/[esx_addons]/esx_ambulancejob/server/main.lua b/[esx_addons]/esx_ambulancejob/server/main.lua index 99a2cfcc..effca84c 100644 --- a/[esx_addons]/esx_ambulancejob/server/main.lua +++ b/[esx_addons]/esx_ambulancejob/server/main.lua @@ -19,7 +19,7 @@ AddEventHandler('esx_ambulancejob:revive', function(playerId) if deadPlayers[playerId] then if Config.ReviveReward > 0 then xPlayer.showNotification(_U('revive_complete_award', xTarget.name, Config.ReviveReward)) - xPlayer.addMoney(Config.ReviveReward) + xPlayer.addMoney(Config.ReviveReward, "Revive Reward") xTarget.triggerEvent('esx_ambulancejob:revive') else xPlayer.showNotification(_U('revive_complete', xTarget.name)) @@ -142,11 +142,11 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function( if Config.RemoveCashAfterRPDeath then if xPlayer.getMoney() > 0 then - xPlayer.removeMoney(xPlayer.getMoney()) + xPlayer.removeMoney(xPlayer.getMoney(), "Death") end if xPlayer.getAccount('black_money').money > 0 then - xPlayer.setAccountMoney('black_money', 0) + xPlayer.setAccountMoney('black_money', 0, "Death") end end @@ -198,7 +198,7 @@ if Config.EarlyRespawnFine then local fineAmount = Config.EarlyRespawnFineAmount xPlayer.showNotification(_U('respawn_bleedout_fine_msg', ESX.Math.GroupDigits(fineAmount))) - xPlayer.removeAccountMoney('bank', fineAmount) + xPlayer.removeAccountMoney('bank', fineAmount, "Respawn Fine") end) end @@ -218,7 +218,7 @@ ESX.RegisterServerCallback('esx_ambulancejob:buyJobVehicle', function(source, cb cb(false) else if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "Job Vehicle Purchase") MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', {xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true}, function (rowsChanged) From f96145a84ee4c084ad55152c99877667464c40f0 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:28:23 +0100 Subject: [PATCH 08/30] feat(esx_barbershop): Reason for removing money --- [esx_addons]/esx_barbershop/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_barbershop/server/main.lua b/[esx_addons]/esx_barbershop/server/main.lua index dbd71d1e..d2145d5f 100644 --- a/[esx_addons]/esx_barbershop/server/main.lua +++ b/[esx_addons]/esx_barbershop/server/main.lua @@ -3,7 +3,7 @@ AddEventHandler('esx_barbershop:pay', function() local source = source local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeMoney(Config.Price) + xPlayer.removeMoney(Config.Price, "Haircut") TriggerClientEvent('esx:showNotification', source, _U('you_paid', ESX.Math.GroupDigits(Config.Price))) end) From f179ffed43578ae6448b91738ab55211492f0231 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:29:21 +0100 Subject: [PATCH 09/30] feat(es_extended): Added Reason Argument to Add/RemoveMoney --- [esx]/es_extended/server/classes/player.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/[esx]/es_extended/server/classes/player.lua b/[esx]/es_extended/server/classes/player.lua index 6361537f..29b0f601 100644 --- a/[esx]/es_extended/server/classes/player.lua +++ b/[esx]/es_extended/server/classes/player.lua @@ -60,14 +60,14 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, return self.getAccount('money').money end - function self.addMoney(money) + function self.addMoney(money, reason) money = ESX.Math.Round(money) - self.addAccountMoney('money', money) + self.addAccountMoney('money', money, reason) end - function self.removeMoney(money) + function self.removeMoney(money, reason) money = ESX.Math.Round(money) - self.removeAccountMoney('money', money) + self.removeAccountMoney('money', money, reason) end function self.getIdentifier() From 11ce86b22e14b7e01bf9c7aa37c8902633734f7b Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 22:31:41 +0100 Subject: [PATCH 10/30] feat(esx_billing): Reasons for account changing --- [esx_addons]/esx_billing/server/main.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/[esx_addons]/esx_billing/server/main.lua b/[esx_addons]/esx_billing/server/main.lua index 1ef55ede..b2b755a9 100644 --- a/[esx_addons]/esx_billing/server/main.lua +++ b/[esx_addons]/esx_billing/server/main.lua @@ -58,8 +58,8 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId) MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, function(rowsChanged) if rowsChanged == 1 then - xPlayer.removeMoney(amount) - xTarget.addMoney(amount) + xPlayer.removeMoney(amount, "Bill Paid") + xTarget.addMoney(amount, "Paid bill") xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) @@ -71,8 +71,8 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId) MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, function(rowsChanged) if rowsChanged == 1 then - xPlayer.removeAccountMoney('bank', amount) - xTarget.addAccountMoney('bank', amount) + xPlayer.removeAccountMoney('bank', amount, "Bill Paid") + xTarget.addAccountMoney('bank', amount, "Paid bill") xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) @@ -95,7 +95,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId) MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, function(rowsChanged) if rowsChanged == 1 then - xPlayer.removeMoney(amount) + xPlayer.removeMoney(amount, "Bill Paid") account.addMoney(amount) xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) @@ -110,7 +110,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId) MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, function(rowsChanged) if rowsChanged == 1 then - xPlayer.removeAccountMoney('bank', amount) + xPlayer.removeAccountMoney('bank', amount, "Bill Paid") account.addMoney(amount) xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) From 3bfa19a160b53efa1f19379c85dd43e86e3f07f6 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:39:50 +0100 Subject: [PATCH 11/30] feat(esx_boat): Reasons For Account Changes --- [esx_addons]/esx_boat/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_boat/server/main.lua b/[esx_addons]/esx_boat/server/main.lua index c2bacc28..1059469f 100644 --- a/[esx_addons]/esx_boat/server/main.lua +++ b/[esx_addons]/esx_boat/server/main.lua @@ -22,7 +22,7 @@ ESX.RegisterServerCallback('esx_boat:buyBoat', function(source, cb, vehicleProps cb(false) else if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "Boat Purchase") MySQL.update('INSERT INTO owned_vehicles (owner, plate, vehicle, type, `stored`) VALUES (@owner, @plate, @vehicle, @type, @stored)', { ['@owner'] = xPlayer.identifier, @@ -92,7 +92,7 @@ ESX.RegisterServerCallback('esx_boat:buyBoatLicense', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.getMoney() >= Config.LicensePrice then - xPlayer.removeMoney(Config.LicensePrice) + xPlayer.removeMoney(Config.LicensePrice, "Boat License Purchase") TriggerEvent('esx_license:addLicense', source, 'boat', function() cb(true) From 82beeb8fcd9d2937aea5c68f1d2ecb6d46824f54 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:40:34 +0100 Subject: [PATCH 12/30] feat(esx_clotheshop): Reasons for account changes --- [esx_addons]/esx_clotheshop/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_clotheshop/server/main.lua b/[esx_addons]/esx_clotheshop/server/main.lua index ee739197..fc2bca8a 100644 --- a/[esx_addons]/esx_clotheshop/server/main.lua +++ b/[esx_addons]/esx_clotheshop/server/main.lua @@ -23,7 +23,7 @@ ESX.RegisterServerCallback('esx_clotheshop:buyClothes', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.getMoney() >= Config.Price then - xPlayer.removeMoney(Config.Price) + xPlayer.removeMoney(Config.Price, "Outfit Purchase") TriggerClientEvent('esx:showNotification', source, _U('you_paid', Config.Price)) cb(true) else From 4ab4e1491cd899bec8806253c860867ab94a6e2f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:42:55 +0100 Subject: [PATCH 13/30] feat(esx_dmvschool): Reasons for account changes --- [esx_addons]/esx_dmvschool/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_dmvschool/server/main.lua b/[esx_addons]/esx_dmvschool/server/main.lua index f360c7fd..578143e1 100644 --- a/[esx_addons]/esx_dmvschool/server/main.lua +++ b/[esx_addons]/esx_dmvschool/server/main.lua @@ -2,7 +2,7 @@ ESX.RegisterServerCallback('esx_dmvschool:canYouPay', function(source, cb, type) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.getMoney() >= Config.Prices[type] then - xPlayer.removeMoney(Config.Prices[type]) + xPlayer.removeMoney(Config.Prices[type], "DMV Purchase") TriggerClientEvent('esx:showNotification', source, _U('you_paid', Config.Prices[type])) cb(true) else From 9d21e979da0ab46440875626f8402b07b00003e8 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:44:12 +0100 Subject: [PATCH 14/30] feat(esx_drugs): Reasons for Account Changes --- [esx_addons]/esx_drugs/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_drugs/server/main.lua b/[esx_addons]/esx_drugs/server/main.lua index f687118d..edced719 100644 --- a/[esx_addons]/esx_drugs/server/main.lua +++ b/[esx_addons]/esx_drugs/server/main.lua @@ -21,9 +21,9 @@ AddEventHandler('esx_drugs:sellDrug', function(itemName, amount) price = ESX.Math.Round(price * amount) if Config.GiveBlack then - xPlayer.addAccountMoney('black_money', price) + xPlayer.addAccountMoney('black_money', price, "Drugs Sold") else - xPlayer.addMoney(price) + xPlayer.addMoney(price, "Drugs Sold") end xPlayer.removeInventoryItem(xItem.name, amount) From 11fac41fd50170dd453dc9c68e89adde5df857a7 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:44:50 +0100 Subject: [PATCH 15/30] feat(esx_garage): Reasons for account changes --- [esx_addons]/esx_garage/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_garage/server/main.lua b/[esx_addons]/esx_garage/server/main.lua index 8c92fd16..36ab3159 100644 --- a/[esx_addons]/esx_garage/server/main.lua +++ b/[esx_addons]/esx_garage/server/main.lua @@ -129,7 +129,7 @@ AddEventHandler("esx_garage:payPound", function(amount) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.getMoney() >= amount then - xPlayer.removeMoney(amount) + xPlayer.removeMoney(amount, "Impound Fee") xPlayer.showNotification(_U('pay_Impound_bill', amount)) else xPlayer.showNotification(_U('missing_money')) From 308e5efa1923dcbd8cfa82c16f28b6d97df88cf9 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:45:39 +0100 Subject: [PATCH 16/30] feat(esx_holdup): Reasons For account changes --- [esx_addons]/esx_holdup/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_holdup/server/main.lua b/[esx_addons]/esx_holdup/server/main.lua index 71e76bf7..a118cf58 100644 --- a/[esx_addons]/esx_holdup/server/main.lua +++ b/[esx_addons]/esx_holdup/server/main.lua @@ -46,9 +46,9 @@ AddEventHandler('esx_holdup:robberyStarted', function(currentStore) if xPlayer then TriggerClientEvent('esx_holdup:robberyComplete', source, store.reward) if Config.GiveBlackMoney then - xPlayer.addAccountMoney('black_money', store.reward) + xPlayer.addAccountMoney('black_money', store.reward, "Robbery") else - xPlayer.addMoney(store.reward) + xPlayer.addMoney(store.reward, "Robbery") end local xPlayers = ESX.GetExtendedPlayers('job', 'police') for i=1, #(xPlayers) do From 620741c986b5595452054cc5557b43ed901e89c6 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:47:31 +0100 Subject: [PATCH 17/30] feat(esx_jobs): Reasons For account changes --- [esx_addons]/esx_jobs/server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[esx_addons]/esx_jobs/server/main.lua b/[esx_addons]/esx_jobs/server/main.lua index 0ad5d5a4..099b0165 100644 --- a/[esx_addons]/esx_jobs/server/main.lua +++ b/[esx_addons]/esx_jobs/server/main.lua @@ -50,7 +50,7 @@ CreateThread(function() end end else - xPlayer.addMoney(v.price) + xPlayer.addMoney(v.price, "Job Payment") end end end @@ -108,7 +108,7 @@ RegisterNetEvent('esx_jobs:caution', function(cautionType, cautionAmount, spawnP if cautionAmount <= Config.MaxCaution and cautionAmount >= 0 then TriggerEvent('esx_addonaccount:getAccount', 'caution', xPlayer.identifier, function(account) if xPlayer.getAccount('bank').money >= cautionAmount then - xPlayer.removeAccountMoney('bank', cautionAmount) + xPlayer.removeAccountMoney('bank', cautionAmount, "Caution Fine") account.addMoney(cautionAmount) xPlayer.showNotification(_U('bank_deposit_taken', ESX.Math.GroupDigits(cautionAmount))) TriggerClientEvent('esx_jobs:spawnJobVehicle', xPlayer.source, spawnPoint, vehicle) @@ -123,7 +123,7 @@ RegisterNetEvent('esx_jobs:caution', function(cautionType, cautionAmount, spawnP local caution = account.money local toGive = ESX.Math.Round(caution * cautionAmount) - xPlayer.addAccountMoney('bank', toGive) + xPlayer.addAccountMoney('bank', toGive, "Caution Return") account.removeMoney(toGive) TriggerClientEvent('esx:showNotification', source, _U('bank_deposit_returned', ESX.Math.GroupDigits(toGive))) end) From a321f26e3fe1aa6052fbdeabfdd5f9b174302f2f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:48:02 +0100 Subject: [PATCH 18/30] feat(esx_lscustom):Reasons For account changes --- [esx_addons]/esx_lscustom/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_lscustom/server/main.lua b/[esx_addons]/esx_lscustom/server/main.lua index 19e8cf73..f138efa8 100644 --- a/[esx_addons]/esx_lscustom/server/main.lua +++ b/[esx_addons]/esx_lscustom/server/main.lua @@ -25,7 +25,7 @@ AddEventHandler('esx_lscustom:buyMod', function(price) if price < xPlayer.getMoney() then TriggerClientEvent('esx_lscustom:installMod', source) TriggerClientEvent('esx:showNotification', source, _U('purchased')) - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "LSC Purchase") else TriggerClientEvent('esx_lscustom:cancelInstallMod', source) TriggerClientEvent('esx:showNotification', source, _U('not_enough_money')) From 121cd0f1fcc813c1bcb2e0ab0064fc28498ce87c Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:50:17 +0100 Subject: [PATCH 19/30] feat(esx_policejob): Reasons For account changes --- [esx_addons]/esx_policejob/server/main.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/[esx_addons]/esx_policejob/server/main.lua b/[esx_addons]/esx_policejob/server/main.lua index dbeeb2a7..9bddaefa 100644 --- a/[esx_addons]/esx_policejob/server/main.lua +++ b/[esx_addons]/esx_policejob/server/main.lua @@ -43,8 +43,8 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, -- does the target player have enough money? if targetAccount.money >= amount then - targetXPlayer.removeAccountMoney(itemName, amount) - sourceXPlayer.addAccountMoney (itemName, amount) + targetXPlayer.removeAccountMoney(itemName, amount, "Confiscated") + sourceXPlayer.addAccountMoney (itemName, amount, "Confiscated") sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name)) targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) @@ -320,7 +320,7 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo -- Weapon if type == 1 then if xPlayer.getMoney() >= selectedWeapon.price then - xPlayer.removeMoney(selectedWeapon.price) + xPlayer.removeMoney(selectedWeapon.price, "Weapon Bought") xPlayer.addWeapon(weaponName, 100) cb(true) @@ -336,7 +336,7 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo if component then if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "Weapon Component Bought") xPlayer.addWeaponComponent(weaponName, component.name) cb(true) @@ -361,7 +361,7 @@ ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, v cb(false) else if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "Job Vehicle Bought") MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true}, function (rowsChanged) From a57a5d8e36e4810702ed362940f481c0734e648f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:51:14 +0100 Subject: [PATCH 20/30] fix(esx_property): Selling to other players was removing from wrong account --- [esx_addons]/esx_property/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_property/server/main.lua b/[esx_addons]/esx_property/server/main.lua index 440ad971..40738f12 100644 --- a/[esx_addons]/esx_property/server/main.lua +++ b/[esx_addons]/esx_property/server/main.lua @@ -180,7 +180,7 @@ ESX.RegisterServerCallback("esx_property:buyProperty", function(source, cb, Prop local xPlayer = ESX.GetPlayerFromId(source) local Price = Properties[PropertyId].Price if xPlayer.getAccount("bank").money >= Price then - xPlayer.removeAccountMoney("bank", Price) + xPlayer.removeAccountMoney("bank", Price, "Bought Property") Properties[PropertyId].Owner = xPlayer.identifier Properties[PropertyId].OwnerName = xPlayer.getName() Properties[PropertyId].Owned = true @@ -200,7 +200,7 @@ ESX.RegisterServerCallback("esx_property:attemptSellToPlayer", function(source, local xTarget = ESX.GetPlayerFromId(PlayerId) local Price = Properties[PropertyId].Price if xTarget and (xTarget.getAccount("bank").money >= Price) and (xPlayer.job.name == PM.job) then - xPlayer.removeAccountMoney("bank", Price) + xTarget.removeAccountMoney("bank", Price, "Sold Property") Properties[PropertyId].Owner = xTarget.identifier Properties[PropertyId].OwnerName = xTarget.getName() Properties[PropertyId].Owned = true From ebaad4fa06cce03f1c98283588acd10d351881f5 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:52:34 +0100 Subject: [PATCH 21/30] feat(esx_property): Reasons For account changes --- [esx_addons]/esx_property/server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[esx_addons]/esx_property/server/main.lua b/[esx_addons]/esx_property/server/main.lua index 40738f12..71c23216 100644 --- a/[esx_addons]/esx_property/server/main.lua +++ b/[esx_addons]/esx_property/server/main.lua @@ -218,7 +218,7 @@ ESX.RegisterServerCallback("esx_property:attemptSellToPlayer", function(source, TriggerEvent('esx_addonaccount:getSharedAccount', PM.society, function(account) account.addMoney(SocietyPrice) end) - xPlayer.addAccountMoney("bank", PlayerPrice) + xPlayer.addAccountMoney("bank", PlayerPrice, "Sold Property") end end cb(xPlayer.getAccount("bank").money >= Price) @@ -231,7 +231,7 @@ ESX.RegisterServerCallback("esx_property:buyFurniture", function(source, cb, Pro if xPlayer.identifier == Owner or IsPlayerAdmin(source) or (Properties[PropertyId].Keys and Properties[PropertyId].Keys[xPlayer.identifier]) then local Price = Config.FurnitureCatagories[PropCatagory][PropIndex].price if xPlayer.getAccount("bank").money >= Price then - xPlayer.removeAccountMoney("bank", Price) + xPlayer.removeAccountMoney("bank", Price, "Furniture") cb(true) local furniture = {Name = PropName, Index = PropIndex, Catagory = PropCatagory, Pos = pos, Heading = heading, Price = Price} table.insert(Properties[PropertyId].furniture, furniture) @@ -265,7 +265,7 @@ ESX.RegisterServerCallback("esx_property:sellProperty", function(source, cb, Pro local Owner = Properties[PropertyId].Owner if xPlayer.identifier == Owner then local Price = ESX.Math.Round(Properties[PropertyId].Price * 0.6) - xPlayer.addAccountMoney("bank", Price) + xPlayer.addAccountMoney("bank", Price, "Sold Property") Properties[PropertyId].Owner = "" Properties[PropertyId].OwnerName = "" Properties[PropertyId].Owned = false From 265da61e9eab9a8f8d68e66993ed66a032af7ddf Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:58:33 +0100 Subject: [PATCH 22/30] feat(esx_shops): Reasons For account changes --- [esx_addons]/esx_shops/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_shops/server/main.lua b/[esx_addons]/esx_shops/server/main.lua index cf9fe0a4..bbfcd6d8 100644 --- a/[esx_addons]/esx_shops/server/main.lua +++ b/[esx_addons]/esx_shops/server/main.lua @@ -43,7 +43,7 @@ AddEventHandler('esx_shops:buyItem', function(itemName, amount, zone) if xPlayer.getMoney() >= price then -- can the player carry the said amount of x item? if xPlayer.canCarryItem(itemName, amount) then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, label .. " Purchase") xPlayer.addInventoryItem(itemName, amount) xPlayer.showNotification(_U('bought', amount, label, ESX.Math.GroupDigits(price))) else From 9de2cb4b40eab1d61877487755bd1ab6d0be401a Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:58:45 +0100 Subject: [PATCH 23/30] feat(esx_society): Reasons For account changes --- [esx_addons]/esx_society/server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[esx_addons]/esx_society/server/main.lua b/[esx_addons]/esx_society/server/main.lua index e570d271..3333099a 100644 --- a/[esx_addons]/esx_society/server/main.lua +++ b/[esx_addons]/esx_society/server/main.lua @@ -72,7 +72,7 @@ AddEventHandler('esx_society:withdrawMoney', function(societyName, amount) TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) if amount > 0 and account.money >= amount then account.removeMoney(amount) - xPlayer.addMoney(amount) + xPlayer.addMoney(amount, "Society Withdraw") xPlayer.showNotification(_U('have_withdrawn', ESX.Math.GroupDigits(amount))) else xPlayer.showNotification(_U('invalid_amount')) @@ -97,7 +97,7 @@ AddEventHandler('esx_society:depositMoney', function(societyName, amount) if xPlayer.job.name == society.name then if amount > 0 and xPlayer.getMoney() >= amount then TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) - xPlayer.removeMoney(amount) + xPlayer.removeMoney(amount, "Society Deposit") xPlayer.showNotification(_U('have_deposited', ESX.Math.GroupDigits(amount))) account.addMoney(amount) end) @@ -118,7 +118,7 @@ AddEventHandler('esx_society:washMoney', function(society, amount) if xPlayer.job.name == society then if amount and amount > 0 and account.money >= amount then - xPlayer.removeAccountMoney('black_money', amount) + xPlayer.removeAccountMoney('black_money', amount, "Washing") MySQL.insert('INSERT INTO society_moneywash (identifier, society, amount) VALUES (?, ?, ?)', {xPlayer.identifier, society, amount}, function(rowsChanged) From e32c8669024f619911873c698c3ae101aa3f9bc9 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:59:29 +0100 Subject: [PATCH 24/30] feat(esx_taxijob): Reasons For account changes --- [esx_addons]/esx_taxijob/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_taxijob/server/main.lua b/[esx_addons]/esx_taxijob/server/main.lua index 1faea64a..091aa9af 100644 --- a/[esx_addons]/esx_taxijob/server/main.lua +++ b/[esx_addons]/esx_taxijob/server/main.lua @@ -30,12 +30,12 @@ AddEventHandler('esx_taxijob:success', function() local playerMoney = ESX.Math.Round(total / 100 * 30) local societyMoney = ESX.Math.Round(total / 100 * 70) - xPlayer.addMoney(playerMoney) + xPlayer.addMoney(playerMoney, "Taxi Fair") account.addMoney(societyMoney) xPlayer.showNotification(_U('comp_earned', societyMoney, playerMoney)) else - xPlayer.addMoney(total) + xPlayer.addMoney(total, "Taxi Fair") xPlayer.showNotification(_U('have_earned', total)) end end) From 6a97cc1045608b7e6fadb583c0d5766b524e19b9 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 01:06:48 +0100 Subject: [PATCH 25/30] feat(esx_vehicleshop): Reasons For account changes --- [esx_addons]/esx_vehicleshop/server/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/[esx_addons]/esx_vehicleshop/server/main.lua b/[esx_addons]/esx_vehicleshop/server/main.lua index 4da577e3..40ddb1dc 100644 --- a/[esx_addons]/esx_vehicleshop/server/main.lua +++ b/[esx_addons]/esx_vehicleshop/server/main.lua @@ -167,7 +167,7 @@ ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, mo local modelPrice = getVehicleFromModel(model).price if modelPrice and xPlayer.getMoney() >= modelPrice then - xPlayer.removeMoney(modelPrice) + xPlayer.removeMoney(modelPrice, "Vehicle Purchase") MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {xPlayer.identifier, plate, json.encode({model = joaat(model), plate = plate}) }, function(rowsChanged) @@ -302,7 +302,7 @@ ESX.RegisterServerCallback('esx_vehicleshop:resellVehicle', function(source, cb, if vehicle.model == model then if vehicle.plate == plate then - xPlayer.addMoney(resellPrice) + xPlayer.addMoney(resellPrice, "Sold Vehicle") RemoveOwnedVehicle(plate) cb(true) else @@ -393,14 +393,14 @@ function PayRent() if bank >= sum and #v > 1 then total = total + sum - xPlayer.removeAccountMoney('bank', sum) + xPlayer.removeAccountMoney('bank', sum, "Vehicle Rental") xPlayer.showNotification(('You have paid $%s for all of your rentals'):format(ESX.Math.GroupDigits(sum))) else for i = 1, #v do local rental = v[i] if xPlayer.getAccount('bank').money >= rental.rent_price then total = total + rental.rent_price - xPlayer.removeAccountMoney('bank', rental.rent_price) + xPlayer.removeAccountMoney('bank', rental.rent_price, "Vehicle Rental") xPlayer.showNotification(_U('paid_rental', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) else xPlayer.showNotification(_U('paid_rental_evicted', ESX.Math.GroupDigits(rental.rent_price), rental.plate)) From 9284d20b5cc5344abcdf6a6732b7ec4d31692385 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 01:14:45 +0100 Subject: [PATCH 26/30] feat(esx_weaponshop): Reasons For account changes --- [esx_addons]/esx_weaponshop/server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[esx_addons]/esx_weaponshop/server/main.lua b/[esx_addons]/esx_weaponshop/server/main.lua index 5558cee6..f1ebdbb5 100644 --- a/[esx_addons]/esx_weaponshop/server/main.lua +++ b/[esx_addons]/esx_weaponshop/server/main.lua @@ -3,7 +3,7 @@ ESX.RegisterServerCallback('esx_weaponshop:buyLicense', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.getMoney() >= Config.LicensePrice then - xPlayer.removeMoney(Config.LicensePrice) + xPlayer.removeMoney(Config.LicensePrice, "Weapon License") TriggerEvent('esx_license:addLicense', source, 'weapon', function() cb(true) @@ -28,7 +28,7 @@ ESX.RegisterServerCallback('esx_weaponshop:buyWeapon', function(source, cb, weap else if zone == 'BlackWeashop' then if xPlayer.getAccount('black_money').money >= price then - xPlayer.removeAccountMoney('black_money', price) + xPlayer.removeAccountMoney('black_money', price, "Black Weapons Deal") xPlayer.addWeapon(weaponName, 42) cb(true) @@ -38,7 +38,7 @@ ESX.RegisterServerCallback('esx_weaponshop:buyWeapon', function(source, cb, weap end else if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) + xPlayer.removeMoney(price, "Weapons Deal") xPlayer.addWeapon(weaponName, 42) cb(true) From 6fba9331ceb569d3d1cef98c7a1540ff0e8ff498 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 01:17:24 +0100 Subject: [PATCH 27/30] fix(server.cfg): Enable Onesync infinity --- server.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.cfg b/server.cfg index 25824af0..69e93c22 100644 --- a/server.cfg +++ b/server.cfg @@ -29,7 +29,7 @@ sets locale "en-US" sets tags "default, esx, legacy, Roleplay" sv_scriptHookAllowed 0 -set onesync legacy # Infinity is not recommended for ESX +set onesync on # Enable OneSync [REQUIRED FOR LEGACY 1.7.5 +] set mysql_connection_string "mysql://user:password@localhost/es_extended?waitForConnections=true&charset=utf8mb4" set mysql_ui true From 5f63779c8942740e15a1b7f80285c438bfa129db Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 01:26:01 +0100 Subject: [PATCH 28/30] tweak(server.cfg): Now Matches txAdmin recipe cfg --- server.cfg | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/server.cfg b/server.cfg index 69e93c22..a5919d10 100644 --- a/server.cfg +++ b/server.cfg @@ -1,15 +1,12 @@ -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# ███████╗███████╗██╗ ██╗ ██╗ ███████╗ ██████╗ █████╗ ██████╗██╗ ██╗ # -# ██╔════╝██╔════╝╚██╗██╔╝ ██║ ██╔════╝██╔════╝ ██╔══██╗██╔════╝╚██╗ ██╔╝ # -# █████╗ ███████╗ ╚███╔╝ ██║ █████╗ ██║ ███╗███████║██║ ╚████╔╝ # -# ██╔══╝ ╚════██║ ██╔██╗ ██║ ██╔══╝ ██║ ██║██╔══██║██║ ╚██╔╝ # -# ███████╗███████║██╔╝ ██╗ ███████╗███████╗╚██████╔╝██║ ██║╚██████╗ ██║ # -# ╚══════╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ # -# Discord: https://discord.gg/kwYdXC4wzb # -# Documentation: https://docs.esx-framework.org # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - +# # # # # # # # # # # # # # # # # # # # # # # # # # # +# ___ _____ __ _ ___ ___ _ _____ __ # +# | __/ __\ \/ / | | | __/ __| /_\ / __\ \ / / # +# | _|\__ \> < | |__| _| (_ |/ _ \ (__ \ V / # +# |___|___/_/\_\ |____|___\___/_/ \_\___| |_| # +# # +# Discord: https://discord.gg/esx-framework # +# Website: https://esx-framework.org/ # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only. endpoint_add_tcp "0.0.0.0:30120" @@ -18,15 +15,14 @@ endpoint_add_udp "0.0.0.0:30120" ### Endpoints Privacy ### sv_endpointPrivacy true -sv_hostname "Unconfigured ESX Legacy Server" +sv_hostname "Unconfigured | ESX Legacy Server" set steam_webApiKey "" sv_licenseKey "" sv_maxclients 10 # Allow access to features usually locked behind a FiveM patreon key -sets sv_projectName "ESX Legacy" -sets sv_projectDesc "My new ESX Legacy project" -sets locale "en-US" -sets tags "default, esx, legacy, Roleplay" +sets sv_projectName "Unconfigured | ESX Legacy Server" +sets sv_projectDesc "The official recipe of the most popular FiveM RP framework, containing Jobs, Housing, Vehicles & more!" +sets tags "default, esx, esx legacy, legacy, official, roleplay" sv_scriptHookAllowed 0 set onesync on # Enable OneSync [REQUIRED FOR LEGACY 1.7.5 +] From 17bc4768b7457ce6d8b64ae3867549e692b83d12 Mon Sep 17 00:00:00 2001 From: Heavy Bob Date: Sat, 10 Sep 2022 12:35:36 +1000 Subject: [PATCH 29/30] User Timestamps by default This small change will allow anyone using legacy to quickly see via sql when a user account was created and when the user was last active. --- [SQL]/legacy.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/[SQL]/legacy.sql b/[SQL]/legacy.sql index d7351c34..a838b9df 100644 --- a/[SQL]/legacy.sql +++ b/[SQL]/legacy.sql @@ -400,6 +400,8 @@ CREATE TABLE `users` ( `id` int(11) NOT NULL, `disabled` TINYINT(1) NULL DEFAULT '0', `last_property` varchar(255) DEFAULT NULL + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `last_seen` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB; -- -------------------------------------------------------- From 91c22ce1fb84cf994b2c4ccf04378bdc5ab3676f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 04:59:52 +0100 Subject: [PATCH 30/30] fix(legacy.sql): Heavy Bob missed a Comma --- [SQL]/legacy.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[SQL]/legacy.sql b/[SQL]/legacy.sql index a838b9df..e9d30e03 100644 --- a/[SQL]/legacy.sql +++ b/[SQL]/legacy.sql @@ -399,7 +399,7 @@ CREATE TABLE `users` ( `is_dead` tinyint(1) DEFAULT 0, `id` int(11) NOT NULL, `disabled` TINYINT(1) NULL DEFAULT '0', - `last_property` varchar(255) DEFAULT NULL + `last_property` varchar(255) DEFAULT NULL, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `last_seen` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB;