RegCommand

Register a command with lots of additional parameters

Parameters description

Parameter
Type
Description
Default

name

string

name of the command

----

accessFromConsole

boolean?

access from the console

false

accessFromInGame

boolean?

access from the game

false

cb

function?

callback function's parameters:

args, rawCommand, IPlayer, FPlayer

----

isPlayerAllowed

boolean?

only ace allowed players can access

the command ( command.cmdName )

false

suggestions

table?

table format: { help: string?, restricted: boolean?, args: table[]? }?

----

Example

HRLib.RegCommand('test', true, true, function(args, rawCommand, IPlayer, FPlayer)
    print(IPlayer.name, args[1])
end, true, {help = 'Test command', args = { {name = 'test', help = 'first parameter'} }})

Last updated