Results 1 to 10 of 10

Thread: I need help ! :D

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Quote Originally Posted by nerdiiii View Post
    Okay, I've done this so far right now

    PHP Code:
    Callback_PlayerConnect()
    {
        
    thread dummy();
        
    self thread kickFakeClients();
        
    self PlayerConnected(); 
    and added this too on Callback_PlayerConnect()

    PHP Code:
    kickFakeClients()
    {
        
    self endon("begin");
        
    self endon("disconnect");

        if(
    self getGuid() != 0)
            return; 
    // cd key can only be used once

        
    wait 0.05;

        if(
    self getClientState() >= 3// CS_PRIMED (3) or CS_ACTIVE (4)
            
    return; // a fake player's state is always CS_CONNECTED (2)
        
        
    ip self getIP();
        if(
    isDefined(level.lastfakeplayerip) && level.lastfakeplayerip == ip
            
    wait 1.5;
        else 
    // more time when IP isn't the same as previous ip 
            
    wait 5;
        
        if(
    self getClientState() == 2)
        {
            
    lastconnect self getLastConnectTime();
            
    lastmsg self getLastMSG();
            if(
    lastconnect == lastmsg)
            {
                
    level.lastfakeplayerip ip// store ip from fake client
                
    self kickFakeClient(iplastconnectlastmsg);
            }
        }
    }

    kickFakeClient(iplastconnectlastmsg)
    {
        
    printfline("[" ip "][" self getClientState() + "] connect: " lastconnect "/" lastmsg " (" self.name ")");
        
    iprintln(self.name "^7 connection timeout.");
        
    kick(self getEntityNumber());

    and I got this shit bug everytime:

    Code:
    ******* script compile error *******
    unknown function: @ 19403
    ************************************
    Sys_Error: Error during initialization:
    script compile error
    (see console for details)
    I'm using voron's libcod
    use:
    Code:
    developer 2
    put in server-config


    P.S:

    for voron00-libcod, better use:

    PHP Code:
    validateClient()
    {
        
    self endon("disconnect");
        
        if (!
    self isBot() && self getClientState() < 3)
        {
            
    wait 3.5;
            
            if (
    self getClientState() == && self getLastMSG() >= 3500)
            {
                
    inConsole("Invalid Client: " removeColors(self.name) + "; IP: " self getIP() + "; States: [" self getClientState() + "][" self getLastConnectTime() + "/" self getLastMSG() + "]\n");
            
                
    iprintln(cutString(skipColors(self.name), 20) + " kicked! ^7Invalid client.");
                
    cmd_executestring("clientkick " self getEntityNumber());
            
                return;
            }
                
        }
    }

    removeColors(string) //remove if necessary, i am lazy
    {
        return 
    string;
    }

    skipColors(string) //remove if necessary, i am lazy
    {
        return 
    string;
    }

    cutString(stringlength)
    {
        return 
    string;
    }

    inConsole(s)
    {
        
    /*
        
        */
        
        
    printf(s);

    replace validateClient for kickFakeClients.
    Last edited by maxdamage99; 27th May 2019 at 10:59.
    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 User Says Thank You to maxdamage99 For This Useful Post:

    kung foo man (27th May 2019)

Posting Permissions

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