From 13cf254f083ef00a0f1c681e2785f2e8bacc63f8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 24 May 2008 03:04:10 +0000 Subject: [PATCH] how did i forget to commit this? sm_revote --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402171 --- plugins/basecommands.sp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/plugins/basecommands.sp b/plugins/basecommands.sp index ec6e7abb..33076a2d 100644 --- a/plugins/basecommands.sp +++ b/plugins/basecommands.sp @@ -71,6 +71,7 @@ public OnPluginStart() RegAdminCmd("sm_who", Command_Who, ADMFLAG_GENERIC, "sm_who [#userid|name]"); RegAdminCmd("sm_reloadadmins", Command_ReloadAdmins, ADMFLAG_BAN, "sm_reloadadmins"); RegAdminCmd("sm_cancelvote", Command_CancelVote, ADMFLAG_VOTE, "sm_cancelvote"); + RegConsoleCmd("sm_revote", Command_ReVote); /* Account for late loading */ new Handle:topmenu; @@ -368,3 +369,31 @@ public Action:Command_Rcon(client, args) return Plugin_Handled; } + +public Action:Command_ReVote(client, args) +{ + if (client == 0) + { + ReplyToCommand(client, "[SM] %t", "Command is in-game only"); + return Plugin_Handled; + } + + if (!IsVoteInProgress()) + { + ReplyToCommand(client, "[SM] %t", "Vote Not In Progress"); + return Plugin_Handled; + } + + if (!IsClientInVotePool(client)) + { + ReplyToCommand(client, "[SM] %t", "Cannot participate in vote"); + return Plugin_Handled; + } + + if (!RedrawClientVoteMenu(client)) + { + ReplyToCommand(client, "[SM] %t", "Cannot change vote"); + } + + return Plugin_Handled; +}