Skip to content

Commit aef8223

Browse files
committed
📃 refactor(server): use lib.print instead of print
1 parent b8bdee3 commit aef8223

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎server/functions.lua‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
5454
end
5555

5656
if Core.RegisteredCommands[name] then
57-
print(('[^3WARNING^7] Command ^5 %s ^7already registered, overriding command'):format(name))
57+
lib.print.warn(('[^3WARNING^7] Command ^5 %s ^7already registered, overriding command'):format(name))
5858

5959
if Core.RegisteredCommands[name].suggestion then
6060
TriggerClientEvent('chat:removeSuggestion', -1, ('/%s'):format(name))
@@ -78,7 +78,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
7878
local command = Core.RegisteredCommands[name]
7979

8080
if not command.allowConsole and playerId == 0 then
81-
print(('[^3WARNING^7] ^5%s^0'):format(TranslateCap('commanderror_console')))
81+
lib.print.warn(('[^3WARNING^7] ^5%s^0'):format(TranslateCap('commanderror_console')))
8282
else
8383
local xPlayer, error = ESX.Players[playerId], nil
8484

@@ -305,7 +305,7 @@ function Core.SavePlayers(cb)
305305
return cb()
306306
end
307307

308-
print(
308+
lib.print.info(
309309
('[^2INFO^7] Saved ^5%s^7 %s over ^5%s^7 ms'):format(
310310
#parameters,
311311
#parameters > 1 and 'players' or 'player',
@@ -503,14 +503,14 @@ function ESX.RefreshJobs()
503503
if Jobs[v.job_name] then
504504
Jobs[v.job_name].grades[tostring(v.grade)] = v
505505
else
506-
print(('[^3WARNING^7] Ignoring job grades for ^5 %s ^0 due to missing job'):format(v.job_name))
506+
lib.print.warn(('[^3WARNING^7] Ignoring job grades for ^5 %s ^0 due to missing job'):format(v.job_name))
507507
end
508508
end
509509

510510
for _, v in pairs(Jobs) do
511511
if ESX.Table.SizeOf(v.grades) == 0 then
512512
Jobs[v.name] = nil
513-
print(('[^3WARNING^7] Ignoring job ^5 %s ^0 due to no job grades found'):format(v.name))
513+
lib.print.warn(('[^3WARNING^7] Ignoring job ^5 %s ^0 due to no job grades found'):format(v.name))
514514
end
515515
end
516516

@@ -547,12 +547,12 @@ function ESX.UseItem(source, item, ...)
547547
local success, result = pcall(itemCallback, source, item, ...)
548548

549549
if not success then
550-
return result and print(result)
551-
or print(('[^3WARNING^7] An error occured when using item ^5 %s ^7! This was not caused by ESX.'):format(item))
550+
return result and lib.print.info(result)
551+
or lib.print.warn(('[^3WARNING^7] An error occured when using item ^5 %s ^7! This was not caused by ESX.'):format(item))
552552
end
553553
end
554554
else
555-
print(('[^3WARNING^7] Item ^5 %s ^7 was used but does not exist!'):format(item))
555+
lib.print.warn(('[^3WARNING^7] Item ^5 %s ^7 was used but does not exist!'):format(item))
556556
end
557557
end
558558

@@ -563,7 +563,7 @@ function ESX.GetItemLabel(item)
563563
if ESX.Items[item] then
564564
return ESX.Items[item].label
565565
else
566-
print(('[^3WARNING^7] Attemting to get invalid Item -> ^5%s^7'):format(item))
566+
lib.print.warn(('[^3WARNING^7] Attemting to get invalid Item -> ^5%s^7'):format(item))
567567
end
568568
end
569569

0 commit comments

Comments
 (0)