Advertisement
Guest User

M'RCON2 System by MXD

a guest
Jul 26th, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.45 KB | None | 0 0
  1. /*
  2. Este sistema es creado por MatrixenXD
  3. ----------------------------------------------------------
  4. -¦¦¦¦¦¦----------¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦---
  5. -¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦-
  6. -¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦-
  7. -¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦---¦¦¦¦¦¦--¦¦¦¦¦¦-
  8. -¦¦¦¦¦¦--¦¦¦¦¦¦--¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦---¦¦¦¦¦¦--¦¦¦¦¦¦-
  9. -¦¦¦¦¦¦--¦¦¦¦¦¦--¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦-----¦¦¦¦¦¦--¦¦¦¦¦¦-
  10. -¦¦¦¦¦¦--¦¦¦¦¦¦--¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦---¦¦¦¦¦¦--¦¦¦¦¦¦-
  11. -¦¦¦¦¦¦----------¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦---¦¦¦¦¦¦--¦¦¦¦¦¦-
  12. -¦¦¦¦¦¦----------¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦-
  13. -¦¦¦¦¦¦----------¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦-
  14. -¦¦¦¦¦¦----------¦¦¦¦¦¦-¦¦¦¦¦¦¦¦--¦¦¦¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦---
  15. ----------------------------------------------------------
  16. Este es mi primer FS así que no robar creditos :V
  17. */
  18.  
  19. //Define FS//
  20. #define FILTERSCRIPT
  21.  
  22. #define SegundaRcon "cambiame"
  23. #define DIALOGO_RCON2 1 //Cambiar si es que lo pondrás en tu GM
  24. #define Rojo 0xFF0000AA
  25.  
  26. //Include//
  27. #include <a_samp>
  28.  
  29. //Variables//
  30. new Rcon2Attemp[MAX_PLAYERS];
  31. new RconAttemp[MAX_PLAYERS];
  32.  
  33.  
  34. //Callbacks//
  35. public OnFilterScriptInit()
  36. {
  37.     print("\n--------------------------------------");
  38.     print("Sistema de doble Rcon by MatrixenXD");
  39.     print("--------------------------------------\n");
  40.     return 1;
  41. }
  42.  
  43. public OnPlayerConnect(playerid)
  44. {
  45.     Rcon2Attemp[playerid] = 0;
  46.     RconAttemp[playerid] = 0;
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerDisconnect(playerid, reason)
  51. {
  52.     Rcon2Attemp[playerid] = 0;
  53.     RconAttemp[playerid] = 0;
  54.     return 1;
  55. }
  56.  
  57.  
  58. public OnRconLoginAttempt(ip[], password[], success)
  59. {
  60.     if(!success)
  61.     {
  62.         for(new pid = 0; pid < MAX_PLAYERS; pid++)
  63.         {
  64.             if(RconAttemp[pid] == 0)
  65.             {
  66.                 SendClientMessage(pid, Rojo, "Error: La contraseña es incorrecta, si sigues así serás baneado");
  67.                 SendClientMessage(pid, Rojo, "Advertencia 1/3");
  68.                 RconAttemp[pid] = 1;
  69.             }
  70.             if(RconAttemp[pid] == 1)
  71.             {
  72.                 SendClientMessage(pid, Rojo, "Error: La contraseña es incorrecta, si sigues así serás baneado");
  73.                 SendClientMessage(pid, Rojo, "Advertencia 2/3");
  74.                 RconAttemp[pid] = 2;
  75.             }
  76.             if(RconAttemp[pid] == 2)
  77.             {
  78.                 SendClientMessage(pid, Rojo, "Serás baneado por exedidos fallos en el inicio de Rcon");
  79.                 SendClientMessage(pid, Rojo, "Advertencias 3/3");
  80.                 Ban(pid);
  81.             }
  82.         }
  83.     }
  84.     else
  85.     {
  86.         for(new i = 0; i < MAX_PLAYERS; i++)
  87.         {
  88.             if(IsPlayerConnected(i))
  89.             {
  90.                 new IPjugador[16];
  91.                 GetPlayerIp(i, IPjugador, 16);
  92.                 if(!strcmp(IPjugador, ip, true))
  93.                 {
  94.                     ShowPlayerDialog(i, DIALOGO_RCON2, DIALOG_STYLE_INPUT,"Sistema de RCON2", "Ingrese la RCON2:", "Aceptar", "Salir");
  95.                 }
  96.             }
  97.         }
  98.     }
  99.     return 1;
  100. }
  101.  
  102.  
  103. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  104. {
  105.     if(dialogid == DIALOGO_RCON2)
  106.     {
  107.         if (response)
  108.         {
  109.             if(!strcmp(SegundaRcon, inputtext) && !(!strlen(inputtext)))
  110.             {
  111.                 SendClientMessage(playerid, Rojo, "Info: Has iniciado RCON2");
  112.             }
  113.             else
  114.             {
  115.                 if(Rcon2Attemp[playerid] == 3)
  116.                 {
  117.                     SendClientMessage(playerid, Rojo, "Has sido automáticamente baneado! Razón: Exedidos fallos de ingreso de la RCON2");
  118.                     ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Ban","{FFFFFF} Has sido baneado del servidor \n\n{FF0000}Razón: {FFFFFF}Exedidos fallos de ingreso de la RCON2", "Aceptar", "") ;
  119.                     Ban(playerid);
  120.                 }
  121.                 Rcon2Attemp[playerid]++;
  122.                 new dialogo2[200];
  123.                 SendClientMessage(playerid, Rojo, "Error: contraseña Rcon2 invalida!");
  124.                 format(dialogo2, sizeof(dialogo2), "¡Contraseña incorrecta!\n\nIngresa nuevamente la Rcon2\n\nIntentos: %d/3", Rcon2Attemp[playerid]);
  125.                 ShowPlayerDialog(playerid, DIALOGO_RCON2, DIALOG_STYLE_INPUT, "Rcon2 Ingreso",dialogo2, "Aceptar","");
  126.             }
  127.         }
  128.         else
  129.         {
  130.             SendClientMessage(playerid, Rojo, "Error en el sistema de segunda rcon, serás expulsado.");
  131.             return Kick(playerid);
  132.         }
  133.     }
  134.     return 1;
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement