Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Feb 4, 2024
1 parent 5f3a5c1 commit b091224
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 31 deletions.
2 changes: 1 addition & 1 deletion configs/mixsystem/mode/zombie.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mp_freezetime 5
mp_forcechasecam 0
mp_forcecamera 0
mp_timelimit 0
mp_round_infinite 0
mp_round_infinite b
mp_auto_join_team 0
mp_roundrespawn_time -1
mp_buytime 0
Expand Down
18 changes: 17 additions & 1 deletion data/lang/mixsystem.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ PUB_ALREADY = Public mode is already running.
PUB_CANC = Please disable other mode before public.

DM_ACTIVATED = ^3%n^1 has activated ^3deatchmatch^1 mode.
DM_ALREADY = deatchmatch mode is already running.
DM_ALREADY = Deatchmatch mode is already running.
DM_CANC = Please disable other mode before deathmatch.

ZM_ACTIVATED = ^3%n^1 has activated ^3zombie^1 mode.
ZM_ALREADY = Zombie mode is already running.
ZM_CANC = Please disable other mode before zombie.

SET_ZOMBIE = ^3%n^1 zombie!

BLEND_TEAMS = ^3%n^1 blend teams.

TRANSF_SPEC = ^3%n^1 transfered all players to ^3spectators^1!
Expand Down Expand Up @@ -71,6 +77,7 @@ STOP_KNIFE = ^3%n^1 stopped ^3knife^1 round^1.
STOP_PUB = ^3%n^1 stopped ^3public^1 mode^1.
STOP_CAP = ^3%n^1 stopped ^3captain^1 mode^1.
STOP_DM = ^3%n^1 stopped ^3deathmatch^1 mode^1.
STOP_ZM = ^3%n^1 stopped ^3zombie^1 mode^1.

SCORE_TIME = TT [^3%s^1] %d vs %d [^3%s^1] CT (^3%d^1/^3%d^1 rounds) (^3%s^1 diff)
SCORE_TIME_WT = TT [^3%s^1] vs [^3%s^1] CT (^3%s^1 diff)
Expand Down Expand Up @@ -134,6 +141,7 @@ MENU_MAIN_MAP = Change map

MENU_CUSTOM_PUB = Publick
MENU_CUSTOM_DM = DeathMatch
MENU_CUSTOM_ZM = Zombie

MENU_STNGS_ROUNDTIME_TRNG = Roundtime: \d[Training]
MENU_STNGS_ROUNDTIME = Roundtime: \y%.1f
Expand Down Expand Up @@ -215,6 +223,12 @@ DM_ACTIVATED = ^3%n^1 активировал ^3ДМ^1 режим.
DM_ALREADY = ДМ режим уже запущен.
DM_CANC = Пожалуйста, отключите другой режим чтобы запустить ДМ.

ZM_ACTIVATED = ^3%n^1 активировал ^3зомби^1 режим.
ZM_ALREADY = Зомби режим уже запущен.
ZM_CANC = Пожалуйста, отключите другой режим чтобы запустить Зомби.

SET_ZOMBIE = ^3%n^1 зомби!

BLEND_TEAMS = ^3%n^1 смешал команды.

TRANSF_SPEC = ^3%n^1 перевел всех игроков за ^3наблюдателей^1!
Expand Down Expand Up @@ -243,6 +257,7 @@ STOP_KNIFE = ^3%n^1 остановил ^3ножевой раунд^1.
STOP_PUB = ^3%n^1 остановил ^3паблик^1 режим.
STOP_CAP = ^3%n^1 остановил режим ^3капитанов^1.
STOP_DM = ^3%n^1 остановил ^3ДМ^1 режим.
STOP_ZM = ^3%n^1 остановил ^3зомби^1 режим^1.

SCORE_TIME = TT [^3%s^1] %d vs %d [^3%s^1] CT (^3%d^1/^3%d^1 раундов) (^3%s^1 разрыв)
SCORE_TIME_WT = TT [^3%s^1] vs [^3%s^1] CT (^3%s^1 разрыв)
Expand Down Expand Up @@ -306,6 +321,7 @@ MENU_MAIN_MAP = Сменить карту

MENU_CUSTOM_PUB = Паблик
MENU_CUSTOM_DM = ДМ
MENU_CUSTOM_ZM = Зомби

MENU_STNGS_ROUNDTIME_TRNG = Roundtime: \d[Training]
MENU_STNGS_ROUNDTIME = Roundtime: \y%.1f
Expand Down
2 changes: 1 addition & 1 deletion scripting/HnsMatchSystem.sma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public plugin_precache() {
}

public plugin_init() {
g_PluginId = register_plugin("Hide'n'Seek Match System", "2.0.1", "OpenHNS"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor, Juice
g_PluginId = register_plugin("Hide'n'Seek Match System", "2.0.2", "OpenHNS"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor, Juice

rh_get_mapname(g_szMapName, charsmax(g_szMapName));

Expand Down
3 changes: 1 addition & 2 deletions scripting/HnsMatchTraining.sma
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,9 @@ public fmAddToFullPack(es, e, iEnt, id, hostflags, player, pSet) {
return FMRES_IGNORED;

if (player) {
set_es(es, ES_Solid, SOLID_NOT);

if (is_user_alive(iEnt)) {
if (g_bInvisPlayers[id]) {
set_es(es, ES_Solid, SOLID_NOT);
set_es(es, ES_RenderMode, kRenderTransTexture);
set_es(es, ES_RenderAmt, 0);
set_es(es, ES_Origin, { 999999999.0, 999999999.0, 999999999.0 });
Expand Down
23 changes: 17 additions & 6 deletions scripting/include/hns-match/addition/cmds.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stock cmds_init() {
RegisterSayCmd("duel", "versus", "cmdDuelMode", access, "Choose 1x1 mode");
RegisterSayCmd("pub", "public", "cmdPubMode", access, "Public mode");
RegisterSayCmd("dm", "deathmatch", "cmdDMMode", access, "DeathMatch mode");
//RegisterSayCmd("zm", "zombie", "cmdZMMode", access, "Zombie mode");
RegisterSayCmd("zm", "zombie", "cmdZMMode", access, "Zombie mode");
RegisterSayCmd("bld", "blend", "cmdBlend", access, "Blend teams");
RegisterSayCmd("specall", "specall", "cmdTransferSpec", access, "Spec Transfer");
RegisterSayCmd("ttall", "ttall", "cmdTransferTT", access, "TT Transfer");
Expand Down Expand Up @@ -236,16 +236,16 @@ public cmdZMMode(id) {
}

if (g_iCurrentMode == MODE_ZM) {
chat_print(id, "Zombie mode is already running.");
chat_print(id, "%L", id, "ZM_ALREADY");
return PLUGIN_HANDLED;
}

if (g_iCurrentMode != MODE_TRAINING) {
chat_print(id, "Please disable other mode before zombie.");
chat_print(id, "%L", id, "ZM_CANC");
return PLUGIN_HANDLED;
}

chat_print(0, "^3%n^1 has activated ^3zombie^1 mode.", id);
chat_print(0, "%l", "ZM_ACTIVATED", id);

zm_start();

Expand All @@ -257,6 +257,12 @@ public cmdBlend(id) {
return PLUGIN_HANDLED;
}

if (g_iCurrentMode == MODE_ZM) {
chat_print(0, "%l", "BLEND_TEAMS", id);
blendZM();
return PLUGIN_HANDLED;
}

if (g_iCurrentMode != MODE_PUB && g_iCurrentMode != MODE_DM)
return PLUGIN_HANDLED;

Expand Down Expand Up @@ -286,6 +292,11 @@ public cmdBlend(id) {
return PLUGIN_HANDLED;
}

public blendZM() {
zm_set_teams();
restartRound(2.0);
}

public cmdTransferSpec(id) {
if (!getUserInAccess(id)) {
return PLUGIN_HANDLED;
Expand Down Expand Up @@ -378,7 +389,7 @@ public cmdKnifeRound(id) {
return PLUGIN_HANDLED;
}

chat_print(id, "%L", id, "START_KNIFE_1");
chat_print(id, "%L", id, "START_KNIFE_1", id);

g_iMatchStatus = MATCH_TEAMKNIFE;
kniferound_start();
Expand Down Expand Up @@ -463,7 +474,7 @@ public cmdStop(id) {
}
case MODE_ZM: {
training_start();
chat_print(0, "Player %n stopped zombie mode", id);
chat_print(0, "%l", "STOP_ZM", id);
}
}

Expand Down
10 changes: 5 additions & 5 deletions scripting/include/hns-match/addition/hnsmenu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public customMenu(id) {
formatex(szMsg, charsmax(szMsg), "%L", id, "MENU_CUSTOM_DM");
menu_additem(hMenu, szMsg, "2");

// formatex(szMsg, charsmax(szMsg), "Zombie");
// menu_additem(hMenu, szMsg, "3");
formatex(szMsg, charsmax(szMsg), "%L", id, "MENU_CUSTOM_ZM");
menu_additem(hMenu, szMsg, "3");

menu_display(id, hMenu, 0);
return PLUGIN_HANDLED;
Expand All @@ -190,9 +190,9 @@ public customMenuHandler(id, hMenu, item) {
case 2: {
cmdDMMode(id);
}
// case 3: {
// cmdZMMode(id);
// }
case 3: {
cmdZMMode(id);
}
}
return PLUGIN_HANDLED;
}
Expand Down
1 change: 0 additions & 1 deletion scripting/include/hns-match/modes/mode_knife.inl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public kniferound_roundend(bool:win_ct) {
training_start();
g_iMatchStatus = MATCH_MAPPICK;
StartVoteRules();
//client_print_color(0, print_team_blue, "%L", 0, "KNIFE_WIN", hns_tag, win_ct ? "CT" : "TT", win_ct ? "CT" : "TT");
}
}
ChangeGameplay(GAMEPLAY_TRAINING);
Expand Down
79 changes: 65 additions & 14 deletions scripting/include/hns-match/modes/mode_zombie.inl
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
new iLastZombie

public zm_init() {
g_ModFuncs[MODE_ZM][MODEFUNC_START] = CreateOneForward(g_PluginId, "zm_start");
g_ModFuncs[MODE_ZM][MODEFUNC_KILL] = CreateOneForward(g_PluginId, "zm_killed", FP_CELL, FP_CELL);
g_ModFuncs[MODE_ZM][MODEFUNC_ROUNDEND] = CreateOneForward(g_PluginId, "zm_roundend", FP_CELL);
g_ModFuncs[MODE_ZM][MODEFUNC_PLAYER_JOIN] = CreateOneForward(g_PluginId, "zm_player_join", FP_CELL);
g_ModFuncs[MODE_ZM][MODEFUNC_PLAYER_LEAVE] = CreateOneForward(g_PluginId, "zm_player_leave", FP_CELL);
}

public zm_start() {
Expand All @@ -17,7 +20,7 @@ public zm_start() {

zm_set_teams();

restartRound(0.5);
restartRound(2.0);
}

public zm_killed(victim, killer) {
Expand All @@ -38,7 +41,7 @@ public zm_roundend(bool:win_ct) {

public zm_set_teams() {
new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum, "ch");
get_players(iPlayers, iNum, "h");

for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];
Expand All @@ -51,24 +54,72 @@ public zm_set_teams() {
set_task(1.0, "set_zombie", 11223);
}

public set_zombie() {
new iZombie = GetRandomTT();
rg_set_user_team(iZombie, TEAM_CT);
chat_print(0, "^3%n^1 zombie!", iZombie);
hns_setrole(iZombie);
}
GetRandomAlive() {
static iPlayers[MAX_PLAYERS], iTTNum
get_players(iPlayers, iTTNum, "he", "TERRORIST");

new iAlivePlayers[MAX_PLAYERS], iAliveNum;

for (new i; i < iTTNum; i++) {
if (!is_user_connected(iPlayers[i])) {
continue;
}

if (is_user_connected(iLastZombie)) {
if (iPlayers[i] == iLastZombie) {
continue;
}
}

iAlivePlayers[iAliveNum] = iPlayers[i];
iAliveNum++;
}

if (!iAliveNum) {
for (new i = 0; i < MAX_PLAYERS; i++) {
iAlivePlayers[i] = iPlayers[i];
}
iAliveNum = iTTNum;
}

GetRandomTT() {
static iPlayers[32], iCTNum
get_players(iPlayers, iCTNum, "che", "TERRORIST");
new iChoose;

if (!iCTNum)
if (iAliveNum > 1) {
iChoose = iAlivePlayers[random(iAliveNum)];
} else {
iChoose = iAlivePlayers[iAliveNum - 1];
}

if (!iAliveNum)
return 0

return iCTNum > 1 ? iPlayers[random(iCTNum)] : iPlayers[iCTNum - 1];
return iChoose;
}

public zm_player_join(id) {
rg_set_user_team(id, TEAM_CT);
rg_round_respawn(id);
}
}

public zm_player_leave(id) {
set_task(2.0, "checkZombie", 12341);

//set_task(2.0, "checkAlive", 12341);
}

public checkZombie() {
new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "he", "CT");

if (!iNum) {
set_zombie();
}
}

public set_zombie() {
new iZombie = GetRandomAlive();
rg_set_user_team(iZombie, TEAM_CT);
chat_print(0, "%l", "SET_ZOMBIE", iZombie);
iLastZombie = iZombie;
hns_setrole(iZombie);
}

0 comments on commit b091224

Please sign in to comment.