Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ___________________________________Rcon_Control_Panel________________________//
- // Creator: ScRipTerZ Aka Crazy_Sniper //
- // Date: 2015/03/01 //
- //______________________________________________________________________________//
- /* Note:
- / 1- Please if you are using it, add my name in credits
- / 2- You can't edit this filterscript without my permission
- / 3- Don't forget to rep me
- */
- //===============Includes=======================================================//
- #include <a_samp> // Thanks to SA-MP Team
- #include <zcmd> // Thanks to Zeex
- //==============================================================================/
- //---------DIALOG-----------------------------------------------------------------------/
- #define DIALOG_SRCP 12520 // Note, if you already using this number you are free to edit.
- #define DIALOG_CHANGEURL 12521
- #define DIALOG_CHANGEHOSTNAME 12522
- #define DIALOG_CHANGERCONPASS 12523
- #define DIALOG_CHANGEMAPNAME 12524
- #define DIALOG_LOADFS 12525
- #define DIALOG_UNLOADFS 12526
- #define DIALOG_RESTART 12527
- #define DIALOG_CHANGEGRAVITY 12528
- #define DIALOG_CHANGEMODE 12529
- #define DIALOG_RCONPASS 12530
- #define DIALOG_RELOAD 12531
- //---------------------------------------------------------------------------------------/
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" - ScRipTerZ _ Rcon Control Panel -");
- print(" - Loaded -");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" - ScRipTerZ _ Rcon Control Panel -");
- print(" - Unloaded -");
- print("--------------------------------------\n");
- return 1;
- }
- #endif
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_SRCP:
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEHOSTNAME,DIALOG_STYLE_INPUT,"Hostname","Write new hostname below","Done","");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEURL,DIALOG_STYLE_INPUT,"Weburl","Change weburl below","Done","Cancel");
- return 1;
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEGRAVITY,DIALOG_STYLE_INPUT,"Gravity","Change gravity below","Done","Cancel");
- return 1;
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid,DIALOG_RESTART,DIALOG_STYLE_MSGBOX,"Restart","Are you sure to restart the server?","Yes","No");
- return 1;
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEMODE,DIALOG_STYLE_INPUT,"Changemode","Write below, new gamemode you want to load\nExample: grandlarc.amx","Done","Cancel");
- return 1;
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid,DIALOG_LOADFS,DIALOG_STYLE_INPUT,"Load FilterScript","Write below, the filterscript name you want to load","Done","Cancel");
- return 1;
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid,DIALOG_UNLOADFS,DIALOG_STYLE_INPUT,"UnLoad FilterScript","Write below, the filterscript name you want to unload","Done","Cancel");
- return 1;
- }
- if(listitem == 7)
- {
- ShowPlayerDialog(playerid,DIALOG_RCONPASS,DIALOG_STYLE_INPUT,"Rcon password","Write below, new rcon password","Done","Cancel");
- return 1;
- }
- if(listitem == 8)
- {
- ShowPlayerDialog(playerid,DIALOG_RELOAD,DIALOG_STYLE_MSGBOX,"Reload Log/Bans","Which you want to reload?","Log","Bans");
- return 1;
- }
- }
- }
- }
- if(dialogid == DIALOG_CHANGEHOSTNAME)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEHOSTNAME,DIALOG_STYLE_INPUT,"Hostname","Write new hostname below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "hostname %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have change the hostname to %s",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload BanList","Click","Cancel");
- }
- if(dialogid == DIALOG_CHANGEURL)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEURL,DIALOG_STYLE_INPUT,"Weburl","Write new website url below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "weburl %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have change weburl to %s",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload BanList","Click","Cancel");
- }
- if(dialogid == DIALOG_CHANGEGRAVITY)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEGRAVITY,DIALOG_STYLE_INPUT,"Gravity","Write new gravity below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "gravity %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have change gravity to %s",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload BanList","Click","Cancel");
- }
- if(dialogid == DIALOG_RESTART)
- {
- if(response)
- {
- SendRconCommand("gmx");
- SendClientMessage(playerid,-1,"{00FF0A}Info: {FFFFFF}Restarting the server...");
- return 1;
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload BanList","Click","Cancel");
- }
- if(dialogid == DIALOG_CHANGEMODE)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_CHANGEMODE,DIALOG_STYLE_INPUT,"GameMode","Write new gamemode name below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "changemode %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have changed gamemode to %s",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload BanList","Click","Cancel");
- }
- if(dialogid == DIALOG_LOADFS)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_LOADFS,DIALOG_STYLE_INPUT,"Load Filterscript","Write filterscript to load below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "loadfs %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have loaded this FilterScript '%s'",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password","Click","Cancel");
- }
- if(dialogid == DIALOG_UNLOADFS)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_UNLOADFS,DIALOG_STYLE_INPUT,"UnLoad Filterscript","Write filterscript to unload below\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "unloadfs %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have unloaded this FilterScript '%s'",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password","Click","Cancel");
- }
- if(dialogid == DIALOG_RCONPASS)
- {
- if(response)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid,DIALOG_UNLOADFS,DIALOG_STYLE_INPUT,"Rcon Password","Write below, new rcon password\n{FF0000}Error: {FFFFFF}Write again","Done","");
- return 1;
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "rcon_password %s", inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{00FF0A}Info: {FFFFFF}you have changed rcon password to '%s'",inputtext);
- SendClientMessage(playerid,-1,string);
- return 1;
- }
- }
- else ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password","Click","Cancel");
- }
- if(dialogid == DIALOG_RELOAD)
- {
- if(response)
- {
- SendRconCommand("reloadlog");
- SendClientMessage(playerid,-1,"{00FF0A}Info: {FFFFFF}you have successfully reloaded the server log");
- return 1;
- }
- else
- {
- SendRconCommand("reloadbans");
- SendClientMessage(playerid,-1,"{00FF0A}Info: {FFFFFF}you have successfully reloaded the bans list");
- }
- }
- return 1;
- }
- CMD:srcp(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowPlayerDialog(playerid,DIALOG_SRCP,DIALOG_STYLE_LIST,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ","{FF1400}Hostname\n{FF1400}Weburl\n{FF1400}Gravity\n{FF1400}Restart\n{FF1400}Change Mode\n{FF1400}Load FilterScript\n{FF1400}Unload FilterScript\n{FF1400}Rcon Password\n{FF1400}Reload Log/Bans","Click","Cancel");
- }
- return 1;
- }
- CMD:srcphelp(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return 0;
- ShowPlayerDialog(playerid,9141,DIALOG_STYLE_MSGBOX,"{FFC800}Rcon Control Panel {FF0000}- {FF7800}By ScRipTerZ {FF0000}- {00FF0A}FAQS","{FF9600}How to use rcon control panel?\nEasy just write ( {FEFEFE}/srcp {FFFFFF}) and choose an option.\nif you found a bug please inform the author ( ScRipTerZ )","Ok","");
- return 1;
- }
- //===================================================================== END =================================================================//
Advertisement
Add Comment
Please, Sign In to add comment