DIALOG problem!!!help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DIALOG problem!!!help (
/showthread.php?tid=274523)
DIALOG problem!!!help -
SAMP Skripter NEwbie - 06.08.2011
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
Re: DIALOG problem!!!help -
SAMP Skripter NEwbie - 06.08.2011
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
Re: DIALOG problem!!!help -
MadeMan - 06.08.2011
Show your OnDialogResponse.
Re: DIALOG problem!!!help -
[MG]Dimi - 06.08.2011
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
Re: DIALOG problem!!!help -
SAMP Skripter NEwbie - 06.08.2011
Код:
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;
}
Re: DIALOG problem!!!help -
MadeMan - 06.08.2011
Do you have dialogs in gamemode or filterscripts?
Re: DIALOG problem!!!help -
SAMP Skripter NEwbie - 06.08.2011
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;
}