Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sistema de Servidor Remoto por Mandrack_FreeZe
- Plugin e Include por Flag (http://forum.sa-mp.com/showthread.php?t=126232)
- Continuação do antigo CrazY Panel System, porém agora totalmente em dialog e adicionadas várias outras funções.
- VERSÃO 3.1:
- Configure o servidor diretamente dentro do jogo, sem precisar usar /rcon reloadfs PC
- SISTEMA CRIADO PARA LIVRE UTILIZAÇÃO E EDIÇÃO MANTENDO OS CRÉDITOS.
- TESTES PODEM SER REALIZADOS EM SERVIDORES HAMACHI
- NÃO RETIRE OS CRÉDITOS
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <extrcon>
- #include <DOF2>
- new checarconfig;
- public OnFilterScriptInit()
- {
- if (!DOF2_FileExists("PCConfig.ini"))
- {
- DOF2_CreateFile("PCConfig.ini");
- DOF2_SetString("PCConfig.ini", "IP", "0");
- DOF2_SetInt("PCConfig.ini", "Port", 7777);
- DOF2_SetString("PCConfig.ini", "RCONPass", "string");
- DOF2_SetInt("PCConfig.ini", "config", 1);
- DOF2_SaveFile();
- print("[PC]Arquivo PCConfig.ini criado com sucesso!");
- } else {
- checarconfig = DOF2_GetInt("PCConfig.ini", "config");
- print("[PC]Arquivo PCConfig.ini encontrado!");
- }
- print("\n--------------------------------------");
- print(" Plainel Remoto por Mandrack_FreeZe");
- print(" Plugin Extern Rcon 1.2 por Flag");
- print(" Versão do FS: v3.0");
- print(" Painel Remoto LIGADO com sucesso!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Painel Remoto por Mandrack_FreeZe");
- print(" Plugin Extern Rcon 1.2 por Flag");
- print(" Versão do FS: v3.0");
- print(" Painel Remoto DESLIGADO com sucesso!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/cp", cmdtext, true, 10) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(checarconfig == 1)
- {
- 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");
- } else {
- ShowPlayerDialog(playerid,5498,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
- }
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem autorização pra usar esse comando!");
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 6197)
- {
- if(response >= 1)
- {
- new string[150];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- DOF2_SetString("PCConfig.ini","RCONPass",inputtext);
- DOF2_SetInt("PCConfig.ini","config", 1);
- checarconfig = 1;
- DOF2_SaveFile();
- format(string, sizeof(string), "O Players %s configurou o RCON do servidor como %s.", PegarNome,DOF2_GetString("PCConfig.ini","RCONPass"));
- print(string);
- 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"));
- ShowPlayerDialog(playerid,6482,DIALOG_STYLE_MSGBOX,"Servidor Configurado!",string,"Confirmar","");
- return 1;
- }
- return 1;
- }
- if(dialogid == 4725)
- {
- if(response >= 1)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- DOF2_SetString("PCConfig.ini","Port",inputtext);
- DOF2_SaveFile();
- format(string, sizeof(string), "O Players %s configurou a Porta do servidor como %s", PegarNome,DOF2_GetString("PCConfig.ini","Port"));
- print(string);
- ShowPlayerDialog(playerid,6197,DIALOG_STYLE_INPUT,"Configurando o Servidor: RCON","Coloque abaixo a senha RCON do servidor.","Confirmar","");
- //SetTimer("DialogRCON", 1000,false);
- //SetTimerEx("DialogRcon", 1000,false, "i", playerid);
- return 1;
- }
- return 1;
- }
- if(dialogid == 5498)
- {
- if(response >= 1)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- DOF2_SetString("PCConfig.ini","IP",inputtext);
- DOF2_SaveFile();
- format(string, sizeof(string), "O Players %s configurou o IP do servidor como %s", PegarNome,DOF2_GetString("PCConfig.ini","IP"));
- print(string);
- ShowPlayerDialog(playerid,4725,DIALOG_STYLE_INPUT,"Configurando o Servidor: Porta","Coloque abaixo a Porta do servidor (Ex: 7777).","Confirmar","");
- //SetTimer("DialogPort", 1000,false);
- //SetTimerEx("DialogPort", 1000,false, "i", playerid);
- return 1;
- }
- return 1;
- }
- if(dialogid == 1973)
- {
- if(response)
- {
- new string[200];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- /*if(listitem == 0)
- {
- //ShowPlayerDialog(playerid,137954,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
- }*/
- if(listitem == 0 )
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você desligou o servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "exit");
- format(string, sizeof(string), "%s desligou o servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- print(string);
- return 1;
- }
- }
- else if(listitem == 1 )
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você deu GMX no servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "gmx");
- format(string, sizeof(string), "%s deu GMX no servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- print(string);
- return 1;
- }
- }
- else if(listitem == 2 )
- {
- ShowPlayerDialog(playerid,9173,DIALOG_STYLE_INPUT,"Trocar nome do Servidor","Coloque o novo nome do servidor abaixo:","Mudar","Cancelar");
- return 1;
- }
- else if(listitem == 3 )
- {
- ShowPlayerDialog(playerid,3719,DIALOG_STYLE_INPUT,"Trocar nome do Mapa","Coloque o novo nome do mapa abaixo:","Mudar","Cancelar");
- return 1;
- }
- else if(listitem == 4 )
- {
- ShowPlayerDialog(playerid,7391,DIALOG_STYLE_INPUT,"Trocar nome do Game Mode","Coloque o novo nome do Game Mode abaixo:","Mudar","Cancelar");
- return 1;
- }
- else if(listitem == 5 )
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você resetou os ips banidos do servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "reloadbans");
- format(string, sizeof(string), "%s deletou os ips banidos do servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- print(string);
- return 1;
- }
- }
- else if(listitem == 6 )
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você deletou o LOG do servidor %s:%d", DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), "reloadlog");
- format(string, sizeof(string), "%s deletou o LOG do servidor %s:%d", PegarNome, DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- print(string);
- return 1;
- }
- }
- else if(listitem == 7 )
- {
- ShowPlayerDialog(playerid,1834,DIALOG_STYLE_LIST,"Opções para players!","Banir IP\nDesbanir IP\nBanir Jogador\nKickar Jogador","Avançar","Cancelar");
- return 1;
- }
- else if(listitem == 8)
- {
- ShowPlayerDialog(playerid,5498,DIALOG_STYLE_INPUT,"Configurando o Servidor: IP","Coloque abaixo o IP do servidor.","Confirmar","");
- }
- else if(listitem == 9)
- {
- 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"));
- ShowPlayerDialog(playerid,6482,DIALOG_STYLE_MSGBOX,"Servidor Configurado!",string,"Confirmar","");
- }
- else
- {
- }
- }
- }
- if(dialogid == 9173)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- 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);
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "hostname %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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);
- print(string);
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem permissão!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 3719)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- 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);
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "mapname %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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);
- print(string);
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem permissão!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 7391)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- 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);
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "gamemodetext %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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);
- print(string);
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem permissão!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 1834)
- {
- if(response)
- {
- if(listitem == 0 )
- {
- ShowPlayerDialog(playerid,7852,DIALOG_STYLE_INPUT,"Banindo IP","Coloque o IP do jogador abaixo:","Banir","Cancelar");
- return 1;
- }
- else if(listitem == 1 )
- {
- ShowPlayerDialog(playerid,2587,DIALOG_STYLE_INPUT,"Desbanindo IP","Coloque o IP do jogador abaixo:","Desbanir","Cancelar");
- return 1;
- }
- else if(listitem == 2 )
- {
- ShowPlayerDialog(playerid,9874,DIALOG_STYLE_INPUT,"Banindo Jogador","Coloque o ID do jogador abaixo:","Banir","Cancelar");
- return 1;
- }
- else if(listitem == 3 )
- {
- ShowPlayerDialog(playerid,3698,DIALOG_STYLE_INPUT,"Kickando Jogador","Coloque oID do jogador abaixo:","Kickar","Cancelar");
- return 1;
- }
- }
- else
- {
- 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");
- return 1;
- }
- }
- if(dialogid == 7852)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você banio o IP %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "banip %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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"));
- print(string);
- return 1;
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem permissão!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 2587)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "Você desbanio o IP %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "unbanip %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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"));
- print(string);
- return 1;
- }
- else {
- SendClientMessage(playerid, -1, "Você não tem permissão!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 9874)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsNumeric(inputtext))
- {
- format(string, sizeof(string), "Você banio o ID %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "ban %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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"));
- print(string);
- return 1;
- }
- else {
- SendClientMessage(playerid, -1, "Apenas números são aceitos!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- if(dialogid == 3698)
- {
- new string[100];
- new PegarNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
- if(response)
- {
- if(IsNumeric(inputtext))
- {
- format(string, sizeof(string), "Você kickou o ID %s do servidor %s:%d", inputtext,DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "kick %s", inputtext);
- SendRconTo(DOF2_GetString("PCConfig.ini","IP"), DOF2_GetInt("PCConfig.ini", "Port"),DOF2_GetString("PCConfig.ini","RCONPass"), string);
- 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"));
- print(string);
- return 1;
- }
- else {
- SendClientMessage(playerid, -1, "Apenas números são aceitos!");
- }
- }
- else
- {
- 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");
- }
- return 1;
- }
- return 0;
- }
- forward DialogPort(playerid);
- public DialogPort(playerid)
- {
- ShowPlayerDialog(playerid,134679,DIALOG_STYLE_INPUT,"Configurando o Servidor: Porta","Coloque abaixo a Porta do servidor (Ex: 7777).","Confirmar","");
- return 1;
- }
- forward DialogRCON(playerid);
- public DialogRCON(playerid)
- {
- ShowPlayerDialog(playerid,16749852,DIALOG_STYLE_INPUT,"Configurando o Servidor: RCON","Coloque abaixo a senha RCON do servidor.","Confirmar","");
- return 1;
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement