From 8ce2ac7a5b26636f84829839fa2fdb4291196555 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 16 Nov 2007 14:17:56 +0000 Subject: [PATCH] fixed amb1161 - voteban didn't actually ban --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401690 --- plugins/basevotes.sp | 22 +++++++--------------- plugins/basevotes/votemap.sp | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/plugins/basevotes.sp b/plugins/basevotes.sp index 6e8d091f..b93c03a7 100644 --- a/plugins/basevotes.sp +++ b/plugins/basevotes.sp @@ -51,8 +51,6 @@ public Plugin:myinfo = new Handle:g_hVoteMenu = INVALID_HANDLE; -new Handle:g_hBanForward = INVALID_HANDLE; - new Handle:g_Cvar_Limits[3] = {INVALID_HANDLE, ...}; //new Handle:g_Cvar_VoteSay = INVALID_HANDLE; @@ -111,8 +109,6 @@ public OnPluginStart() g_Cvar_Limits[1] = CreateConVar("sm_vote_kick", "0.60", "percent required for successful kick vote.", 0, true, 0.05, true, 1.0); g_Cvar_Limits[2] = CreateConVar("sm_vote_ban", "0.60", "percent required for successful ban vote.", 0, true, 0.05, true, 1.0); - g_hBanForward = CreateGlobalForward("OnClientBanned", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String); - /* Account for late loading */ new Handle:topmenu; if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE)) @@ -350,14 +346,6 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2) case (voteType:ban): { - /* Fire the ban forward */ - Call_StartForward(g_hBanForward); - Call_PushCell(0); - Call_PushCell(g_voteClient[VOTE_USERID]); - Call_PushCell(30); - Call_PushString(g_voteArg); - Call_Finish(); - if (g_voteArg[0] == '\0') { strcopy(g_voteArg, sizeof(g_voteArg), "Votebanned"); @@ -365,9 +353,13 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2) PrintToChatAll("[SM] %t", "Banned player", g_voteInfo[VOTE_NAME], 30); LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote ban successful, banned \"%L\" (minutes \"30\") (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg); - - ServerCommand("banid %d %s", 30, g_voteClient[VOTE_AUTHID]); - ServerCommand("kickid %d \"%s\"", g_voteClient[VOTE_USERID], g_voteArg); + + BanClient(g_voteClient[VOTE_CLIENTID], + 30, + BANFLAG_AUTO, + g_voteArg, + "Banned by vote", + "sm_voteban"); } } } diff --git a/plugins/basevotes/votemap.sp b/plugins/basevotes/votemap.sp index fcfd0cb6..c878ce77 100644 --- a/plugins/basevotes/votemap.sp +++ b/plugins/basevotes/votemap.sp @@ -111,7 +111,7 @@ public MenuHandler_Map(Handle:menu, MenuAction:action, param1, param2) GetMenuItem(menu, param2, info, sizeof(info), _, name, sizeof(name)); - if (IsStringInArray(g_SelectedMaps, info)) + if (FindStringInArray(g_SelectedMaps, info) != -1) { return ITEMDRAW_IGNORE; }