Skip to content

GameRule "HasMatchStarted" turns to false before match ends #88

Answered by in0finite
xGuysOG asked this question in Q&A
Discussion options

You must be logged in to vote

This is not a problem of the library, this is simply the way how server updates GameRules entity properties.

There sadly is no "HasMatchEnded" in the gamerules

Yes, there is an equivalent : GameRules.GamePhase == CSGamePhase.MatchEnded.

However, you don't need that. The proper way to detect if match has started would be something like this :

bool hasMatchEverStarted = false;
demo.EntityEvents.CCSGameRulesProxy.AddChangeCallback(proxy => proxy.GameRules?.HasMatchStarted, (proxy, _, _) =>
{
    hasMatchEverStarted |= demo.GameRules.HasMatchStarted;
});

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by saul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #84 on September 07, 2024 07:25.