Skip to content

Commit

Permalink
fix zm, add cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
hedqi committed May 22, 2024
1 parent 35e76a2 commit c68db2e
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Counter-Strike Hide'n'Seek Match System plugins.
| hns_last | 1 | Включить/Отключить выдачу гранат последнему ТТ |
| hns_dmrespawn | 3 | Время (в секундах), в течение которого игрок возродится в режиме DM |
| hns_survotetime | 10 | Время (в секундах), в течение которого идет голосование (surrender) |
| hns_randompick | 1 | Включить/Отключить случайный выбор игроков |
| hns_knifemap | 35hp_2 | Ножевая карта |
| hns_prefix | MATCH | Префикс системы |

Expand Down Expand Up @@ -186,6 +187,8 @@ Counter-Strike Hide'n'Seek Match System plugins.
| hud / hudinfo | Отключить/Включить худ |
| rnw / rocknewwatcher | Голосовать за нового watcher |
| wt / watcher | Передать/Назначить нового watcher |
| speclist / showpec | Включить/выключить speclist |
| spechide / hidespec | Включить/выключить spechide |

## Благодарности / Aвторы других плагинов
[Garey](https://github.com/Garey27)
Expand Down
3 changes: 3 additions & 0 deletions README_ENG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Counter-Strike Hide'n'Seek Match System plugins
| hns_last | 1 | Enable/disable grenades to the last TT |
| hns_dmrespawn | 3 | Time (in seconds) for the player to revive in DM mode |
| hns_survotetime | 10 | Time (in seconds) for surrender |
| hns_randompick | 1 | Enable/disable random player selection |
| hns_knifemap | 35hp_2 | Knifemap |
| hns_prefix | MATCH | system prefix |

Expand Down Expand Up @@ -179,6 +180,8 @@ Counter-Strike Hide'n'Seek Match System plugins
| hud / hudinfo | disable/enable hud |
| rnw / rocknewwatcher | vote for new watcher |
| wt / watcher | transfer/assign a new watcher |
| speclist / showspec | Enable/Disable speclist |
| spechide / hidespec | Enable/Disable spechide |

## Acknowledgments / Authors of other plugins
[Garey](https://github.com/Garey27)
Expand Down
1 change: 1 addition & 0 deletions configs/mixsystem/matchsystem.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ hns_survotetime "10"
hns_surtimedelay "120"
hns_checkplay "0"
hns_rules "0"
hns_randompick "1"
hns_knifemap "35hp_2"
hns_gamename "Hide'n'Seek"
hns_prefix "MATCH"
2 changes: 1 addition & 1 deletion configs/mixsystem/mode/zombie.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mp_round_infinite b
mp_auto_join_team 0
mp_roundrespawn_time -1
mp_buytime 0
mp_roundover 2
mp_roundover 1
mp_give_player_c4 0
mp_t_default_weapons_secondary ""
mp_ct_default_weapons_secondary ""
4 changes: 2 additions & 2 deletions scripting/HnsMatchPts.sma
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ SQL_SetPts(TeamName:team_winners) {
cData[0] = SQL_WINNERS;

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "e", team_winners == TEAM_TERRORIST ? "TERRORIST" : "CT");
get_players(iPlayers, iNum, "ce", team_winners == TEAM_TERRORIST ? "TERRORIST" : "CT");

if (iNum) {
for(new i, szAuthId[MAX_AUTHID_LENGTH]; i < iNum; i++) {
Expand All @@ -256,7 +256,7 @@ SQL_SetPts(TeamName:team_winners) {
iLen = 0;
}

get_players(iPlayers, iNum, "e", team_winners == TEAM_TERRORIST ? "CT" : "TERRORIST");
get_players(iPlayers, iNum, "ce", team_winners == TEAM_TERRORIST ? "CT" : "TERRORIST");

if (iNum) {
for(new i, szAuthId[MAX_AUTHID_LENGTH]; i < iNum; i++) {
Expand Down
8 changes: 7 additions & 1 deletion scripting/HnsMatchSystem.sma
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public rgRoundEnd(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay)
return HC_SUPERCEDE;
}

if (g_iCurrentMode == MODE_ZM && event == ROUND_TERRORISTS_WIN) {
set_member_game(m_bGameStarted, true);
SetHookChainReturn(ATYPE_BOOL, false);
return HC_SUPERCEDE;
}

if (g_GPFuncs[g_iCurrentGameplay][GP_ROUNDEND])
ExecuteForward(g_GPFuncs[g_iCurrentGameplay][GP_ROUNDEND], _, (status == WINSTATUS_CTS) ? true : false);

Expand Down Expand Up @@ -485,7 +491,7 @@ public ShowTimeAsMoney()
{
if (g_iCurrentMode == MODE_MIX && g_iMatchStatus == MATCH_STARTED && g_iCurrentRules == RULES_TIMER) {
static players[32], num, id
get_players(players, num, "a");
get_players(players, num, "ac");
for(--num; num>=0; num--)
{
id = players[num];
Expand Down
4 changes: 2 additions & 2 deletions scripting/include/hns-match/addition/captain.inc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public pickMenu(id, bool:bStartWait) {
return PLUGIN_HANDLED;
}

if(bStartWait == true)
if(bStartWait == true && g_iSettings[RANDOMPICK] == 1)
{
WaitPick();
}
Expand Down Expand Up @@ -320,7 +320,7 @@ public wait_function(id)
GetPickRandom() {
new iChoose;
static iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum, "he", "SPECTATOR");
get_players(iPlayers, iNum, "che", "SPECTATOR");

new iSpecPlayers[MAX_PLAYERS], iSpecNum;

Expand Down
4 changes: 4 additions & 0 deletions scripting/include/hns-match/addition/cvars.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum _: CVARS
Float:DMRESPAWN,
SUTVOTETIME,
SURTIMEDELAY,
RANDOMPICK,
KNIFEMAP[24],
PREFIX[24]
}
Expand Down Expand Up @@ -60,6 +61,9 @@ stock cvars_init() {
pCvar[SURTIMEDELAY] = create_cvar("hns_surtimedelay", "120", FCVAR_NONE, "Surrender time delay", true, 0.0);
bind_pcvar_num(pCvar[SURTIMEDELAY], g_iSettings[SURTIMEDELAY]);

pCvar[RANDOMPICK] = create_cvar("hns_randompick", "1", FCVAR_NONE, "Random pick", true, 0.0, true, 1.0);
bind_pcvar_num(pCvar[RANDOMPICK], g_iSettings[RANDOMPICK]);

pCvar[KNIFEMAP] = create_cvar("hns_knifemap", "35hp_2", FCVAR_NONE, "Knife map");
bind_pcvar_string(pCvar[KNIFEMAP], g_iSettings[KNIFEMAP], charsmax(g_iSettings[KNIFEMAP]));

Expand Down
2 changes: 1 addition & 1 deletion scripting/include/hns-match/modes/mode_dm.inl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public LuckyTransferToTT(id) {

GetRandomCT() {
static iPlayers[32], iCTNum
get_players(iPlayers, iCTNum, "ahe", "CT");
get_players(iPlayers, iCTNum, "ache", "CT");

if (!iCTNum)
return 0
Expand Down
4 changes: 3 additions & 1 deletion scripting/include/hns-match/modes/mode_knife.inl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public kniferound_roundend(bool:win_ct) {

pickMenu(g_iCaptainPick, true);

set_task(1.0, "WaitPick");
if (g_iSettings[RANDOMPICK] == 1) {
set_task(1.0, "WaitPick");
}
}
case MATCH_TEAMKNIFE: {
if (win_ct) {
Expand Down
4 changes: 2 additions & 2 deletions scripting/include/hns-match/modes/mode_mix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public mix_start() {
loadMapCFG();

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "e", "TERRORIST");
get_players(iPlayers, iNum, "ce", "TERRORIST");
g_eMatchInfo[e_mTeamSizeTT] = iNum;
g_eMatchInfo[e_mTeamSize] = get_num_players_in_match();

Expand Down Expand Up @@ -303,7 +303,7 @@ public mix_roundend(bool:win_ct) {
g_eMatchInfo[e_iRoundsPlayed][g_isTeamTT]++;

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "ahe", "CT");
get_players(iPlayers, iNum, "ache", "CT");

if (!iNum) {
new Float:roundtime = get_round_time() * 60.0;
Expand Down
6 changes: 3 additions & 3 deletions scripting/include/hns-match/modes/mode_zombie.inl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public zm_roundend(bool:win_ct) {

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

for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];
Expand All @@ -56,7 +56,7 @@ public zm_set_teams() {

GetRandomAlive() {
static iPlayers[MAX_PLAYERS], iTTNum
get_players(iPlayers, iTTNum, "he", "TERRORIST");
get_players(iPlayers, iTTNum, "che", "TERRORIST");

new iAlivePlayers[MAX_PLAYERS], iAliveNum;

Expand Down Expand Up @@ -109,7 +109,7 @@ public zm_player_leave(id) {

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

if (!iNum) {
set_zombie();
Expand Down
2 changes: 1 addition & 1 deletion scripting/include/hns-match/user.inc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ setTeam(id, TeamName:iTeam) {

stock get_num_players_in_match() {
new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "h");
get_players(iPlayers, iNum, "ch");
new numGameplr;
for (new i; i < iNum; i++) {
new tempid = iPlayers[i];
Expand Down

0 comments on commit c68db2e

Please sign in to comment.