SA-MP Forums Archive
OnDialogResponse in a filterscript - 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)
+--- Thread: OnDialogResponse in a filterscript (/showthread.php?tid=293206)



OnDialogResponse in a filterscript - MP2 - 27.10.2011

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.


Re: OnDialogResponse in a filterscript - Wesley221 - 27.10.2011

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


Re: OnDialogResponse in a filterscript - MP2 - 27.10.2011

THANK YOU SO MUCH! +rep <3