From b7589969078aae4ea922f08689aead5d675dafa2 Mon Sep 17 00:00:00 2001 From: WessTorn Date: Thu, 13 Jul 2023 11:42:20 +0300 Subject: [PATCH] v1.0.2 --- data/lang/hidenseek.txt | 8 ++++++++ hns_main.sma | 25 +++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/data/lang/hidenseek.txt b/data/lang/hidenseek.txt index be89853..8b85b53 100644 --- a/data/lang/hidenseek.txt +++ b/data/lang/hidenseek.txt @@ -1,5 +1,9 @@ [en] +MAIN_WIN_TERRORISTS = The hiders won! +MAIN_WIN_CTS = The seekers won!^nSwap teams. +MAIN_FREEZE_END = The seekers are coming! + MAIN_TRANSFER_TT = [^3%s^1] ^3%n^1 transferred for ^3CT^1. MAIN_TRANSFER_CT = [^3%s^1] ^3%n^1 transferred for ^3Terrorists^1. MAIN_SWAP = [^3%s^1] Team TT Won ^3%d^1 rounds! Automatic Swap. @@ -20,6 +24,10 @@ HNS_NO = No [ru] +MAIN_WIN_TERRORISTS = Прячущиеся победили! +MAIN_WIN_CTS = Искатели победили!^nCмена команд. +MAIN_FREEZE_END = Искатели идут! + MAIN_TRANSFER_TT = [^3%s^1] ^3%n^1 перенесли за ^3КТ^1. MAIN_TRANSFER_CT = [^3%s^1] ^3%n^1 перенесли за ^3Террористов^1. MAIN_SWAP = [^3%s^1] Команда TT Выйграла ^3%d^1 раунда! Автоматический свап. diff --git a/hns_main.sma b/hns_main.sma index 61dea0d..c36a4c8 100644 --- a/hns_main.sma +++ b/hns_main.sma @@ -5,7 +5,6 @@ #define rg_get_user_team(%0) get_member(%0, m_iTeam) - new bool:g_isDeathMatch; enum HNS_CVAR { @@ -45,7 +44,7 @@ enum _: Forwards_s { new g_hForwards[Forwards_s]; public plugin_init() { - register_plugin("HNS Mode Main", "1.0.1", "OpenHNS"); + register_plugin("HNS Mode Main", "1.0.2", "OpenHNS"); register_clcmd("chooseteam", "BlockCmd"); register_clcmd("jointeam", "BlockCmd"); @@ -60,6 +59,7 @@ public plugin_init() { bind_pcvar_num(register_cvar("hns_swist", "1"), g_pCvar[c_iSwist]); bind_pcvar_string(register_cvar("hns_prefix", "HNS"), g_pCvar[c_szPrefix], charsmax(g_pCvar[c_szPrefix])); + RegisterHookChain(RG_CSGameRules_OnRoundFreezeEnd, "rgFreezeEnd", true); RegisterHookChain(RG_CSGameRules_RestartRound, "rgRoundStart", true); RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "rgPlayerResetMaxSpeed", true); RegisterHookChain(RG_CBasePlayer_Spawn, "rgPlayerSpawn", true); @@ -75,8 +75,10 @@ public plugin_init() { unregister_forward(FM_Spawn, g_iRegisterSpawn, 1); - set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET) - set_msg_block(get_user_msgid("Money"), BLOCK_SET) + //set_msg_block(get_user_msgid("SendAudio"), BLOCK_SET); + set_msg_block(get_user_msgid("TextMsg"), BLOCK_SET); + set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET); + set_msg_block(get_user_msgid("Money"), BLOCK_SET); set_task(0.5, "delayed_mode"); @@ -141,6 +143,11 @@ public BlockCmd(id) { return PLUGIN_HANDLED; } +public rgFreezeEnd() { + set_dhudmessage(0, 250, 0, -1.0, 0.2, .holdtime = 4.0); + show_dhudmessage(0, "%L", LANG_PLAYER, "MAIN_FREEZE_END"); +} + public rgRoundStart() { set_task(1.0, "taskDestroyBreakables"); } @@ -261,8 +268,11 @@ public rgRoundEnd(WinStatus: status, ScenarioEventEndRound: event, Float:tmDelay if (status == WINSTATUS_CTS) { rg_swap_all_players(); - ExecuteForward(g_hForwards[hns_team_swap], _, 0); + ExecuteForward(g_hForwards[hns_team_swap]); iWinsTT = 0; + + set_dhudmessage(0, 0, 255, -1.0, 0.2, .holdtime = 4.0); + show_dhudmessage(0, "%L", LANG_PLAYER, "MAIN_WIN_CTS"); } else if (status == WINSTATUS_TERRORISTS) { new iPlayers[MAX_PLAYERS], iCTNum, iTTNum get_players(iPlayers, iCTNum, "che", "CT"); @@ -270,13 +280,16 @@ public rgRoundEnd(WinStatus: status, ScenarioEventEndRound: event, Float:tmDelay if (iCTNum + iTTNum > 2) iWinsTT++; + + set_dhudmessage(250, 0, 0, -1.0, 0.2, .holdtime = 4.0); + show_dhudmessage(0, "%L", LANG_PLAYER, "MAIN_WIN_TERRORISTS"); } if (g_pCvar[c_iSwapTeams]) { if (iWinsTT >= g_pCvar[c_iSwapTeams]) { client_print_color(0, print_team_blue, "%L", 0, "MAIN_SWAP", g_pCvar[c_szPrefix], g_pCvar[c_iSwapTeams]); rg_swap_all_players(); - ExecuteForward(g_hForwards[hns_team_swap], _, 0); + ExecuteForward(g_hForwards[hns_team_swap]); iWinsTT = 0; } }