Skip to main content

Create a command ⌨️

  • Go in the nui/scripts/configs/commands.js file.
  • Add a new key (it will be the application name)
  • Paste the default command template:
"command-name": {
"description": () => { return GetLocale("cmd_command_name_desc"); },
"action": () => {
AddConsoleLine("command-name", "Hello World");
}
},
  • Create a new locale at locales/locales.js with the key that you passed to the GetLocale function for all the languages that you are using.
  • You can use all the functions that are in the nui/scripts/script.js (e.g., the AddConsoleLine function take as first argument the command string that triggered the addition of this line and as second argument the line to add)