Function uiSettings_menuConfigurations_playerMenu_leaderboardsSettings_manageStatistics_builtIn_editStatistic

  • Displays and handles the edit built-in statistic form for a given entity.

    Parameters

    • sourceEntitya: Entity | Player | Globals.modules.cmds.executeCommandPlayerW

      The entity that initiated the request. Can be an instance of Entity, executeCommandPlayerW, or Player.

    • statistic: {
          buttonDisplayName: "Money";
          buttonIcon: "textures/items/emerald";
          displayOptions: {
              get addCommaSeparators(): boolean;
              get currencyPrefix(): string;
          };
          getterFunction: (player: Globals.modules.playersave.savedPlayer) => string;
          id: "money";
          menuTitle: "Money";
          sorter: (a: string, b: string) => -1 | 0 | 1;
          statsListDisplayName: "Money";
          type: "built-in";
          valueType: "bigint";
      }

    Returns Promise<0 | 1>

    A promise that resolves to:

    • 1 if the operation was successful or the form was canceled.
    • 0 if the user selected "Cancel" in the access denied message or "Close" if an error message appeared.

    The function performs the following steps:

    1. Checks if ultra security mode is enabled.
    2. If enabled, verifies if the player has the required permission to access the settings.
    3. If the player lacks permission, displays an access denied message.
    4. If the player has permission or ultra security mode is disabled, displays the UI settings form.
    5. Updates the configuration based on the form input.
    6. Returns the appropriate status code based on the outcome.