My filterscript and OnDialogResponse
#1

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.
Reply
#2

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.
}
Reply
#3

No, it won't work.
Reply
#4

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?
Reply
#5

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

Any one else?! I need it fast..
Reply
#7

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).
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)