OnDialogResponse in a filterscript
#1

OnDialogResponse isn't getting called in my filterscripts. I have return 1;'s at the following places in my gamemode:

pawn Код:
OnDialogResponse(...)
{
    if(dialogid == DIALOG_LOGIN)
    {
        // Code
        return 1;
    }
    if(dialogid == DIALOG_REGISTER)
    {
        // Code
        return 1;
    }
    return 1;
}
The filterscript:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    SendClientMessageToAll(COLOR_RACE, "OnDialogResponse");
    if(dialogid == DIALOG_CP_TYPE)
    {
        if(response) SetPVarInt(playerid, "race_cp_type", 0);
        else SetPVarInt(playerid, "race_cp_type", 3);
        ShowPlayerDialog(playerid, DIALOG_CP_SIZE, DIALOG_STYLE_INPUT, "Race CP size", "Enter the size for checkpoints (10 is usually good)", "Set", "Cancel");
        return 1;
    }
    else if(dialogid == DIALOG_CP_SIZE && response)
    {
        SetPVarFloat(playerid, "race_cp_size", floatstr(inputtext));
        SendClientMessage(playerid, COLOR_RACE, "Type {FFFFFF}/CP{F4A460} to create checkpoints at your current position.");
        return 1;
    }
    return 1;
}
It worked a few weeks ago, however. I am using 0.3d.
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    SendClientMessageToAll(COLOR_RACE, "OnDialogResponse");
    if(dialogid == DIALOG_CP_TYPE)
    {
        if(response) SetPVarInt(playerid, "race_cp_type", 0);
        else SetPVarInt(playerid, "race_cp_type", 3);
        ShowPlayerDialog(playerid, DIALOG_CP_SIZE, DIALOG_STYLE_INPUT, "Race CP size", "Enter the size for checkpoints (10 is usually good)", "Set", "Cancel");
        return 1;
    }
    else if(dialogid == DIALOG_CP_SIZE && response)
    {
        SetPVarFloat(playerid, "race_cp_size", floatstr(inputtext));
        SendClientMessage(playerid, COLOR_RACE, "Type {FFFFFF}/CP{F4A460} to create checkpoints at your current position.");
        return 1;
    }
    return 0; // return 1 in a gamemode, 0 in a filtersript
}
Check the comment
Reply
#3

THANK YOU SO MUCH! +rep <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)