26.08.2014, 12:55
You should return 1, to prevent it checking things it's wouldn't equal if it has already found the only thing it can be. After all you can only see one dialog at once. You should return 1, one indentation before where you have done it like so:
EDIT: Sorry for poor indentation of my alterations, I can't get them to fit right xD - Edited in the Comment box.
pawn Код:
#include <a_samp>
new menu;
public OnFilterScriptInit()
{
menu = CreatePickup(371, 2, 1061.3151, 1285.5503, 10.8203, -1);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == menu) return ShowPlayerDialog(playerid, 2, 2, "Gate", "Open the gate", "Select", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 1, 3, "Gate", "Write the secret password", "Select", "Cancel");
}
}
}
return 1;
}
if(dialogid == 1)
{
if(response)
{
if(!strcmp(inputtext, "1234", true))
{
SendClientMessage(playerid, -1, "Password accepted");
}
else
{
SendClientMessage(playerid, -1, "Password is wrong");
}
}
return 1;
}
return 1;
}