[FilterScript] Rcon Control Panel
#1

Hello

Well I made Rcon Control Panel it's not nice like other it Only have 12commands

*ChangeHostName
*ChangeMapName
*ChangeGameModeTEXT
*Password
*ChangeGravity
*ChangeWorldTime
*ChangeWebsiteURL
*Announce
*Load Filter-Script
*Unload Filter-Script
*Ban
*Kick


Code:
//Rcon Control Panel Made by Meow22

#include <a_samp>
#define NAME "Server Owner Control Panel"


#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xF5DEB3AA

new title[256];
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (!IsPlayerAdmin(playerid)) return 0;
	if(strcmp("/mcpanel", cmdtext, true) == 0)
	{
	    if (IsPlayerAdmin(playerid))ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
		return 1;
	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if (dialogid == 8500 && response)
	{
	    if (listitem == 0)
	    {
	        ShowPlayerDialog(playerid, 8501, DIALOG_STYLE_INPUT, "HostName", "{FF0000}<Enter New Host Name>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 1)
	    {
	        ShowPlayerDialog(playerid, 8502, DIALOG_STYLE_INPUT, "Password", "{FF0000}<(Enter Password 0 For Unlock):", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 2)
	    {
	        ShowPlayerDialog(playerid, 8503, DIALOG_STYLE_INPUT, "GameModeText", "{FF0000}<Enter Server GameMode Text> ", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 3)
	    {
	        ShowPlayerDialog(playerid, 8504, DIALOG_STYLE_INPUT, "MapName", "{FF0000}<Change Server Map>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 4)
	    {
	        ShowPlayerDialog(playerid, 8505, DIALOG_STYLE_INPUT, "Gravity", "{FF0000}<Change the Gravity(Default: 0.008)>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 5)
	    {
	        ShowPlayerDialog(playerid, 8506, DIALOG_STYLE_INPUT, "Weburl", "{FF0000}<Enter Your Website [URL]>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 6)
	    {
	        ShowPlayerDialog(playerid, 8507, DIALOG_STYLE_INPUT, "WorldTime", "{FF0000<Change Server Time(0-23)>:", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 7)
	    {
	        ShowPlayerDialog(playerid, 8508, DIALOG_STYLE_INPUT, "Ban", "{FF0000}<Ban <id>:", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 8)
	    {
	        ShowPlayerDialog(playerid, 8509, DIALOG_STYLE_INPUT, "Kick", "{FF0000}<Kick <id>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 9)
	    {
	        ShowPlayerDialog(playerid, 8510, DIALOG_STYLE_INPUT, "Announce", "{FF0000}<Annonuce Message to all>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 10)
	    {
	        ShowPlayerDialog(playerid, 8511, DIALOG_STYLE_INPUT, "Load Filterscript", "{FF0000}<Enter The FilterScript File Name>", "Enter", "Exit");
	        return 1;
	    }
	    if (listitem == 11)
		{
	        ShowPlayerDialog(playerid, 8512, DIALOG_STYLE_INPUT, "UnLoad Filterscript", "{FF0000<Enter The FilterScript File Name>", "Enter", "Exit");
	        return 1;
	    }
	    return 1;
	}
	
	if (dialogid == 8501)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"hostname %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8502)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"password %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8503)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"gamemodetext %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8504)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"mapname %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8505)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"gravity %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	if (dialogid == 8506)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"weburl %s",inputtext);
	        SendRconCommand(command);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8507)
	{
	    if (response)
	    {
	        new command[256];
	        format(command,sizeof(command),"worldtime %s",inputtext);
	        SendRconCommand(command);
			SetWorldTime(strval(inputtext));
	    }
	    else
	    {
		        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8508)
	{
	    if (response)
	    {
			new ID = strval(inputtext);
			if (!IsPlayerConnected(ID))
			{
				ShowPlayerDialog(playerid,8550,DIALOG_STYLE_MSGBOX,title,"{FF0000}This player is not online!","OK","");
				return 1;
			}
			new msg[256],name1[128],name2[128];
			GetPlayerName(playerid,name1,128);
			GetPlayerName(ID,name2,128);
			format(msg,256,"[%d]%s has been Banned by [%d]%s",ID,name2,playerid,name1);
			print(msg);
			SendClientMessage(ID,COLOR_RED,msg);
			Ban(ID);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8509)
	{
	    if (response)
	    {
			new ID = strval(inputtext);
			if (!IsPlayerConnected(ID))
			{
				ShowPlayerDialog(playerid,8550,DIALOG_STYLE_MSGBOX,title,"{FF0000}This player is not online!","OK","");
				return 1;
			}
			new msg[256],name1[128],name2[128];
			GetPlayerName(playerid,name1,128);
			GetPlayerName(ID,name2,128);
			format(msg,256,"[%d]%s has been Kicked by [%d]%s",ID,name2,playerid,name1);
			print(msg);
			SendClientMessage(ID,COLOR_RED,msg);
			Kick(ID);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	
	if (dialogid == 8510)
	{
	    if (response)
	    {
			new msg[256],name[128];
			GetPlayerName(playerid,name,128);
			format(msg,256,"Admin [%d]%s Announce: %s",playerid,name,inputtext);
			SendClientMessageToAll(COLOR_YELLOW,msg);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	if (dialogid == 8511)
	{
	    if (response)
	    {
	        new c[128];
	        format(c,128,"loadfs %s",inputtext);
			SendRconCommand©;
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	if (dialogid == 8512)
	{
	    if (response)
	    {
	        new c[128];
	        format(c,128,"unloadfs %s",inputtext);
			SendRconCommand©;
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,8500,DIALOG_STYLE_LIST,title,"{0F00F0}ChangeHostName\n{0F00F0}Password\n{0F00F0}ChangeGameModeText\n{0F00F0}ChangeMapName\n{0F00F0}ChangeGravity\n{0F00F0}ChangeWeburl\n{0F00F0}ChangeWorldTime\n{0F00F0}Ban\n{0F00F0}Kick\n{0F00F0}Announce\n{0F00F0}Load Filterscript\n{0F00F0}UnLoad FilterScript","Enter","Exit");
	    }
	}
	return 0;
}
Reply
#2

not bad
Reply
#3

good work
+REP
Reply
#4

Why you don't try something new ??
Reply
#5

Quote:
Originally Posted by FailerZ
View Post
Why you don't try something new ??
Why I try new stuff also.
Reply
#6

Good Work!
Reply
#7

Nice +rep
Reply
#8

Nothing new at all, you should use switches for on the OnDialogResponse as it's a lot faster, and use ZCMD too as that's a lot faster.
Reply
#9

Quote:
Originally Posted by DanishHaq
View Post
Nothing new at all, you should use switches for on the OnDialogResponse as it's a lot faster, and use ZCMD too as that's a lot faster.
Well ok I will use that and thanks for telling
Reply
#10

Nice script my friend
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)