#include <amxmodx>
#include <reapi>
#define SECONDS_IN_MINUTE 60
new
szMapname[32],
g_iRound,
maxrounds;
public plugin_init() {
register_plugin("[ReAPI] Round info", "1.2", "mIDnight");
RegisterHookChain(RG_CSGameRules_RestartRound, "@CSGameRules_RestartRound_Pre", .post = false);
RegisterHookChain(RG_CSGameRules_OnRoundFreezeEnd,"@CSGameRules_OnRoundFreezeEnd", .post = true);
rh_get_mapname(szMapname, charsmax(szMapname));
bind_pcvar_num(get_cvar_pointer("mp_maxrounds"), maxrounds);
}
@CSGameRules_RestartRound_Pre() {
g_iRound = get_member_game(m_bCompleteReset) ? 0 : g_iRound + 1;
}
@CSGameRules_OnRoundFreezeEnd() {
new
message[191],
out_min,
out_sec;
get_minutes(get_timeleft(), out_min, out_sec);
formatex(message, sizeof(message),\
"^4[Respect Gaming 2] [^1Round: ^3%i^1/^3%i^1|^3Map: ^4%s^1|^1Players: ^3%i^1/^3%i^4]^1|^3remaining time: ^4%imin %isec",\
g_iRound, maxrounds, szMapname, get_playersnum(), get_member_game(m_nMaxPlayers), out_min, out_sec);
client_print_color(0, print_team_default, message);
}
get_minutes(const time, &out_min, &out_sec) {
out_min = time / SECONDS_IN_MINUTE;
out_sec = time % SECONDS_IN_MINUTE;
}