3 #include <server/teamplay.qh>
5 void GameRules_teams(bool value)
8 serverflags |= SERVERFLAG_TEAMPLAY;
10 cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
12 serverflags &= ~SERVERFLAG_TEAMPLAY;
14 cvar_set("teamplay", "0"); // DP needs this for sending proper getstatus replies.
18 bool _GameRules_score_enabled = true;
19 void GameRules_score_enabled(bool value)
21 _GameRules_score_enabled = value;
24 bool GameRules_limit_score_initialized;
25 void GameRules_limit_score(int limit)
27 if (GameRules_limit_score_initialized) return;
28 if (autocvar_g_campaign) return;
29 if (limit < 0) return;
30 cvar_set("fraglimit", ftos(limit));
31 GameRules_limit_score_initialized = true;
34 bool GameRules_limit_lead_initialized;
35 void GameRules_limit_lead(int limit)
37 if (GameRules_limit_lead_initialized) return;
38 if (autocvar_g_campaign) return;
39 if (limit < 0) return;
40 cvar_set("leadlimit", ftos(limit));
41 GameRules_limit_lead_initialized = true;
44 bool GameRules_limit_time_initialized;
45 void GameRules_limit_time(int limit)
47 if (GameRules_limit_time_initialized) return;
48 if (autocvar_g_campaign) return;
49 if (limit < 0) return;
50 cvar_set("timelimit", ftos(limit));
51 GameRules_limit_time_initialized = true;
54 bool GameRules_limit_time_qualifying_initialized;
55 void GameRules_limit_time_qualifying(int limit)
57 if (GameRules_limit_time_qualifying_initialized) return;
58 if (autocvar_g_campaign) return;
59 if (limit < 0) return;
60 cvar_set("g_race_qualifying_timelimit", ftos(limit));
61 GameRules_limit_time_qualifying_initialized = true;
64 void GameRules_limit_fallbacks()
66 GameRules_limit_score(autocvar_fraglimit_override);
67 GameRules_limit_lead(autocvar_leadlimit_override);
68 GameRules_limit_time(autocvar_timelimit_override);
71 void _GameRules_scoring_begin(int teams, float spprio, float stprio)
73 ScoreRules_basics(teams, spprio, stprio, _GameRules_score_enabled);
75 void _GameRules_scoring_field(entity i, string label, int scoreflags)
77 ScoreInfo_SetLabel_PlayerScore(i, label, scoreflags);
79 void _GameRules_scoring_field_team(float i, string label, int scoreflags)
81 ScoreInfo_SetLabel_TeamScore(i, label, scoreflags);
83 void _GameRules_scoring_end()
85 ScoreRules_basics_end();