Filterscript Dialogs not working
#1

Hey, i was just wondering if anyone could help me.

I have Dialogs in my script, and i was trying to load rRace as i would like to have simple races.

When i type /buildrace the first dialog comes up but when you select something nothing happens.
I have made sure that the Dialogsid are not colliding and they are not.

What else could the issue be?

Thanks.
Reply
#2

Go to OnPlayerDialogResponse, and find the case id - the same as you use for ShowPlayerDialog, and to make it work when you click on buttons it just need to be

pawn Код:
if(response)
{
  // code here
}
Also be sure that the ID of your dialog is not something very high, and check if they aren't duplicated - ID already used before.
Reply
#3

Make sure the defined dialog ID's arent used yet. Those can glitch and not work.
Reply
#4

As i stated the Dialog's haven't been used as i checked the ID's. And also the Dialogs Do have a response, they just aren't working.
Reply
#5

Could you show us an example of your dialog with responding and how you did that ? i mean for example
pawn Код:
//cmd:example(playerid, params [])
ShowPlayerDialog(playerid,dialogid...);
pawn Код:
public OnDialogResponse(..);
//show us how did you response the dialog
Reply
#6

All the Dialogs in my Base script work Fine.

In the filterscript they Don't work so i will post the filterscript Dialogs.

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 599:
{
if(!response) return BuildRace = 0;
switch(listitem)
{
case 0: BuildRaceType = 0;
case 1: BuildRaceType = 3;
}
ShowDialog(playerid, 600);
}
case 600..601:
{
if(!response) return ShowDialog(playerid, 599);
if(!strlen(inputtext)) return ShowDialog(playerid, 601);
if(strlen(inputtext) < 1 || strlen(inputtext) > 20) return ShowDialog(playerid, 601);
strmid(BuildName, inputtext, 0, strlen(inputtext), sizeof(BuildName));
ShowDialog(playerid, 602);
}
case 602..603:
{
if(!response) return ShowDialog(playerid, 600);
if(!strlen(inputtext)) return ShowDialog(playerid, 603);
if(isNumeric(inputtext))
{

if(!IsValidVehicle(strval(inputtext))) return ShowDialog(playerid, 603);
new
Float: pPos[4]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
BuildModeVID = strval(inputtext);
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
BuildVehicle = CreateVehicle(strval(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 * 60));
PutPlayerInVehicle(playerid, BuildVehicle, 0);
BuildCreatedVehicle = 0x01;
ShowDialog(playerid, 604);
}
else
{
if(!IsValidVehicle(ReturnVehicleID(inputtext))) return ShowDialog(playerid, 603);
new
Float: pPos[4]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
BuildModeVID = ReturnVehicleID(inputtext);
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
BuildVehicle = CreateVehicle(ReturnVehicleID(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 * 60));
PutPlayerInVehicle(playerid, BuildVehicle, 0);
BuildCreatedVehicle = 0x01;
ShowDialog(playerid, 604);
}
}
case 604:
{
if(!response) return ShowDialog(playerid, 602);
SendClientMessage(playerid, GREEN, ">> Go to the start line on the left road and press 'KEY_FIRE' and do the same with the right road block.");
SendClientMessage(playerid, GREEN, " - When this is done, you will see a dialog to continue.");
BuildVehPosCount = 0;
BuildTakeVehPos = true;
}
case 605:
{
if(!response) return ShowDialog(playerid, 604);
SendClientMessage(playerid, GREEN, ">> Start taking checkpoints now by clicking 'KEY_FIRE'.");
SendClientMessage(playerid, GREEN, " - Press 'ENTER' when you're done with the checkpoints!");
BuildCheckPointCount = 0;
BuildTakeCheckpoints = true;
}
case 606:
{
if(!response) return ShowDialog(playerid, 606);
BuildRace = 0;
BuildCheckPointCount = 0;
BuildVehPosCount = 0;
BuildTakeCheckpoints = false;
BuildTakeVehPos = false;
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
}
}

}

From rRace Filterscript.
Reply
#7

Check all your filterscripts and your gamemode and look for all OnDialogResponse callbacks.
They should all have "return 0;" on the last line.

If there is "return1;", your server looks only in the first script it sees, executes the callback and stops.
It won't process the callback in your other filterscripts.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)