From 65d6d32c6edb5d9103a782768862b562aa3bcf7f Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Tue, 28 Jul 2026 01:16:36 +0200 Subject: [PATCH] fix(es_extended/server/modules/commands): survive console use and fix notifications RegisterCommand hands the callback xPlayer or false, so group, refreshitems and fix threw from the server console instead of doing their work. The same three lines still used the old showNotification argument list, which put a number into title and made esx_notify throw, so players got no confirmation either. --- [core]/es_extended/server/modules/commands.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/[core]/es_extended/server/modules/commands.lua b/[core]/es_extended/server/modules/commands.lua index 2320e82f..6e85da79 100644 --- a/[core]/es_extended/server/modules/commands.lua +++ b/[core]/es_extended/server/modules/commands.lua @@ -178,9 +178,11 @@ ESX.RegisterCommand( return end xTarget.triggerEvent("esx:repairPedVehicle") - xPlayer.showNotification(TranslateCap("command_repair_success"), true, false, 140) - if xPlayer.source ~= xTarget.source then - xTarget.showNotification(TranslateCap("command_repair_success_target"), true, false, 140) + if xPlayer then + xPlayer.showNotification(TranslateCap("command_repair_success")) + end + if not xPlayer or xPlayer.source ~= xTarget.source then + xTarget.showNotification(TranslateCap("command_repair_success_target")) end if Config.AdminLogging then ESX.DiscordLogFields("UserActions", "Fix Vehicle /fix Triggered!", "pink", { @@ -445,7 +447,11 @@ if not Config.CustomInventory then ESX.RegisterCommand("refreshitems", "admin", function(xPlayer) local itemCount = ESX.RefreshItems() - xPlayer.showNotification(Translate("command_refreshitems_success", itemCount), true, false, 140) + if xPlayer then + xPlayer.showNotification(Translate("command_refreshitems_success", itemCount)) + else + print(("[^2INFO^7] %s^7"):format(Translate("command_refreshitems_success", itemCount))) + end end, true, { help = TranslateCap("command_refreshitems") }) ESX.RegisterCommand( @@ -558,7 +564,7 @@ end, true, { help = TranslateCap("command_saveall") }) ESX.RegisterCommand("group", { "user", "admin" }, function(xPlayer, _, _) print(("%s, you are currently: ^5%s^0"):format(xPlayer.getName(), xPlayer.getGroup())) -end, true) +end, false) ESX.RegisterCommand("job", { "user", "admin" }, function(xPlayer, _, _) local job = xPlayer.getJob()