diff --git a/scripts/server/command.js b/scripts/server/command.js index 98d8a224..88d0a7bb 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -169,9 +169,11 @@ function loadCommands() { new CommandData("reloadaccentcfg", reloadAccentConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the accent configuration and texts"), new CommandData("setbizblips", toggleServerBusinessBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business blips on/off"), + new CommandData("setbusinessblips", toggleServerBusinessBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business blips on/off"), new CommandData("sethouseblips", toggleServerHouseBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house blips on/off"), new CommandData("setjobblips", toggleServerJobBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job blips on/off"), new CommandData("setbizpickups", toggleServerBusinessPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business pickups on/off"), + new CommandData("setbusinesspickups", toggleServerBusinessPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business pickups on/off"), new CommandData("sethousepickups", toggleServerHousePickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house pickups on/off"), new CommandData("setjobpickups", toggleServerJobPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job pickups on/off"), new CommandData("nametagdistance", setServerNameTagDistanceCommand, "", getStaffFlagValue("ManageServer"), true, true, "Sets the distance at which name tags are displayed"), @@ -218,8 +220,13 @@ function loadCommands() { new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), new CommandData("closegate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), new CommandData("housegate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), - new CommandData("biz", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("bizgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("businessgate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), new CommandData("door", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("opengate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("closegate", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("opendoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), + new CommandData("closedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), new CommandData("garagedoor", triggerGateCommand, "", getStaffFlagValue("None"), true, true, "Opens/closes the nearest gate"), ], help: [ @@ -278,6 +285,8 @@ function loadCommands() { new CommandData("houseitems", listHouseInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the house's storage"), new CommandData("bizstorage", listBusinessStorageInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the business's extra storage (not buyable)"), new CommandData("bizfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), + new CommandData("businessstorage", listBusinessStorageInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the business's extra storage (not buyable)"), + new CommandData("businessfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), new CommandData("buylist", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), new CommandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false, "Turns on or off an item"), @@ -330,13 +339,17 @@ function loadCommands() { // Admin Job Stuff new CommandData("addjob", createJobCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("addjobloc", createJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("addjoblocation", createJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("addjobuniform", createJobUniformCommand, " ", getStaffFlagValue("ManageJobs"), true, false), new CommandData("deljobloc", deleteJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("deljoblocation", deleteJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("deljobuniform", deleteJobUniformCommand, " ", getStaffFlagValue("ManageJobs"), true, false), new CommandData("addjobroute", createJobRouteCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("addjobrouteloc", createJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("addjobroutelocation", createJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("deljobroute", deleteJobRouteCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("deljobrouteloc", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("deljobroutelocation", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobroutelocpos", setJobRouteLocationPositionCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobroutename", setJobRouteNameCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobroutepay", setJobRoutePayCommand, "", getStaffFlagValue("ManageJobs"), true, false), @@ -359,6 +372,10 @@ function loadCommands() { new CommandData("jobaddplayerbl", addPlayerToJobBlackListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobdelplayerbl", removePlayerFromJobBlackListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobdelplayerbl", removePlayerFromJobWhiteListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("jobaddplrwl", addPlayerToJobWhiteListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("jobaddplayerbl", addPlayerToJobBlackListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("jobdelplayerbl", removePlayerFromJobBlackListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), + new CommandData("jobdelplrbl", removePlayerFromJobWhiteListCommand, " [job id]", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobreloadall", reloadAllJobsCommand, "", getStaffFlagValue("ManageJobs"), true, false), new CommandData("jobinfo", getJobInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job"), new CommandData("joblocinfo", getJobLocationInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job location"), @@ -430,9 +447,12 @@ function loadCommands() { new CommandData("getveh", getVehicleCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports a vehicle to you."), new CommandData("warpinveh", warpIntoVehicleCommand, "[vehicle id]", getStaffFlagValue("ManageVehicles"), true, false), new CommandData("returnplr", returnPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Returns a player to their previous position."), + new CommandData("returnplayer", returnPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Returns a player to their previous position."), new CommandData("gotopos", gotoPositionCommand, " [int] [vw]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to specific coordinates with optional interior and dimension."), new CommandData("gotoveh", gotoVehicleCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a vehicle by ID."), + new CommandData("gotovehicle", gotoVehicleCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a vehicle by ID."), new CommandData("gotobiz", gotoBusinessCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a business by ID or name."), + new CommandData("gotobusiness", gotoBusinessCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a business by ID or name."), new CommandData("gotohouse", gotoHouseCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a house by ID or description."), new CommandData("gotojob", gotoJobLocationCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a job location by name and location ID."), new CommandData("gotoloc", gotoGameLocationCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a game location by name."), @@ -459,15 +479,26 @@ function loadCommands() { //new CommandData("setfightstyle", setPlayerFightStyleCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's fight style."), new CommandData("setstars", setPlayerWantedLevelCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to have a wanted level"), new CommandData("plrinfo", getPlayerInfoCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"), - new CommandData("getplrhouse", getHousesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"), - new CommandData("getplrbiz", getBusinessesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), - new CommandData("getplrveh", getVehiclesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), + new CommandData("playerinfo", getPlayerInfoCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"), + new CommandData("getplrhouses", getHousesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"), + new CommandData("getplrbizs", getBusinessesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), + new CommandData("getplrbusinesses", getBusinessesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), + new CommandData("getplrvehs", getVehiclesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), + new CommandData("getplrvehicles", getVehiclesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), + new CommandData("getplayerhouses", getHousesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"), + new CommandData("getplayerbizs", getBusinessesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), + new CommandData("getplayerbusinesses", getBusinessesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), + new CommandData("getplayervehs", getVehiclesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), + new CommandData("getplayervehicles", getVehiclesOwnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), new CommandData("geoip", getPlayerGeoIPInformationCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"), new CommandData("ip", getPlayerIPInformationCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"), new CommandData("plrsync", toggleSyncForElementsSpawnedByPlayerCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sets whether elements spawned by a player are synced (traffic, peds, etc)"), new CommandData("health", setPlayerHealthCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"), new CommandData("infiniterun", setPlayerInfiniteRunCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Toggles a player's infinite sprint"), + new CommandData("atbiz", getPlayerCurrentBusinessCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"), + new CommandData("atbusiness", getPlayerCurrentBusinessCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Gets which business a player is at/in"), + new CommandData("athouse", getPlayerCurrentHouseCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Gets which house a player is at/in"), ], startup: [], subAccount: [ @@ -735,9 +766,9 @@ function processPlayerCommand(command, params, client) { 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} ?`); + messagePlayerError(client, getLocaleString(client, "InvalidCommandPossibleMatchTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}${toLowerCase(possibleCommand.command)}{MAINCOLOUR}`)); } else { - messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} does not exist! Use /help for commands and information.`); + messagePlayerError(client, getLocaleString(client, "InvalidCommandHelpTip", `{ALTCOLOUR}/${command}{MAINCOLOUR}`, `{ALTCOLOUR}/help{MAINCOLOUR}`)); } return false; } @@ -745,13 +776,14 @@ function processPlayerCommand(command, params, client) { if(!commandData.enabled) { logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`); messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} is disabled!`); + messagePlayerError(client, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`)); return false; } if(doesCommandRequireLogin(toLowerCase(command))) { if(!isPlayerLoggedIn(client)) { logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`); - messagePlayerError(client, `You must be logged in to use the {ALTCOLOUR}/${command}{MAINCOLOUR} command!`); + messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`)); return false; } } @@ -767,7 +799,7 @@ function processPlayerCommand(command, params, client) { if(!isConsole(client)) { if(!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) { logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`); - messagePlayerError(client, `You do not have permission to use the {ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR} command!`); + messagePlayerError(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`); return false; } }