Problem about scripting
#5

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:

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;
}
EDIT: Sorry for poor indentation of my alterations, I can't get them to fit right xD - Edited in the Comment box.
Reply


Messages In This Thread
Problem about scripting - by Goldac - 26.08.2014, 12:43
Re: Problem about scripting - by Phyzic - 26.08.2014, 12:45
Re: Problem about scripting - by Goldac - 26.08.2014, 12:50
Re: Problem about scripting - by Phyzic - 26.08.2014, 12:53
Re: Problem about scripting - by IceCube! - 26.08.2014, 12:55
Re: Problem about scripting - by Goldac - 26.08.2014, 12:59
Re: Problem about scripting - by Dotayuri - 26.08.2014, 13:01
Re: Problem about scripting - by Dotayuri - 26.08.2014, 13:31
Re: Problem about scripting - by IceCube! - 26.08.2014, 13:37
Re: Problem about scripting - by Dotayuri - 26.08.2014, 13:37

Forum Jump:


Users browsing this thread: 1 Guest(s)