fixed amb1161 - voteban didn't actually ban

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401690
This commit is contained in:
David Anderson 2007-11-16 14:17:56 +00:00
parent a00c455135
commit 8ce2ac7a5b
2 changed files with 8 additions and 16 deletions

View File

@ -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");
}
}
}

View File

@ -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;
}