From 846154b1d1fb24dc825dffecd16a63a68dbc5a05 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:11:46 -0600 Subject: [PATCH] New dev cmds, add cmd help for possible matches --- scripts/server/command.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/server/command.js b/scripts/server/command.js index ef575bcd..27d93a40 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -224,6 +224,9 @@ function loadCommands() { commandData("streamnameall", streamAudioNameToAllPlayersCommand, " ", getStaffFlagValue("Developer"), true, true), commandData("forceresetpass", forceAccountPasswordResetCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("Developer"), true, true), ], discord: [], email: [ @@ -650,7 +653,13 @@ function processPlayerCommand(command, params, client) { if(!doesCommandExist(toLowerCase(command))) { console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`); - messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`); + + let possibleCommand = getCommandFromParams(command); + if(possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) { + messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Did you mean {ALTCOLOUR}/${possibleCommand.command} ?`); + } else { + messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`); + } return false; } @@ -750,5 +759,4 @@ function getCommandAliasesNames(command) { return commandAliases; } -// =========================================================================== - +// =========================================================================== \ No newline at end of file