DIALOG problem!!!help
#1

I have a problem with dialog.................
When I click on the button "Close" it says :"Server closed the connection"

here the pics:

In that pictures the dialog is from the anticheat Junkbuster10 but its not just there in all off my dialogs are problems with the "close" button...

How can I fix that
Reply
#2

Yes it is easy but here :
Код:
PRIVATE: ShowPlayerConfigDialog (playerid)
{
	ShowPlayerDialog (playerid, DIALOG_CFG, DIALOG_STYLE_LIST, "JunkBuster", "Set a variable\nLoad configuration from file\nSave configuration to file\nLoad default configuration\nSee JunkBuster reports\nSee JunkBuster commands for admins", "Choose", "Close");
}
there is no return
Reply
#3

Show your OnDialogResponse.
Reply
#4

You didnt define dialogid and since you have
PHP код:
 if(dialogid)//not define ID
{
if(!
response)
{
Kick(playerid);
return 
0;
}

Defineing dialogid will do the job
Reply
#5

Код:
CALLBACK: OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
	new len = strlen (inputtext);
		
	for (new i = 0; i < len; ++i)
		if (inputtext [i] == '%')//A % can crash your server if you want to use the inputtext in a formatted string. Let's prevent this.
			inputtext [i] = '#';

	if (IsPlayerAdmin (playerid))
	{
		switch (dialogid)
		{
			case DIALOG_CMDS:
			{
				if (response)
					CallLocalFunction ("OnPlayerCommandText", "is", playerid, JB::AdminCommands[listitem]); //Sexy command list.
				return 1;
			}

			case DIALOG_CFG:
			{
				if (response)
				{
					switch (listitem)
					{
						case 0:
							ShowPlayerVarlistDialog (playerid);

						case 1:
						{
							ConfigJunkBuster ();
							SendClientMessage (playerid, JB_GREEN, "JunkBuster:{FFFF00} Configuration has been loaded from file.");
							ShowPlayerConfigDialog (playerid);
						}

						case 2:
						{
							SaveJunkBusterVars ();
							SendClientMessage (playerid, JB_GREEN, "JunkBuster:{FFFF00} Configuration has been saved to file.");
							ShowPlayerConfigDialog (playerid);
						}

						case 3:
						{
							JB::Variables = JB::DefaultVariables;
							SendClientMessage (playerid, JB_GREEN, "JunkBuster:{FFFF00} Default configuration has been loaded.");
	    					JB::Log ("JunkBuster variables have been reset to default values.");
							ShowPlayerConfigDialog (playerid);
						}
						
						case 4:
                            ShowPlayerReportDialog (playerid);
						
						case 5:
						{
						    new string [1024];
								
							for (new i = 0; i < sizeof (JB::AdminCommands); ++i)
								format (string, sizeof (string), "%s%s\n", string, JB::AdminCommands [i]);

							ShowPlayerDialog (playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "JunkBuster Commands", string, "Perform", "Close");
						}
					}
				}
				return 1;
			}
Reply
#6

Do you have dialogs in gamemode or filterscripts?
Reply
#7

yes.....thtat callback is from my FS

thats from GM:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new sendername[MAX_PLAYER_NAME];
	new string[500];
	if(dialogid == 212) // Bus
	{
		if(response)
		{
		if(listitem == 0) // Ruta1

			if (BusrouteWest[playerid][0] == 12 || BusrouteEast[playerid][0] == 12)
			{
				BusrouteWest[playerid][0] = 0;
				BusrouteEast[playerid][0] = 0;
			}
		    if(BusrouteWest[playerid][0] == 0 && BusrouteEast[playerid][0] == 0)
		    {
				new playervehicleid = GetPlayerVehicleID(playerid);
				if(IsABus(playervehicleid))
				{
					TogglePlayerControllable(playerid, 1);
					GameTextForPlayer(playerid, "~g~Voznja zapoceta", 5000, 3);
					SendClientMessage(playerid, COLOR_GREEN, "Crveni marker oznacava stajaliste.");
					BusrouteEast[playerid][0] = 1;
					BusrouteEast[playerid][1] = playervehicleid;
					OnPlayerEnterCheckpoint(playerid);
					return 1;
				}
			    else
			    {
				    SendClientMessage(playerid, COLOR_GREY, "Nisi u busu !");
			    }
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "Vec si na voznji !");
			}

		   }
		if(listitem == 1) // Ruta 2
			{
			if (BusrouteWest[playerid][0] == 12 || BusrouteEast[playerid][0] == 12)
			{
				BusrouteWest[playerid][0] = 0;
				BusrouteEast[playerid][0] = 0;
			}
			if(BusrouteWest[playerid][0] == 0 && BusrouteEast[playerid][0] == 0)
			{
				new playervehicleid = GetPlayerVehicleID(playerid);
				if(IsABus(playervehicleid))
				{
					TogglePlayerControllable(playerid, 1);
					GameTextForPlayer(playerid, "~g~Voznja zapoceta", 5000, 3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "---------Zapadne - Los Santos Bus stanice-----------");
					SendBusRoute(playerid, 1);
					SendClientMessage(playerid, COLOR_RED, " ");
					SendClientMessage(playerid, COLOR_GREEN, "Crveni marker oznacava stajaliste.");
					BusrouteWest[playerid][0] = 1;
					BusrouteWest[playerid][1] = playervehicleid;
					OnPlayerEnterCheckpoint(playerid);
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "Nisi u busu !");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "Vec si na voznji !");
			}


		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)