Commands

The library includes a standalone command system.

The main intention here is to provide one singular setup for creating commands instead of having to create multiple commands, for multiple frameworks.

Commands are currently server side only.

Functions

utils.commands.register = register_command

register

The following can be used to register a new command on the server.

utils.commands.register(command_name, { permission_ranks }, command_note, { chat_suggestions }, function(source, args, raw) ... end)

Permission ranks can be anything you like. Just ensure that whatever ranks you are using to restrict the command are given to users within the utils user_accounts database table. Use nil to allow all users access to the command.

Example

 utils.commands.register('test_command', { 'test_rank', 'test_rank2' }, 'Just a test command.', {{ name = 'Test suggestion', help = 'Just a test suggestion' }}, function(source, args, raw) ... end)

Last updated