diff --git a/plugins/basecommands/cancelvote.sp b/plugins/basecommands/cancelvote.sp index 8cf2bb7e..be3dbb72 100644 --- a/plugins/basecommands/cancelvote.sp +++ b/plugins/basecommands/cancelvote.sp @@ -22,12 +22,23 @@ public AdminMenu_CancelVote(Handle:topmenu, if (action == TopMenuAction_DrawOption) { Format(buffer, maxlength, "%T", "Cancel vote", param); + + if (IsVoteInProgress()) + { + return ITEMDRAW_DEFAULT; + } + else + { + return ITEMDRAW_IGNORE; + } } else if (action == TopMenuAction_SelectOption) { PerformCancelVote(param); RedisplayAdminMenu(topmenu, param); } + + return 0; } public Action:Command_CancelVote(client, args) diff --git a/plugins/include/topmenus.inc b/plugins/include/topmenus.inc index ee16b47e..713da262 100644 --- a/plugins/include/topmenus.inc +++ b/plugins/include/topmenus.inc @@ -47,7 +47,8 @@ enum TopMenuAction * * INPUT : TopMenu Handle, object ID, client index in extra parameter. * OUTPUT: Buffer for rendering, maxlength of buffer. - * OUTPUT: Must return an ITEMDRAW constant. + * OUTPUT: Must return an ITEMDRAW constant. The return value may be ignored + * if the item is simply being sorted into the menu. */ TopMenuAction_DrawOption = 0,