View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-10-2012 , 22:33   Re: Maximum ban time
Reply With Quote #6

I have one that works for the command sm_ban, but you'll need to tweak the adminmenu so the admins cannot use the menu to ban for longer than n minutes.

Basically, something like this should do it - but like I said, I was still able to pull up my adminmenu (which I didn't alter) and use that ban menu:

PHP Code:
#pragma semicolon 1
#include <sourcemod>

public OnPluginStart()
{
    
AddCommandListener(Command_TempBan"sm_ban");
}

public 
Action:Command_TempBan(client, const String:command[], argc)
{
    if (!
client || CheckCommandAccess(client"allow_perm_bans"ADMFLAG_CUSTOM4))
    {
        return 
Plugin_Continue;
    }
    
    new 
String:time[5];
    
GetCmdArg(2timesizeof(time));
    
    new 
itime StringToInt(time);
    
    if (
itime == || itime 60)
    {
        
PrintToChat(client"You are not allowed to ban for [%i] minutes"itime);
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;

__________________
View my Plugins | Donate

Last edited by TnTSCS; 04-10-2012 at 22:37.
TnTSCS is offline