whiplk

[FilterScript] - AdminSt, by Jeffrey_Hatrix

May 14th, 2012
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 35.90 KB | None | 0 0
  1. /*******************************************************************************
  2. |                                                                              |
  3. |                        FilterScript by Jeffrey_Hatrix                        |
  4. |                                                                              |
  5. *******************************************************************************/
  6. // Diretivas ===================================================================
  7.  
  8. #include <a_samp>
  9. #include <ZCMD>
  10. #include <sscanf2>
  11. #include <SII>
  12.  
  13. #define DIALOG_REGISTER 90
  14. #define DIALOG_LOGIN 91
  15. // Inicializadores =============================================================
  16.  
  17. enum systemAdmins
  18. {
  19.     bool:IsAdmin,
  20.     AdminLvl
  21. };
  22. static admin_db[MAX_PLAYERS][systemAdmins];
  23. new Float:x, Float:y, Float:z, Float:a;
  24.  
  25. enum DATA
  26. {
  27.     bool:IsConnected
  28. };
  29. static players_db[MAX_PLAYERS][DATA];
  30.  
  31. enum carIdCreated
  32. {
  33.     bool:newCar,
  34.     bool:oldCar,
  35.     ModelOld,
  36.     IdUpdate,
  37.     color1,
  38.     color2
  39. };
  40. static cars_db[MAX_PLAYERS][carIdCreated];
  41. static bool:work_db[MAX_PLAYERS];
  42. new bool:Aberto[MAX_PLAYERS], getId;
  43. new bool:CallOff[MAX_PLAYERS];
  44. new strGlobal[0x80];
  45. new bool:parBlock[MAX_PLAYERS];
  46. new bool:tv_on[MAX_PLAYERS];
  47.  
  48.  
  49. // Callbacks ===================================================================
  50.  
  51. public OnFilterScriptInit()
  52. {
  53.     print("\nAdminSt Jeffrey FilterScript loaded.\n");
  54.     print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                      Jeffrey_Hatrix EfficientPawnProgrammer.\n\n");
  55.     print("                                    Commands:");
  56.     print("                   ---------------------------------------------");
  57.     print("                   |                                           |");
  58.     print("                   |    /GMX, /repararid, /respawn, /carro     |");
  59.     print("                   |    /destruir, /carroantigo, /mudarcor     |");
  60.     print("                   |    /ir, /trazer, /trazertodos, /matar     |");
  61.     print("                   |    /skin, /darvida, /darcolete, /dararma  |");
  62.     print("                   |    /retirararmas, /congelar, /descongelar |");
  63.     print("                   |    /ircarro, /trazercarro, /ls, /lsa      |");
  64.     print("                   |    /sf, /sfa, /lv, /lva, /tapa, /daradmin |");
  65.     print("                   |    /dartemp, /admins, /ban, /banoff       |");
  66.     print("                   |    /banip, /kick, /kickoff, /desban       |");
  67.     print("                   |    /verip, /relatorio, /av, /jogar        |");
  68.     print("                   |    /z, /tv, /a, /shutup, /par, /blockpar  |");
  69.     print("                   |                                           |");
  70.     print("                   ---------------------------------------------\n\n\n");
  71.     return 0x01;
  72. }
  73.  
  74. public OnPlayerConnect(playerid)
  75. {
  76.     admin_db[playerid][IsAdmin] = false;
  77.     admin_db[playerid][AdminLvl] = 0x00;
  78.     players_db[playerid][IsConnected] = false;
  79.     CarregarAdmins(playerid);
  80.     CarregarBanidos(playerid);
  81.     CarregarIpsBanidos(playerid);
  82.     FUP(playerid);
  83.     return 0x00;
  84. }
  85.  
  86. public OnPlayerText(playerid, text[])
  87. {
  88.     if(CallOff[playerid])
  89.         return SendClientMessage(playerid, -1, "Você ainda não pode falar..."), 0x00;
  90.     else if(!CallOff[playerid])
  91.         return 0x01;
  92.  
  93.     return 0x00;
  94. }
  95.  
  96. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  97. {
  98.     switch(dialogid)
  99.     {
  100.         case 0x02:
  101.         {
  102.             switch(response)
  103.             {
  104.                 case 0x00..0x01:
  105.                 {
  106.                     Kick(playerid);
  107.                     return 0x01;
  108.                 }
  109.             }
  110.         }
  111.         case 0x03:
  112.         {
  113.             switch(response)
  114.             {
  115.                 case 0x01:
  116.                 {
  117.                     getId = playerid;
  118.                     Aberto[getId] = true;
  119.                     format(strGlobal, 0x80, "ID:[%d] Nick:[%s] Relatório: %s", playerid, Nick(playerid), inputtext);
  120.                     for(new iLoop; iLoop < MAX_PLAYERS; iLoop++)
  121.                     {
  122.                         if(admin_db[iLoop][IsAdmin])
  123.                         {
  124.                             ShowPlayerDialog(iLoop, 4, DIALOG_STYLE_MSGBOX, "Relatório", strGlobal, "Responder", "Fechar");
  125.                         }
  126.                     }
  127.                     return 0x01;
  128.                 }
  129.             }
  130.         }
  131.         case 0x04:
  132.         {
  133.             switch(response)
  134.             {
  135.                 case 0x00:
  136.                 {
  137.                     Aberto[getId] = false;
  138.                     return 0x01;
  139.                 }
  140.                 case 0x01:
  141.                 {
  142.                     ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Resposta", "Digite a sua resposta ao relato anterior", "Enviar", "");
  143.                     return 0x01;
  144.                 }
  145.             }
  146.         }
  147.         case 0x05:
  148.         {
  149.             switch(response)
  150.             {
  151.                 case 0x01:
  152.                 {
  153.                     format(strGlobal, 0x80, "Admin: %s respondeu: %s", Nick(playerid), inputtext);
  154.                     ShowPlayerDialog(getId, 6, DIALOG_STYLE_MSGBOX, "Resposta", strGlobal, "Ok", "");
  155.                     Aberto[getId] = false;
  156.                     return 0x01;
  157.                 }
  158.             }
  159.         }
  160.         case 0x07:
  161.         {
  162.             switch(response)
  163.             {
  164.                 case 0x00..0x01:
  165.                 {
  166.                     Kick(playerid);
  167.                     return 0x01;
  168.                 }
  169.             }
  170.         }
  171.         case DIALOG_REGISTER:
  172.         {
  173.             switch(response)
  174.             {
  175.                 case 0x00..0x01:
  176.                 {
  177.                     if(strlen(inputtext) > 15 || strlen(inputtext) < 4)
  178.                         return SendClientMessage(playerid, -1, "Caracteres acima de 4 e abaixo de 15."), FUP(playerid);
  179.  
  180.                     Registrar(playerid, inputtext);
  181.                     return 0x01;
  182.                 }
  183.             }
  184.         }
  185.         case DIALOG_LOGIN:
  186.         {
  187.             switch(response)
  188.             {
  189.                 case 0x00.. 0x01:
  190.                 {
  191.                     if(strlen(inputtext) > 15 || strlen(inputtext) < 4)
  192.                         return SendClientMessage(playerid, -1, "Caracteres acima de 4 e abaixo de 15."), FUP(playerid);
  193.  
  194.                     Logar(playerid, inputtext);
  195.                     return 0x01;
  196.                 }
  197.             }
  198.         }
  199.     }
  200.     return 0x00;
  201. }
  202.  
  203. // Comandos ====================================================================
  204.  
  205. CMD:gmx(playerid)
  206. {
  207.     if(!admin_db[playerid][IsAdmin])
  208.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  209.  
  210.     SendClientMessageToAll(-1, "GMX, aguardem!");
  211.     SendRconCommand("gmx");
  212.     return 0x01;
  213. }
  214.  
  215. CMD:repararid(playerid, params[])
  216. {
  217.     if(IsPlayerInAnyVehicle(playerid))
  218.     {
  219.         RepairVehicle(GetPlayerVehicleID(playerid));
  220.         SendClientMessage(playerid, -1, "Carro reparado!");
  221.         return 0x01;
  222.     }
  223.     else
  224.     {
  225.         new carId;
  226.         if(sscanf(params, "i", carId))
  227.             return SendClientMessage(playerid, -1, "Comando: /repararid [id]");
  228.  
  229.         RepairVehicle(carId);
  230.         SendClientMessage(playerid, -1, "Carro reparado!");
  231.     }
  232.     return 0x01;
  233. }
  234.  
  235. CMD:respawn(playerid)
  236. {
  237.     RespawnVehInutils();
  238.     SendClientMessage(playerid, -1, "Carros respawnados!");
  239.     return 0x01;
  240. }
  241.  
  242. CMD:carro(playerid, params[])
  243. {
  244.     if(cars_db[playerid][oldCar])
  245.         return SendClientMessage(playerid, -1, "Você já tem um veículo criado, /destruir, para poder criar outro.");
  246.  
  247.     if(!admin_db[playerid][IsAdmin])
  248.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  249.        
  250.     new carId, cor1, cor2;
  251.     if(sscanf(params, "iii", carId, cor1, cor2))
  252.         return SendClientMessage(playerid, -1, "Comando: /carro [id][cor1][cor2]");
  253.        
  254.     GetPlayerPos(playerid, x, y, z);
  255.     GetPlayerFacingAngle(playerid, a);
  256.     cars_db[playerid][color1] = cor1;
  257.     cars_db[playerid][color2] = cor2;
  258.     cars_db[playerid][oldCar] = true;
  259.     cars_db[playerid][ModelOld] = carId;
  260.     cars_db[playerid][IdUpdate] = CreateVehicle(carId, x, y, z, a, cor1, cor2, 99999999);
  261.     PutPlayerInVehicle(playerid, cars_db[playerid][IdUpdate], 0);
  262.     SendClientMessage(playerid, -1, "Você criou um carro novo, /destruir para destrui-lo");
  263.     return 0x01;
  264. }
  265.  
  266. CMD:destruir(playerid)
  267. {
  268.     if(!cars_db[playerid][oldCar])
  269.         return SendClientMessage(playerid, -1, "Você não criou nenhum veículo, /carro, para criar um...");
  270.  
  271.     if(!admin_db[playerid][IsAdmin])
  272.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  273.        
  274.     DestroyVehicle(cars_db[playerid][IdUpdate]);
  275.     cars_db[playerid][oldCar] = false;
  276.     SendClientMessage(playerid, -1, "Você destruiu seu carro antigo, /carro para criar um novo carro.");
  277.     return 0x01;
  278. }
  279.  
  280. CMD:carroantigo(playerid)
  281. {
  282.     if(!admin_db[playerid][IsAdmin])
  283.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  284.        
  285.     if(cars_db[playerid][oldCar])
  286.         return SendClientMessage(playerid, -1, "Você já ressucitou seu carro antigo, ou já tem um carro criado, /destruir antes de tudo.");
  287.  
  288.     GetPlayerPos(playerid, x, y, z);
  289.     GetPlayerFacingAngle(playerid, a);
  290.     cars_db[playerid][IdUpdate] = CreateVehicle(cars_db[playerid][ModelOld], x, y, z, a, cars_db[playerid][color1], cars_db[playerid][color2], 9999999);
  291.     cars_db[playerid][oldCar] = true;
  292.     PutPlayerInVehicle(playerid, cars_db[playerid][IdUpdate], 0);
  293.     SendClientMessage(playerid, -1, "Você ressucitou um carro antigo, /destruir para destrui-lo");
  294.     return 0x01;
  295. }
  296.  
  297. CMD:mudarcor(playerid, params[])
  298. {
  299.     if(!admin_db[playerid][IsAdmin])
  300.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  301.        
  302.     new carId, cor1, cor2;
  303.     if(IsPlayerInAnyVehicle(playerid))
  304.     {
  305.         if(sscanf(params, "ii", cor1, cor2))
  306.             return SendClientMessage(playerid, -1, "Comando: /mudarcor [cor1][cor2]");
  307.            
  308.         ChangeVehicleColor(GetPlayerVehicleID(playerid), cor1, cor2);
  309.     }
  310.     else
  311.     if(sscanf(params, "iii", carId, cor1, cor2))
  312.         return SendClientMessage(playerid, -1, "Comando: /mudarcor [id][cor1][cor2]");
  313.  
  314.     cars_db[playerid][color1] = cor1;
  315.     cars_db[playerid][color2] = cor2;
  316.     ChangeVehicleColor(carId, cor1, cor2);
  317.     SendClientMessage(playerid, -1, "Você mudou as cores de seu carro !");
  318.     return 0x01;
  319. }
  320.  
  321. CMD:ir(playerid, params[])
  322. {
  323.     if(!admin_db[playerid][IsAdmin])
  324.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  325.        
  326.     new PlayerB;
  327.     if(sscanf(params, "i", PlayerB))
  328.         return SendClientMessage(playerid, -1, "Comando: /ir [id]");
  329.        
  330.     if(PlayerB == playerid)
  331.         return SendClientMessage(playerid, -1, "Você não pode ir até você mesmo.");
  332.        
  333.     GetPlayerPos(PlayerB, x, y, z);
  334.     SetPlayerPos(playerid, x+1, y+1, z);
  335.     format(strGlobal, 0x2D, "Você foi até o player: %s", Nick(PlayerB));
  336.     SendClientMessage(playerid, -1, strGlobal);
  337.     format(strGlobal, 0x2D, "O admin %s veio até você", Nick(playerid));
  338.     SendClientMessage(PlayerB, -1, strGlobal);
  339.     return 0x01;
  340. }
  341.  
  342. CMD:trazer(playerid, params[])
  343. {
  344.     if(!admin_db[playerid][IsAdmin])
  345.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  346.        
  347.     new PlayerB;
  348.     if(sscanf(params, "i", PlayerB))
  349.         return SendClientMessage(playerid, -1, "Comando: /trazer [id]");
  350.        
  351.     if(PlayerB == playerid)
  352.         return SendClientMessage(playerid, -1, "Você não pode trazer você até você mesmo.");
  353.        
  354.     GetPlayerPos(playerid, x, y, z);
  355.     SetPlayerPos(playerid, x+1, y+1, z);
  356.     format(strGlobal, 0x2D, "Você trouxe o player: %s", Nick(PlayerB));
  357.     SendClientMessage(playerid, -1, strGlobal);
  358.     format(strGlobal, 0x2D, "O admin %s levou você até ele", Nick(playerid));
  359.     SendClientMessage(PlayerB, -1, strGlobal);
  360.     return 0x01;
  361. }
  362.  
  363. CMD:trazertodos(playerid)
  364. {
  365.     if(!admin_db[playerid][IsAdmin])
  366.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  367.  
  368.     for(new iLoop; iLoop < MAX_PLAYERS; iLoop++)
  369.     {
  370.         if(!admin_db[iLoop][IsAdmin])
  371.         {
  372.             GetPlayerPos(playerid, x, y, z);
  373.             SetPlayerPos(iLoop, x+1, y+1, z);
  374.         }
  375.     }
  376.     format(strGlobal, 0x2D, "O admin %s teleportou todos players até ele!", Nick(playerid));
  377.     SendClientMessageToAll(-1, strGlobal);
  378.     return 0x01;
  379. }
  380.  
  381. CMD:matar(playerid, params[])
  382. {
  383.     if(!admin_db[playerid][IsAdmin])
  384.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  385.        
  386.     new PlayerB;
  387.     if(sscanf(params, "i", PlayerB))
  388.         return SendClientMessage(playerid, -1, "Comando: /matar [id]");
  389.        
  390.     if(PlayerB == playerid)
  391.         return SendClientMessage(playerid, -1, "Você não pode matar a sí mesmo");
  392.        
  393.     SetPlayerHealth(PlayerB, 0);
  394.     format(strGlobal, 0x2D, "Você matou o player: %s", Nick(PlayerB));
  395.     SendClientMessage(playerid, -1, strGlobal);
  396.     format(strGlobal, 0x2D, "O admin %s matou você", Nick(playerid));
  397.     SendClientMessage(PlayerB, -1, strGlobal);
  398.     return 0x01;
  399. }
  400.  
  401. CMD:skin(playerid, params[])
  402. {
  403.     if(!admin_db[playerid][IsAdmin])
  404.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  405.        
  406.     new PlayerB, skinId;
  407.     if(sscanf(params, "ii", PlayerB, skinId))
  408.         return SendClientMessage(playerid, -1, "Comando: /skin [id][idskin]");
  409.  
  410.     SetPlayerSkin(PlayerB, skinId);
  411.     format(strGlobal, 0x32, "Você setou a skin do player: %s, para %d", Nick(PlayerB), skinId);
  412.     SendClientMessage(playerid, -1, strGlobal);
  413.     format(strGlobal, 0x32, "O admin %s setou sua skin para %d", Nick(playerid), skinId);
  414.     SendClientMessage(PlayerB, -1, strGlobal);
  415.     return 0x01;
  416. }
  417.  
  418. CMD:darvida(playerid, params[])
  419. {
  420.     if(!admin_db[playerid][IsAdmin])
  421.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  422.        
  423.     new PlayerB, Float:vida;
  424.     if(sscanf(params, "ii", PlayerB, vida))
  425.         return SendClientMessage(playerid, -1, "Comando: /darvida [id][valor]");
  426.        
  427.     new Float:getVida;
  428.     GetPlayerHealth(playerid, getVida);
  429.     SetPlayerHealth(playerid, getVida+vida);
  430.     format(strGlobal, 0x32, "Você setou a vida do player: %s, para %d", Nick(PlayerB), vida);
  431.     SendClientMessage(playerid, -1, strGlobal);
  432.     format(strGlobal, 0x32, "O admin %s setou sua vida para %d", Nick(playerid), vida);
  433.     SendClientMessage(PlayerB, -1, strGlobal);
  434.     return 0x01;
  435. }
  436.  
  437. CMD:darcolete(playerid, params[])
  438. {
  439.     if(!admin_db[playerid][IsAdmin])
  440.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  441.        
  442.     new PlayerB, Float:colete;
  443.     if(sscanf(params, "ii", PlayerB, colete))
  444.         return SendClientMessage(playerid, -1, "Comando: /darcolete [id][valor]");
  445.        
  446.     new Float:getColete;
  447.     GetPlayerArmour(playerid, getColete);
  448.     SetPlayerArmour(playerid, getColete+colete);
  449.     format(strGlobal, 0x32, "Você setou o colete do player: %s, para %d", Nick(PlayerB), colete);
  450.     SendClientMessage(playerid, -1, strGlobal);
  451.     format(strGlobal, 0x32, "O admin %s setou seu colete para %d", Nick(playerid), colete);
  452.     SendClientMessage(PlayerB, -1, strGlobal);
  453.     return 0x01;
  454. }
  455.  
  456. CMD:dararma(playerid, params[])
  457. {
  458.     if(!admin_db[playerid][IsAdmin])
  459.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  460.        
  461.     new PlayerB, arma, mun;
  462.     if(sscanf(params, "iii", PlayerB, arma, mun))
  463.         return SendClientMessage(playerid, -1, "Comando: /dararma [id][arma][munição]");
  464.        
  465.     GivePlayerWeapon(PlayerB, arma, mun);
  466.     format(strGlobal, 0x3C, "Você deu %d munições de %d para o player: %s", mun, arma, Nick(PlayerB));
  467.     SendClientMessage(playerid, -1, strGlobal);
  468.     format(strGlobal, 0x3C, "O admin %s deu %d munições de %d para você", Nick(playerid), mun, arma);
  469.     SendClientMessage(PlayerB, -1, strGlobal);
  470.     return 0x01;
  471. }
  472.  
  473. CMD:retirararmas(playerid, params[])
  474. {
  475.     if(!admin_db[playerid][IsAdmin])
  476.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  477.        
  478.     new PlayerB;
  479.     if(sscanf(params, "i", PlayerB))
  480.         return SendClientMessage(playerid, -1, "Comando: /retirararmas [id]");
  481.        
  482.     ResetPlayerWeapons(PlayerB);
  483.     format(strGlobal, 0x32, "Você resetou as armas do player: %s", Nick(PlayerB));
  484.     SendClientMessage(playerid, -1, strGlobal);
  485.     format(strGlobal, 0x32, "O admin %s retirou suas armas!", Nick(playerid));
  486.     SendClientMessage(PlayerB, -1, strGlobal);
  487.     return 0x01;
  488. }
  489.  
  490. CMD:congelar(playerid, params[])
  491. {
  492.     if(!admin_db[playerid][IsAdmin])
  493.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  494.        
  495.     new PlayerB;
  496.     if(sscanf(params, "i", PlayerB))
  497.         return SendClientMessage(playerid, -1, "Comando: /congelar [id]");
  498.        
  499.     TogglePlayerControllable(PlayerB, 0);
  500.     format(strGlobal, 0x32, "Você congelou o player: %s", Nick(PlayerB));
  501.     SendClientMessage(playerid, -1, strGlobal);
  502.     format(strGlobal, 0x32, "O admin %s congelou você!", Nick(playerid));
  503.     SendClientMessage(PlayerB, -1, strGlobal);
  504.     return 0x01;
  505. }
  506.  
  507. CMD:descongelar(playerid, params[])
  508. {
  509.     if(!admin_db[playerid][IsAdmin])
  510.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  511.        
  512.     new PlayerB;
  513.     if(sscanf(params, "i", PlayerB))
  514.         return SendClientMessage(playerid, -1, "Comando: /descongelar [id]");
  515.        
  516.     TogglePlayerControllable(PlayerB, 1);
  517.     format(strGlobal, 0x32, "Você descongelou o player: %s", Nick(PlayerB));
  518.     SendClientMessage(playerid, -1, strGlobal);
  519.     format(strGlobal, 0x32, "O admin %s descongelou você!", Nick(playerid));
  520.     SendClientMessage(PlayerB, -1, strGlobal);
  521.     return 0x01;
  522. }
  523.  
  524. CMD:ircarro(playerid, params[])
  525. {
  526.     if(!admin_db[playerid][IsAdmin])
  527.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  528.        
  529.     new carId;
  530.     if(sscanf(params, "i", carId))
  531.         return SendClientMessage(playerid, -1, "Comando: /ircarro [id]");
  532.        
  533.     PutPlayerInVehicle(playerid, carId, 0);
  534.     format(strGlobal, 0x2D, "Você foi até o carro %d", carId);
  535.     SendClientMessage(playerid, -1, strGlobal);
  536.     return 0x01;
  537. }
  538.  
  539. CMD:trazercarro(playerid, params[])
  540. {
  541.     if(!admin_db[playerid][IsAdmin])
  542.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  543.        
  544.     new carId;
  545.     if(sscanf(params, "i", carId))
  546.         return SendClientMessage(playerid, -1, "Comando: /trazercarro [id]");
  547.        
  548.     GetPlayerPos(playerid, x, y, z);
  549.     SetVehiclePos(carId, x+2, y+2, z);
  550.     PutPlayerInVehicle(playerid, carId, 0);
  551.     format(strGlobal, 0x2D, "Você trouxe o carro %d até você", carId);
  552.     SendClientMessage(playerid, -1, strGlobal);
  553.     return 0x01;
  554. }
  555.  
  556. CMD:ls(playerid)
  557. {
  558.     if(!admin_db[playerid][IsAdmin])
  559.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  560.        
  561.     SetPlayerPos(playerid, 1243.2365, -1692.5746, 16.1976);
  562.     SetPlayerFacingAngle(playerid, 180.7490);
  563.     SendClientMessage(playerid, -1, "Bem vindo à Los Santos!");
  564.     return 0x01;
  565. }
  566.  
  567. CMD:lsa(playerid)
  568. {
  569.     if(!admin_db[playerid][IsAdmin])
  570.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  571.        
  572.     SetPlayerPos(playerid,1893.3164,-2329.0193,13.5469);
  573.     SetPlayerFacingAngle(playerid, 35.0668);
  574.     SendClientMessage(playerid, -1, "Bem vindo ao Aeroporto de Los Santos!");
  575.     return 0x01;
  576. }
  577.  
  578. CMD:lv(playerid)
  579. {
  580.     if(!admin_db[playerid][IsAdmin])
  581.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  582.        
  583.     SetPlayerPos(playerid, 1674.4037,1447.6370, 10.7904);
  584.     SetPlayerFacingAngle(playerid, 72.5065);
  585.     SendClientMessage(playerid, -1, "Bem vindo à Las Venturas!");
  586.     return 0x01;
  587. }
  588.  
  589. CMD:lva(playerid)
  590. {
  591.     if(!admin_db[playerid][IsAdmin])
  592.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  593.        
  594.     SetPlayerPos(playerid, 1512.3953,1703.5693,10.8203);
  595.     SetPlayerFacingAngle(playerid, 22.3513);
  596.     SendClientMessage(playerid, -1, "Bem vindo ao Aeroporto de Las Venturas!");
  597.     return 0x01;
  598. }
  599.  
  600. CMD:sfa(playerid)
  601. {
  602.     if(!admin_db[playerid][IsAdmin])
  603.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  604.        
  605.     SetPlayerPos(playerid, -1450.6621,-273.2752,14.1484);
  606.     SetPlayerFacingAngle(playerid, 243.1030);
  607.     SendClientMessage(playerid, -1, "Bem vindo ao Aeroporto de San Fierro!");
  608.     return 0x01;
  609. }
  610.  
  611. CMD:sf(playerid)
  612. {
  613.     if(!admin_db[playerid][IsAdmin])
  614.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  615.        
  616.     SetPlayerPos(playerid, -1989.2897,1040.2900,55.7266);
  617.     SetPlayerFacingAngle(playerid, 176.1217);
  618.     SendClientMessage(playerid, -1, "Bem vindo à San Fierro!");
  619.     return 0x01;
  620. }
  621.  
  622. CMD:tapa(playerid, params[])
  623. {
  624.     if(!admin_db[playerid][IsAdmin])
  625.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  626.        
  627.     new PlayerB;
  628.     if(sscanf(params, "i", PlayerB))
  629.         return SendClientMessage(playerid, -1, "Comando: /tapa [id]");
  630.  
  631.     GetPlayerPos(PlayerB, x, y, z);
  632.     SetPlayerPos(PlayerB, x, y, z+0x14);
  633.     format(strGlobal, 0x37, "Você deu um tapa no player: %s", Nick(PlayerB));
  634.     SendClientMessage(playerid, -1, strGlobal);
  635.     format(strGlobal, 0x37, "O admin %s deu um tapa em você!", Nick(playerid));
  636.     SendClientMessage(PlayerB, -1, strGlobal);
  637.     return 0x01;
  638. }
  639.  
  640. CMD:daradmin(playerid, params[])
  641. {
  642.     if(!IsPlayerAdmin(playerid))
  643.         return SendClientMessage(playerid, -1, "Você não é um administrador Rcon.");
  644.  
  645.     new PlayerB, lvl;
  646.     if(sscanf(params, "ii", PlayerB, lvl))
  647.         return SendClientMessage(playerid, -1, "Comando: /daradmin [id][nível]");
  648.        
  649.     if(lvl == 0x01)
  650.         return SendClientMessage(playerid, -1, "Para dar admin temporário use /dartemp");
  651.        
  652.     if(lvl == 0x00)
  653.     {
  654.         format(strGlobal, 0x28, "Admins/%s.ini", Nick(playerid));
  655.         INI_Remove(strGlobal);
  656.         admin_db[playerid][IsAdmin] = false;
  657.         admin_db[playerid][AdminLvl] = 0x00;
  658.         return 0x01;
  659.     }
  660.     admin_db[playerid][IsAdmin] = true;
  661.     admin_db[playerid][AdminLvl] = lvl;
  662.     GodAdmin(PlayerB, true);
  663.     SalvarAdmins(PlayerB);
  664.     format(strGlobal, 0x3C, "Você deu nível %d de admin para: %s", lvl, Nick(PlayerB));
  665.     SendClientMessage(playerid, -1, strGlobal);
  666.     format(strGlobal, 0x3C, "O admin %s deu nível %d de admin para você!", Nick(playerid), lvl);
  667.     SendClientMessage(PlayerB, -1, strGlobal);
  668.     return 0x01;
  669. }
  670.  
  671. CMD:admins(playerid)
  672. {
  673.     for(new iLoop; iLoop < MAX_PLAYERS; iLoop++)
  674.     {
  675.         if(IsPlayerConnected(iLoop))
  676.         {
  677.             if(admin_db[iLoop][IsAdmin])
  678.             {
  679.                 format(strGlobal, 0x37, "| Admin %s, nível: %d |\n", Nick(iLoop), admin_db[iLoop][AdminLvl]);
  680.                 ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Admins online", strGlobal, "Ok", "");
  681.                 return 0x01;
  682.             }
  683.         }
  684.         else
  685.         {
  686.             SendClientMessage(playerid, -1, "Nenhum admin online !");
  687.             break;
  688.         }
  689.     }
  690.     return 0x01;
  691. }
  692.  
  693. CMD:ban(playerid, params[])
  694. {
  695.     if(!admin_db[playerid][IsAdmin])
  696.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  697.        
  698.     new PlayerB, motivo[0x80];
  699.     if(sscanf(params, "is[128]", PlayerB, motivo))
  700.         return SendClientMessage(playerid, -1, "Comando: /ban [id][motivo]");
  701.        
  702.     if(PlayerB != playerid)
  703.     {
  704.         if(PlayerB != INVALID_PLAYER_ID)
  705.         {
  706.             new sec, ye, min1, day, mon, hour;
  707.             getdate(ye, mon, day);
  708.             gettime(hour, min1, sec);
  709.             format(strGlobal, 0x2D, "Banidos/%s.ini", Nick(PlayerB));
  710.             INI_Open(strGlobal);
  711.             INI_WriteString("Motivo", motivo);
  712.             INI_WriteInt("Dia", day);
  713.             INI_WriteInt("Mês", mon);
  714.             INI_WriteInt("Ano", ye);
  715.             INI_WriteInt("Hora", hour);
  716.             INI_WriteInt("Minuto", min1);
  717.             INI_WriteInt("Segundo", sec);
  718.             INI_WriteString("Admin", Nick(playerid));
  719.             INI_Save();
  720.             INI_Close();
  721.             format(strGlobal, 0x80, "Você foi banido pelo admin %s, motivo: %s", Nick(playerid), motivo);
  722.             SendClientMessage(playerid, -1, strGlobal);
  723.             format(strGlobal, 0x80, "%s foi banido por %s, motivo: %s", Nick(PlayerB), Nick(playerid), motivo);
  724.             SendClientMessageToAll(-1, strGlobal);
  725.         }
  726.         Kick(PlayerB);
  727.         return 0x01;
  728.     }
  729.     return 0x01;
  730. }
  731.  
  732. CMD:kick(playerid, params[])
  733. {
  734.     if(!admin_db[playerid][IsAdmin])
  735.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  736.        
  737.     new PlayerB, motivo[0x80];
  738.     if(sscanf(params, "is[128]", PlayerB, motivo))
  739.         return SendClientMessage(playerid, -1, "Comando: /kick [id][motivo]");
  740.        
  741.     if(PlayerB != playerid)
  742.     {
  743.         if(PlayerB != INVALID_PLAYER_ID)
  744.         {
  745.             format(strGlobal, 0x80, "Você levou Kick do admin %s, motivo: %s", Nick(playerid), motivo);
  746.             SendClientMessage(playerid, -1, strGlobal);
  747.             format(strGlobal, 0x80, "%s foi kikado por %s, motivo: %s", Nick(PlayerB), Nick(playerid), motivo);
  748.             SendClientMessageToAll(-1, strGlobal);
  749.         }
  750.         Kick(PlayerB);
  751.         return 0x01;
  752.     }
  753.     return 0x01;
  754. }
  755.  
  756. CMD:kickoff(playerid, params[])
  757. {
  758.     if(!admin_db[playerid][IsAdmin])
  759.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  760.        
  761.     new PlayerB;
  762.     if(sscanf(params, "i", PlayerB))
  763.         return SendClientMessage(playerid, -1, "Comando: /kickoff [id]");
  764.        
  765.     if(PlayerB != playerid)
  766.     {
  767.         if(PlayerB != INVALID_PLAYER_ID)
  768.         {
  769.             SendClientMessage(playerid, -1, "Você foi kikado !");
  770.         }
  771.         Kick(PlayerB);
  772.         return 0x01;
  773.     }
  774.     return 0x01;
  775. }
  776.  
  777. CMD:banoff(playerid, params[])
  778. {
  779.     if(!admin_db[playerid][IsAdmin])
  780.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  781.        
  782.     new PlayerB;
  783.     if(sscanf(params, "i", PlayerB))
  784.         SendClientMessage(playerid, -1, "Comando: /banoff [id]");
  785.        
  786.     if(PlayerB != playerid)
  787.     {
  788.         if(PlayerB != INVALID_PLAYER_ID)
  789.         {
  790.             new sec, ye, min1, day, mon, hour;
  791.             getdate(ye, mon, day);
  792.             gettime(hour, min1, sec);
  793.             format(strGlobal, 0x2D, "Banidos/%s.ini", Nick(PlayerB));
  794.             INI_Open(strGlobal);
  795.             INI_WriteString("Motivo", "Banido silênciosamente");
  796.             INI_WriteInt("Dia", day);
  797.             INI_WriteInt("Mês", mon);
  798.             INI_WriteInt("Ano", ye);
  799.             INI_WriteInt("Hora", hour);
  800.             INI_WriteInt("Minuto", min1);
  801.             INI_WriteInt("Segundo", sec);
  802.             INI_WriteString("Admin", Nick(playerid));
  803.             INI_Save();
  804.             INI_Close();
  805.             SendClientMessage(playerid, -1, "Você foi banido !");
  806.         }
  807.         Kick(PlayerB);
  808.         return 0x01;
  809.     }
  810.     return 0x01;
  811. }
  812.  
  813. CMD:banip(playerid, params[])
  814. {
  815.     if(!admin_db[playerid][IsAdmin])
  816.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  817.        
  818.     new PlayerB;
  819.     if(sscanf(params, "i", PlayerB))
  820.         return SendClientMessage(playerid, -1, "Comando: /banip [id]");
  821.        
  822.     if(PlayerB != playerid)
  823.     {
  824.         if(PlayerB != INVALID_PLAYER_ID)
  825.         {
  826.             new ips[0x3C];
  827.             GetPlayerIp(playerid, ips, sizeof( ips ));
  828.             format(strGlobal, 0x2D, "Banidos/%s.ini", ips);
  829.             INI_Open(strGlobal);
  830.             INI_WriteString("Banido pelo IP", ips);
  831.             INI_Save();
  832.             INI_Close();
  833.             format(strGlobal, 0x41, "Player %s foi banido pelo IP por %s", Nick(PlayerB), Nick(playerid));
  834.             SendClientMessageToAll(-1, strGlobal);
  835.             SendClientMessage(playerid, -1, "Seu ip foi banido !");
  836.         }
  837.         Kick(PlayerB);
  838.         return 0x01;
  839.     }
  840.     return 0x01;
  841. }
  842.  
  843. CMD:desban(playerid, params[])
  844. {
  845.     if(!admin_db[playerid][IsAdmin])
  846.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  847.        
  848.     new nickBan[MAX_PLAYER_NAME];
  849.     if(sscanf(params, "s[24]", nickBan))
  850.         return SendClientMessage(playerid, -1, "Comando: /desban [nome]");
  851.        
  852.     format(strGlobal, 0x2D, "Banidos/%s.ini", nickBan);
  853.     if(INI_Exist(strGlobal))
  854.         return INI_Remove(strGlobal);
  855.        
  856.     format(strGlobal, 0x2D, "Você desbaniu a conta %s", nickBan);
  857.     SendClientMessage(playerid, -1, strGlobal);
  858.     return 0x01;
  859. }
  860.  
  861. CMD:verip(playerid, params[])
  862. {
  863.     if(!admin_db[playerid][IsAdmin])
  864.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  865.        
  866.     new PlayerB;
  867.     if(sscanf(params, "i", PlayerB))
  868.         return SendClientMessage(playerid, -1, "Comando: /verip [id]");
  869.        
  870.     new ips[0x3C];
  871.     GetPlayerIp(PlayerB, ips, sizeof( ips ));
  872.     format(strGlobal, 0x2D, "ID:[%d] Nick:[%s] IP:[%s]", PlayerB, Nick(PlayerB), ips);
  873.     SendClientMessage(playerid, -1, strGlobal);
  874.     return 0x01;
  875. }
  876.  
  877.  
  878. CMD:relatorio(playerid)
  879. {
  880.     ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Relatorio", "Digite seu relatório destinado aos admins abaixo.",  "Enviar", "");
  881.     return 0x01;
  882. }
  883.  
  884. CMD:av(playerid, params[])
  885. {
  886.     if(!admin_db[playerid][IsAdmin])
  887.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  888.        
  889.     new aviso[0x3C];
  890.     if(sscanf(params, "s[60]", aviso))
  891.         return SendClientMessage(playerid, -1, "Comando: /av [aviso]");
  892.        
  893.     format(strGlobal, 0x80, "Aviso do admin %s: %s", Nick(playerid), aviso);
  894.     SendClientMessageToAll(0x451FE0AA, strGlobal);
  895.     return 0x01;
  896. }
  897.  
  898. CMD:jogar(playerid)
  899. {
  900.     if(!admin_db[playerid][IsAdmin])
  901.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  902.        
  903.     if(work_db[playerid])
  904.     {
  905.         GodAdmin(playerid, false);
  906.         SendClientMessage(playerid, -1, "Você entrou no modo jogo, /jogar para entrar no modo trabalho novamente.");
  907.         work_db[playerid] = false;
  908.         return 0x01;
  909.     }
  910.     else if(!work_db[playerid])
  911.     {
  912.         GodAdmin(playerid, true);
  913.         SendClientMessage(playerid, -1, "Você entrou no modo trabalho, /jogar para entrar no modo jogo novamente.");
  914.         work_db[playerid] = true;
  915.     }
  916.     return 0x01;
  917. }
  918.  
  919. CMD:z(playerid, params[])
  920. {
  921.     if(!admin_db[playerid][IsAdmin])
  922.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  923.        
  924.     new zPos;
  925.     if(sscanf(params, "i", zPos))
  926.         return SendClientMessage(playerid, -1, "Comando: /z [float:pos]");
  927.        
  928.     GetPlayerPos(playerid, x, y, z);
  929.     SetPlayerPos(playerid, x, y, z + zPos);
  930.     return 0x01;
  931. }
  932.  
  933. CMD:tv(playerid, params[])
  934. {
  935.     if(!admin_db[playerid][IsAdmin])
  936.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  937.        
  938.     new PlayerB;
  939.     if(sscanf(params, "i", PlayerB))
  940.         return SendClientMessage(playerid, -1, "Comando: /tv [id]");
  941.        
  942.     if(!tv_on[playerid])
  943.     {
  944.         TogglePlayerSpectating(playerid, 1);
  945.         PlayerSpectatePlayer(playerid, PlayerB, SPECTATE_MODE_NORMAL);
  946.         format(strGlobal, 0x2D, "Você entrou modo TV no player [%d]%s", PlayerB, Nick(PlayerB));
  947.         SendClientMessage(playerid, -1, strGlobal);
  948.         return 0x01;
  949.     }
  950.     return 0x01;
  951. }
  952.  
  953. CMD:tvoff(playerid)
  954. {
  955.     if(tv_on[playerid])
  956.     {
  957.         TogglePlayerSpectating(playerid, 0);
  958.         SendClientMessage(playerid, -1, "Você saiu do modo TV");
  959.     }
  960.     return 0x01;
  961. }
  962.  
  963. CMD:a(playerid, params[])
  964. {
  965.     if(!admin_db[playerid][IsAdmin])
  966.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  967.        
  968.     new aChat[0x3C];
  969.     if(sscanf(params, "s[60]", aChat))
  970.         return SendClientMessage(playerid, -1, "Comando: /a [chat]");
  971.        
  972.     format(strGlobal, 0x80, "aChat - Admin %s diz: %s", Nick(playerid), aChat);
  973.     for(new iLoop; iLoop < MAX_PLAYERS; iLoop++)
  974.     {
  975.         if(admin_db[iLoop][IsAdmin])
  976.         {
  977.             SendClientMessage(iLoop, 0xFF00FFAA, strGlobal);
  978.         }
  979.     }
  980.     return 0x01;
  981. }
  982.  
  983. CMD:shutup(playerid, params[])
  984. {
  985.     if(!admin_db[playerid][IsAdmin])
  986.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  987.        
  988.     new PlayerB;
  989.     if(sscanf(params, "i", PlayerB))
  990.         return SendClientMessage(playerid, -1, "Comando: /shutup [id]");
  991.        
  992.     if(!CallOff[PlayerB])
  993.     {
  994.         CallOff[PlayerB] = true;
  995.         format(strGlobal, 0x2D, "Você calou %s", Nick(PlayerB));
  996.         SendClientMessage(playerid, -1, strGlobal);
  997.         format(strGlobal,0x2D, "Você foi calado pelo admin %s", Nick(playerid));
  998.         return 1;
  999.     }
  1000.     else
  1001.     {
  1002.         format(strGlobal, 0x2D, "Você descalou %s", Nick(PlayerB));
  1003.         SendClientMessage(playerid, -1, strGlobal);
  1004.         SendClientMessage(PlayerB, -1, "Você já pode falar, foi descalado.");
  1005.         CallOff[PlayerB] = false;
  1006.     }
  1007.     return 0x01;
  1008. }
  1009.  
  1010. CMD:par(playerid, params[])
  1011. {
  1012.     new PlayerB, PM[0x80];
  1013.     if(sscanf(params, "is[128]", PlayerB, PM))
  1014.         return SendClientMessage(playerid, -1, "Comando: /par [id][texto]");
  1015.        
  1016.     if(admin_db[playerid][IsAdmin] || admin_db[PlayerB][IsAdmin])
  1017.     {
  1018.         if(!parBlock[PlayerB])
  1019.         {
  1020.             format(strGlobal, 0x80, "[Particular] - %s diz: %s", Nick(playerid), PM);
  1021.             SendClientMessage(PlayerB, 0xFFF900AA, strGlobal);
  1022.             SendClientMessage(playerid, 0xFFF900AA, "Particular enviada!");
  1023.             return 0x01;
  1024.         }
  1025.         else SendClientMessage(playerid, -1, "Este admin bloqueou as mensagens particulares");
  1026.     }
  1027.     else if(!admin_db[PlayerB][IsAdmin] && !admin_db[playerid][IsAdmin])
  1028.     {
  1029.         SendClientMessage(playerid, -1, "Você só pode mandar particulares para admins");
  1030.         return 0x01;
  1031.     }
  1032.     return 0x01;
  1033. }
  1034.  
  1035. CMD:blockpar(playerid)
  1036. {
  1037.     if(!admin_db[playerid][IsAdmin])
  1038.         return SendClientMessage(playerid, -1, "Você não é um administrador.");
  1039.  
  1040.     if(!parBlock[playerid])
  1041.     {
  1042.         parBlock[playerid] = true;
  1043.         return 0x01;
  1044.     }
  1045.     else
  1046.     {
  1047.         parBlock[playerid] = false;
  1048.     }
  1049.     return 0x01;
  1050. }
  1051.  
  1052. CMD:aa(playerid)
  1053. {
  1054.     new strLocal[0xFF+0x80];
  1055.     strcat(strLocal,"/gmx /repararid /respawn /carro /destruir /carroantigo /mudarcor\n");
  1056.     strcat(strLocal,"/ir /trazer /trazertodos /matar /skin /darvida /darcolete /dararma /retirararmas\n");
  1057.     strcat(strLocal,"/congelar /descongelar /ircarro /trazercarro /ls  /lsa /sf /sfa /lv /lva\n");
  1058.     strcat(strLocal,"/tapa /daradmin /admins /ban /banoff /banip /kick /kickoff /desban /verip\n");
  1059.     strcat(strLocal,"/relatorio /av /jogar /z /tv /tvoff /a /shutup /par /blockpar\n");
  1060.     ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Comandos administrativos", strLocal, "Fechar", "");
  1061.     return 0x01;
  1062. }
  1063.  
  1064. // Stocks ======================================================================
  1065.  
  1066. stock RespawnVehInutils()
  1067. {
  1068.     new bool:VehicleOccupied_db[MAX_VEHICLES];
  1069.     for(new iLoop; iLoop < MAX_PLAYERS; iLoop++)
  1070.     {
  1071.         if(IsPlayerInAnyVehicle(iLoop))
  1072.         {
  1073.             VehicleOccupied_db[GetPlayerVehicleID(iLoop)] = true;
  1074.         }
  1075.     }
  1076.     for(new iLoop; iLoop < MAX_VEHICLES; iLoop++)
  1077.     {
  1078.         if(!VehicleOccupied_db[iLoop])
  1079.         {
  1080.             SetVehicleToRespawn(iLoop);
  1081.         }
  1082.     }
  1083.     return 0x01;
  1084. }
  1085.  
  1086. stock GodAdmin(playerid, bool:index)
  1087. {
  1088.     if(index)
  1089.     {
  1090.         SetPlayerHealth(playerid, 999999999);
  1091.         return 0x01;
  1092.     }
  1093.     if(!index)
  1094.     {
  1095.         SetPlayerHealth(playerid, 100);
  1096.         return 0x01;
  1097.     }
  1098.     return 0x01;
  1099. }
  1100.  
  1101. stock Nick(playerid)
  1102. {
  1103.     new nome[MAX_PLAYER_NAME];
  1104.     GetPlayerName(playerid, nome, sizeof( nome ));
  1105.     return nome;
  1106. }
  1107.  
  1108. stock FUP(playerid)
  1109. {
  1110.     format(strGlobal, 0x2D, "Players/%s.ini", Nick(playerid));
  1111.     if(!INI_Exist(strGlobal))
  1112.     {
  1113.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registro", "Vejo que é novato por aqui,\ndigite uma senha para se registrar\n", "Confirmar", "");
  1114.         return 0x01;
  1115.     }
  1116.     else if(INI_Exist(strGlobal))
  1117.     {
  1118.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Você já é registrado,\ndigite a sua senha para confirmar login.\n", "Confirmar", "");
  1119.         return 0x01;
  1120.     }
  1121.     return 0x00;
  1122. }
  1123.  
  1124. stock Registrar(playerid, const senha[])
  1125. {
  1126.     format(strGlobal, 0x2D, "Players/%s.ini", Nick(playerid));
  1127.     if(INI_Exist(strGlobal))
  1128.         return 0x00;
  1129.        
  1130.     INI_Open(strGlobal);
  1131.     INI_WriteString("Senha", senha);
  1132.     INI_Save();
  1133.     INI_Close();
  1134.     SendClientMessage(playerid, -1, "Registrado com sucesso!");
  1135.     players_db[playerid][IsConnected] = true;
  1136.     return 0x01;
  1137. }
  1138.  
  1139. stock Logar(playerid, const senha[])
  1140. {
  1141.     format(strGlobal, 0x2D, "Players/%s.ini", Nick(playerid));
  1142.     if(!INI_Exist(strGlobal))
  1143.         return 0x00;
  1144.  
  1145.     new ler[16];
  1146.     INI_Open(strGlobal);
  1147.     INI_WriteString(ler, "Senha");
  1148.     INI_Save();
  1149.     INI_Close();
  1150.     if(!strcmp(senha, ler, true))
  1151.     {
  1152.         SendClientMessage(playerid, -1, "Logado com sucesso."),
  1153.         players_db[playerid][IsConnected] = true;
  1154.         return 0x01;
  1155.     }
  1156.     else
  1157.     {
  1158.         FUP(playerid);
  1159.     }
  1160.     return 0x01;
  1161. }
  1162.  
  1163. stock SalvarAdmins(playerid)
  1164. {
  1165.     format(strGlobal, 0x28, "Admins/%s.ini", Nick(playerid));
  1166.  
  1167.     INI_Open(strGlobal);
  1168.     INI_WriteInt("AdminLevel", admin_db[playerid][AdminLvl]);
  1169.     INI_Save();
  1170.     INI_Close();
  1171.     return 0x01;
  1172. }
  1173.  
  1174. stock CarregarAdmins(playerid)
  1175. {
  1176.     format(strGlobal, 0x28, "Admins/%s.ini", Nick(playerid));
  1177.     if(!INI_Exist(strGlobal))
  1178.         return 0x00;
  1179.        
  1180.     INI_Open(strGlobal);
  1181.     admin_db[playerid][AdminLvl] = INI_ReadInt("AdminLevel");
  1182.     admin_db[playerid][IsAdmin] = true;
  1183.     work_db[playerid] = true;
  1184.     GodAdmin(playerid, true);
  1185.     return 0x01;
  1186. }
  1187.  
  1188. stock CarregarBanidos(playerid)
  1189. {
  1190.     new banidos[0x2D];
  1191.     format(banidos, sizeof(banidos), "Banidos/%s.ini", Nick(playerid));
  1192.     if(INI_Exist(banidos))
  1193.     {
  1194.         new adm[0x1E], motivo[0x37];
  1195.         TogglePlayerControllable(playerid, 0);
  1196.         INI_Open(banidos);
  1197.         INI_ReadString(adm, "Admin", 30);
  1198.         INI_ReadString(motivo, "Motivo", 60);
  1199.         new Ano, Mes, Dia, Hor, Min;
  1200.         Ano = INI_ReadInt("Ano");
  1201.         Mes = INI_ReadInt("Mês");
  1202.         Dia = INI_ReadInt("Dia");
  1203.         Hor = INI_ReadInt("Hora");
  1204.         Min = INI_ReadInt("Minuto");
  1205.         INI_Save();
  1206.         INI_Close();
  1207.         format(strGlobal, 0x80, "Você foi banido pelo admin: %s\n\nMotivo: %s\n\nData: [%d/%d/%d]\nHorario: [%d:%d]", adm, motivo, Dia, Mes, Ano, Hor, Min);
  1208.         ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "{EA1515}BANIDO !", strGlobal, "Ok", "");
  1209.         return 0x01;
  1210.     }
  1211.     return 0x00;
  1212. }
  1213.  
  1214. stock CarregarIpsBanidos(playerid)
  1215. {
  1216.     new ips[0x3F];
  1217.     GetPlayerIp(playerid, ips, sizeof(ips));
  1218.     format(strGlobal, 0x2D, "Banidos/%s.ini", ips);
  1219.     if(INI_Exist(strGlobal))
  1220.         return ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "{EA1515}BANIDO !", "Este IP foi banido do servidor!", "Ok", "");
  1221.  
  1222.     return 0x00;
  1223. }
Advertisement
Add Comment
Please, Sign In to add comment