SA-MP Forums Archive
My filterscript and OnDialogResponse - 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: My filterscript and OnDialogResponse (/showthread.php?tid=252680)



My filterscript and OnDialogResponse - Incognation - 02.05.2011

Hello,

I have a filterscript called "house".
I can use every callback, but I can't use OnDialogResponse.

All of the returns are "return 1;".
How can I fix it?

Some code:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_HOUSE && response)
    {
        new i = GetPVarInt(playerid, "at_house");
        switch(listitem)
        {
            case 0:
            {
                SetPVarInt(playerid, "money", GetPVarInt(playerid, "money") - HouseInfo[i][Value]);
                GivePlayerMoney(playerid, -HouseInfo[i][Value]);
               
                SendMessage(playerid, COLOUR_GREEN, "You've bought {FFFFFF}%s {5ADE8B}for {FFFFFF}$%i{5ADE8B}!", HouseInfo[i][Name], HouseInfo[i][Value]);
            }
        }
       
        return 1;
    }
   
    return 1;
}
Greetz,
Incognation.


Re: My filterscript and OnDialogResponse - Stigg - 02.05.2011

Try:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_HOUSE && response)
    {
        new i = GetPVarInt(playerid, "at_house");
        switch(listitem)
        {
            case 0:
            {
                SetPVarInt(playerid, "money", GetPVarInt(playerid, "money") - HouseInfo[i][Value]);
                GivePlayerMoney(playerid, -HouseInfo[i][Value]);
               
                SendMessage(playerid, COLOUR_GREEN, "You've bought {FFFFFF}%s {5ADE8B}for {FFFFFF}$%i{5ADE8B}!", HouseInfo[i][Name], HouseInfo[i][Value]);
            }
        }
       
        return 1;
    }
   
    return 0;//In all your scripts.
}



Re: My filterscript and OnDialogResponse - Incognation - 02.05.2011

No, it won't work.


Re: My filterscript and OnDialogResponse - Joe Staff - 02.05.2011

YOu have to explain further what your issue is, do you mean the dialog doesn't appear, or do you mean the dialog has no response?


Re: My filterscript and OnDialogResponse - Incognation - 02.05.2011

He appear, but the OnDialogResponse don't be called.


Re: My filterscript and OnDialogResponse - Incognation - 03.05.2011

Any one else?! I need it fast..


Re: My filterscript and OnDialogResponse - Calgon - 03.05.2011

Have you tried returning 0 and using the solution provided? You can't return 1 in OnDialogResponse because it will then not forward to other scripts (filterscripts, etc).


Re: My filterscript and OnDialogResponse - Incognation - 03.05.2011

I try it again, wait a second.
It worked! Thank you!!