BratokHR

Untitled

Jan 20th, 2021
718
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. kickFakeClients()
  2. {
  3.     self endon("begin");
  4.     self endon("disconnect");
  5.  
  6.     /*if (!isDefined(self.isBot))
  7.     {*/
  8.         if (self getClientState() >= 3) // CS_PRIMED (3) or CS_ACTIVE (4)
  9.             return; // a fake player's state is always CS_CONNECTED (2)
  10.  
  11.         ip = self getIP();
  12.  
  13.         if (isDefined(level.lastfakeplayerip) && level.lastfakeplayerip == ip)
  14.             wait 1.5;
  15.         else // more time when IP isn't the same as previous ip
  16.             wait 5;
  17.  
  18.         if (self getClientState() == 2)
  19.         {
  20.             lastconnect = self getLastConnectTime();
  21.             lastmsg = self getLastMSG();
  22.             if (lastconnect == lastmsg)
  23.             {
  24.                 level.lastfakeplayerip = ip; // store ip from fake client
  25.                 kick2(self getEntityNumber(), "EXE_CANNOTVALIDATEPURECLIENT");
  26.             }
  27.         }
  28.     //}
  29. }
Advertisement
Add Comment
Please, Sign In to add comment