// =========================================================================== // Vortrex's Roleplay Resource // https://github.com/VortrexFTW/gtac_roleplay // =========================================================================== // FILE: command.js // DESC: Provides command data, functions and usage // TYPE: Server (JavaScript) // =========================================================================== let serverCommands = []; // =========================================================================== let builtInCommands = [ "refresh", "restart", "stop", "start", "reconnect", "setname", "connect", "disconnect", "say", "dumpdoc", ]; // =========================================================================== function initCommandScript() { logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ..."); serverCommands = loadCommands(); //addAllCommandHandlers(); logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!"); } // =========================================================================== function loadCommands() { let tempCommands = { accent: [ commandData("accent", setAccentCommand, "", getStaffFlagValue("None"), false, false, "Sets your character's accent"), commandData("accents", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), commandData("accentlist", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), ], account: [ commandData("login", loginCommand, "", getStaffFlagValue("None"), false, false, "Login to an account"), commandData("register", registerCommand, "", getStaffFlagValue("None"), false, false, "Creates an account"), commandData("changepass", changeAccountPasswordCommand, " ", getStaffFlagValue("None"), true, false, "Change an account password"), commandData("iplogin", toggleAutoLoginByIPCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically login if you join with the same IP as your last join"), commandData("autolastchar", toggleAutoSelectLastCharacterCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically spawn with the last character you played as"), commandData("gui", toggleAccountGUICommand, "", getStaffFlagValue("None"), false, false, "Toggle whether to use GUI. If GUI is disabled on the server, it won't show even if you have GUI enabled."), commandData("2fa", toggleAccountTwoFactorAuthCommand, "", getStaffFlagValue("None"), true, false, "Set up and use two-factor authentication."), commandData("setemail", setAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Sets your email. To reset your password, you must have a valid email set and verified."), commandData("verifyemail", verifyAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Confirms/verifies your email."), //commandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."), commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"), commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"), commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"), ], ammunation: [], animation: [ commandData("anim", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), commandData("an", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), commandData("e", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), commandData("anims", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), commandData("animlist", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"), ], antiCheat: [ commandData("addacscriptwl", addAntiCheatWhiteListedScriptCommand, "