Stuneris

AntiWrongRconLogin

Aug 16th, 2011
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.13 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new wrong[MAX_PLAYERS];
  4.  
  5. public OnRconLoginAttempt(ip[], password[], success)
  6. {
  7.     if(!success)
  8.     {
  9.         for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
  10.         {
  11.                 if(!strcmp(ip, PlayerIP(playerid), true))
  12.                     {
  13.                     if(wrong[playerid] < 3)
  14.                 {
  15.                         wrong[playerid]++;
  16.                         new printas[150];
  17.                         format(printas, 150, "Žaidėjas %s(%s) Suvedė neteisingai slaptažodį(%s) %d kartą.", PlayerName(playerid), ip, password, wrong[playerid]);
  18.                         print(printas);
  19.                 }
  20.                     else if(wrong[playerid] > 2)
  21.                 {
  22.                         SendClientMessage(playerid, 0xFF0000FF, "Nelysk kur nereikia!");
  23.                         new printas[150];
  24.                         format(printas, 150, "Žaidėjas %s(%s) Suvedė neteisingai slaptažodį(%s) 3 kartą ir buvo išmestas.", PlayerName(playerid), ip, password);
  25.                         print(printas);
  26.                     BanEx(playerid, "AntiRconLogin");
  27.                 }
  28.             }
  29.         }
  30.     }
  31.     return 1;
  32. }
  33.  
  34. PlayerName(playerid)
  35. {
  36.     new name[MAX_PLAYER_NAME];
  37.     GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  38.     return name;
  39. }
  40.  
  41. PlayerIP(playerid)
  42. {
  43.     new ip[16];
  44.     GetPlayerName(playerid, ip, 16);
  45.     return ip;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment