pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DRCONLIST)
{
if(response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, CWHITE, " You have exited the Console."); // If he chose the Exit
SendRconCommand("exit");
}
case 1:
{
ShowPlayerDialog(playerid, DHOSTNAME, DIALOG_STYLE_INPUT, "Hostname", " Please enter a new Name for your server:", "Change", "Cancel"); // If he chose the Hostname, it will show him a dialog which he will have to write a new hostname
}
case 2:
{
ShowPlayerDialog(playerid, DGMTEXT, DIALOG_STYLE_INPUT, "Gamemode text", " Please enter a new gamemode text:", "Change", "Cancel"); // If he chose the Game Mode Text, it will show him a dialog which he will have to write a new Gamemode Text
}
case 3:
{
ShowPlayerDialog(playerid, DMAPNAME, DIALOG_STYLE_INPUT, "Map Name", " Please enter a new Map Name for your server:", "Change", "Cancel"); // If he chose the Map Name, it will show him a dialog which he will have to write a new mapname
}
case 4:
{
ShowPlayerDialog(playerid, DKICK, DIALOG_STYLE_INPUT, "Kick ID", " Please enter the ID you want to kick:", "Kick", "Cancel"); // If he chose the Kick, it will show him a dialog which he will have to write an ID he wants to get kicked.
}
case 5:
{
ShowPlayerDialog(playerid, DBAN, DIALOG_STYLE_INPUT, "Ban ID", " Please enter the ID you want to ban:", "Ban", "Cancel"); // If he chose the Ban, it will show him a dialog which he will have to write an ID he wants to get banned
}
case 6:
{
ShowPlayerDialog(playerid, DCMODE, DIALOG_STYLE_INPUT, "Change Mode", " Please enter a new GameMode for your server:", "Change", "Cancel"); // If he chose the Change Mode, it will show him a dialog which he will have to write a new Gamemode to load
}
case 7:
{
SendClientMessageToAll(CWHITE, " Server Restarting in 10 seconds!");
SetTimerEx("SRestart", 10000, 1, "i", playerid); // If he pressed the GMX, it will make him a timer which will restart the server
}
case 8:
{
ShowPlayerDialog(playerid, DSAY, DIALOG_STYLE_INPUT, "Admin Say", " Please enter something you want to say:", "Say", "Cancel"); // If he chose the Say, it will show him a dialog which he will have to write an admin message to send
}
case 9:
{
ShowPlayerDialog(playerid, DBANIP, DIALOG_STYLE_INPUT, "Ban IP", " Please enter an IP that you want to ban:", "Ban IP", "Cancel"); // If he chose the Ban IP, it will show him a dialog which he will have to write an IP he wants to get banned
}
case 10:
{
ShowPlayerDialog(playerid, DUNBANIP, DIALOG_STYLE_INPUT, "Unban IP", " Please enter an IP that you want to unban:", "Unban IP", "Cancel"); // If he chose the Unban IP, it will show him a dialog which he will have to write an IP he wants to get unbanned
}
case 11:
{
ShowPlayerDialog(playerid, DGRAVITY, DIALOG_STYLE_INPUT, "Gravity", " Please enter the amount of Gravity you want to be:", "Set Gravity", "Cancel"); // If he chose the Gravity, it will show him a dialog which he will have to write a new gravity for the server
}
case 12:
{
ShowPlayerDialog(playerid, DWEATHER, DIALOG_STYLE_INPUT, "Weather", " Please enter a weather ID to change Weather:", "Set Weather", "Cancel"); // If he chose the Weather, it will show him a dialog which he will have to write a new Weather for the server
}
case 13:
{
ShowPlayerDialog(playerid, DLOADFS, DIALOG_STYLE_INPUT, "Load Filterscript", " Please enter a Filterscript name to Load:", "Load FS", "Cancel"); // If he chose the Load Filterscript, it will show him a dialog which he will have to write a FS to load
}
case 14:
{
ShowPlayerDialog(playerid, DWEBURL, DIALOG_STYLE_INPUT, "Web URL", " Please enter a Web URL to set:", "Set Web URL", "Cancel"); // If he chose the Web URL, it will show him a dialog which he will have to write a new WEB URL
}
case 15:
{
ShowPlayerDialog(playerid, DUNLOADFS, DIALOG_STYLE_INPUT, "Unload Filterscript", " Please enter a Filterscript name to Unload:", "Unload FS", "Cancel");// If he chose the Unload Filterscript, it will show him a dialog which he will have to write a FS to unload
}
case 16:
{
ShowPlayerDialog(playerid, DRELOADFS, DIALOG_STYLE_INPUT, "Reload Filterscript", " Please enter a Filterscript name to Unload:", "Reload FS", "Cancel");// If he chose the Reload Filterscript, it will show him a dialog which he will have to write a FS to reload
}
}
}
}
if(dialogid == DHOSTNAME) // If he responsed on the Hostname change it will send him a message and change the Hostname
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "hostname %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Hostname changed!");
}
}
if(dialogid == DGMTEXT) // If he responsed on the Gamemode text change it will send him a message and change the GM text
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "gamemodetext %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Gamemode text changed!");
}
}
if(dialogid == DMAPNAME) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "mapname %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Mapname changed!");
}
}
if(dialogid == DKICK) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "kick %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " You have kicked the player!");
}
}
if(dialogid == DBAN) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "ban %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " You have kicked the player!");
}
}
if(dialogid == DCMODE) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "changemode %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Gamemode text changed!");
}
}
if(dialogid == DSAY) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "say %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Admin message sent!");
}
}
if(dialogid == DBANIP) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "banip %s", inputtext);
SendRconCommand(string);
format(string,sizeof(string), "You have banned IP %s", inputtext);
SendClientMessage(playerid, CWHITE, string);
}
}
if(dialogid == DUNBANIP) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "unbanip %s", inputtext);
SendRconCommand(string);
format(string,sizeof(string), "You have unbanned IP %s", inputtext);
SendClientMessage(playerid, CWHITE, string);
}
}
if(dialogid == DGRAVITY) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "gravity %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Gravity changed!");
}
}
if(dialogid == DWEATHER) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "weather %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Weather changed!");
}
}
if(dialogid == DLOADFS) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "loadfs %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Filterscript loaded!");
}
}
if(dialogid == DWEBURL) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "weburl %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Server Web URL changed!");
}
}
if(dialogid == DUNLOADFS) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "unloadfs %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Filterscript unloaded!");
}
}
if(dialogid == DRELOADFS) // SAME AS ABOVE DIALOGS^^
{
if(response)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, CGREY, "You did not enter anything" );
return 1;
}
new string[256];
format(string,sizeof(string), "reloadfs %s", inputtext);
SendRconCommand(string);
SendClientMessage(playerid, CWHITE, " Filterscript reloaded!");
}
}
return 1;
}