OnDialogResponse not being called
#1

My OnDialogResponse won't call for any of my dialogs that i'm using in my FS.
Nothing is printed when I use the CMD '/tagwall'.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        print("dialog 1 called");
        if(response)
        {
            Tagging[playerid] = 1;
            if(listitem == 0)
            {
                print("listitem 0 called");
                TagMode[playerid] = 1;
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Select a Color", "{FFFFFF}Sample\n{BF4000}Sample\n{FF0000}Sample\n{FFFF00}Sample\n{7CFC00}Sample\n{00BFFF}Sample\n{FF6347}Sample\n{FF9933}Sample", "Next", "Exit");
            }
            if(listitem == 1)
            {
                print("listitem 1 called");
                TagMode[playerid] = 2;
                SelectObject(playerid);
            }
            if(listitem == 2)
            {
                print("listitem 3 called");
                TagMode[playerid] = 3;
                SelectObject(playerid);
            }
        }
    }
    if(dialogid == 2)
    {
        print("dialog 2 called");
        if(response)
        {
            TagColor[playerid] = listitem;
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Name of Tag", "Please enter what you want your tag to be!", "Next", "Exit");
        }
    }
    if(dialogid == 3)
    {
        print("dialog 3 called");
        if(response)
        {
            if(strlen(inputtext) < 1 || strlen(inputtext) > 16) return SendClientMessage(playerid, 0xFF0000AA, "Tag canceled: Too short, or long of tag.");
            new Float:p[3];
            GetPlayerPos(playerid, p[0], p[1], p[2]);
            new ob = CreateObject(0, p[0], p[1]+1, p[2], 0, 0, 0, 0);
            SetObjectMaterialText(ob, inputtext, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, Colors[TagColor[playerid]], 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            SelectObject(playerid);
        }
    }
    return 0;
}
The CMD:

pawn Код:
CMD:tagwall(playerid)
{
    if(GetPlayerWeapon(playerid) != 41) return SendClientMessage(playerid, 0xFF0000AA, "You must have a spray can!");
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select an Option", "Create a Tag\nEdit a Tag\nDelete a Tag", "Next", "Exit");
    return 1;
}
Reply
#2

show me #define for dialogs.
Reply
#3

Your dialog ID's are probably being mixed with the ones in your GM. An easy way to fix this is to take each dialogid and multiply it by a random number (or make a define for the FS to multiply each ID by).

pawn Код:
#define FS_DIALOG_ID 300
So instead of doing this:

pawn Код:
ShowPlayerDialog(playerid, 1, ...);
You can do this...

pawn Код:
ShowPlayerDialog(playerid, FS_DIALOG_ID*1, ...);
Reply
#4

use this :-
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == first)
    {
        print("dialog 1 called");
        if(response)
        {
            Tagging[playerid] = 1;
            if(listitem == 0)
            {
                print("listitem 0 called");
                TagMode[playerid] = 1;
                ShowPlayerDialog(playerid, second, DIALOG_STYLE_LIST, "Select a Color", "{FFFFFF}Sample\n{BF4000}Sample\n{FF0000}Sample\n{FFFF00}Sample\n{7CFC00}Sample\n{00BFFF}Sample\n{FF6347}Sample\n{FF9933}Sample", "Next", "Exit");
            }
            if(listitem == 1)
            {
                print("listitem 1 called");
                TagMode[playerid] = 2;
                SelectObject(playerid);
            }
            if(listitem == 2)
            {
                print("listitem 3 called");
                TagMode[playerid] = 3;
                SelectObject(playerid);
            }
        }
    }
    if(dialogid == second)
    {
        print("dialog 2 called");
        if(response)
        {
            TagColor[playerid] = listitem;
            ShowPlayerDialog(playerid, third, DIALOG_STYLE_INPUT, "Name of Tag", "Please enter what you want your tag to be!", "Next", "Exit");
        }
    }
    if(dialogid == third)
    {
        print("dialog 3 called");
        if(response)
        {
            if(strlen(inputtext) < 1 || strlen(inputtext) > 16) return SendClientMessage(playerid, 0xFF0000AA, "Tag canceled: Too short, or long of tag.");
            new Float:p[3];
            GetPlayerPos(playerid, p[0], p[1], p[2]);
            new ob = CreateObject(0, p[0], p[1]+1, p[2], 0, 0, 0, 0);
            SetObjectMaterialText(ob, inputtext, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, Colors[TagColor[playerid]], 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            SelectObject(playerid);
        }
    }
    return 0;
}
add this to top :-
Код:
#define first 65
#define second 67
#define third 68
cmd :-
Код:
CMD:tagwall(playerid)
{
    if(GetPlayerWeapon(playerid) != 41) return SendClientMessage(playerid, 0xFF0000AA, "You must have a spray can!");
    ShowPlayerDialog(playerid, first, DIALOG_STYLE_LIST, "Select an Option", "Create a Tag\nEdit a Tag\nDelete a Tag", "Next", "Exit");
    return 1;
}
Reply
#5

No, that isn't happening, as I had had it set to the 6000s before.
Reply
#6

Is the FS even being loaded? Print a message OnFilterScriptInit() just to be sure.
Reply
#7

Yes, the FS is being loaded. And the first dialog comes up whenever I type in /tagwall:
Reply
#8

bump.
Reply
#9

Is the GM dialog response returning 0?
Reply
#10

At the bottom to the following
pawn Код:
//return 0;
"at the end to"
//return 1;
or try
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == first)
    {
        print("dialog 1 called");
        if(response)
        {
            Tagging[playerid] = 1;
            if(listitem == 0)
            {
                print("listitem 0 called");
                TagMode[playerid] = 1;
                ShowPlayerDialog(playerid, second, DIALOG_STYLE_LIST, "Select a Color", "{FFFFFF}Sample\n{BF4000}Sample\n{FF0000}Sample\n{FFFF00}Sample\n{7CFC00}Sample\n{00BFFF}Sample\n{FF6347}Sample\n{FF9933}Sample", "Next", "Exit");
                return 1;
            }
            if(listitem == 1)
            {
                print("listitem 1 called");
                TagMode[playerid] = 2;
                SelectObject(playerid);
                return 1;
            }
            if(listitem == 2)
            {
                print("listitem 3 called");
                TagMode[playerid] = 3;
                SelectObject(playerid);
                return 1;
            }
        }
    }
    if(dialogid == second)
    {
        print("dialog 2 called");
        if(response)
        {
            TagColor[playerid] = listitem;
            ShowPlayerDialog(playerid, third, DIALOG_STYLE_INPUT, "Name of Tag", "Please enter what you want your tag to be!", "Next", "Exit");
            return 1;
        }
    }
    if(dialogid == third)
    {
        print("dialog 3 called");
        if(response)
        {
            if(strlen(inputtext) < 1 || strlen(inputtext) > 16) return SendClientMessage(playerid, 0xFF0000AA, "Tag canceled: Too short, or long of tag.");
            new Float:p[3];
            GetPlayerPos(playerid, p[0], p[1], p[2]);
            new ob = CreateObject(0, p[0], p[1]+1, p[2], 0, 0, 0, 0);
            SetObjectMaterialText(ob, inputtext, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, Colors[TagColor[playerid]], 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            SelectObject(playerid);
            return 1;
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)