Всем привет, поделитесь вот таким плагином:)
Вложения
-
11.6 KB Просмотры: 100
#include <amxmodx>
#include <reapi>
new szMapname[32], g_iRound, nextmap[32], 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_string(get_cvar_pointer("amx_nextmap"), nextmap, sizeof(nextmap));
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];
formatex(message, sizeof(message), "^4* [^1Round: ^3%d^1/^3%d ^1| Map: ^3%s ^1| ^1Nextmap: ^3%s ^1| ^1Players: ^3%i^1/^3%i^4]", g_iRound, maxrounds, szMapname, nextmap, get_playersnum(), get_member_game(m_nMaxPlayers));
client_print_color(0, print_team_default, message);
}
#include <amxmodx>
#include <reapi>
enum _:eData
{
HostMapName[64],
HostTotalPlayers
};
new g_eData[eData];
public plugin_init()
{
register_plugin("Show info", "1.0.0", "@pywave");
RegisterHookChain(RG_CSGameRules_RestartRound, "@RestartRound", .post = true);
}
public client_putinserver(player_id)
{
if (!is_user_bot(player_id)) g_eData[HostTotalPlayers]++;
}
@RestartRound()
{
new m_iCurrentRound = get_member_game(m_iTotalRoundsPlayed) + 1;
new m_MaxPlayers = get_member_game(m_nMaxPlayers);
new m_AcitvePlayers = get_playersnum();
get_mapname(g_eData[HostMapName], charsmax(g_eData[HostMapName]));
client_print_color(0, print_team_default, "^1[^4Инфо^1] Раунд ^4%d | ^1Играет: ^4%d^1/^4%d^1 | Сыграло: ^4%d^1 | Карта: ^4%s", m_iCurrentRound,
m_AcitvePlayers, m_MaxPlayers, g_eData[HostTotalPlayers], g_eData[HostMapName]);
}