API - BACKEND

SendAngularMessage

SendAngularMessage is a streamlined wrapper designed for dispatching NUI messages, optimized for integration with Angular's NuiService via the fromMessageAction function.

Signature

SendAngularMessage(action: string, data: any)
  • action: The specific action you aim to target.

  • data: The data to be sent alongside this action.

Usage

SendAngularMessage("setVisible", true);

DebugPrint Utility

Description: debugPrint is a utility designed for outputting debug information to the console. Its functionality is activated based on the presence and setting of a specific console variable (convar).

Convar Activation: The utility relies on a particular naming convention for the convar, which is: YOUR_RESOURCE_NAME-debugMode. To enable debug mode for debugPrint, you should:

  • Add setr YOUR_RESOURCE_NAME-debugMode 1 to your server.cfg.

  • Alternatively, enable it using the setr console command directly.

Signature:

// Signature replicating the print function
debugPrint(...args: any[]): void
  • ...args: A spread of arguments that you want to log in the console.

Usage Example:

debugPrint("Is Angular better than React?", true, someOtherVar);

This command will output the specified messages or data to the console, contingent on the activation of the debug mode through the aforementioned convar.

Last updated