Skip to content

IGameRules

cs_script API / IGameRules

interface in cs_script/point_script — the type of GameRules.

An API provided to scripts for the state of the match: warmup, rounds, and team money.
Access these functions by importing GameRules from "cs_script/point_script".

    CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2

    Members

    IsWarmupPeriod

    IsWarmupPeriod(): boolean

    Get if the game is currently in a Warmup period.

    StartWarmup

    StartWarmup(): void

    Start the warmup period, restarting the round.

    EndWarmup

    EndWarmup(): void

    End the warmup period as if its timer had run out. The game mode then ends it the usual way, starting on the next tick.

    IsFreezePeriod

    IsFreezePeriod(): boolean

    Get if the game is currently in a Freeze period.

    IsTeamIntroPeriod

    IsTeamIntroPeriod(): boolean

    Get if the game is currently in a Team Intro period.

    GetRoundsPlayed

    GetRoundsPlayed(): number

    Get the number of rounds played in the current game.

    GetRoundRemainingTime

    GetRoundRemainingTime(): number

    Get the time remaining in the current round in seconds.

    SetRoundRemainingTime

    SetRoundRemainingTime(time: number): void

    Set the time remaining in the current round in seconds.

    GetTeamScore

    GetTeamScore(team: number): number

    Get the team's score.

    AddTeamScore

    AddTeamScore(team: number, score: number): void

    Add to the team's score. Call before TerminateRound so the round end sees the new score.

    TerminateRound

    TerminateRound(reason: CSRoundEndReason, delay?: number): void

    Terminate the current round. Counts as a round played unless it is a draw. Will not add to team scores. Does nothing if the round has already ended.

    AddTeamMoney

    AddTeamMoney(team: number, reason: CSTeamMoneyReason, amount?: number): void

    Adds the money to all player controllers on the team, following all classic rules.
    If players are not eligible to receive end-of-round money, then that restriction is honored.
    Disconnected players will get their account balance incremented, and will have correct
    amount of money after they reconnect to the server.
    If the amount parameter is 0 or undefined, then the amount will be determined using server convar
    setting corresponding to the reason parameter.