tweak(es_extended): Uniform prints

This commit is contained in:
Mycroft
2022-09-22 23:55:44 +01:00
parent 69342a678b
commit 663a84ca9a
6 changed files with 25 additions and 25 deletions
+7 -7
View File
@@ -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
+3 -3
View File
@@ -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')
+7 -7
View File
@@ -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
+2 -2
View File
@@ -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'}
}})
+3 -3
View File
@@ -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)
+3 -3
View File
@@ -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