Results 1 to 6 of 6

Thread: [Cod2] Ban through command

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    459
    Thanks
    79
    Thanked 122 Times in 101 Posts
    PHP Code:
    CodeCallback_CLSpam(typeip)
    {
    CONST_TimesForBan 40;

    sm strtok(type":");
    svc sm[0];
    type sm[1];

    switch (
    svc)
    {

    case 
    "RCON":
    //
    break;

    case 
    "CHALLENGE":
    //
    break;

    case 
    "INFO":
    //
    break;

    case 
    "STATUS":
    if (
    type == "ADDRESS")
    {
        if (!
    isDefined(level.locked_ip[ip]))
            
    level.locked_ip[ip] = 0;

        
    level.locked_ip[ip]++;
        
        if (
    level.locked_ip[ip] >= CONST_TimesForBan)
        {
            
    //level.locked_ip[ip] = 0;
            
    ip_without_port strtok(ip":")[0];
            
    system("iptables -A INPUT -s "+ip_without_port+" -j DROP");
            
    printf("[CLSpam] IP: "+ip+" banned! Reason: "+type+" [TIMES: "+level.locked_ip[ip]+"]\n");
            
    level.locked_ip[ip] = 0;
    }
    else
        
    printf("SVC_Status: global limit\n");

    break;

    default:
    //
    break;

    }


    Last edited by maxdamage99; 14th January 2019 at 05:07.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  2. The Following 2 Users Say Thank You to maxdamage99 For This Useful Post:

    kung foo man (15th June 2018),Polat (15th June 2018)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •