Give a Battle Pass

The K4-Seasons plugin provides two methods to grant a Battle Pass to players: via the css_givebp command or by updating the database through external systems like a webshop.

Method 1: Using the Command

Command: css_givebp

  • Description: Grants a Battle Pass to a specified player.

  • Permission Required: @k4seasons/admin

  • Syntax:

    css_givebp [target]
    • [target]: The identifier of the player (e.g., #{userid}, groups, or username).

  • Example Usage:

    css_givebp #{userid}
  • Effect:

    • Immediately assigns the Battle Pass to the specified player.

    • The player gains access to Battle Pass-exclusive rewards and benefits for the current season.


Method 2: Granting via Database Update

Webshops or other external systems can also grant a Battle Pass by updating the player's data in the database.

Steps for Webshop Integration:

  1. Update the battle_pass_purchased Field:

    • Locate the player in the database (e.g., by steamid).

    • Set the battle_pass_purchased field to a valid current date and time (e.g., the date of purchase).

    • Example:

      UPDATE k4se_players
      SET battle_pass_purchased = NOW()
      WHERE steam_id = 76561198345583467;
  2. Automatic Detection by the Plugin:

    • The plugin periodically checks the database for updates (every 1 minute).

    • If it detects that the battle_pass_purchased field has been updated with a valid date:

      • It activates the Battle Pass for the player.

      • The player receives an in-game message, which can be edited in the translations:

        [ Battle-Pass ] Congratulations! You have activated the Battle-Pass for this season.
  3. Player Access:

    • The player gains immediate access to all Battle Pass-exclusive rewards and benefits for the current season.


Battle Pass Validity

  1. Season-Limited:

    • The Battle Pass is only valid for the current season. Once the season ends, the Battle Pass is automatically revoked.

  2. Example Scenario:

    • If a player activates their Battle Pass during Season 1, they retain access until the end of Season 1.

    • When Season 2 begins, the plugin revokes their Battle Pass unless they purchase or are granted a new one.


Key Features

Command-Based Activation

  • Simple and immediate for administrators.

  • Use css_givebp to manually grant a Battle Pass to players.

Database-Driven Activation

  • Seamless integration with webshops or external systems.

  • Automatically detects Battle Pass purchases and activates them within 1 minute.

  • Sends in-game feedback to players upon activation.

Season-Specific Validity

  • Ensures that the Battle Pass is only valid for the active season.

  • Automatically revokes Battle Pass access at the end of the season, requiring renewal for future seasons.

Last updated