ConsoleOutput

From GT-MP
Jump to: navigation, search
ConsoleOutput
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

This function returns a specified text in server's console.



Syntax

API.consoleOutput(string text);
API.consoleOutput(string text, params object[] args);
API.consoleOutput(LogCat category, string text);
API.consoleOutput(LogCat category, string text, params object[] args);

Required Arguments

  • text: the text that should be displayed in the console. Of string type.

Optional Arguments

  • category: the logging category to use. Of LogCat type.

Please refer to String.Format for more information about the formatting.

Usage example

API.consoleOutput("You should see me!");
API.consoleOutput(
        "(C) Currency: . . . . . . . . {0:C}\n" +
        "(D) Decimal:. . . . . . . . . {0:D}\n" +
        "(E) Scientific: . . . . . . . {1:E}\n" +
        "(F) Fixed point:. . . . . . . {1:F}\n" +
        "(G) General:. . . . . . . . . {0:G}\n" +
        "    (default):. . . . . . . . {0} (default = 'G')\n" +
        "(N) Number: . . . . . . . . . {0:N}\n" +
        "(P) Percent:. . . . . . . . . {1:P}\n" +
        "(R) Round-trip: . . . . . . . {1:R}\n" +
        "(X) Hexadecimal:. . . . . . . {0:X}\n",
        -123, -123.45f);


References