Open Road MP

mp.commands

Register chat commands and list them.

add

mp.commands.add(name: string, help: string, run: (player: Player, args: string[]) => void, options?: CommandOptions): void

Registers the chat command /name for this gamemode. The server sends it only to this gamemode and answers commands nobody registered itself ("Unbekannter Befehl"). With several gamemodes, the first to register a name keeps it. With options.role only players with that role (or admins) may use it. help is shown in help lists and in the hints over the chat input: arguments first, then " - " and the description ("<amount> - sets your bank balance"); empty = an alias, not listed.

Types: Player, CommandOptions

all

mp.commands.all(): readonly CommandInfo[]

All chat commands of all gamemodes on this server, e.g. for a help list.

Types: CommandInfo

On this page