🚀Console

Built-in Console library. (Opens with key: F1)

Examples:

.AddCommand with any args count:

function ExampleCommand(Args)
{
    print(format("We got %d args.", Args.len()));
}

Console.AddCommand("examplecmd", "This is example description", ExampleCommand);

.AddCommand with limited args count:

function ExampleCommand(Args)
{
    print(format("First arg: %s", Args[0]));
    print(format("Second arg: %s", Args[1]));
    print(format("Third arg: %s", Args[2]));
}

Console.AddCommand("examplecmd", "This is example description", "<arg0> <arg1> <arg2>", 3, ExampleCommand);
Console.Print("Red ", Color(255, 0, 0));
Console.Print("Green ", Color(0, 255, 0), true);
Console.Print("Blue", Color(0, 0, 255), true);

Static Functions:

.AddCommand

Console.AddCommand(name: string, description: string, usage: string, numargs: integer, callback: function): boolean

Returns true when command was successfully registered and doesn't exist.

.RemoveCommand

Console.RemoveCommand(name: string)

Removes command by name. Note: You can't remove command registered by other script!

.Print

Console.Print(text: string, color: Color, sameline: boolean)

This is mostly same as print function, but this will open you more option for like raw text printing & color and printing on old line to make multi color print.

Last updated