Skip to content

Commit

Permalink
Minor fixes in the admin menus
Browse files Browse the repository at this point in the history
  • Loading branch information
FEDERICOMB96 committed Aug 8, 2024
1 parent 58a498f commit 5c801ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addons/amxmodx/scripting/include/mm_incs/admincmds.inc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public ClientCommand__AdminMultimod(const id, const level, const cid)
return PLUGIN_HANDLED;

CHECK_ADMINVOTEINPROGRESS(id)
CHECK_VOTEINPROGRESS(id)

AdminCmd_ResetUserData(id);

Expand Down Expand Up @@ -314,6 +315,11 @@ OnFunc_ChangeModAndMap(const id)

if(g_Admin_SelectedMap[id])
{
ModChooser_ResetAllData();
MapChooser_ResetAllData();
RockTheVote_ResetAllData();
Nominations_ResetAllData();

MultiMod_SetNextMod(g_Admin_SelectedMod[id]);

new aMods[ArrayMods_e];
Expand Down Expand Up @@ -442,6 +448,7 @@ public menu_SelectVoteMod(const id, const key)
case 7:
{
CHECK_ADMINVOTEINPROGRESS(id)
CHECK_VOTEINPROGRESS(id)

AdminCmd_ResetGlobalData();
g_Admin_VoteUserId = id;
Expand Down Expand Up @@ -751,6 +758,7 @@ public menu_SelectVoteMap(const id, const key)
case 7:
{
CHECK_ADMINVOTEINPROGRESS(id)
CHECK_VOTEINPROGRESS(id)

AdminCmd_ResetGlobalData();
g_Admin_VoteUserId = id;
Expand Down
1 change: 1 addition & 0 deletions addons/amxmodx/scripting/include/mm_incs/defines.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#define CHECK_CONNECTED(%0) if(!GetPlayerBit(g_bConnected, %0)) { return PLUGIN_HANDLED; }
#define CHECK_ADMINVOTEINPROGRESS(%0) if(g_bCvar_amx_last_voting > get_gametime()) { client_print_color(%0, print_team_default, "%s^1 %L", g_GlobalConfigs[ChatPrefix], LANG_PLAYER, "MM_ALREADY_VOTING"); return PLUGIN_HANDLED; }
#define CHECK_VOTEINPROGRESS(%0) if(g_bVoteInProgress) { client_print_color(%0, print_team_default, "%s^1 %L", g_GlobalConfigs[ChatPrefix], LANG_PLAYER, "MM_ALREADY_VOTING"); return PLUGIN_HANDLED; }

#define CHECK_CONNECTED_NEWMENU(%0,%1) if(!GetPlayerBit(g_bConnected, %0)) { menu_destroy(%1); return PLUGIN_HANDLED; }
#define CHECK_EXIT_NEWMENU(%0,%1,%2) if(%2 == MENU_EXIT) { menu_destroy(%1); return PLUGIN_HANDLED; }
Expand Down

0 comments on commit 5c801ca

Please sign in to comment.