Advertisement
elrooT

rAdmin! ~ 0.1 BETA

Sep 20th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 68.23 KB | None | 0 0
  1. #include <a_samp>
  2. #include <Dini>
  3. #include <dudb>
  4. #include <zcmd>
  5. #include <sscanf2>
  6.  
  7. #pragma tabsize 0
  8.  
  9. #undef MAX_PLAYERS
  10. #define MAX_PLAYERS     50
  11.  
  12. //===============================NEWS Y MAS=====================================
  13.  
  14. new str[128],
  15.     pname[MAX_PLAYER_NAME],
  16.     Car[MAX_PLAYERS],
  17.     Car2[MAX_PLAYERS],
  18.     cpid,
  19.     Clicked;
  20. new archivo[128];
  21.  
  22. enum pInfo
  23. {
  24.     Registrado,
  25.     Logueado,
  26.     Admin,
  27.     Baneado,
  28.     Muteado,
  29.     Congelado,
  30.     Warnings,
  31.     Reports,
  32.     MuteWarns
  33. };
  34. new aInfo[MAX_PLAYERS][pInfo];
  35.  
  36. new RandomColors[400] = {
  37. 0x4F5152D4,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0xEE82EEFF,0xFF1493FF,
  38. 0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0xF4A460FF,
  39. 0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
  40. 0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
  41. 0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
  42. 0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
  43. 0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
  44. 0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
  45. 0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
  46. 0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
  47. 0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
  48. 0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
  49. 0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
  50. 0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
  51. 0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
  52. 0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
  53. 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
  54. 0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
  55. 0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
  56. 0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
  57. 0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
  58. 0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
  59. 0xD8C762FF,0xD8C762FF,0x4F5152D4,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,
  60. 0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0xF4A460FF,
  61. 0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
  62. 0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
  63. 0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
  64. 0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
  65. 0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
  66. 0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
  67. 0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
  68. 0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
  69. 0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
  70. 0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
  71. 0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
  72. 0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
  73. 0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
  74. 0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
  75. 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
  76. 0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
  77. 0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
  78. 0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
  79. 0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
  80. 0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
  81. 0xD8C762FF,0xD8C762FF,0xEE82EEFF,0xFF1493FF
  82. };
  83.  
  84. //===============================DEFINES========================================
  85.  
  86. #define Users "rAdmin/%s.ini"
  87. #define MaxLevel        5                  // Cambia este valor por el valor que desees que sea el nivel
  88.                                            // de administracion maximo ~
  89.                                            
  90. #define MAX_WARNINGS    3                  // Cambia este valor por el valor que desees que sea la maxima cantidad
  91.                                            // de Warnings antes de que el usuario sea kickeado. ~
  92.                                            
  93. #define MAX_MUTEWARNS   5                  // Cambia este valor por el valor que desees que sea la maxima cantidad
  94.                                            // de MuteWarnings antes de que el usuario sea kickeado. ~
  95.                                            
  96. #define MAX_REPORTS     3                  // Cambia este valor para cambiar la cantidad maxima de reportes
  97.                                            // que puede tener cada usuario antes de ser kickeado. ~
  98.  
  99. #define Click 100                          // DialogID del dialogo de OnPlayerClickPlayer ~
  100.  
  101. #define COLOR_KANE          0xED5A00FF
  102. #define COLOR_GREY          0xAFAFAFAA
  103. #define COLOR_RED           0xFF0000AA
  104. #define COLOR_YELLOW        0xFFFF00AA
  105. #define COLOR_GREEN         0x66CC99AA
  106. #define COLOR_BLUE          0x0000BBAA
  107. #define COLOR_LIGHTBLUE     0x91C8FF
  108. #define COLOR_MEDBLUE       0x0091FFFF
  109. #define COLOR_LIGHTGREEN    0x38FF06FF
  110. #define COLOR_ORANGE        0xF97804FF
  111.  
  112. //================================FORWARDS======================================
  113.  
  114. forward SpawnKick(playerid);
  115. forward MessageToAdmins(color,const string[]);
  116. forward SalvarDatos(playerid);
  117. forward VehicleOccupied(vehicleid);
  118. forward GMR();
  119.  
  120. //==============================================================================
  121.  
  122.  
  123. public OnFilterScriptInit()
  124. {
  125.     print("----------------------------------------");
  126.     print("---Sistema de Administracion by rooT.---");
  127.     print("-----------------Loaded-----------------");
  128.     print("----------------------------------------");
  129.     return 1;
  130. }
  131.  
  132. public OnFilterScriptExit()
  133. {
  134.     print("----------------------------------------");
  135.     print("---Sistema de Administracion by rooT.---");
  136.     print("----------------Unloaded----------------");
  137.     print("----------------------------------------");
  138.     return 1;
  139. }
  140.  
  141. public OnPlayerConnect(playerid)
  142. {
  143.     aInfo[playerid][Registrado] = 0;
  144.     aInfo[playerid][Logueado] = 0;
  145.     aInfo[playerid][Admin] = 0;
  146.     aInfo[playerid][Baneado] = 0;
  147.     aInfo[playerid][Muteado] = 0;
  148.     aInfo[playerid][Congelado] = 0;
  149.     aInfo[playerid][Warnings] = 0;
  150.     aInfo[playerid][Reports] = 0;
  151.     aInfo[playerid][MuteWarns] = 0;
  152.     SetPlayerColor(playerid, random(RandomColors[200]));
  153.    
  154.     GetPlayerName(playerid, pname, sizeof(pname));
  155.     format(archivo, sizeof(archivo), Users, udb_encode(pname));
  156.    
  157.     if(!dini_Exists(archivo))
  158.     {
  159.         format(str, sizeof(str), "Bienvenido %s! Tu cuenta no esta registrada! Utiliza /registrar para registrarla!", pname);
  160.         SendClientMessage(playerid, COLOR_YELLOW, str);
  161.         aInfo[playerid][Registrado] = 0;
  162.     }
  163.     else
  164.     {
  165.         if(dini_Int(archivo, "Baneado") == 1)
  166.         {
  167.             SendClientMessage(playerid, COLOR_RED, "Estas baneado en el servidor!");
  168.             return Kick(playerid);
  169.         }
  170.        
  171.         format(str, sizeof(str), "Bienvenido %s! Utiliza /login para ingresar a tu cuenta", pname);
  172.         SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
  173.         aInfo[playerid][Registrado] = 1;
  174.        
  175.     }
  176.     format(str, sizeof(str), "%s Ingreso al servidor!", pname);
  177.     SendClientMessageToAll(COLOR_LIGHTGREEN, str);
  178.     return 1;
  179. }
  180.  
  181.  
  182. public OnPlayerSpawn(playerid)
  183. {
  184.     if(aInfo[playerid][Registrado] == 0)
  185.     {
  186.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "Tienes 60 segundos para registrarte o seras kickeado!");
  187.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "Utiliza /registrar para hacerlo");
  188.         SetTimerEx("SpawnKick", 60000, 0, "i", playerid);
  189.         TogglePlayerControllable(playerid, 0);
  190.         return 0;
  191.     }
  192.  
  193.     if(aInfo[playerid][Logueado] == 0)
  194.     {
  195.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "Tienes 60 segundos para loguear o seras kickeado!");
  196.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "Utiliza /login para hacerlo");
  197.         SetTimerEx("SpawnKick", 60000, 0, "i", playerid);
  198.         TogglePlayerControllable(playerid, 0);
  199.         return 0;
  200.     }
  201.     return 1;
  202. }
  203.  
  204. public OnPlayerDisconnect(playerid, reason)
  205. {
  206.     GetPlayerName(playerid, pname, sizeof(pname));
  207.     switch(reason)
  208.     {
  209.         case 0: format(str, sizeof(str), "%s dejo el servidor. (Crash)", pname);
  210.         case 1: format(str, sizeof(str), "%s dejo el servidor. (Salio)", pname);
  211.         case 2: format(str, sizeof(str), "%s dejo el servidor. (Kickeado/Baneado)", pname);
  212.     }
  213.     SendClientMessageToAll(COLOR_GREEN, str);
  214.    
  215.     format(archivo, sizeof(archivo), Users, udb_encode(pname));
  216.     if(dini_Exists(archivo))
  217.     {
  218.         dini_IntSet(archivo, "Admin", aInfo[playerid][Admin]);
  219.         dini_IntSet(archivo, "Baneado", aInfo[playerid][Baneado]);
  220.         dini_IntSet(archivo, "Muteado", aInfo[playerid][Muteado]);
  221.         dini_IntSet(archivo, "Congelado", aInfo[playerid][Congelado]);
  222.     }
  223.    
  224.     aInfo[playerid][Registrado] = 0;
  225.     aInfo[playerid][Logueado] = 0;
  226.     aInfo[playerid][Admin] = 0;
  227.     aInfo[playerid][Baneado] = 0;
  228.     aInfo[playerid][Muteado] = 0;
  229.     aInfo[playerid][Congelado] = 0;
  230.     aInfo[playerid][Warnings] = 0;
  231.     aInfo[playerid][Reports] = 0;
  232.     aInfo[playerid][MuteWarns] = 0;
  233.     return 1;
  234. }
  235.  
  236. /*==============================================================================
  237. ================================================================================
  238. ===========================rAdmin Player Commands!==============================
  239. ================================================================================
  240. ==============================================================================*/
  241.  
  242. /*
  243.   //==========================================================================\\
  244.  //============================================================================\\
  245. ||==============================Registrar || Login==============================||
  246.  \\============================================================================//
  247.   \\==========================================================================//
  248. */
  249.  
  250. CMD:registrar(playerid, params[])
  251. {
  252.     if(aInfo[playerid][Registrado] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "Esta cuenta esta registrada! Utiliza /login para ingresar");
  253.     GetPlayerName(playerid, pname, sizeof(pname));
  254.     format(archivo, sizeof(archivo), Users, udb_encode(pname));
  255.     if(strlen(params) > 4 && strlen(params) < 24)
  256.     {
  257.         dini_Create(archivo);
  258.         dini_IntSet(archivo, "pass", udb_hash(params));
  259.         dini_IntSet(archivo, "Admin", 0);
  260.         dini_IntSet(archivo, "Baneado", 0);
  261.         dini_IntSet(archivo, "Muteado", 0);
  262.         dini_IntSet(archivo, "Congelado", 0);
  263.         dini_IntSet(archivo, "Vehicle", 0);
  264.        
  265.         format(str, sizeof(str), "[rAdmin] Registraste el nombre %s bajo la contraseña %s. Fuiste logueado automaticamente!", pname, params);
  266.         SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
  267.        
  268.         aInfo[playerid][Logueado] = 1;
  269.         aInfo[playerid][Registrado] = 1;
  270.         TogglePlayerControllable(playerid, 1);
  271.     }
  272.     else
  273.     {
  274.         SendClientMessage(playerid, COLOR_RED, "Uso: /registrar <contraseña>");
  275.         return SendClientMessage(playerid, COLOR_ORANGE, "Recuerda que tu contraseña debe tener entre 4 & 24 caracteres!");
  276.     }
  277.     return 1;
  278. }
  279.  
  280. CMD:login(playerid, params[])
  281. {
  282.     if(aInfo[playerid][Registrado] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "Esta cuenta no esta registrada! Utiliza /registrar para registrarla!");
  283.     if(aInfo[playerid][Logueado] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "Ya estas logueado!");
  284.     GetPlayerName(playerid, pname, sizeof(pname));
  285.     format(archivo, sizeof(archivo), Users, udb_encode(pname));
  286.  
  287.     if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Uso: /login <password>");
  288.    
  289.     if(udb_hash(params) != dini_Int(archivo, "pass"))
  290.     {
  291.         format(str, sizeof(str), "La contraseña que ingresaste es incorrecta!");
  292.         SendClientMessage(playerid, COLOR_RED, str);
  293.     }
  294.     else
  295.     {
  296.         aInfo[playerid][Admin] = dini_Int(archivo, "Admin");
  297.         aInfo[playerid][Baneado] = dini_Int(archivo, "Baneado");
  298.         aInfo[playerid][Muteado] = dini_Int(archivo, "Muteado");
  299.         aInfo[playerid][Congelado] = dini_Int(archivo, "Congelado");
  300.         aInfo[playerid][Logueado] = 1;
  301.        
  302.         if(aInfo[playerid][Admin] > 0)
  303.         {
  304.             format(str, sizeof(str), "Bienvenido %s! Admin Level: %d.! Utiliza /acmds para ver tus comandos de administracion!", pname, aInfo[playerid][Admin]);
  305.             SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
  306.             SendClientMessage(playerid, COLOR_RED, "[rAdmin] Logueado satisfactoriamente!");
  307.         }
  308.         else
  309.         {
  310.             format(str, sizeof(str), "Bienvenido %s! Utiliza /comandos para ver los comandos disponibles!", pname);
  311.             SendClientMessage(playerid, COLOR_YELLOW, str);
  312.             SendClientMessage(playerid, COLOR_RED, "[rAdmin] Logueado satisfactoriamente!");
  313.         }
  314.         TogglePlayerControllable(playerid, 1);
  315.     }
  316.     return 1;
  317. }
  318.  
  319. /*
  320.   //==========================================================================\\
  321.  //============================================================================\\
  322. ||============================CambiarPass || Reportar===========================||
  323.  \\============================================================================//
  324.   \\==========================================================================//
  325. */
  326.  
  327. CMD:cambiarpass(playerid, params[])
  328. {
  329.     if(aInfo[playerid][Registrado] == 0 || aInfo[playerid][Logueado] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "Debes loguearte/registrarte antes de cambiar tu password!");
  330.     GetPlayerName(playerid, pname, sizeof(pname));
  331.     format(archivo, sizeof(archivo), Users, udb_encode(pname));
  332.    
  333.     if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Uso: /cambiarpass <password>");
  334.    
  335.     if(strlen(params) >= 4 && strlen(params) <= 24)
  336.     {
  337.         dini_IntSet(archivo, "pass", udb_hash(params));
  338.         format(str, sizeof(str), "[rAdmin] Cambiaste tu contraseña a %s. No la olvides!", pname, params);
  339.         SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
  340.     }
  341.     else
  342.     {
  343.         SendClientMessage(playerid, COLOR_RED, "Uso: /registrar <contraseña>");
  344.         return SendClientMessage(playerid, COLOR_ORANGE, "Recuerda que tu contraseña debe tener entre 4 & 24 caracteres!");
  345.     }
  346.    
  347.    
  348.     return 1;
  349. }
  350.  
  351. CMD:reportar(playerid, params[])
  352. {
  353.     new playerid2, pname2[MAX_PLAYER_NAME], reason[128];
  354.     if(!sscanf(params, "rs", playerid2, reason))
  355.     {
  356.         if(aInfo[playerid2][Admin] != MaxLevel)
  357.         {
  358.             if(playerid2 == playerid) return SendClientMessage(playerid, COLOR_GREEN, "No te puedes reportar:D");
  359.             GetPlayerName(playerid, pname, sizeof(pname));
  360.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  361.  
  362.             format(str, sizeof(str), "El jugador %s [ID: %d] ha reportado a %s [ID: %d] ~ Razon: %s", pname, playerid, pname2, playerid2, reason);
  363.             MessageToAdmins(COLOR_YELLOW, str);
  364.             aInfo[playerid2][Reports] ++;
  365.            
  366.             if(aInfo[playerid2][Reports] >= MAX_REPORTS)
  367.             {
  368.                 format(str, sizeof(str), "El jugador %s [ID: %d] fue kickeado por acumular %d reportes.", pname2, playerid2, MAX_REPORTS);
  369.                 SendClientMessageToAll(COLOR_ORANGE, str);
  370.                 Kick(playerid2);
  371.             }
  372.         }
  373.         else return SendClientMessage(playerid, COLOR_RED, "Este usuario no puede ser reportado!");
  374.     }
  375.     else return SendClientMessage(playerid, COLOR_RED, "Uso: /reportar <playerid> <razon>");
  376.     return 1;
  377. }
  378.  
  379. /*==============================================================================
  380. ================================================================================
  381. ===========================rAdmin Admin Commands!===============================
  382. ================================================================================
  383. ==============================================================================*/
  384.  
  385.  
  386.  
  387. /*==============================================================================
  388. ================================================================================
  389. ============================rAdmin Admin Nivel 1================================
  390. ================================================================================
  391. ==============================================================================*/
  392.  
  393. /*
  394.   //==========================================================================\\
  395.  //============================================================================\\
  396. ||====================================aCMDS!====================================||
  397. ||====================================gInfo!====================================||
  398.  \\============================================================================//
  399.   \\==========================================================================//
  400. */
  401.  
  402. CMD:acmds(playerid, params[])
  403. {
  404.     if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins!");
  405.     if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Uso: /acmds <nivel>");
  406.    
  407.    
  408.     if(strval(params) == 1)
  409.     {
  410.         if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins Nivel 1");
  411.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  412.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 1: /kick || /warn || /slap || /asay");
  413.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 1: /setskin || /saveskin || /useskin");
  414.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 1: /ginfo || /acmds");
  415.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  416.     }
  417.     else if(strval(params) == 2)
  418.     {
  419.         if(aInfo[playerid][Admin] < 2) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins Nivel 2");
  420.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  421.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 2: /mute || /unmute || /freeze");
  422.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 2: /unfreeze || /ann || /abike");
  423.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 2: /acar || /gmiauto || /miauto");
  424.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  425.     }
  426.     else if(strval(params) == 3)
  427.     {
  428.         if(aInfo[playerid][Admin] < 3) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins Nivel 3");
  429.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  430.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 3: /sethealth || /setarmour");
  431.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 3: /spawn || /akill");
  432.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  433.     }
  434.     else if(strval(params) == 4)
  435.     {
  436.         if(aInfo[playerid][Admin] < 4) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins Nivel 4");
  437.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  438.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 4: /ban || /clearchat || /rcars");
  439.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  440.     }
  441.     else if(strval(params) == 5)
  442.     {
  443.         if(aInfo[playerid][Admin] < 5) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins Nivel 5");
  444.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  445.         SendClientMessage(playerid, COLOR_YELLOW, "|- Level 5: /setlevel || /gmx || /passwd");
  446.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  447.     }
  448.     else if(strval(params) > MaxLevel) return SendClientMessage(playerid, COLOR_RED, "Ese nivel de administracion no existe!");
  449.     return 1;
  450. }
  451.  
  452. /*
  453.   //==========================================================================\\
  454.  //============================================================================\\
  455. ||====================================gInfo!====================================||
  456.  \\============================================================================//
  457.   \\==========================================================================//
  458. */
  459.  
  460. CMD:ginfo(playerid, params[])
  461. {
  462.     if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins!");
  463.     new playerid2;
  464.        
  465.     if(!sscanf(params, "r", playerid2))
  466.     {
  467.         new pname2[MAX_PLAYER_NAME],
  468.             pIP[16],
  469.             Float:vida,
  470.             Float:chaleco;
  471.         GetPlayerName(playerid2, pname2, sizeof(pname2));
  472.         GetPlayerIp(playerid2, pIP, sizeof(pIP));
  473.         GetPlayerHealth(playerid2, vida);
  474.         GetPlayerArmour(playerid2, chaleco);
  475.         format(archivo, sizeof(archivo), Users, udb_encode(pname));
  476.        
  477.         if(aInfo[playerid][Admin] == 1)
  478.         {
  479.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  480.             format(str, sizeof(str), "Jugador: %s || Registrado: %d || Logueado: %d", pname2, aInfo[playerid2][Registrado], aInfo[playerid2][Logueado]);
  481.             SendClientMessage(playerid, COLOR_YELLOW, str);
  482.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  483.         }
  484.         else if(aInfo[playerid][Admin] == 2)
  485.         {
  486.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  487.             format(str, sizeof(str), "Jugador: %s || Registrado: %d || Logueado: %d", pname2, aInfo[playerid2][Registrado], aInfo[playerid2][Logueado]);
  488.             SendClientMessage(playerid, COLOR_YELLOW, str);
  489.  
  490.             format(str, sizeof(str), "IP: %s || Admin Level: %d || Muteado: %d || Congelado: %d", pIP, aInfo[playerid2][Admin], aInfo[playerid2][Muteado], aInfo[playerid2][Congelado]);
  491.             SendClientMessage(playerid, COLOR_YELLOW, str);
  492.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  493.         }
  494.         else if(aInfo[playerid][Admin] == 3)
  495.         {
  496.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  497.             format(str, sizeof(str), "Jugador: %s || Registrado: %d || Logueado: %d", pname2, aInfo[playerid2][Registrado], aInfo[playerid2][Logueado]);
  498.             SendClientMessage(playerid, COLOR_YELLOW, str);
  499.  
  500.             format(str, sizeof(str), "IP: %s || Admin Level: %d || Muteado: %d || Congelado: %d", pIP, aInfo[playerid2][Admin], aInfo[playerid2][Muteado], aInfo[playerid2][Congelado]);
  501.             SendClientMessage(playerid, COLOR_YELLOW, str);
  502.            
  503.             format(str, sizeof(str), "Interior: %d || VirtualWorld: %d || Vida: %d || Chaleco: %d", GetPlayerInterior(playerid2), GetPlayerVirtualWorld(playerid2), floatround(vida), floatround(chaleco));
  504.             SendClientMessage(playerid, COLOR_YELLOW, str);
  505.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  506.         }
  507.         else if(aInfo[playerid][Admin] == 4)
  508.         {
  509.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  510.             format(str, sizeof(str), "Jugador: %s || Registrado: %d || Logueado: %d", pname2, aInfo[playerid2][Registrado], aInfo[playerid2][Logueado]);
  511.             SendClientMessage(playerid, COLOR_YELLOW, str);
  512.  
  513.             format(str, sizeof(str), "IP: %s || Admin Level: %d || Muteado: %d || Congelado: %d", pIP, aInfo[playerid2][Admin], aInfo[playerid2][Muteado], aInfo[playerid2][Congelado]);
  514.             SendClientMessage(playerid, COLOR_YELLOW, str);
  515.  
  516.             format(str, sizeof(str), "Interior: %d || VirtualWorld: %d || Vida: %d || Chaleco: %d", GetPlayerInterior(playerid2), GetPlayerVirtualWorld(playerid2), floatround(vida), floatround(chaleco));
  517.             SendClientMessage(playerid, COLOR_YELLOW, str);
  518.            
  519.             format(str, sizeof(str), "Warnings: %d || Reportes: %d || Skin: %d || VehicleSaved: %d", aInfo[playerid2][Warnings], aInfo[playerid2][Reports], GetPlayerSkin(playerid2), dini_Int(archivo, "Vehicle"));
  520.             SendClientMessage(playerid, COLOR_YELLOW, str);
  521.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  522.         }
  523.         else if(aInfo[playerid][Admin] == 5)
  524.         {
  525.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  526.             format(str, sizeof(str), "Jugador: %s || Registrado: %d || Logueado: %d", pname2, aInfo[playerid2][Registrado], aInfo[playerid2][Logueado]);
  527.             SendClientMessage(playerid, COLOR_YELLOW, str);
  528.  
  529.             format(str, sizeof(str), "IP: %s || Admin Level: %d || Muteado: %d || Congelado: %d", pIP, aInfo[playerid2][Admin], aInfo[playerid2][Muteado], aInfo[playerid2][Congelado]);
  530.             SendClientMessage(playerid, COLOR_YELLOW, str);
  531.  
  532.             format(str, sizeof(str), "Interior: %d || VirtualWorld: %d || Vida: %d || Chaleco: %d", GetPlayerInterior(playerid2), GetPlayerVirtualWorld(playerid2), floatround(vida), floatround(chaleco));
  533.             SendClientMessage(playerid, COLOR_YELLOW, str);
  534.  
  535.             format(str, sizeof(str), "Warnings: %d || Reportes: %d || Skin: %d || VehicleSaved: %d", aInfo[playerid2][Warnings], aInfo[playerid2][Reports], GetPlayerSkin(playerid2), dini_Int(archivo, "Vehicle"));
  536.             SendClientMessage(playerid, COLOR_YELLOW, str);
  537.            
  538.             format(str, sizeof(str), "Rcon Login: %d", IsPlayerAdmin(playerid2));
  539.             SendClientMessage(playerid, COLOR_YELLOW, str);
  540.             SendClientMessage(playerid, COLOR_LIGHTGREEN, "|===========================================|");
  541.         }
  542.     }
  543.     else return SendClientMessage(playerid, COLOR_RED, "Uso: /ginfo <playerid>");
  544.     return 1;
  545. }
  546.  
  547. /*
  548.   //==========================================================================\\
  549.  //============================================================================\\
  550. ||==============================Kick, Warn, Slap!===============================||
  551.  \\============================================================================//
  552.   \\==========================================================================//
  553. */
  554.  
  555. CMD:kick(playerid, params[])
  556. {
  557.     new playerid2, pname2[MAX_PLAYER_NAME], reason[128];
  558.     if(aInfo[playerid][Admin] >= 1)
  559.     {
  560.         if(!sscanf(params, "rs", playerid2, reason))
  561.         {
  562.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  563.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  564.             GetPlayerName(playerid, pname, sizeof(pname));
  565.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  566.  
  567.             format(str, sizeof(str), "El jugador %s [ID: %d] fue kickeado por el administrador %s ~ Razon: %s", pname2,  playerid2, pname, reason);
  568.             SendClientMessageToAll(COLOR_YELLOW, str);
  569.             Kick(playerid2);
  570.            
  571.         }
  572.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /kick <playerid> <razon>");
  573.     }
  574.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  575.     return 1;
  576. }
  577.  
  578. CMD:warn(playerid, params[])
  579. {
  580.     new playerid2, pname2[MAX_PLAYER_NAME], reason[128], string[128];
  581.     if(aInfo[playerid][Admin] >= 1)
  582.     {
  583.         if(!sscanf(params, "rs", playerid2, reason))
  584.         {
  585.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  586.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  587.             GetPlayerName(playerid, pname, sizeof(pname));
  588.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  589.  
  590.             aInfo[playerid2][Warnings]++;
  591.            
  592.             if(aInfo[playerid2][Warnings] < MAX_WARNINGS)
  593.             {
  594.                 format(string, sizeof(string), "El usuario %s [ID: %d] fue warneado por el Administrador %s ~ Razon: %s (Warnings: %d/%d) -|", pname2, playerid2, pname, reason, aInfo[playerid2][Warnings], MAX_WARNINGS);
  595.                 return SendClientMessageToAll(COLOR_YELLOW, string);
  596.             }
  597.             else
  598.             {
  599.                 format(string, sizeof(string), "El usuario %s [ID: %d] fue kickeado por el Administrador %s ~ Razon: %s (Warnings: %d/%d)", pname2, playerid2, pname, reason, aInfo[playerid2][Warnings], MAX_WARNINGS);
  600.                 SendClientMessageToAll(COLOR_YELLOW, string);
  601.                 Kick(playerid2);
  602.                 return aInfo[playerid2][Warnings] = 0;
  603.             }
  604.         }
  605.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /warn <playerid> <razon>");
  606.     }
  607.     else
  608.     {
  609.         SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  610.     }
  611.     return 1;
  612. }
  613.  
  614. CMD:slap(playerid, params[])
  615. {
  616.     new playerid2;
  617.     if(aInfo[playerid][Admin] >= 1)
  618.     {
  619.         if(!sscanf(params, "rs", playerid2))
  620.         {
  621.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  622.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  623.             GetPlayerName(playerid, pname, sizeof(pname));
  624.             new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS];
  625.  
  626.             GetPlayerPos(playerid2, X[playerid2], Y[playerid2], Z[playerid2]);
  627.             SetPlayerPos(playerid2, X[playerid2], Y[playerid2], Z[playerid2]+10);
  628.             new Float:health;
  629.             GetPlayerHealth(playerid2, health);
  630.             SetPlayerHealth(playerid2, health-10);
  631.             format(str, sizeof(str), "El Administrador %s [ID: %d] te ha slapeado!", pname, playerid);
  632.             SendClientMessage(playerid2, COLOR_BLUE, str);
  633.            
  634.         }
  635.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /slap <playerid>");
  636.     }
  637.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  638.     return 1;
  639. }
  640.  
  641. /*
  642.   //==========================================================================\\
  643.  //============================================================================\\
  644. ||=====================================Asay=====================================||
  645.  \\============================================================================//
  646.   \\==========================================================================//
  647. */
  648.  
  649. CMD:asay(playerid, params[])
  650. {
  651.     if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Uso: /asay <texto>");
  652.     if(aInfo[playerid][Admin] >= 1)
  653.     {
  654.         GetPlayerName(playerid, pname, sizeof(pname));
  655.         format(str, sizeof(str), "|- Admin %s: %s", pname, params);
  656.         SendClientMessageToAll(COLOR_YELLOW, str);
  657.        
  658.     }
  659.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  660.     return 1;
  661. }
  662.  
  663. /*
  664.   //==========================================================================\\
  665.  //============================================================================\\
  666. ||===================================SetSkin====================================||
  667.  \\============================================================================//
  668.   \\==========================================================================//
  669. */
  670.  
  671. CMD:setskin(playerid, params[])
  672. {
  673.     new playerid2, pname2[MAX_PLAYER_NAME], skin;
  674.     if(aInfo[playerid][Admin] >= 1)
  675.     {
  676.         if(!sscanf(params, "rd", playerid2, skin))
  677.         {
  678.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  679.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  680.             GetPlayerName(playerid, pname, sizeof(pname));
  681.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  682.  
  683.             format(str, sizeof(str), "El administrador %s [ID: %d] cambio tu skin al %d", pname, playerid, skin);
  684.             SendClientMessage(playerid2, COLOR_YELLOW, str);
  685.             SetPlayerSkin(playerid2, skin);
  686.  
  687.         }
  688.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /setskin <playerid> <skin>");
  689.     }
  690.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  691.     return 1;
  692. }
  693.  
  694. /*
  695.   //==========================================================================\\
  696.  //============================================================================\\
  697. ||===================================UseSkin====================================||
  698.  \\============================================================================//
  699.   \\==========================================================================//
  700. */
  701.  
  702. CMD:useskin(playerid, params[])
  703. {
  704.     if(aInfo[playerid][Admin] >= 1)
  705.     {
  706.         GetPlayerName(playerid, pname, sizeof(pname));
  707.         format(archivo, sizeof(archivo), Users, udb_encode(pname));
  708.        
  709.         SendClientMessage(playerid, COLOR_YELLOW, "Ahora estas usando tu skin guardado!");
  710.         SetPlayerSkin(playerid, dini_Int(archivo, "SavedSkin"));
  711.     }
  712.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  713.     return 1;
  714. }
  715.  
  716. /*
  717.   //==========================================================================\\
  718.  //============================================================================\\
  719. ||==================================SaveSkin====================================||
  720.  \\============================================================================//
  721.   \\==========================================================================//
  722. */
  723.  
  724. CMD:saveskin(playerid, params[])
  725. {
  726.     if(aInfo[playerid][Admin] >= 1)
  727.     {
  728.         new skin;
  729.         if(!sscanf(params, "d", skin))
  730.         {
  731.             GetPlayerName(playerid, pname, sizeof(pname));
  732.             format(archivo, sizeof(archivo), Users, udb_encode(pname));
  733.            
  734.             format(str, sizeof(str), "Guardaste el Skin %d!", skin);
  735.             SendClientMessage(playerid, COLOR_YELLOW, str);
  736.            
  737.             dini_IntSet(archivo, "SavedSkin", skin);
  738.             SetPlayerSkin(playerid, dini_Int(archivo, "SavedSkin"));
  739.         }
  740.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /saveskin <skinid>");
  741.     }
  742.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  743.     return 1;
  744. }
  745.  
  746. /*==============================================================================
  747. ================================================================================
  748. ============================rAdmin Admin Nivel 2================================
  749. ================================================================================
  750. ==============================================================================*/
  751.  
  752.  
  753. /*
  754.   //==========================================================================\\
  755.  //============================================================================\\
  756. ||================================Mute || Unmute!===============================||
  757.  \\============================================================================//
  758.   \\==========================================================================//
  759. */
  760.  
  761. CMD:mute(playerid, params[])
  762. {
  763.     new playerid2, pname2[MAX_PLAYER_NAME];
  764.     if(aInfo[playerid][Admin] >= 2)
  765.     {
  766.         if(!sscanf(params, "r", playerid2))
  767.         {
  768.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  769.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  770.             GetPlayerName(playerid, pname, sizeof(pname));
  771.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  772.            
  773.             format(str, sizeof(str), "El jugador %s [ID: %d] fue muteado por el administrador %s.", pname2,  playerid2, pname);
  774.             if(aInfo[playerid2][Muteado] == 1) return SendClientMessage(playerid, COLOR_MEDBLUE, "Este jugador ya esta Silenciado!");
  775.             SendClientMessageToAll(COLOR_YELLOW, str);
  776.             aInfo[playerid2][Muteado] = 1;
  777.            
  778.         }
  779.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /mute <playerid> <razon>");
  780.     }
  781.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  782.     return 1;
  783. }
  784.  
  785. CMD:unmute(playerid, params[])
  786. {
  787.     new playerid2, pname2[MAX_PLAYER_NAME];
  788.     if(aInfo[playerid][Admin] >= 2)
  789.     {
  790.         if(!sscanf(params, "r", playerid2))
  791.         {
  792.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  793.             GetPlayerName(playerid, pname, sizeof(pname));
  794.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  795.  
  796.             format(str, sizeof(str), "El jugador %s [ID: %d] fue desmuteado por el administrador %s.", pname2,  playerid2, pname);
  797.             if(aInfo[playerid2][Muteado] == 0) return SendClientMessage(playerid, COLOR_MEDBLUE, "Este jugador no esta Silenciado!");
  798.             SendClientMessageToAll(COLOR_YELLOW, str);
  799.             aInfo[playerid2][Muteado] = 0;
  800.            
  801.         }
  802.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /unmute <playerid> <razon>");
  803.     }
  804.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  805.     return 1;
  806. }
  807.  
  808. /*
  809.   //==========================================================================\\
  810.  //============================================================================\\
  811. ||=================================Abike || Acar================================||
  812.  \\============================================================================//
  813.   \\==========================================================================//
  814. */
  815.  
  816. CMD:abike(playerid, params[])
  817. {
  818.     if(aInfo[playerid][Admin] >= 2)
  819.     {
  820.         if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Ya estas en un vehiculo!");
  821.         new Float:x, Float:y, Float:z, Float:a;
  822.         GetPlayerPos(playerid, x, y, z);
  823.         GetPlayerFacingAngle(playerid, a);
  824.         if(Car2[playerid] == 1) return DestroyVehicle(Car[playerid]);
  825.         Car2[playerid] = 1;
  826.         Car[playerid] = CreateVehicle(522, x, y, z+1, a, 0, 126, 600000);
  827.         PutPlayerInVehicle(playerid, Car[playerid], 0);
  828.        
  829.     }
  830.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins.");
  831.     return 1;
  832. }
  833.  
  834. CMD:acar(playerid, params[])
  835. {
  836.     if(aInfo[playerid][Admin] >= 2)
  837.     {
  838.         if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Ya estas en un vehiculo!");
  839.         new Float:x, Float:y, Float:z, Float:a;
  840.         GetPlayerPos(playerid, x, y, z);
  841.         GetPlayerFacingAngle(playerid, a);
  842.         if(Car2[playerid] == 1) return DestroyVehicle(Car[playerid]);
  843.         Car2[playerid] = 1;
  844.         Car[playerid] = CreateVehicle(541, x, y, z+1, a, 0, 126, 600000);
  845.         PutPlayerInVehicle(playerid, Car[playerid], 0);
  846.        
  847.     }
  848.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins.");
  849.     return 1;
  850. }
  851.  
  852. CMD:miauto(playerid, params[])
  853. {
  854.     if(aInfo[playerid][Admin] >= 2)
  855.     {
  856.         GetPlayerName(playerid, pname, sizeof(pname));
  857.         format(archivo, sizeof(archivo), Users, udb_encode(pname));
  858.        
  859.         if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Ya estas en un vehiculo!");
  860.         if(dini_Int(archivo, "Vehicle") == 0) return SendClientMessage(playerid, COLOR_RED, "No has guardado un vehiculo! Utiliza /gmiauto <vehicleid>");
  861.         new Float:x, Float:y, Float:z, Float:a;
  862.         GetPlayerPos(playerid, x, y, z);
  863.         GetPlayerFacingAngle(playerid, a);
  864.         if(Car2[playerid] == 1) return DestroyVehicle(Car[playerid]);
  865.         Car2[playerid] = 1;
  866.         Car[playerid] = CreateVehicle(dini_Int(archivo, "Vehicle"), x, y, z+1, a, 0, 126, 600000);
  867.         PutPlayerInVehicle(playerid, Car[playerid], 0);
  868.        
  869.     }
  870.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins.");
  871.     return 1;
  872. }
  873.  
  874. CMD:gmiauto(playerid, params[])
  875. {
  876.     if(aInfo[playerid][Admin] >= 2)
  877.     {
  878.         new vehicleid;
  879.         if(!sscanf(params, "i", vehicleid))
  880.         {
  881.             GetPlayerName(playerid, pname, sizeof(pname));
  882.             format(archivo, sizeof(archivo), Users, udb_encode(pname));
  883.             dini_IntSet(archivo, "Vehicle", vehicleid);
  884.             format(str, sizeof(str), "Has guardado como vehiculo el Vehiculo %d", vehicleid);
  885.             SendClientMessage(playerid, COLOR_YELLOW, str);
  886.            
  887.             new Float:x, Float:y, Float:z, Float:a;
  888.             GetPlayerPos(playerid, x, y, z);
  889.             GetPlayerFacingAngle(playerid, a);
  890.             if(Car2[playerid] == 1) return DestroyVehicle(Car[playerid]);
  891.             Car2[playerid] = 1;
  892.             Car[playerid] = CreateVehicle(dini_Int(archivo, "Vehicle"), x, y, z+1, a, 0, 126, 600000);
  893.             PutPlayerInVehicle(playerid, Car[playerid], 0);
  894.  
  895.         }
  896.         else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins.");
  897.     }
  898.     return 1;
  899. }
  900.  
  901. /*
  902.   //==========================================================================\\
  903.  //============================================================================\\
  904. ||==============================Freeze || Unfreeze!=============================||
  905.  \\============================================================================//
  906.   \\==========================================================================//
  907. */
  908.  
  909. CMD:freeze(playerid, params[])
  910. {
  911.     new playerid2, pname2[MAX_PLAYER_NAME];
  912.     if(aInfo[playerid][Admin] >= 2)
  913.     {
  914.         if(!sscanf(params, "r", playerid2))
  915.         {
  916.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  917.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  918.             GetPlayerName(playerid, pname, sizeof(pname));
  919.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  920.  
  921.             format(str, sizeof(str), "El jugador %s [ID: %d] fue congelado por el administrador %s.", pname2,  playerid2, pname);
  922.             if(aInfo[playerid2][Congelado] == 1) return SendClientMessage(playerid, COLOR_MEDBLUE, "Este jugador ya esta Congelado!");
  923.             aInfo[playerid2][Congelado] = 1;
  924.             SendClientMessageToAll(COLOR_YELLOW, str);
  925.             TogglePlayerControllable(playerid2, 0);
  926.            
  927.         }
  928.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /freeze <playerid>");
  929.     }
  930.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  931.     return 1;
  932. }
  933.  
  934. CMD:unfreeze(playerid, params[])
  935. {
  936.     new playerid2, pname2[MAX_PLAYER_NAME];
  937.     if(aInfo[playerid][Admin] >= 2)
  938.     {
  939.         if(!sscanf(params, "r", playerid2))
  940.         {
  941.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  942.             GetPlayerName(playerid, pname, sizeof(pname));
  943.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  944.  
  945.             format(str, sizeof(str), "El jugador %s [ID: %d] fue descongelado por el administrador %s.", pname2,  playerid2, pname);
  946.             if(aInfo[playerid2][Congelado] == 0) return SendClientMessage(playerid, COLOR_MEDBLUE, "Este jugador no esta Congelado!");
  947.             aInfo[playerid2][Congelado] = 0;
  948.             SendClientMessageToAll(COLOR_YELLOW, str);
  949.             TogglePlayerControllable(playerid2, 1);
  950.            
  951.         }
  952.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /unfreeze <playerid>");
  953.     }
  954.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  955.     return 1;
  956. }
  957.  
  958. /*
  959.   //==========================================================================\\
  960.  //============================================================================\\
  961. ||==================================Anuncios====================================||
  962.  \\============================================================================//
  963.   \\==========================================================================//
  964. */
  965.  
  966. CMD:ann(playerid, params[])
  967. {
  968.     if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Uso: /ann <texto>");
  969.     if(aInfo[playerid][Admin] >= 2)
  970.     {
  971.         format(str, sizeof(str), "%s", params);
  972.         GameTextForAll(str, 5000, 1);
  973.        
  974.     }
  975.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  976.     return 1;
  977. }
  978.  
  979. /*==============================================================================
  980. ================================================================================
  981. ============================rAdmin Admin Nivel 3================================
  982. ================================================================================
  983. ==============================================================================*/
  984.  
  985. /*
  986.   //==========================================================================\\
  987.  //============================================================================\\
  988. ||============================Sethealth || Setarmour============================||
  989.  \\============================================================================//
  990.   \\==========================================================================//
  991. */
  992.  
  993. CMD:sethealth(playerid, params[])
  994. {
  995.     new playerid2, pname2[MAX_PLAYER_NAME], health;
  996.     if(aInfo[playerid][Admin] >= 3)
  997.     {
  998.         if(!sscanf(params, "ri", playerid2, health))
  999.         {
  1000.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1001.             GetPlayerName(playerid, pname, sizeof(pname));
  1002.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1003.            
  1004.             SetPlayerHealth(playerid2, health);
  1005.             format(str, sizeof(str), "El Administrador %s [ID: %d] cambio tu vida a %d.", pname,  playerid, health);
  1006.             SendClientMessage(playerid2, COLOR_YELLOW, str);
  1007.            
  1008.         }
  1009.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /sethealth <playerid> <vida>");
  1010.     }
  1011.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1012.     return 1;
  1013. }
  1014.  
  1015. CMD:setarmour(playerid, params[])
  1016. {
  1017.     new playerid2, pname2[MAX_PLAYER_NAME], armour;
  1018.     if(aInfo[playerid][Admin] >= 3)
  1019.     {
  1020.         if(!sscanf(params, "ri", playerid2, armour))
  1021.         {
  1022.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1023.             GetPlayerName(playerid, pname, sizeof(pname));
  1024.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1025.            
  1026.             SetPlayerArmour(playerid2, armour);
  1027.             format(str, sizeof(str), "El Administrador %s [ID: %d] cambio tu Armadura a %d.", pname,  playerid, armour);
  1028.             SendClientMessage(playerid2, COLOR_YELLOW, str);
  1029.            
  1030.         }
  1031.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /setarmour <playerid> <chaleco>");
  1032.     }
  1033.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1034.     return 1;
  1035. }
  1036.  
  1037. /*
  1038.   //==========================================================================\\
  1039.  //============================================================================\\
  1040. ||=====================================Spawn====================================||
  1041.  \\============================================================================//
  1042.   \\==========================================================================//
  1043. */
  1044.  
  1045. CMD:spawn(playerid, params[])
  1046. {
  1047.     new playerid2, pname2[MAX_PLAYER_NAME];
  1048.     if(aInfo[playerid][Admin] >= 3)
  1049.     {
  1050.         if(!sscanf(params, "r", playerid2))
  1051.         {
  1052.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1053.             GetPlayerName(playerid, pname, sizeof(pname));
  1054.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1055.            
  1056.             format(str, sizeof(str), "El jugador %s [ID: %d] fue spawneado por el administrador %s.", pname2,  playerid2, pname);
  1057.             SendClientMessageToAll(COLOR_YELLOW, str);
  1058.             SpawnPlayer(playerid2);
  1059.         }
  1060.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /spawn <playerid>");
  1061.     }
  1062.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1063.     return 1;
  1064. }
  1065.  
  1066. /*
  1067.   //==========================================================================\\
  1068.  //============================================================================\\
  1069. ||=====================================Akill====================================||
  1070.  \\============================================================================//
  1071.   \\==========================================================================//
  1072. */
  1073.  
  1074. CMD:akill(playerid, params[])
  1075. {
  1076.     new playerid2, pname2[MAX_PLAYER_NAME];
  1077.     if(aInfo[playerid][Admin] >= 3)
  1078.     {
  1079.         if(!sscanf(params, "r", playerid2))
  1080.         {
  1081.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1082.             GetPlayerName(playerid, pname, sizeof(pname));
  1083.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1084.  
  1085.             format(str, sizeof(str), "El jugador %s [ID: %d] fue asesinado por el administrador %s.", pname2,  playerid2, pname);
  1086.             SendClientMessageToAll(COLOR_YELLOW, str);
  1087.             SetPlayerHealth(playerid2, 0);
  1088.             SetPlayerArmour(playerid2, 0);
  1089.         }
  1090.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /akill <playerid>");
  1091.     }
  1092.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1093.     return 1;
  1094. }
  1095.  
  1096. /*==============================================================================
  1097. ================================================================================
  1098. ============================rAdmin Admin Nivel 4================================
  1099. ================================================================================
  1100. ==============================================================================*/
  1101.  
  1102. /*
  1103.   //==========================================================================\\
  1104.  //============================================================================\\
  1105. ||======================================Ban=====================================||
  1106.  \\============================================================================//
  1107.   \\==========================================================================//
  1108. */
  1109.  
  1110. CMD:ban(playerid, params[])
  1111. {
  1112.     new playerid2, pname2[MAX_PLAYER_NAME], reason[128];
  1113.     if(aInfo[playerid][Admin] >= 4)
  1114.     {
  1115.         if(!sscanf(params, "rs", playerid2, reason))
  1116.         {
  1117.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1118.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  1119.             GetPlayerName(playerid, pname, sizeof(pname));
  1120.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1121.  
  1122.             format(str, sizeof(str), "El jugador %s [ID: %d] fue baneado por el administrador %s ~ Razon: %s", pname2,  playerid2, pname, reason);
  1123.             SendClientMessageToAll(COLOR_YELLOW, str);
  1124.             aInfo[playerid2][Baneado] = 1;
  1125.             BanEx(playerid2, reason);
  1126.         }
  1127.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /ban <playerid> <razon>");
  1128.     }
  1129.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1130.     return 1;
  1131. }
  1132.  
  1133. /*
  1134.   //==========================================================================\\
  1135.  //============================================================================\\
  1136. ||==================================ClearChat===================================||
  1137.  \\============================================================================//
  1138.   \\==========================================================================//
  1139. */
  1140.  
  1141. CMD:clearchat(playerid, params[])
  1142. {
  1143.     if(aInfo[playerid][Admin] >= 4)
  1144.     {
  1145.         GetPlayerName(playerid, pname, sizeof(pname));
  1146.         for(new i = 0; i < 100; i++)
  1147.         {
  1148.             format(str, sizeof(str), "  ");
  1149.             SendClientMessageToAll(COLOR_LIGHTGREEN, str);
  1150.         }
  1151.         format(str, sizeof(str), "El Administrador %s [ID: %d] limpio el chat..", pname,  playerid);
  1152.         SendClientMessageToAll(COLOR_YELLOW, str);
  1153.     }
  1154.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1155.     return 1;
  1156. }
  1157.  
  1158. /*
  1159.   //==========================================================================\\
  1160.  //============================================================================\\
  1161. ||==================================Resp Cars===================================||
  1162.  \\============================================================================//
  1163.   \\==========================================================================//
  1164. */
  1165.  
  1166. CMD:rcars(playerid, params[])
  1167. {
  1168.     if(aInfo[playerid][Admin] >= 4 || IsPlayerAdmin(playerid))
  1169.     {
  1170.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "Respawneaste todos los vehiculos desocupados!");
  1171.         GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Vehiculos ~g~Respawneados!", 3000,3);
  1172.  
  1173.         for(new cars=0; cars<MAX_VEHICLES; cars++)
  1174.         {
  1175.             if(!VehicleOccupied(cars))
  1176.             {
  1177.                 SetVehicleToRespawn(cars);
  1178.             }
  1179.         }
  1180.     }
  1181.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins");
  1182.     return 1;
  1183. }
  1184.  
  1185. /*==============================================================================
  1186. ================================================================================
  1187. ============================rAdmin Admin Nivel 5================================
  1188. ================================================================================
  1189. ==============================================================================*/
  1190.  
  1191. /*
  1192.   //==========================================================================\\
  1193.  //============================================================================\\
  1194. ||===================================SetLevel===================================||
  1195.  \\============================================================================//
  1196.   \\==========================================================================//
  1197. */
  1198.  
  1199. CMD:setlevel(playerid, params[])
  1200. {
  1201.     new playerid2, pname2[MAX_PLAYER_NAME], admlevel;
  1202.     if(aInfo[playerid][Admin] >= MaxLevel || IsPlayerAdmin(playerid))
  1203.     {
  1204.         if(!sscanf(params, "rd", playerid2, admlevel))
  1205.         {
  1206.             if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_RED, "ID Incorrecto.");
  1207.             if(aInfo[playerid2][Admin] > aInfo[playerid][Admin]) return SendClientMessage(playerid, COLOR_RED, "Imposible afectar a un admin de mayor nivel!");
  1208.             GetPlayerName(playerid, pname, sizeof(pname));
  1209.             GetPlayerName(playerid2, pname2, sizeof(pname2));
  1210.  
  1211.             aInfo[playerid2][Admin] = admlevel;
  1212.             format(str, sizeof(str), "El Administrador %s [ID: %d] te dio nivel %d.", pname,  playerid, admlevel);
  1213.             SendClientMessage(playerid2, COLOR_YELLOW, str);
  1214.         }
  1215.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /setlevel <playerid> <nivel>");
  1216.     }
  1217.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins del Maximo Nivel.");
  1218.     return 1;
  1219. }
  1220.  
  1221. /*
  1222.   //==========================================================================\\
  1223.  //============================================================================\\
  1224. ||==================================SvRestart===================================||
  1225.  \\============================================================================//
  1226.   \\==========================================================================//
  1227. */
  1228.  
  1229. CMD:gmx(playerid, params[])
  1230. {
  1231.     if(aInfo[playerid][Admin] == MaxLevel || IsPlayerAdmin(playerid))
  1232.     {
  1233.         SendClientMessage(playerid, COLOR_YELLOW, "El servidor sera reiniciado en 5 segundos!");
  1234.         SetTimer("GMR", 5000, false);
  1235.     }
  1236.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins del Maximo Nivel.");
  1237.     return 1;
  1238. }
  1239.  
  1240. /*
  1241.   //==========================================================================\\
  1242.  //============================================================================\\
  1243. ||===================================SvPasswd===================================||
  1244.  \\============================================================================//
  1245.   \\==========================================================================//
  1246. */
  1247.  
  1248. CMD:passwd(playerid, params[])
  1249. {
  1250.     if(aInfo[playerid][Admin] == MaxLevel || IsPlayerAdmin(playerid))
  1251.     {
  1252.         new passwd[12];
  1253.         if(!sscanf(params, "s", passwd))
  1254.         {
  1255.             if(strlen(passwd) < 4 || strlen(passwd) > 12) return SendClientMessage(playerid, COLOR_RED, "La password debe tener entre 4 y 12 caracteres!");
  1256.             format(str, sizeof(str), "La password del servidor ahora es %s!", passwd);
  1257.             SendClientMessage(playerid, COLOR_YELLOW, str);
  1258.             format(str, sizeof(str), "password %s", passwd);
  1259.             SendRconCommand(str);
  1260.         }
  1261.         else return SendClientMessage(playerid, COLOR_RED, "Uso: /passwd <password>");
  1262.     }
  1263.     else return SendClientMessage(playerid, COLOR_RED, "Este comando es solo para Admins del Maximo Nivel.");
  1264.     return 1;
  1265. }
  1266.  
  1267. /*==============================================================================
  1268. ================================================================================
  1269. =================================OnPlayerText!==================================
  1270. ================================================================================
  1271. ==============================================================================*/
  1272.  
  1273. public OnPlayerText(playerid, text[])
  1274. {
  1275.     new string[128];
  1276.     GetPlayerName(playerid, pname, sizeof(pname));
  1277.     format(string, sizeof(string), "%s [%d]:{FFFFFF} %s", pname, playerid, text);
  1278.    
  1279.     if(BuscarIPs(text))
  1280.     {
  1281.         format(str, sizeof(str), "El jugador %s [ID: %d] intento spamear la IP %s", pname, playerid, text);
  1282.         MessageToAdmins(COLOR_LIGHTGREEN, str);
  1283.         SendClientMessage(playerid, COLOR_GREEN, "Se ha detectado spam en su mensaje. Usted ha sido kickeado!");
  1284.         SendClientMessage(playerid, COLOR_GREEN, "La IP ha sido enviada a los admins para que la investiguen!");
  1285.        
  1286.         format(str, sizeof(str), "El usuario %s [ID: %d] intento hacer spam y fue kickeado!", pname, playerid);
  1287.         SendClientMessageToAll(COLOR_MEDBLUE, str);
  1288.         Kick(playerid);
  1289.         return 0;
  1290.     }
  1291.            
  1292.     if(aInfo[playerid][Muteado] == 1)
  1293.     {
  1294.         aInfo[playerid][MuteWarns] ++;
  1295.         if(aInfo[playerid][MuteWarns] < MAX_MUTEWARNS)
  1296.         {
  1297.             format(str, sizeof(str), "Has sido warneado por intentar hablar! Warnings: %d/%d", aInfo[playerid][MuteWarns], MAX_MUTEWARNS);
  1298.             SendClientMessage(playerid, COLOR_RED, str);
  1299.         }
  1300.         if(aInfo[playerid][MuteWarns] >= MAX_MUTEWARNS)
  1301.         {
  1302.             format(str, sizeof(str), "Has sido kickeado por intentar hablar! Warnings: %d/%d", aInfo[playerid][MuteWarns], MAX_MUTEWARNS);
  1303.             SendClientMessage(playerid, COLOR_RED, str);
  1304.             Kick(playerid);
  1305.         }
  1306.         return 0;
  1307.     }
  1308.    
  1309.     if(text[0] == '#' && aInfo[playerid][Admin] > 0)
  1310.     {
  1311.         format(str, sizeof(str), "*%s: %s", pname, text[1]);
  1312.         printf("%s", text[0]);
  1313.         for(new i = 0; i < MAX_PLAYERS; i++)
  1314.         {
  1315.             if(IsPlayerConnected(i))
  1316.             {
  1317.                 if(aInfo[i][Admin] != 0)
  1318.                 MessageToAdmins(COLOR_LIGHTGREEN, str);
  1319.             }
  1320.         }
  1321.     }
  1322.     else
  1323.     {
  1324.         SendClientMessageToAll(GetPlayerColor(playerid), string);
  1325.     }
  1326.    
  1327.     return 0;
  1328. }
  1329.  
  1330. /*==============================================================================
  1331. ================================================================================
  1332. =============================OnPlayerClickPlayer================================
  1333. ====================================System======================================
  1334. ================================================================================
  1335. ==============================================================================*/
  1336.  
  1337. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1338. {
  1339.     if(Clicked == 1) return SendClientMessage(playerid, COLOR_RED, "El menú ya esta siendo usado!");
  1340.     Clicked = 1;
  1341.     cpid = clickedplayerid;
  1342.     if(aInfo[playerid][Admin] == 0 || aInfo[playerid][Admin] < aInfo[cpid][Admin]) return 0;
  1343.     ShowPlayerDialog(playerid, Click, DIALOG_STYLE_LIST, "rAdmin! [Player Menu]", "Freeze | Unfreeze Player\nMute | Unmute Player\nWarn Player\nKick Player\nBan Player\nSlap Player\nSpawn Player\nKill Player", "Aceptar", "Cancelar");
  1344.     return 1;
  1345. }
  1346.  
  1347. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1348. {
  1349.     switch(dialogid) // Lookup the dialogid
  1350.     {
  1351.         case Click:
  1352.         {
  1353.             if(response == 0) return 0;
  1354.             switch(listitem) // This is far more efficient than using an if-elseif-else structure
  1355.             {
  1356.                 case 0: // Listitems start with 0, not 1
  1357.                 {
  1358.                     if(aInfo[playerid][Admin] < 2) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 2");
  1359.                     if(aInfo[cpid][Congelado] == 1)
  1360.                     {
  1361.                         aInfo[cpid][Congelado] = 0;
  1362.                         SendClientMessage(playerid, COLOR_YELLOW, "Has descongelado a este jugador.");
  1363.                         SendClientMessage(cpid, COLOR_RED, "Has sido descongelado desde el Admin Panel!");
  1364.                         TogglePlayerControllable(cpid, 1);
  1365.                         Clicked = 0;
  1366.                     }
  1367.                     else
  1368.                     {
  1369.                         aInfo[cpid][Congelado] = 1;
  1370.                         SendClientMessage(playerid, COLOR_YELLOW, "Has congelado a este jugador.");
  1371.                         SendClientMessage(cpid, COLOR_RED, "Has sido congelado desde el Admin Panel!");
  1372.                         TogglePlayerControllable(cpid, 0);
  1373.                         Clicked = 0;
  1374.                     }
  1375.                 }
  1376.                 case 1:
  1377.                 {
  1378.                     if(aInfo[playerid][Admin] < 2) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 2");
  1379.                     if(aInfo[cpid][Muteado] == 1)
  1380.                     {
  1381.                         aInfo[cpid][Muteado] = 0;
  1382.                         SendClientMessage(playerid, COLOR_YELLOW, "Has desmuteado a este jugador.");
  1383.                         SendClientMessage(cpid, COLOR_RED, "Has sido desmuteado desde el Admin Panel!");
  1384.                         Clicked = 0;
  1385.                     }
  1386.                     else
  1387.                     {
  1388.                         aInfo[cpid][Muteado] = 1;
  1389.                         SendClientMessage(playerid, COLOR_YELLOW, "Has muteado a este jugador.");
  1390.                         SendClientMessage(cpid, COLOR_RED, "Has sido muteado desde el Admin Panel!");
  1391.                         Clicked = 0;
  1392.                     }
  1393.                 }
  1394.                 case 2:
  1395.                 {
  1396.                     if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 1");
  1397.                     aInfo[cpid][Warnings] ++;
  1398.                     new pname2[MAX_PLAYER_NAME], string[128];
  1399.  
  1400.                     GetPlayerName(playerid, pname, sizeof(pname));
  1401.                     GetPlayerName(cpid, pname2, sizeof(pname2));
  1402.  
  1403.                     if(aInfo[cpid][Warnings] < MAX_WARNINGS)
  1404.                     {
  1405.                         format(string, sizeof(string), "El usuario %s [ID: %d] fue warneado por el Administrador %s. (Warnings: %d/%d) -|", pname2, cpid, pname, aInfo[cpid][Warnings], MAX_WARNINGS);
  1406.                         SendClientMessageToAll(COLOR_YELLOW, string);
  1407.                         Clicked = 0;
  1408.                     }
  1409.                     else
  1410.                     {
  1411.                         format(string, sizeof(string), "El usuario %s [ID: %d] fue kickeado por el Administrador %s. (Warnings: %d/%d)", pname2, cpid, pname, aInfo[cpid][Warnings], MAX_WARNINGS);
  1412.                         SendClientMessageToAll(COLOR_YELLOW, string);
  1413.                         Kick(cpid);
  1414.                         aInfo[cpid][Warnings] = 0;
  1415.                         Clicked = 0;
  1416.                     }
  1417.                 }
  1418.                 case 3:
  1419.                 {
  1420.                     if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 1");
  1421.                     new pname2[MAX_PLAYER_NAME];
  1422.                     GetPlayerName(playerid, pname, sizeof(pname));
  1423.                     GetPlayerName(cpid, pname2, sizeof(pname2));
  1424.  
  1425.                     format(str, sizeof(str), "El jugador %s [ID: %d] fue kickeado por el administrador %s.", pname2,  cpid, pname);
  1426.                     SendClientMessageToAll(COLOR_YELLOW, str);
  1427.                     Kick(cpid);
  1428.                     Clicked = 0;
  1429.                 }
  1430.                 case 4:
  1431.                 {
  1432.                     if(aInfo[playerid][Admin] < 4) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 4");
  1433.                     new pname2[MAX_PLAYER_NAME];
  1434.                     GetPlayerName(playerid, pname, sizeof(pname));
  1435.                     GetPlayerName(cpid, pname2, sizeof(pname2));
  1436.  
  1437.                     format(str, sizeof(str), "El jugador %s [ID: %d] fue baneado por el administrador %s.", pname2,  cpid, pname);
  1438.                     SendClientMessageToAll(COLOR_YELLOW, str);
  1439.                     BanEx(cpid, "Baneado desde el Admin Panel");
  1440.                     Clicked = 0;
  1441.                 }
  1442.                 case 5:
  1443.                 {
  1444.                     if(aInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 1");
  1445.                     GetPlayerName(playerid, pname, sizeof(pname));
  1446.                     new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS];
  1447.  
  1448.                     GetPlayerPos(cpid, X[cpid], Y[cpid], Z[cpid]);
  1449.                     SetPlayerPos(cpid, X[cpid], Y[cpid], Z[cpid]+10);
  1450.                     new Float:health;
  1451.                     GetPlayerHealth(cpid, health);
  1452.                     SetPlayerHealth(cpid, health-10);
  1453.                     format(str, sizeof(str), "El Administrador %s [ID: %d] te ha slapeado!", pname, playerid);
  1454.                     SendClientMessage(cpid, COLOR_YELLOW, str);
  1455.                     Clicked = 0;
  1456.                 }
  1457.                 case 6:
  1458.                 {
  1459.                     if(aInfo[playerid][Admin] < 3) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 3");
  1460.                     new pname2[MAX_PLAYER_NAME];
  1461.                     GetPlayerName(playerid, pname, sizeof(pname));
  1462.                     GetPlayerName(cpid, pname2, sizeof(pname2));
  1463.  
  1464.                     format(str, sizeof(str), "El jugador %s [ID: %d] fue spawneado por el administrador %s.", pname2,  cpid, pname);
  1465.                     SendClientMessageToAll(COLOR_YELLOW, str);
  1466.                     SpawnPlayer(cpid);
  1467.                     Clicked = 0;
  1468.                 }
  1469.                 case 7:
  1470.                 {
  1471.                     if(aInfo[playerid][Admin] < 3) return SendClientMessage(playerid, COLOR_RED, "Esta accion es solo para Admins Nivel 3");
  1472.                     new pname2[MAX_PLAYER_NAME];
  1473.                     GetPlayerName(playerid, pname, sizeof(pname));
  1474.                     GetPlayerName(cpid, pname2, sizeof(pname2));
  1475.  
  1476.                     format(str, sizeof(str), "El jugador %s [ID: %d] fue asesinado por el administrador %s.", pname2,  cpid, pname);
  1477.                     SendClientMessageToAll(COLOR_YELLOW, str);
  1478.                     SetPlayerHealth(cpid, 0);
  1479.                     SetPlayerArmour(cpid, 0);
  1480.                     Clicked = 0;
  1481.                 }
  1482.             }
  1483.         }
  1484.     }
  1485.     return 0;
  1486. }
  1487.  
  1488. /*==============================================================================
  1489. ================================================================================
  1490. =====================================Otros======================================
  1491. ================================================================================
  1492. ==============================================================================*/
  1493.  
  1494. public SpawnKick(playerid)
  1495. {
  1496.     if(aInfo[playerid][Registrado] == 0 || aInfo[playerid][Logueado] == 0)
  1497.     {
  1498.         SendClientMessage(playerid, COLOR_RED, "[rAdmin] Fuiste kickeado por no registrarte/loguearte en los primeros 60 segundos!");
  1499.         Kick(playerid);
  1500.     }
  1501.     return 1;
  1502. }
  1503.  
  1504. public MessageToAdmins(color, const string[])
  1505. {
  1506.     for(new i = 0; i < MAX_PLAYERS; i++)
  1507.     {
  1508.         if(IsPlayerConnected(i) == 1)
  1509.         {
  1510.             if(aInfo[i][Admin] != 0)
  1511.             {
  1512.                 SendClientMessage(i, color, string);
  1513.             }
  1514.         }
  1515.     }
  1516.     return 1;
  1517. }
  1518.  
  1519. public VehicleOccupied(vehicleid)
  1520. {
  1521.     for(new i=0;i<MAX_PLAYERS;i++)
  1522.     {
  1523.         if(IsPlayerInVehicle(i,vehicleid)) return 1;
  1524.     }
  1525.     return 0;
  1526. }
  1527.  
  1528. public GMR()
  1529. {
  1530.     SendRconCommand("gmx");
  1531. }
  1532.  
  1533. //===================================================================ANTI-SPAM!!
  1534. //===================================================================ANTI-SPAM!!
  1535. //===================================================================ANTI-SPAM!!
  1536.  
  1537. forward split(const strsrc[], strdest[][], delimiter);
  1538.  
  1539. stock BuscarIPs(mensaje[])
  1540. {
  1541.     new encontrados;
  1542.     new Parte[30][64];
  1543.     split(mensaje, Parte, '.');
  1544.     for(new i = 1; i < 5; i++)
  1545.     {
  1546.         if(IsNumeric(Parte[i]))
  1547.         {
  1548.             encontrados ++;
  1549.         }
  1550.     }
  1551.     if(encontrados >= 2)
  1552.     {
  1553.         return 1;
  1554.     }
  1555.     return 0;
  1556. }
  1557.  
  1558. stock IsNumeric(const string[])
  1559. {
  1560.   new length=strlen(string);
  1561.   if (length==0) return false;
  1562.   for (new i = 0; i < length; i++)
  1563.     {
  1564.       if (
  1565.             (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
  1566.              || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
  1567.              || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
  1568.          ) return false;
  1569.     }
  1570.   if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  1571.   return true;
  1572. }
  1573.  
  1574. public split(const strsrc[], strdest[][], delimiter)
  1575. {
  1576.     new i, li;
  1577.     new aNum;
  1578.     new len;
  1579.     while(i <= strlen(strsrc))
  1580.     {
  1581.         if(strsrc[i]==delimiter || i==strlen(strsrc))
  1582.         {
  1583.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  1584.             strdest[aNum][len] = 0;
  1585.             li = i+1;
  1586.             aNum++;
  1587.         }
  1588.         i++;
  1589.     }
  1590.     return 1;
  1591. }
  1592. //===================================================================ANTI-SPAM!!
  1593. //===================================================================ANTI-SPAM!!
  1594. //===================================================================ANTI-SPAM!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement