BigETI

Some kind of RCON protection

Apr 26th, 2011
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.67 KB | None | 0 0
  1. public OnRconLoginAttempt(ip[], password[], success)
  2. {
  3.     if(!success)
  4.     {
  5.         printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
  6.         for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
  7.         {
  8.             new pip[16];
  9.             GetPlayerIp(i, pip, sizeof(pip));
  10.             if(!strcmp(ip, pip, true))
  11.             {
  12.                 SetPVarInt(i, "RCONFail", GetPVarInt(i, "RCONFail")+1);
  13.                 if(GetPVarInt(i, "RCONFail") == 5)
  14.                 {
  15.                     SendClientMessage(i, 0xFF0000FF, "Wrong Password. Bye!");
  16.                     BanEx(i, "Failed to login as RCON");
  17.                 }
  18.                 else SendClientMessage(i, 0xFF0000FF, "Wrong RCON passord. Do not try to login as RCON if you aren't even permitted.");
  19.             }
  20.         }
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment