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
css_givebp
Description: Grants a Battle Pass to a specified player.
Permission Required:
@k4seasons/admin
Syntax:
[target]
: The identifier of the player (e.g.,#{userid}
, groups, or username).
Example Usage:
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:
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:
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:
Player Access:
The player gains immediate access to all Battle Pass-exclusive rewards and benefits for the current season.
Battle Pass Validity
Season-Limited:
The Battle Pass is only valid for the current season. Once the season ends, the Battle Pass is automatically revoked.
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