Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Jul 13, 2023
1 parent 6d187eb commit b758996
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
8 changes: 8 additions & 0 deletions data/lang/hidenseek.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 раунда! Автоматический свап.
Expand Down
25 changes: 19 additions & 6 deletions hns_main.sma
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#define rg_get_user_team(%0) get_member(%0, m_iTeam)


new bool:g_isDeathMatch;

enum HNS_CVAR {
Expand Down Expand Up @@ -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");
Expand All @@ -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);
Expand All @@ -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");

Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -261,22 +268,28 @@ 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");
get_players(iPlayers, iTTNum, "che", "TERRORIST");

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;
}
}
Expand Down

0 comments on commit b758996

Please sign in to comment.