Dialog returns to the first dialog in secs. -
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(!response)
{
SendClientMessage(playerid, red, "You Cancelled.");
}
else
{
RegisterPlayer(playerid, inputtext);
}
}
if(dialogid == 2)
{
if(!response)
{
SendClientMessage(playerid, red, "You Canceled");
}
else
{
LoginPlayer(playerid, inputtext);
}
}
if(dialogid == 3)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "What will you do if a cop asks you to pull over?", "Ignore the cop and proceed\nStop and wait for instructions", "Ok", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Practical test.", "This will be available soon.", "Ok", "");
}
}
}
else
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Driving School", "You cancelled.", "Ok", "");
}
}
if(dialogid == 4)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Theory test", "Wrong Answer", "Ok", "");
}
case 1:
{
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Which side of the road should you drive?", "Left\nRight", "Ok", "Cancel");
}
}
}
else
{
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "Theory test", "You cancelled.", "Ok", "");
}
}
if(dialogid == 10)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Theory test", "Wrong answer.", "Ok","");
}
case 1:
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Congrats", "You have passed the test and earned your license.", "Ok","");
dlic[playerid] = 1;
}
}
}
else
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Theory test", "You cancelled", "Ok", "");
}
}
return 0;
}
What happens is that it returns to dialog id 3 after like 2 seconds while taking the test.