Advertisement
Guest User

PC 3.1

a guest
Sep 30th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.91 KB | None | 0 0
  1. /*
  2. Sistema de Servidor Remoto por Mandrack_FreeZe
  3. Plugin e Include por Flag (http://forum.sa-mp.com/showthread.php?t=126232)
  4. Continuação do antigo CrazY Panel System, porém agora totalmente em dialog e adicionadas várias outras funções.
  5. VERSÃO 3.1:
  6. Configure o servidor diretamente dentro do jogo, sem precisar usar /rcon reloadfs PC
  7.  
  8. SISTEMA CRIADO PARA LIVRE UTILIZAÇÃO E EDIÇÃO MANTENDO OS CRÉDITOS.
  9.  
  10. TESTES PODEM SER REALIZADOS EM SERVIDORES HAMACHI
  11.  
  12. NÃO RETIRE OS CRÉDITOS
  13. */
  14. #define FILTERSCRIPT
  15.  
  16. #include <a_samp>
  17. #include <extrcon>
  18. #include <DOF2>
  19.  
  20. new checarconfig;
  21. public OnFilterScriptInit()
  22. {
  23.     if (!DOF2_FileExists("PCConfig.ini"))
  24.     {
  25.         DOF2_CreateFile("PCConfig.ini");
  26.         DOF2_SetString("PCConfig.ini", "IP", "0");
  27.         DOF2_SetInt("PCConfig.ini", "Port", 7777);
  28.         DOF2_SetString("PCConfig.ini", "RCONPass", "string");
  29.         DOF2_SetInt("PCConfig.ini", "config", 1);
  30.         DOF2_SaveFile();
  31.         print("[PC]Arquivo PCConfig.ini criado com sucesso!");
  32.     } else {
  33.         checarconfig = DOF2_GetInt("PCConfig.ini", "config");
  34.         print("[PC]Arquivo PCConfig.ini encontrado!");
  35.     }
  36.    
  37.     print("\n--------------------------------------");
  38.     print(" Plainel Remoto por Mandrack_FreeZe");
  39.     print(" Plugin Extern Rcon 1.2 por Flag");
  40.     print(" Versão do FS: v3.0");
  41.     print(" Painel Remoto LIGADO com sucesso!");
  42.     print("--------------------------------------\n");
  43.     return 1;
  44. }
  45.  
  46. public OnFilterScriptExit()
  47. {
  48.     print("\n--------------------------------------");
  49.     print(" Painel Remoto por Mandrack_FreeZe");
  50.     print(" Plugin Extern Rcon 1.2 por Flag");
  51.     print(" Versão do FS: v3.0");
  52.     print(" Painel Remoto DESLIGADO com sucesso!");
  53.     print("--------------------------------------\n");
  54.     return 1;
  55. }
  56.  
  57. public OnPlayerCommandText(playerid, cmdtext[])
  58. {
  59.     if (strcmp("/cp", cmdtext, true, 10) == 0)
  60.     {
  61.         if(IsPlayerAdmin(playerid))
  62.         {
  63.             if(checarconfig == 1)
  64.             {
  65.                 ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  66.             } else {
  67.                 ShowPlayerDialog(playerid,5498,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
  68.             }
  69.         }
  70.         else {
  71.             SendClientMessage(playerid, -1, "Você não tem autorização pra usar esse comando!");
  72.         }
  73.         }
  74.     return 1;
  75.     }
  76.    
  77. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  78. {
  79.         if(dialogid == 6197)
  80.             {
  81.                 if(response >= 1)
  82.                 {
  83.                     new string[150];
  84.                     new PegarNome[MAX_PLAYER_NAME];
  85.                     GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  86.                     DOF2_SetString("PCConfig.ini","RCONPass",inputtext);
  87.                     DOF2_SetInt("PCConfig.ini","config", 1);
  88.                     checarconfig = 1;
  89.                     DOF2_SaveFile();
  90.                     format(string, sizeof(string), "O Players %s configurou o RCON do servidor como %s.", PegarNome,DOF2_GetString("PCConfig.ini","RCONPass"));
  91.                     print(string);
  92.                     format(string, sizeof(string), "Seu servidor está configurado agora!\nInformações:\n\nIP: %s\nPorta: %d\nSenha RCON: %s\n\nUtilize /cp novamente!", DOF2_GetString("PCConfig.ini","IP"),DOF2_GetInt("PCConfig.ini","Port"),DOF2_GetString("PCConfig.ini","RCONPass"));
  93.                     ShowPlayerDialog(playerid,6482,DIALOG_STYLE_MSGBOX,"Servidor Configurado!",string,"Confirmar","");
  94.                     return 1;
  95.                 }
  96.                 return 1;
  97.             }
  98.  
  99.         if(dialogid == 4725)
  100.             {
  101.                 if(response >= 1)
  102.                 {
  103.                     new string[100];
  104.                     new PegarNome[MAX_PLAYER_NAME];
  105.                     GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  106.                     DOF2_SetString("PCConfig.ini","Port",inputtext);
  107.                     DOF2_SaveFile();
  108.                     format(string, sizeof(string), "O Players %s configurou a Porta do servidor como %s", PegarNome,DOF2_GetString("PCConfig.ini","Port"));
  109.                     print(string);
  110.                     ShowPlayerDialog(playerid,6197,DIALOG_STYLE_INPUT,"Configurando o Servidor: RCON","Coloque abaixo a senha RCON do servidor.","Confirmar","");
  111.                     //SetTimer("DialogRCON", 1000,false);
  112.                     //SetTimerEx("DialogRcon", 1000,false, "i", playerid);
  113.                     return 1;
  114.                 }
  115.                 return 1;
  116.             }
  117.            
  118.         if(dialogid == 5498)
  119.             {
  120.                 if(response >= 1)
  121.                 {
  122.                     new string[100];
  123.                     new PegarNome[MAX_PLAYER_NAME];
  124.                     GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  125.                     DOF2_SetString("PCConfig.ini","IP",inputtext);
  126.                     DOF2_SaveFile();
  127.                     format(string, sizeof(string), "O Players %s configurou o IP do servidor como %s", PegarNome,DOF2_GetString("PCConfig.ini","IP"));
  128.                     print(string);
  129.                     ShowPlayerDialog(playerid,4725,DIALOG_STYLE_INPUT,"Configurando o Servidor: Porta","Coloque abaixo a Porta do servidor (Ex: 7777).","Confirmar","");
  130.                     //SetTimer("DialogPort", 1000,false);
  131.                     //SetTimerEx("DialogPort", 1000,false, "i", playerid);
  132.                     return 1;
  133.                 }
  134.                 return 1;
  135.             }
  136.  
  137.         if(dialogid == 1973)
  138.         {
  139.             if(response)
  140.             {
  141.             new string[200];
  142.             new PegarNome[MAX_PLAYER_NAME];
  143.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  144.             /*if(listitem == 0)
  145.             {
  146.                 //ShowPlayerDialog(playerid,137954,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
  147.             }*/
  148.             if(listitem == 0 )
  149.             {
  150.                 if(IsPlayerAdmin(playerid))
  151.                 {
  152.                     format(string, sizeof(string), "Você desligou o servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  153.                     SendClientMessage(playerid, -1, string);
  154.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "exit");
  155.                     format(string, sizeof(string), "%s desligou o servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  156.                     print(string);
  157.                     return 1;
  158.                 }
  159.             }
  160.             else if(listitem == 1 )
  161.             {
  162.                 if(IsPlayerAdmin(playerid))
  163.                 {
  164.                     format(string, sizeof(string), "Você deu GMX no servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  165.                     SendClientMessage(playerid, -1, string);
  166.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "gmx");
  167.                     format(string, sizeof(string), "%s deu GMX no servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  168.                     print(string);
  169.                     return 1;
  170.                 }
  171.             }
  172.             else if(listitem == 2 )
  173.             {
  174.             ShowPlayerDialog(playerid,9173,DIALOG_STYLE_INPUT,"Trocar nome do Servidor","Coloque o novo nome do servidor abaixo:","Mudar","Cancelar");
  175.             return 1;
  176.             }
  177.             else if(listitem == 3 )
  178.             {
  179.             ShowPlayerDialog(playerid,3719,DIALOG_STYLE_INPUT,"Trocar nome do Mapa","Coloque o novo nome do mapa abaixo:","Mudar","Cancelar");
  180.             return 1;
  181.             }
  182.             else if(listitem == 4 )
  183.             {
  184.             ShowPlayerDialog(playerid,7391,DIALOG_STYLE_INPUT,"Trocar nome do Game Mode","Coloque o novo nome do Game Mode abaixo:","Mudar","Cancelar");
  185.             return 1;
  186.             }
  187.             else if(listitem == 5 )
  188.             {
  189.                 if(IsPlayerAdmin(playerid))
  190.                 {
  191.                     format(string, sizeof(string), "Você resetou os ips banidos do servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  192.                     SendClientMessage(playerid, -1, string);
  193.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "reloadbans");
  194.                     format(string, sizeof(string), "%s deletou os ips banidos do servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  195.                     print(string);
  196.                     return 1;
  197.                 }
  198.             }
  199.             else if(listitem == 6 )
  200.             {
  201.                 if(IsPlayerAdmin(playerid))
  202.                 {
  203.                     format(string, sizeof(string), "Você deletou o LOG do servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  204.                     SendClientMessage(playerid, -1, string);
  205.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "reloadlog");
  206.                     format(string, sizeof(string), "%s deletou o LOG do servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  207.                     print(string);
  208.                     return 1;
  209.                 }
  210.             }
  211.             else if(listitem == 7 )
  212.             {
  213.             ShowPlayerDialog(playerid,1834,DIALOG_STYLE_LIST,"Opções para players!","Banir IP\nDesbanir IP\nBanir Jogador\nKickar Jogador","Avançar","Cancelar");
  214.             return 1;
  215.             }
  216.             else if(listitem == 8)
  217.             {
  218.             ShowPlayerDialog(playerid,5498,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
  219.             }
  220.             else if(listitem == 9)
  221.             {
  222.             format(string, sizeof(string), "Seu servidor está configurado agora!\nInformações:\n\nIP: %s\nPorta: %d\nSenha RCON: %s\n\nUtilize /cp novamente!", DOF2_GetString("PCConfig.ini","IP"),DOF2_GetInt("PCConfig.ini","Port"),DOF2_GetString("PCConfig.ini","RCONPass"));
  223.             ShowPlayerDialog(playerid,6482,DIALOG_STYLE_MSGBOX,"Servidor Configurado!",string,"Confirmar","");
  224.             }
  225.             else
  226.             {
  227.            
  228.             }
  229.     }
  230. }
  231.    
  232.         if(dialogid == 9173)
  233.     {
  234.             new string[100];
  235.             new PegarNome[MAX_PLAYER_NAME];
  236.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  237.             if(response)
  238.             {
  239.             if(IsPlayerAdmin(playerid))
  240.                 {
  241.                     format(string, sizeof(string), "Você mudou o nome do servidor %s:%d para %s", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  242.                     SendClientMessage(playerid, -1, string);
  243.                     format(string, sizeof(string), "hostname %s", inputtext);
  244.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  245.                     format(string, sizeof(string), "%s mudou o nome do servidor %s:%d para %s", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  246.                     print(string);
  247.                 }
  248.             else {
  249.             SendClientMessage(playerid, -1, "Você não tem permissão!");
  250.             }
  251.             }
  252.             else
  253.             {
  254.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  255.             }
  256.             return 1;
  257.         }
  258.        
  259.         if(dialogid == 3719)
  260.     {
  261.             new string[100];
  262.             new PegarNome[MAX_PLAYER_NAME];
  263.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  264.             if(response)
  265.             {
  266.             if(IsPlayerAdmin(playerid))
  267.                 {
  268.                     format(string, sizeof(string), "Você mudou o nome do mapa do servidor %s:%d para %s", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  269.                     SendClientMessage(playerid, -1, string);
  270.                     format(string, sizeof(string), "mapname %s", inputtext);
  271.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  272.                     format(string, sizeof(string), "%s mudou o nome do mapa do servidor %s:%d para %s.", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  273.                     print(string);
  274.                 }
  275.             else {
  276.             SendClientMessage(playerid, -1, "Você não tem permissão!");
  277.             }
  278.             }
  279.             else
  280.             {
  281.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  282.             }
  283.             return 1;
  284.         }
  285.        
  286.         if(dialogid == 7391)
  287.     {
  288.             new string[100];
  289.             new PegarNome[MAX_PLAYER_NAME];
  290.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  291.             if(response)
  292.             {
  293.                 if(IsPlayerAdmin(playerid))
  294.                 {
  295.                     format(string, sizeof(string), "Você mudou o nome do Game Mode do servidor %s:%d para %s", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  296.                     SendClientMessage(playerid, -1, string);
  297.                     format(string, sizeof(string), "gamemodetext %s", inputtext);
  298.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  299.                     format(string, sizeof(string), "%s mudou o nome do Game Mode do servidor %s:%d para %s.", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"), inputtext);
  300.                     print(string);
  301.                 }
  302.                 else {
  303.                     SendClientMessage(playerid, -1, "Você não tem permissão!");
  304.                 }
  305.             }
  306.             else
  307.             {
  308.                 ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  309.             }
  310.             return 1;
  311.         }
  312.        
  313.         if(dialogid == 1834)
  314.         {
  315.             if(response)
  316.             {
  317.                 if(listitem == 0 )
  318.                 {
  319.                     ShowPlayerDialog(playerid,7852,DIALOG_STYLE_INPUT,"Banindo IP","Coloque o IP do jogador abaixo:","Banir","Cancelar");
  320.                     return 1;
  321.                 }
  322.                 else if(listitem == 1 )
  323.                 {
  324.                     ShowPlayerDialog(playerid,2587,DIALOG_STYLE_INPUT,"Desbanindo IP","Coloque o IP do jogador abaixo:","Desbanir","Cancelar");
  325.                     return 1;
  326.                 }
  327.                 else if(listitem == 2 )
  328.                 {
  329.                     ShowPlayerDialog(playerid,9874,DIALOG_STYLE_INPUT,"Banindo Jogador","Coloque o ID do jogador abaixo:","Banir","Cancelar");
  330.                     return 1;
  331.                 }
  332.                 else if(listitem == 3 )
  333.                 {
  334.                     ShowPlayerDialog(playerid,3698,DIALOG_STYLE_INPUT,"Kickando Jogador","Coloque oID do jogador abaixo:","Kickar","Cancelar");
  335.                     return 1;
  336.                 }
  337.             }
  338.             else
  339.             {
  340.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  341.             return 1;
  342.             }
  343.         }
  344.        
  345.         if(dialogid == 7852)
  346.     {
  347.             new string[100];
  348.             new PegarNome[MAX_PLAYER_NAME];
  349.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  350.             if(response)
  351.             {
  352.             if(IsPlayerAdmin(playerid))
  353.                 {
  354.                     format(string, sizeof(string), "Você banio o IP %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  355.                     SendClientMessage(playerid, -1, string);
  356.                     format(string, sizeof(string), "banip %s", inputtext);
  357.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  358.                     format(string, sizeof(string), "%s banio o IP %s do servidor %s:%d.",PegarNome, inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  359.                     print(string);
  360.                     return 1;
  361.                 }
  362.             else {
  363.             SendClientMessage(playerid, -1, "Você não tem permissão!");
  364.             }
  365.             }
  366.             else
  367.             {
  368.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  369.             }
  370.             return 1;
  371.         }
  372.        
  373.         if(dialogid == 2587)
  374.     {
  375.             new string[100];
  376.             new PegarNome[MAX_PLAYER_NAME];
  377.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  378.             if(response)
  379.             {
  380.             if(IsPlayerAdmin(playerid))
  381.                 {
  382.                     format(string, sizeof(string), "Você desbanio o IP %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  383.                     SendClientMessage(playerid, -1, string);
  384.                     format(string, sizeof(string), "unbanip %s", inputtext);
  385.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  386.                     format(string, sizeof(string), "%s desbanio o IP %s do servidor %s:%d.",PegarNome, inputtext, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  387.                     print(string);
  388.                     return 1;
  389.                 }
  390.             else {
  391.             SendClientMessage(playerid, -1, "Você não tem permissão!");
  392.             }
  393.             }
  394.             else
  395.             {
  396.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  397.             }
  398.             return 1;
  399.         }
  400.        
  401.         if(dialogid == 9874)
  402.     {
  403.             new string[100];
  404.             new PegarNome[MAX_PLAYER_NAME];
  405.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  406.             if(response)
  407.             {
  408.             if(IsNumeric(inputtext))
  409.                 {
  410.                     format(string, sizeof(string), "Você banio o ID %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  411.                     SendClientMessage(playerid, -1, string);
  412.                     format(string, sizeof(string), "ban %s", inputtext);
  413.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  414.                     format(string, sizeof(string), "%s banio o ID %s do servidor %s:%d.",PegarNome, inputtext, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  415.                     print(string);
  416.                     return 1;
  417.                 }
  418.             else {
  419.             SendClientMessage(playerid, -1, "Apenas números são aceitos!");
  420.             }
  421.             }
  422.             else
  423.             {
  424.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor\nInformações do servidor configurado","Selecionar","Cancelar");
  425.             }
  426.             return 1;
  427.         }
  428.        
  429.         if(dialogid == 3698)
  430.     {
  431.             new string[100];
  432.             new PegarNome[MAX_PLAYER_NAME];
  433.             GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
  434.             if(response)
  435.             {
  436.             if(IsNumeric(inputtext))
  437.                 {
  438.                     format(string, sizeof(string), "Você kickou o ID %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  439.                     SendClientMessage(playerid, -1, string);
  440.                     format(string, sizeof(string), "kick %s", inputtext);
  441.                     SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
  442.                     format(string, sizeof(string), "%s kickou o ID %s do servidor %s:%d.",PegarNome, inputtext, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
  443.                     print(string);
  444.                     return 1;
  445.                 }
  446.             else {
  447.             SendClientMessage(playerid, -1, "Apenas números são aceitos!");
  448.             }
  449.             }
  450.             else
  451.             {
  452.             ShowPlayerDialog(playerid,1973,DIALOG_STYLE_LIST,"Painel Remoto By Mandrack_FreeZe","Desativar servidor\nGMX\nNome do servidor\nNome do Mapa\nNome do GM\nReiniciar bans do server\nReiniciar LOG do server\nOpções para Players\nConfigurar novo Servidor","Selecionar","Cancelar");
  453.             }
  454.             return 1;
  455.         }
  456.         return 0;
  457. }
  458.  
  459. forward DialogPort(playerid);
  460. public DialogPort(playerid)
  461. {
  462.     ShowPlayerDialog(playerid,134679,DIALOG_STYLE_INPUT,"Configurando o Servidor: Porta","Coloque abaixo a Porta do servidor (Ex: 7777).","Confirmar","");
  463.     return 1;
  464. }
  465. forward DialogRCON(playerid);
  466. public DialogRCON(playerid)
  467. {
  468.     ShowPlayerDialog(playerid,16749852,DIALOG_STYLE_INPUT,"Configurando o Servidor: RCON","Coloque abaixo a senha RCON do servidor.","Confirmar","");
  469.     return 1;
  470. }
  471.  
  472. IsNumeric(const string[])
  473. {
  474.     for (new i = 0, j = strlen(string); i < j; i++)
  475.     {
  476.         if (string[i] > '9' || string[i] < '0') return 0;
  477.     }
  478.     return 1;
  479. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement