Skip to content

Commit

Permalink
fix cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Mar 30, 2021
1 parent 98caa03 commit f33d0f9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 46 deletions.
2 changes: 1 addition & 1 deletion scripting/HnsMatchSystem.sma
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public plugin_precache() {
}

public plugin_init() {
register_plugin("Hide'n'Seek Match System", "1.1.0", "??"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor
register_plugin("Hide'n'Seek Match System", "1.1.1", "??"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor

get_mapname(g_eMatchInfo[e_mMapName], charsmax(g_eMatchInfo[e_mMapName]));

Expand Down
86 changes: 41 additions & 45 deletions scripting/include/hns-match/cmds.inc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public cmdShowKnife(id) {

public cmdPubMode(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

if (g_iCurrentMode != e_mPublic) {
if (g_iCurrentMode != e_mMatch && g_iCurrentMode != e_mKnife && g_iCurrentMode != e_mPaused) {
Expand All @@ -141,12 +141,12 @@ public cmdPubMode(id) {

removeHook(id);

return;
return PLUGIN_HANDLED;
}

public cmdDMMode(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

if (g_iCurrentMode != e_mDM) {
if (g_iCurrentMode != e_mMatch && g_iCurrentMode != e_mKnife && g_iCurrentMode != e_mPaused) {
Expand All @@ -167,34 +167,34 @@ public cmdDMMode(id) {

removeHook(id);

return;
return PLUGIN_HANDLED;
}

public cmdTransferSpec(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "TRANSF_SPEC", prefix, getUserName(id));
transferUsers(TEAM_SPECTATOR);
return;
return PLUGIN_HANDLED;
}

public cmdTransferTT(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "TRANSF_TT", prefix, getUserName(id));
transferUsers(TEAM_TERRORIST);
return;
return PLUGIN_HANDLED;
}

public cmdTransferCT(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "TRANSF_CT", prefix, getUserName(id));
transferUsers(TEAM_CT);
return;
return PLUGIN_HANDLED;
}

public cmdStartRound(id) {
Expand Down Expand Up @@ -323,7 +323,7 @@ public cmdStop(id) {

public cmdSkillMode(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "TYPE_SKILL", prefix, getUserName(id));

Expand All @@ -344,12 +344,12 @@ public cmdSkillMode(id) {

set_pcvar_num(g_eCvars[e_cSemiclip], 1);

return;
return PLUGIN_HANDLED;
}

public cmdBoostMode(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "TYPE_BOOST", prefix, getUserName(id));

Expand All @@ -361,36 +361,36 @@ public cmdBoostMode(id) {
set_pcvar_num(g_eCvars[e_cSemiclip], 0);
disableSemiclip();

return;
return PLUGIN_HANDLED;
}

public cmdAa10(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "AA_10", prefix, getUserName(id));

set_cvar_num("sv_airaccelerate", 10);
set_pcvar_num(g_eCvars[e_cAA], 10);

return;
return PLUGIN_HANDLED;
}

public cmdAa100(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "AA_100", prefix, getUserName(id));

set_cvar_num("sv_airaccelerate", 100);
set_pcvar_num(g_eCvars[e_cAA], 100);

return;
return PLUGIN_HANDLED;
}

public cmdRestartRound(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "GAME_RESTART", prefix, getUserName(id));
restartRound();
Expand All @@ -399,12 +399,12 @@ public cmdRestartRound(id) {
if (g_iCurrentMode == e_mMatch)
g_iGameStops++;

return;
return PLUGIN_HANDLED;
}

public cmdSwapTeams(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

client_print_color(0, print_team_blue, "%L", id, "GAME_SWAP", prefix, getUserName(id));

Expand All @@ -416,12 +416,12 @@ public cmdSwapTeams(id) {
if (g_iCurrentMode == e_mMatch)
g_iGameStops++;

return;
return PLUGIN_HANDLED;
}

public cmdStartPause(id) {
if (!getUserInAccess(id))
return;
return PLUGIN_HANDLED;

if (g_iCurrentMode == e_mMatch) {

Expand Down Expand Up @@ -467,7 +467,7 @@ public cmdStartPause(id) {
rg_send_audio(0, "fvox/activated.wav");
disableSemiclip();
}
return;
return PLUGIN_HANDLED;
}

public taskHudPaused() {
Expand All @@ -479,7 +479,7 @@ public taskHudPaused() {

public cmdStopPause(id) {
if (id && !getUserInAccess(id))
return;
return PLUGIN_HANDLED;

if (g_iCurrentMode == e_mPaused) {
g_iCurrentMode = e_mMatch;
Expand All @@ -505,7 +505,7 @@ public cmdStopPause(id) {
}
loadMapCFG();
}
return;
return PLUGIN_HANDLED;
}

public cmdSurrender(id) {
Expand Down Expand Up @@ -595,27 +595,23 @@ public cmdPick(id) {
}

public cmdTeamSpec(id) {
if (g_iCurrentMode != e_mPublic)
return;

if (g_iCurrentMode != e_mDM)
return;

g_bSpec[id] = !g_bSpec[id];
if (g_iCurrentMode == e_mPublic || g_iCurrentMode == e_mDM) { // Переделать
g_bSpec[id] = !g_bSpec[id];

if (g_bSpec[id]) {
if (getUserTeam(id) == TEAM_SPECTATOR) {
g_bSpec[id] = false;
return;
}
hTeam[id] = getUserTeam(id);
transferUserToSpec(id);
} else {
if (getUserTeam(id) != TEAM_SPECTATOR) {
g_bSpec[id] = true;
return;
if (g_bSpec[id]) {
if (getUserTeam(id) == TEAM_SPECTATOR) {
g_bSpec[id] = false;
return;
}
hTeam[id] = getUserTeam(id);
transferUserToSpec(id);
} else {
if (getUserTeam(id) != TEAM_SPECTATOR) {
g_bSpec[id] = true;
return;
}
rg_set_user_team(id, hTeam[id]);
}
rg_set_user_team(id, hTeam[id]);
}
}

Expand Down

0 comments on commit f33d0f9

Please sign in to comment.