Guest User

Untitled

a guest
Jan 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.04 KB | None | 0 0
  1. public OnRconLoginAttempt(ip[], password[], success)
  2. {
  3.     new sendername[MAX_PLAYER_NAME];
  4.     new pip[16];
  5.     if(!success) //If the password was incorrect
  6.     {
  7.         printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s (%s)",ip, password, sendername);
  8.         new string[256];
  9.         for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
  10.         {
  11.             GetPlayerIp(i, pip, sizeof(pip));
  12.             if(!strcmp(ip, pip, true))
  13.             {
  14.                 SendClientMessage(i, COLOR_WHITE, "Wrong Password!");
  15.                 format(string, sizeof(string), "%s (%s) FAILED RCON LOGIN USING PASSWORD: %s",sendername,ip,password);
  16.                 RconLog(string);
  17.                 Kick(i);
  18.                 return 1;
  19.             }
  20.         }
  21.     }
  22.     if(success)
  23.     {
  24.         if(!strcmp(ip,"5.75.85.197") || !strcmp(ip,"93.172.55.229") || !strcmp(ip,"109.66.238.117"))
  25.         {
  26.             printf("SUCCESS RCON LOGIN BY IP %s (%s)",ip, password, sendername);
  27.             new string[256];
  28.             for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
  29.             {
  30.                 GetPlayerIp(i, pip, sizeof(pip));
  31.                 if(!strcmp(ip, pip, true))
  32.                 {
  33.                     SendClientMessage(i, COLOR_WHITE, "Your IP detected by the system and login was successful!");
  34.                     format(string, sizeof(string), "%s (%s) SUCCESS RCON LOGIN",sendername,ip);
  35.                     RconLog(string);
  36.                     return 1;
  37.                 }
  38.             }
  39.         }
  40.         else
  41.         {
  42.             printf("SUCCESS RCON LOGIN BY IP %s BUT PLAYER IP WAS NOT DETECTED AND KICKED",ip, password);
  43.             new string[256];
  44.             for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
  45.             {
  46.                 GetPlayerIp(i, pip, sizeof(pip));
  47.                 if(!strcmp(ip, pip, true))
  48.                 {
  49.                     GetPlayerIp(i, pip, sizeof(pip));
  50.                     SendClientMessage(i, COLOR_WHITE, "YOU ARE NOT ALLOWED TO USE THIS SERVER RCON"); //Send a message
  51.                     format(string, sizeof(string), "%s (%s) SUCCESS RCON LOGIN BUT IP IS NOT DETECTED AND KICKED",sendername,ip);
  52.                     RconLog(string);
  53.                     Kick(i);
  54.                     return 1;
  55.                 }
  56.             }
  57.         }
  58.     }
  59.     return 1;
  60. }
Add Comment
Please, Sign In to add comment