22.07.2013, 16:25
Hey there.I am making a new FS but I have a problem.Whenever I type the Command, it works but when I click on something it does nothing.Just closes the dialog.Here is the Command:
And here the DRCONLIST on OnDialogResponse:
pawn Код:
CMD:rconmenu(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, DRCONLIST, DIALOG_STYLE_LIST, "RCON Command List", "Exit\nHostname\nGame Mode Text\nMap Name\nKick\nBan\nChange Mode\nGMX\nSay\nBan IP\nUnban IP\nGravity\nWeather\nLoad Filterscript\nWeb URL\nUnload Filterscript\nReload Filterscript", "Select", "Close");
}
else
{
SendClientMessage(playerid, CGREY, "You need to be Logged In as RCON Administrator.");
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DRCONLIST)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, CWHITE, " You have exited the Console.");
SendRconCommand("exit");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, DHOSTNAME, DIALOG_STYLE_INPUT, "Hostname", " Please enter a new Name for your server:", "Change", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, DGMTEXT, DIALOG_STYLE_INPUT, "Ban IP", " Please enter an IP that you want to ban:", "Ban IP", "Cancel");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, DMAPNAME, DIALOG_STYLE_INPUT, "Map Name", " Please enter a new Map Name for your server:", "Change", "Cancel");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, DKICK, DIALOG_STYLE_INPUT, "Kick ID", " Please enter the ID you want to kick:", "Kick", "Cancel");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, DBAN, DIALOG_STYLE_INPUT, "Ban ID", " Please enter the ID you want to ban:", "Ban", "Cancel");
}
if(listitem == 6)
{
ShowPlayerDialog(playerid, DCMODE, DIALOG_STYLE_INPUT, "Change Mode", " Please enter a new GameMode for your server:", "Change", "Cancel");
}
if(listitem == 7)
{
SendClientMessageToAll(CWHITE, " Server Restarting in 10 seconds!");
SetTimerEx("SRestart", 10000, 1, "i", playerid);
}
if(listitem == 8)
{
ShowPlayerDialog(playerid, DSAY, DIALOG_STYLE_INPUT, "Admin Say", " Please enter something you want to say:", "Say", "Cancel");
}
if(listitem == 9)
{
ShowPlayerDialog(playerid, DBANIP, DIALOG_STYLE_INPUT, "Ban IP", " Please enter an IP that you want to ban:", "Ban IP", "Cancel");
}
if(listitem == 10)
{
ShowPlayerDialog(playerid, DUNBANIP, DIALOG_STYLE_INPUT, "Unban IP", " Please enter an IP that you want to unban:", "Unban IP", "Cancel");
}
if(listitem == 11)
{
ShowPlayerDialog(playerid, DGRAVITY, DIALOG_STYLE_INPUT, "Gravity", " Please enter the amount of Gravity you want to be:", "Set Gravity", "Cancel");
}
if(listitem == 12)
{
ShowPlayerDialog(playerid, DWEATHER, DIALOG_STYLE_INPUT, "Weather", " Please enter a weather ID to change Weather:", "Set Weather", "Cancel");
}
if(listitem == 13)
{
ShowPlayerDialog(playerid, DLOADFS, DIALOG_STYLE_INPUT, "Load Filterscript", " Please enter a Filterscript name to Load:", "Load FS", "Cancel");
}
if(listitem == 14)
{
ShowPlayerDialog(playerid, DWEBURL, DIALOG_STYLE_INPUT, "Web URL", " Please enter a Web URL to set:", "Set Web URL", "Cancel");
}
if(listitem == 15)
{
ShowPlayerDialog(playerid, DUNLOADFS, DIALOG_STYLE_INPUT, "Unload Filterscript", " Please enter a Filterscript name to Unload:", "Unload FS", "Cancel");
}
if(listitem == 16)
{
ShowPlayerDialog(playerid, DRELOADFS, DIALOG_STYLE_INPUT, "Reload Filterscript", " Please enter a Filterscript name to Unload:", "Reload FS", "Cancel");
}
}
}