Skip to main content

register_command

Function register_command 

Source
pub fn register_command(
    name: &str,
    help: &str,
    run: impl FnMut(&[&str], UObjectHandle) + Send + 'static,
) -> RustealResult<()>
Expand description

Register the console command name: typing name arg1 arg2 in the console, or -ExecCmds on the command line, calls run with the arguments and the world the command runs in (null when there is none).

Fails when the name is already a command or variable.