Skip to content

Commit

Permalink
mini fix menu
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Mar 6, 2021
1 parent e66a97e commit 256b9bf
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 99 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.0.9.3", "??"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor
register_plugin("Hide'n'Seek Match System", "1.0.9.4", "??"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor

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

Expand Down
21 changes: 20 additions & 1 deletion scripting/include/hns-match/captain.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,30 @@

#define _captain_included

stock captainStart(id) {
resetCaptainData();
g_iCurrentMode = e_mCaptain;

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "c");

for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];

if (getUserTeam(iPlayer) == TEAM_SPECTATOR)
continue;

transferUserToSpec(iPlayer);
}
chooseCapsMenu(id);
client_print_color(0, print_team_blue, "%L", id, "CAP_CHOOSE", prefix, id);
}

stock chooseCapsMenu(id) {
if (!is_user_connected(id))
return;

if (~get_user_flags(id) & access)
if (!getUserInAccess(id))
return;

if (g_iCurrentMode != e_mCaptain)
Expand Down
158 changes: 72 additions & 86 deletions scripting/include/hns-match/cmds.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public sayHandle(id) {
if (equali(szArgs, "/wintime", 8)) {
trim(szTarget);

if (!(get_user_flags(id) & access))
if (!getUserInAccess(id))
return PLUGIN_HANDLED;

if (is_str_num(szTarget)) {
Expand All @@ -79,7 +79,7 @@ public sayHandle(id) {
if (equali(szArgs, "/Roundtime", 10)) {
trim(szTarget);

if (!(get_user_flags(id) & access))
if (!getUserInAccess(id))
return PLUGIN_HANDLED;

if (is_str_num(szTarget)) {
Expand Down Expand Up @@ -121,8 +121,8 @@ public cmdShowKnife(id) {
}

public cmdPubMode(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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 PLUGIN_HANDLED;
return;
}

public cmdDMMode(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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

removeHook(id);

return PLUGIN_HANDLED;
return;
}

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

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

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

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

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

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

public cmdStartRound(id) {
if (get_user_flags(id) & access) {
if (g_iCurrentMode != e_mTraining) {
client_print_color(id, print_team_blue, "%L", id, "NOT_START_MIX", prefix);
if (!getUserInAccess(id))
return;

if (g_iCurrentMode != e_mTraining) {
client_print_color(id, print_team_blue, "%L", id, "NOT_START_MIX", prefix);
return;
} else {
if (equali(g_eMatchInfo[e_mMapName], knifeMap))
return;
} else {
if (equali(g_eMatchInfo[e_mMapName], knifeMap))
return;

client_print_color(0, print_team_blue, "%L", id, "START_MIX", prefix, getUserName(id));
g_eSurrenderData[e_sFlDelay] = get_gametime() + surrenderTimeDelay;
client_print_color(0, print_team_blue, "%L", id, "START_MIX", prefix, getUserName(id));
g_eSurrenderData[e_sFlDelay] = get_gametime() + surrenderTimeDelay;

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "c");
for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];
arrayset(g_ePlayerInfo[iPlayer], 0, PlayerInfo_s);
}


pfStartMatch();
new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "c");
for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];
arrayset(g_ePlayerInfo[iPlayer], 0, PlayerInfo_s);
}

pfStartMatch();
}
}

Expand All @@ -231,14 +231,15 @@ stock pfStartMatch() {
}

public cmdKnifeRound(id) {
if (get_user_flags(id) & access) {
if (g_iCurrentMode != e_mTraining) {
client_print_color(id, print_team_blue, "%L", id, "NOT_START_KNIFE", prefix);
return;
} else {
pfKnifeRound(id);
removeHook(id);
}
if (!getUserInAccess(id))
return;

if (g_iCurrentMode != e_mTraining) {
client_print_color(id, print_team_blue, "%L", id, "NOT_START_KNIFE", prefix);
return;
} else {
pfKnifeRound(id);
removeHook(id);
}
}

Expand All @@ -249,35 +250,20 @@ stock pfKnifeRound(id) {
if (id)
client_print_color(0, print_team_blue, "%L", id, "START_KNIFE", prefix, getUserName(id));

return PLUGIN_HANDLED;
return;
}

public cmdCaptain(id) {
if (~get_user_flags(id) & access)
if (!getUserInAccess(id))
return;

if (!equali(g_eMatchInfo[e_mMapName], knifeMap))
return;

if (g_iCurrentMode != e_mTraining)
return;

resetCaptainData();
g_iCurrentMode = e_mCaptain;

new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "c");

for (new i; i < iNum; i++) {
new iPlayer = iPlayers[i];

if (getUserTeam(iPlayer) == TEAM_SPECTATOR)
continue;

transferUserToSpec(iPlayer);
}
chooseCapsMenu(id);
client_print_color(0, print_team_blue, "%L", id, "CAP_CHOOSE", prefix, id);

captainStart(id);
}

public cmdStopMode(id) {
Expand All @@ -289,7 +275,7 @@ public cmdStopMode(id) {
}

public cmdStop(id) {
if (id && ~get_user_flags(id) & access)
if (id && !getUserInAccess(id))
return;

if (!g_iCurrentMode)
Expand Down Expand Up @@ -336,8 +322,8 @@ public cmdStop(id) {
}

public cmdSkillMode(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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

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

set_pcvar_num(g_eCvars[e_cSemiclip], 1);

return PLUGIN_HANDLED;
return;
}

public cmdBoostMode(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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

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

return PLUGIN_HANDLED;
return;
}

public cmdAa10(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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 PLUGIN_HANDLED;
return;
}

public cmdAa100(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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 PLUGIN_HANDLED;
return;
}

public cmdRestartRound(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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

return PLUGIN_HANDLED;
return;
}

public cmdSwapTeams(id) {
if (~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

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

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

return PLUGIN_HANDLED;
return;
}

public cmdStartPause(id) {
if (id && ~get_user_flags(id) & access)
return PLUGIN_HANDLED;
if (!getUserInAccess(id))
return;

if (g_iCurrentMode == e_mMatch) {

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

public taskHudPaused() {
Expand All @@ -492,8 +478,8 @@ public taskHudPaused() {
}

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

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

public cmdSurrender(id) {
Expand Down
2 changes: 1 addition & 1 deletion scripting/include/hns-match/forward.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public fwdEmitSoundPre(id, iChannel, szSample[], Float:volume, Float:attenuation
return FMRES_IGNORED;
}

public fwdGameNameDesc() { // Надо убрать
public fwdGameNameDesc() {
static gameName[32];
get_pcvar_string(g_eCvars[e_cGameName], gameName, 31);
forward_return(FMV_STRING, gameName);
Expand Down
Loading

0 comments on commit 256b9bf

Please sign in to comment.