From 663a84ca9a460ff97cc8ef1a4893081fed6c9885 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Thu, 22 Sep 2022 23:55:44 +0100 Subject: [PATCH] tweak(es_extended): Uniform prints --- [esx]/es_extended/client/functions.lua | 14 +++++++------- [esx]/es_extended/client/main.lua | 6 +++--- [esx]/es_extended/server/classes/player.lua | 14 +++++++------- [esx]/es_extended/server/commands.lua | 4 ++-- [esx]/es_extended/server/common.lua | 6 +++--- [esx]/es_extended/server/functions.lua | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua index 3ba77831..5543166a 100644 --- a/[esx]/es_extended/client/functions.lua +++ b/[esx]/es_extended/client/functions.lua @@ -87,7 +87,7 @@ function ESX.ShowNotification(message, type, length) if GetResourceState("esx_notify") ~= "missing" then exports["esx_notify"]:Notify(type, length, message) else - print("[ERROR] Missing esx_notify") + print("[^1ERROR^7] ^5ESX Notify^7 is Missing!") end end @@ -96,7 +96,7 @@ function ESX.TextUI(message, type) if GetResourceState("esx_textui") ~= "missing" then exports["esx_textui"]:TextUI(message, type) else - print("[ERROR] Missing ESX TextUI!") + print("[^1ERROR^7] ^5ESX TextUI^7 is Missing!") return end end @@ -105,7 +105,7 @@ function ESX.HideUI() if GetResourceState("esx_textui") ~= "missing" then exports["esx_textui"]:HideUI() else - print("[ERROR] Missing ESX TextUI!") + print("[^1ERROR^7] ^5ESX TextUI^7 is Missing!") return end end @@ -174,19 +174,19 @@ if GetResourceState("esx_context") ~= "missing" then end else function ESX.OpenContext() - print("[ERROR] Tried to open context menu, but esx_context is missing!") + print("[^1ERROR^7] Tried to ^5open^7 context menu, but ^5esx_context^7 is missing!") end function ESX.PreviewContext() - print("[ERROR] Tried to preview context menu, but esx_context is missing!") + print("[^1ERROR^7] Tried to ^5preview^7 context menu, but ^5esx_context^7 is missing!") end function ESX.CloseContext() - print("[ERROR] Tried to close context menu, but esx_context is missing!") + print("[^1ERROR^7] Tried to ^5close^7 context menu, but ^5esx_context^7 is missing!") end function ESX.RefreshContext() - print("[ERROR] Tried to close context menu, but esx_context is missing!") + print("[^1ERROR^7] Tried to ^5Refresh^7 context menu, but ^5esx_context^7 is missing!") end end diff --git a/[esx]/es_extended/client/main.lua b/[esx]/es_extended/client/main.lua index 1291ec41..d53e0455 100644 --- a/[esx]/es_extended/client/main.lua +++ b/[esx]/es_extended/client/main.lua @@ -264,17 +264,17 @@ if not Config.OxInventory then RegisterNetEvent('esx:addWeapon') AddEventHandler('esx:addWeapon', function(weapon, ammo) - print("[WARNING] event 'esx:addWeapon' is deprecated. Please use xPlayer.addWeapon Instead!") + print("[^1ERROR^7] event ^5'esx:addWeapon'^7 Has Been Removed. Please use ^5xPlayer.addWeapon^7 Instead!") end) RegisterNetEvent('esx:addWeaponComponent') AddEventHandler('esx:addWeaponComponent', function(weapon, weaponComponent) - print("[WARNING] event 'esx:addWeaponComponent' is deprecated. Please use xPlayer.addWeaponComponent Instead!") + print("[^1ERROR^7] event ^5'esx:addWeaponComponent'^7 Has Been Removed. Please use ^5xPlayer.addWeaponComponent^7 Instead!") end) RegisterNetEvent('esx:setWeaponAmmo') AddEventHandler('esx:setWeaponAmmo', function(weapon, weaponAmmo) - print("[WARNING] event 'esx:setWeaponAmmo' is deprecated. Please use xPlayer.addWeaponComponent Instead!") + print("[^1ERROR^7] event ^5'esx:setWeaponAmmo'^7 Has Been Removed. Please use ^5xPlayer.addWeaponComponent^7 Instead!") end) RegisterNetEvent('esx:setWeaponTint') diff --git a/[esx]/es_extended/server/classes/player.lua b/[esx]/es_extended/server/classes/player.lua index 7c9cd11e..89575309 100644 --- a/[esx]/es_extended/server/classes/player.lua +++ b/[esx]/es_extended/server/classes/player.lua @@ -174,7 +174,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, 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)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) return end if money >= 0 then @@ -190,14 +190,14 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, print(('[^1ERROR^7] Tried To Set Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end else - print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) end end 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)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) return end if money > 0 then @@ -212,14 +212,14 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end else - print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) end end 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)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) return end if money > 0 then @@ -235,7 +235,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, print(('[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId)) end else - print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number!'):format(accountName, self.playerId)) + print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money)) end end @@ -356,7 +356,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, TriggerEvent('esx:setJob', self.source, self.job, lastJob) self.triggerEvent('esx:setJob', self.job) else - print(('[es_extended] [^3WARNING^7] Ignoring invalid .setJob() usage for "%s"'):format(self.identifier)) + print(('[es_extended] [^3WARNING^7] Ignoring invalid ^5.setJob()^7 usage for ID: ^5%s^7, Job: ^5%s^7'):format(self.source, job)) end end diff --git a/[esx]/es_extended/server/commands.lua b/[esx]/es_extended/server/commands.lua index ff503336..62173c05 100644 --- a/[esx]/es_extended/server/commands.lua +++ b/[esx]/es_extended/server/commands.lua @@ -152,7 +152,7 @@ end ESX.RegisterCommand('setgroup', 'admin', function(xPlayer, args, showError) if not args.playerId then args.playerId = xPlayer.source end - if args.group == "superadmin" then args.group = "admin" print("[^3WARNING^7] Superadmin detected, setting group to admin") end + if args.group == "superadmin" then args.group = "admin" print("[^3WARNING^7] ^5Superadmin^7 detected, setting group to ^5admin^7") end args.playerId.setGroup(args.group) end, true, {help = _U('command_setgroup'), validate = true, arguments = { {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, @@ -161,7 +161,7 @@ end, true, {help = _U('command_setgroup'), validate = true, arguments = { ESX.RegisterCommand('save', 'admin', function(xPlayer, args, showError) Core.SavePlayer(args.playerId) - print("[^2Info^0] Saved Player!") + print("[^2Info^0] Saved Player - ^5".. args.playerId.source .. "^0") end, true, {help = _U('command_save'), validate = true, arguments = { {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} }}) diff --git a/[esx]/es_extended/server/common.lua b/[esx]/es_extended/server/common.lua index fb0b2cdd..6c68f1d6 100644 --- a/[esx]/es_extended/server/common.lua +++ b/[esx]/es_extended/server/common.lua @@ -74,14 +74,14 @@ MySQL.ready(function() if Jobs[v.job_name] then Jobs[v.job_name].grades[tostring(v.grade)] = v else - print(('[^3WARNING^7] Ignoring job grades for ^5"%s"^0 due to missing job'):format(v.job_name)) + print(('[^3WARNING^7] Ignoring job grades for ^5%s^0 due to missing job'):format(v.job_name)) end end for _, v in pairs(Jobs) do if ESX.Table.SizeOf(v.grades) == 0 then Jobs[v.name] = nil - print(('[^3WARNING^7] Ignoring job ^5"%s"^0 due to no job grades found'):format(v.name)) + print(('[^3WARNING^7] Ignoring job ^5%s^0 due to no job grades found'):format(v.name)) end end @@ -93,7 +93,7 @@ MySQL.ready(function() ESX.Jobs = Jobs end - print('[^2INFO^7] ESX ^5Legacy^0 initialized') + print('[^2INFO^7] ESX ^5Legacy 1.8.5^0 initialized!') StartDBSync() StartPayCheck() end) diff --git a/[esx]/es_extended/server/functions.lua b/[esx]/es_extended/server/functions.lua index b617a346..6f038b13 100644 --- a/[esx]/es_extended/server/functions.lua +++ b/[esx]/es_extended/server/functions.lua @@ -171,7 +171,7 @@ function ESX.TriggerServerCallback(name, requestId, source, cb, ...) if Core.ServerCallbacks[name] then Core.ServerCallbacks[name](source, cb, ...) else - print(('[^3WARNING^7] Server callback ^5"%s"^0 does not exist. ^1Please Check The Server File for Errors!'):format(name)) + print(('[^3WARNING^7] Server callback ^5%s^0 does not exist. Please Check The Server File for ^1Errors^7!'):format(name)) end end @@ -209,7 +209,7 @@ function Core.SavePlayers(cb) if type(cb) == 'function' then cb() else - print(('[^2INFO^7] Saved %s %s over %s ms'):format(count, count > 1 and 'players' or 'player', (os.time() - time) / 1000000)) + print(('[^2INFO^7] Saved ^5%s^7 %s over ^5%s^7 ms'):format(count, count > 1 and 'players' or 'player', ESX.Math.Round((os.time() - time) / 1000000, 2))) end end end) @@ -392,7 +392,7 @@ function ESX.GetItemLabel(item) if ESX.Items[item] then return ESX.Items[item].label else - print('[^3WARNING^7] Attemting to get invalid Item -> ' .. item) + print('[^3WARNING^7] Attemting to get invalid Item -> ^5' .. item .. "^7") end end