Advertisement
Guest User

MRcon Console v1.0

a guest
Jul 4th, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.69 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #define FILTERSCRIPT
  4. #define COLOR_LIME 0x10F441AA
  5. #define COLOR_WHITE 0xFFFFFFAA
  6. #define COL_GREEN "{00FF00}"
  7. #define COL_WHITE "{FFFFFF}"
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print(" Blank Filterscript by your name here");
  12.     return 1;
  13. }
  14.  
  15. public OnFilterScriptExit()
  16. {
  17.     return 1;
  18. }
  19.  
  20. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  21. {
  22.     if(!IsPlayerAdmin(playerid))return 0;
  23.     if(IsPlayerAdmin(playerid))
  24.     {
  25.     SetPlayerHealth(clickedplayerid, 0);
  26.     }
  27.     return 1;
  28. }
  29.  
  30. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  31. {
  32.     if(dialogid == 66)
  33.     {
  34.         if(response)
  35.         {
  36.             if(listitem == 0) {
  37.             SendRconCommand("gmx"); SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent"); SendClientMessageToAll(COLOR_WHITE, "The Server Is Restarting");
  38.             }
  39.             else if(listitem == 1) {
  40.             SendRconCommand("exit"); SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  41.             }
  42.             else if(listitem == 2) {
  43.             ShowPlayerDialog(playerid,67,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Name",""COL_WHITE"Write the Server Name to which you want to change the Server Name","Change","Cancel");
  44.             }
  45.             else if(listitem == 3) {
  46.             ShowPlayerDialog(playerid,68,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Password",""COL_WHITE"Write the Password to which you want to Set/Change the server Password","Set/Change","Cancel");
  47.             }
  48.             else if(listitem == 4) {
  49.             ShowPlayerDialog(playerid,69,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Rcon Password",""COL_WHITE"Write the Password to which you want to change the server Rcon Password","Change","Cancel");
  50.             }
  51.             else if(listitem == 5) {
  52.             ShowPlayerDialog(playerid,83,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Gamemode",""COL_WHITE"Enter the Gamemode name to which you want to change the server gamemode","Change","Cancel");
  53.             }
  54.             else if(listitem == 6) {
  55.             ShowPlayerDialog(playerid,70,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server GameMode Text",""COL_WHITE"Write the Gamemode Text to which you want to change the server Gamemode Text","Change","Cancel");
  56.             }
  57.             else if(listitem == 7) {
  58.             ShowPlayerDialog(playerid,71,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Map Name",""COL_WHITE"Write the Map Name to which you want to change the server Map Name","Change","Cancel");
  59.             }
  60.             else if(listitem == 8) {
  61.             ShowPlayerDialog(playerid,81,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Weburl",""COL_WHITE"Enter a URL to set it at server Weburl","Set","Cancel");
  62.             }
  63.             else if(listitem == 9) {
  64.             ShowPlayerDialog(playerid,72,DIALOG_STYLE_INPUT,""COL_GREEN"Change Server Language",""COL_WHITE"Write the Language to which you want to change the server Language","Change","Cancel");
  65.             }
  66.             else if(listitem == 10) {
  67.             ShowPlayerDialog(playerid,73,DIALOG_STYLE_INPUT,""COL_GREEN"Load Filterscript",""COL_WHITE"Write the name of the Filterscript which you want to load","Load","Cancel");
  68.             }
  69.             else if(listitem == 11) {
  70.             ShowPlayerDialog(playerid,74,DIALOG_STYLE_INPUT,""COL_GREEN"Unload Filterscript",""COL_WHITE"Write the name of the Filterscript which you want to Unload","Unload","Cancel");
  71.             }
  72.             else if(listitem == 12) {
  73.             ShowPlayerDialog(playerid,75,DIALOG_STYLE_INPUT,""COL_GREEN"Reload Filterscript",""COL_WHITE"Write the name of the Filterscript which you want to Reload","Reload","Cancel");
  74.             }
  75.             else if(listitem == 13) {
  76.             ShowPlayerDialog(playerid,76,DIALOG_STYLE_INPUT,""COL_GREEN"Ban Player",""COL_WHITE"Write the playerid of the player which you want to Ban","Ban","Cancel");
  77.             }
  78.             else if(listitem == 14) {
  79.             ShowPlayerDialog(playerid,78,DIALOG_STYLE_INPUT,""COL_GREEN"Unban IP",""COL_WHITE"Write the IP which you want to Unban","Unban","Cancel");
  80.             }
  81.             else if(listitem == 15) {
  82.             ShowPlayerDialog(playerid,79,DIALOG_STYLE_INPUT,""COL_GREEN"Kick",""COL_WHITE"Write the playerid of the player you want to kick","Kick","Cancel");
  83.             }
  84.             else if(listitem == 16) {
  85.             SendRconCommand("reloadbans");
  86.             SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  87.             }
  88.             else if(listitem == 17) {
  89.             ShowPlayerDialog(playerid,80,DIALOG_STYLE_INPUT,""COL_GREEN"Admin Announce",""COL_WHITE"Enter the text which you want to announce as an admin","Announce","Cancel");
  90.             }
  91.             else if(listitem == 18) {
  92.             ShowPlayerDialog(playerid,82,DIALOG_STYLE_INPUT,""COL_GREEN"Set Gravity",""COL_WHITE"Enter the amount of gravity to which you want to change","Change","Cancel");
  93.             }
  94.             else if(listitem == 19) {
  95.             ShowPlayerDialog(playerid,84,DIALOG_STYLE_INPUT,""COL_GREEN"Set Messages Per Seconds",""COL_WHITE"Enter the amount of messages limit per second to which you want to change","Change","Cancel");
  96.             }
  97.             else if(listitem == 20) {
  98.             ShowPlayerDialog(playerid,85,DIALOG_STYLE_INPUT,""COL_GREEN"Set Message Holes Limit",""COL_WHITE"Enter the amount of message hole limit to which you want to change","Change","Cancel");
  99.             }
  100.             else if(listitem == 21) {
  101.             ShowPlayerDialog(playerid,86,DIALOG_STYLE_INPUT,""COL_GREEN"Set Acks Limit",""COL_WHITE"Enter the amount of acks limit to which want to change","Change","Cancel");
  102.             }
  103.         }
  104.     }
  105.    
  106.     if(dialogid == 67)
  107.     {
  108.         if(response)
  109.         {
  110.         new str[256],string[256];
  111.         format(str,sizeof(string),"hostname %s",inputtext);
  112.         format(string,sizeof(string),"(%s)", str);
  113.         SendRconCommand(str);
  114.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  115.         }
  116.     }
  117.     if(dialogid == 68)
  118.     {
  119.         if(response)
  120.         {
  121.         new str[256],string[256];
  122.         format(str,sizeof(string),"password %s",inputtext);
  123.         format(string,sizeof(string),"(%s)", str);
  124.         SendRconCommand(str);
  125.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  126.         }
  127.     }
  128.     if(dialogid == 69)
  129.     {
  130.         if(response)
  131.         {
  132.         new str[256],string[256];
  133.         format(str,sizeof(string),"rcon_password %s",inputtext);
  134.         format(string,sizeof(string),"(%s)", str);
  135.         SendRconCommand(str);
  136.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  137.         }
  138.     }
  139.     if(dialogid == 70)
  140.     {
  141.         if(response)
  142.         {
  143.         new str[256],string[256];
  144.         format(str,sizeof(string),"gamemodetext %s",inputtext);
  145.         format(string,sizeof(string),"(%s)", str);
  146.         SendRconCommand(str);
  147.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  148.         }
  149.     }
  150.     if(dialogid == 71)
  151.     {
  152.         if(response)
  153.         {
  154.         new str[256],string[256];
  155.         format(str,sizeof(string),"mapname %s",inputtext);
  156.         format(string,sizeof(string),"(%s)", str);
  157.         SendRconCommand(str);
  158.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  159.         }
  160.     }
  161.     if(dialogid == 72)
  162.     {
  163.         if(response)
  164.         {
  165.         new str[256],string[256];
  166.         format(str,sizeof(string),"language %s",inputtext);
  167.         format(string,sizeof(string),"(%s)", str);
  168.         SendRconCommand(str);
  169.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  170.         }
  171.     }
  172.     if(dialogid == 73)
  173.     {
  174.         if(response)
  175.         {
  176.         new str[256],string[256];
  177.         format(str,sizeof(string),"loadfs %s",inputtext);
  178.         format(string,sizeof(string),"(%s)", str);
  179.         SendRconCommand(str);
  180.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  181.         }
  182.     }
  183.     if(dialogid == 74)
  184.     {
  185.         if(response)
  186.         {
  187.         new str[256],string[256];
  188.         format(str,sizeof(string),"unloadfs %s",inputtext);
  189.         format(string,sizeof(string),"(%s)", str);
  190.         SendRconCommand(str);
  191.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  192.         }
  193.     }
  194.     if(dialogid == 75)
  195.     {
  196.         if(response)
  197.         {
  198.         new str[256],string[256];
  199.         format(str,sizeof(string),"reloadfs %s",inputtext);
  200.         format(string,sizeof(string),"(%s)", str);
  201.         SendRconCommand(str);
  202.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  203.         }
  204.     }
  205.     if(dialogid == 76)
  206.     {
  207.         if(response)
  208.         {
  209.         new str[256],string[256];
  210.         format(str,sizeof(string),"ban %s",inputtext);
  211.         format(string,sizeof(string),"Admin %s Banned Playerid (%s)", GetName(playerid), inputtext);
  212.         SendClientMessageToAll(COLOR_LIME, string);
  213.         SendRconCommand(str);
  214.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  215.         }
  216.     }
  217.     if(dialogid == 78)
  218.     {
  219.         if(response)
  220.         {
  221.         new str[256],string[256];
  222.         format(str,sizeof(string),"unbanip %s",inputtext);
  223.         format(string,sizeof(string),"(%s)", str);
  224.         SendRconCommand(str);
  225.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  226.         }
  227.     }
  228.     if(dialogid == 79)
  229.     {
  230.         if(response)
  231.         {
  232.         new str[256],string[256];
  233.         format(str,sizeof(string),"kick %s",inputtext);
  234.         format(string,sizeof(string),"Admin %s Kicked Playerid (%d)", GetName(playerid), inputtext);
  235.         SendClientMessageToAll(COLOR_LIME, string);
  236.         SendRconCommand(str);
  237.         SendClientMessage(playerid,COLOR_WHITE,"SERVER: Console Command Sent");
  238.         }
  239.     }
  240.     if(dialogid == 80)
  241.     {
  242.         if(response)
  243.         {
  244.         new str[256],string[256];
  245.         format(str,sizeof(string),"say %s",inputtext);
  246.         format(string,sizeof(string),"(%s)", str);
  247.         SendRconCommand(str);
  248.         }
  249.     }
  250.     if(dialogid == 81)
  251.     {
  252.         if(response)
  253.         {
  254.         new str[256],string[256];
  255.         format(str,sizeof(string),"weburl %s",inputtext);
  256.         format(string,sizeof(string),"(%s)", str);
  257.         SendRconCommand(str);
  258.         }
  259.     }
  260.     if(dialogid == 82)
  261.     {
  262.         if(response)
  263.         {
  264.         new str[256],string[256];
  265.         format(str,sizeof(string),"gravity %s",inputtext);
  266.         format(string,sizeof(string),"(%s)", str);
  267.         SendRconCommand(str);
  268.         }
  269.     }
  270.     if(dialogid == 83)
  271.     {
  272.         if(response)
  273.         {
  274.         new str[256],string[256];
  275.         format(str,sizeof(string),"changemode %s",inputtext);
  276.         format(string,sizeof(string),"(%s)", str);
  277.         SendRconCommand(str);
  278.         }
  279.     }
  280.     if(dialogid == 84)
  281.     {
  282.         if(response)
  283.         {
  284.         new str[256],string[256];
  285.         format(str,sizeof(string),"messageslimit %s",inputtext);
  286.         format(string,sizeof(string),"(%s)", str);
  287.         SendRconCommand(str);
  288.         }
  289.     }
  290.     if(dialogid == 85)
  291.     {
  292.         if(response)
  293.         {
  294.         new str[256],string[256];
  295.         format(str,sizeof(string),"messagesholelimit %s",inputtext);
  296.         format(string,sizeof(string),"(%s)", str);
  297.         SendRconCommand(str);
  298.         }
  299.     }
  300.     if(dialogid == 86)
  301.     {
  302.         if(response)
  303.         {
  304.         new str[256],string[256];
  305.         format(str,sizeof(string),"ackslimit %s",inputtext);
  306.         format(string,sizeof(string),"(%s)", str);
  307.         SendRconCommand(str);
  308.         }
  309.     }
  310.     return 1;
  311. }
  312.  
  313. CMD:console(playerid, params[])
  314. {
  315.     if(!IsPlayerAdmin(playerid))return 0;
  316.     if(IsPlayerAdmin(playerid))
  317.     {
  318.     ShowPlayerDialog(playerid, 66, DIALOG_STYLE_LIST, ""COL_GREEN"Admin Console",
  319.                       ""COL_WHITE"Restart Server\nClose Server\nChange Server Name\nSet/Reset Server Password\nChange Rcon Password\nChange Server Gamemode\nChange Server GameMode Text\nChange Server Maps Name\nChange Server Weburl\nChange Server Language\nLoad Filterscript\nUnload Filterscript\nReload Filterscript\nBan\nUnban IP\nKick\nClear BanLog\nAdmin Announce\nSet Gravity\nChange Messages Per Second\nSet Message Hole Limit\nSet Acks Limit", "Select", "Cancel");
  320.     }
  321.     return 1;
  322. }
  323.  
  324. stock GetName(playerid)
  325. {
  326.     new playerName[MAX_PLAYER_NAME];
  327.  
  328.     GetPlayerName(playerid, playerName, sizeof(playerName));
  329.  
  330.     return playerName;
  331. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement