Guest User

Rcon Panel

a guest
Nov 1st, 2013
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. #include <a_samp>
  2. //Dialogs
  3. #define D_Panel 500
  4. #define D_HostName 501
  5. #define D_GameModeText 502
  6. #define D_MapName 503
  7. #define D_Exec 504
  8. #define D_Kick 505
  9. #define D_Ban 506
  10. #define D_ChangeMode 507
  11. #define D_Gmx 508
  12. #define D_Say 509
  13. #define D_BanIP 510
  14. #define D_UnBanIP 511
  15. #define D_Gravity 512
  16. #define D_Weather 513
  17. #define D_LoadFS 514
  18. #define D_Weburl 515
  19. #define D_UnLoadFS 516
  20. #define D_ReloadFS 517
  21. #define D_RCON_PASSWORD 518
  22. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  23. new string[256];
  24. switch(dialogid){
  25. case 500:{
  26. if(!response)return 1;
  27. switch(listitem){
  28. case 0:ShowPlayerDialog(playerid,D_HostName,1,"Edit Host Name","Write the new host name:","Accept","Cancel");
  29. case 1:ShowPlayerDialog(playerid,D_GameModeText,1,"Edit Game Mode Text","Write the new game mode text:","Accept","Cancel");
  30. case 2:ShowPlayerDialog(playerid,D_MapName,1,"Edit Map Name","Write the new map name:","Accept","Cancel");
  31. case 3:ShowPlayerDialog(playerid,D_Exec,1,"Edit Exec","Write the file you want to exec:","Accept","Cancel");
  32. case 4:ShowPlayerDialog(playerid,D_Kick,1,"Kick Player","Write ID for kick:","Accept","Cancel");
  33. case 5:ShowPlayerDialog(playerid,D_Ban,1,"Ban Player","Write ID for ban:","Accept","Cancel");
  34. case 6:ShowPlayerDialog(playerid,D_ChangeMode,1,"Edit Mode","Write the name of new mode:","Accept","Cancel");
  35. case 7:ShowPlayerDialog(playerid,D_Gmx,1,"GMX - Restart","Write the reason for GMX:","Accept","Cancel");
  36. case 8:SendRconCommand("reloadbans"),SendClientMessage(playerid,-1,"You have been reload server bans.");
  37. case 9:SendRconCommand("reloadlog"),SendClientMessage(playerid,-1,"You have been reload server log.");
  38. case 10:ShowPlayerDialog(playerid,D_Say,1,"Say Server","Write what you want say:","Say","Cancel");
  39. case 11:SendRconCommand("players");
  40. case 12:ShowPlayerDialog(playerid,D_BanIP,1,"Ban IP","Write IP to give ban:","Accept","Cancel");
  41. case 13:ShowPlayerDialog(playerid,D_UnBanIP,1,"UnBan IP","Write IP to give un ban:","Accept","Cancel");
  42. case 14:ShowPlayerDialog(playerid,D_Gravity,1,"Edit Gravity","Write the new number of gravity:","Accept","Cancel");
  43. case 15:ShowPlayerDialog(playerid,D_Weather,1,"Edit Weather","Write the new number of weather:","Accept","Cancel");
  44. case 16:ShowPlayerDialog(playerid,D_LoadFS,1,"Load FilterScript","Write the name of filterscript:","Accept","Cancel");
  45. case 17:ShowPlayerDialog(playerid,D_Weburl,1,"Edit Webrul","Write the name of new webrul:","Accept","Cancel");
  46. case 18:ShowPlayerDialog(playerid,D_UnLoadFS,1,"UnLoad FilterScript","Write the name of filterscript:","Accept","Cancel");
  47. case 19:ShowPlayerDialog(playerid,D_ReloadFS,1,"Reload FilterScript","Write the name of filterscript:","Accept","Cancel");
  48. case 20:ShowPlayerDialog(playerid,D_RCON_PASSWORD,3,"Edit RCON PASSWORD","Write the new RCON PASSWORD","Accept","Cancel");}}
  49. case D_HostName:format(string, sizeof(string), "hostname %s", inputtext),SendRconCommand(string);
  50. case D_GameModeText:format(string, sizeof(string), "gamemodetext %s", inputtext),SendRconCommand(string);
  51. case D_MapName:format(string, sizeof(string), "mapname %s", inputtext),SendRconCommand(string);
  52. case D_Exec:format(string, sizeof(string), "exec %s", inputtext),SendRconCommand(string);
  53. case D_Kick:Kick(strval(inputtext));
  54. case D_Ban:Ban(strval(inputtext));
  55. case D_ChangeMode:format(string, sizeof(string), "changemode %s", inputtext),SendRconCommand(string);
  56. case D_Gmx:format(string,sizeof(string),"SERVER: Gamemode is restarting.. Reason: %s",inputtext),SendClientMessageToAll(-1,string),SendRconCommand("gmx");
  57. case D_Say:format(string,sizeof(string),"say %s",inputtext),SendRconCommand(string);
  58. case D_BanIP:format(string,sizeof(string),"banip %s",inputtext),SendRconCommand(string);
  59. case D_UnBanIP:format(string,sizeof(string),"unbanip %s",inputtext),SendRconCommand(string);
  60. case D_Gravity:format(string,sizeof(string),"gravity %s",inputtext),SendRconCommand(string);
  61. case D_Weather:format(string,sizeof(string),"weather %d",strval(inputtext)),SendRconCommand(string);
  62. case D_LoadFS:format(string,sizeof(string),"loadfs %s",inputtext),SendRconCommand(string);
  63. case D_Weburl:format(string,sizeof(string),"weburl %s",inputtext),SendRconCommand(string);
  64. case D_UnLoadFS:format(string,sizeof(string),"unloadfs %s",inputtext),SendRconCommand(string);
  65. case D_ReloadFS:format(string,sizeof(string),"reloadfs %s",inputtext),SendRconCommand(string);
  66. case D_RCON_PASSWORD:format(string,sizeof(string),"rcon_password %s",inputtext),SendRconCommand(string);}
  67. return 1;}
  68. public OnPlayerCommandText(playerid, cmdtext[]){
  69. if(!strcmp(cmdtext, "/PRcon", true) && IsPlayerAdmin(playerid))return ShowPlayerDialog(playerid,D_Panel,2,"Edit Rcon Panel","Host Name\nGame Mode Text\nMap Name\nExec\nKick\nBan\nChange Mode\nGMX\nReload Bans\nReload Log\nSay\nPlayers\nBan IP\nUnBan IP\nGravity\nWeather\nLoad FS\nWebrul\nUnLoad FS\nReload FS\nRCON_PASSWORD","Select","Cancel");
  70. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment