@@ -54,6 +54,7 @@ public Plugin myinfo =
5454Menu g_hVoteMenu = null ;
5555
5656ConVar g_Cvar_Limits [3 ] = {null , ...};
57+ ConVar g_Cvar_Voteban = null ;
5758//ConVar g_Cvar_VoteSay = null;
5859
5960enum voteType
@@ -108,6 +109,7 @@ public void OnPluginStart()
108109 g_Cvar_Limits [0 ] = CreateConVar (" sm_vote_map" , " 0.60" , " percent required for successful map vote." , 0 , true , 0.05 , true , 1.0 );
109110 g_Cvar_Limits [1 ] = CreateConVar (" sm_vote_kick" , " 0.60" , " percent required for successful kick vote." , 0 , true , 0.05 , true , 1.0 );
110111 g_Cvar_Limits [2 ] = CreateConVar (" sm_vote_ban" , " 0.60" , " percent required for successful ban vote." , 0 , true , 0.05 , true , 1.0 );
112+ g_Cvar_Voteban = CreateConVar (" sm_voteban_time" , " 30" , " length of ban in minutes." , 0 , true , 0.0 );
111113
112114 AutoExecConfig (true , " basevotes" );
113115
@@ -344,23 +346,32 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
344346
345347 case (ban ):
346348 {
349+ if (g_voteArg [0 ] == ' \0 ' )
350+ {
351+ strcopy (g_voteArg , sizeof (g_voteArg ), " Votebanned" );
352+ }
353+
354+ int minutes = g_Cvar_Voteban .IntValue ;
355+
356+ PrintToChatAll (" [SM] %t " , " Banned player" , g_voteInfo [VOTE_NAME ], minutes );
357+
347358 int voteTarget ;
348359 if ((voteTarget = GetClientOfUserId (g_voteTarget )) == 0 )
349360 {
350- LogAction (- 1 , - 1 , " Vote ban failed, unable to ban \" %s \" (reason \" %s \" )" , g_voteInfo [VOTE_NAME ], " Player no longer available" );
361+ LogAction (- 1 , - 1 , " Vote ban successful, banned \" %s \" (%s ) (minutes \" %d \" ) (reason \" %s \" )" , g_voteInfo [VOTE_NAME ], g_voteInfo [VOTE_AUTHID ], minutes , g_voteArg );
362+
363+ BanIdentity (g_voteInfo [VOTE_AUTHID ],
364+ minutes ,
365+ BANFLAG_AUTHID ,
366+ g_voteArg ,
367+ " sm_voteban" );
351368 }
352369 else
353370 {
354- if (g_voteArg [0 ] == ' \0 ' )
355- {
356- strcopy (g_voteArg , sizeof (g_voteArg ), " Votebanned" );
357- }
371+ LogAction (- 1 , voteTarget , " Vote ban successful, banned \" %L \" (minutes \" %d \" ) (reason \" %s \" )" , voteTarget , minutes , g_voteArg );
358372
359- PrintToChatAll (" [SM] %t " , " Banned player" , g_voteInfo [VOTE_NAME ], 30 );
360- LogAction (- 1 , voteTarget , " Vote ban successful, banned \" %L \" (minutes \" 30\" ) (reason \" %s \" )" , voteTarget , g_voteArg );
361-
362373 BanClient (voteTarget ,
363- 30 ,
374+ minutes ,
364375 BANFLAG_AUTO ,
365376 g_voteArg ,
366377 " Banned by vote" ,
0 commit comments