Dialog response not Sending Message [Input Dialog]
#1

Hey,
Ugh.. been working on this for a while now and just can't seem to work out why my dialogs aren't sending the player a message after the valid input into the Input dialog, Here is what I have so far....

pawn Code:
.
        case 166: //How many rooms?
        {
            if(!response) return 1;
            if(response)
            {
                new room;
                sscanf(inputtext, "d", room);
                if(room < 1 || room > MAX_ROOMS) return format(string, sizeof(string), "You selected %s Rooms", room);
                else
                {
                    format(string, sizeof(string), "Please select a value of rooms between 1 and %s", MAX_ROOMS);
                }
            }
        }
Any Ideas...?

Cheers in advance.
Reply
#2

Code:
format(string, sizeof(string), "You selected %s Rooms", room);
return SendClientMessage(playerid, -1, string);
Code:
format(string, sizeof(string), "Please select a value of rooms between 1 and %s", MAX_ROOMS);
SendClientMessage(playerid, -1, string);
Reply
#3

just guessing here
pawn Code:
if(room < 1 || room > MAX_ROOMS) return format(string, sizeof(string), "You selected %s Rooms", room);
to
pawn Code:
if(room > 0 || room < MAX_ROOMS) return format(string, sizeof(string), "You selected %s Rooms", room);

edit:

and yes your not useing SendClientMessage like stated above.
Reply
#4

Make sure your scripts all return zero at the end of "OnDialogResponse". If for example your GM returns 1 at the end of the callback, your dialogs in your filterscripts wont execute correct.

In the new.pwn that comes with the server, OnDialogResponse should really look like this.

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 0;
}
It's OK to return other values if the dialog is found. Because all dialogids should be unique.
EG,
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        return 1;
    }

    return 0;
}
Not sure f this is your problem but it's a very common mistake. What usually happens is, when you respond to the dialog it closes the dialog and nothing else.

EDIT: I never read the whole thread nor did i look at your code, my bad. Ill not delete this because someone else might have this problem.
Reply
#5

Quote:
Originally Posted by TzAkS.
View Post
Code:
format(string, sizeof(string), "You selected %s Rooms", room);
return SendClientMessage(playerid, -1, string);
Code:
format(string, sizeof(string), "Please select a value of rooms between 1 and %s", MAX_ROOMS);
SendClientMessage(playerid, -1, string);
Hmm.. okay i tried this and it worked... but the string isn't printing correctly as an example...
I typed "6" and it showed


Then i typed "666" and it showed


Quote:
Originally Posted by Jonny5
View Post
just guessing here
pawn Code:
if(room < 1 || room > MAX_ROOMS) return format(string, sizeof(string), "You selected %s Rooms", room);
to
pawn Code:
if(room > 1 || room < MAX_ROOMS) return format(string, sizeof(string), "You selected %s Rooms", room);

edit:

and yes your not useing SendClientMessage like stated above.
Ahh cheers for your help but it's kind of not what i am after :P

Quote:
Originally Posted by iggy1
View Post
Make sure your scripts all return zero at the end of "OnDialogResponse". If for example your GM returns 1 at the end of the callback, your dialogs in your filterscripts wont execute correct.

In the new.pwn that comes with the server, OnDialogResponse should really look like this.

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 0;
}
It's OK to return other values if the dialog is found. Because all dialogids should be unique.
EG,
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        return 1;
    }

    return 0;
}
Not sure f this is your problem but it's a very common mistake. What usually happens is, when you respond to the dialog it closes the dialog and nothing else.
Yea, thanks for your help, but i am not using it as a filter script, but I will keep it in mind, Cheers

So basically it is not printing correctly
I type '6' and it shows


I type '666' and it shows
Reply
#6

Use %d for numbers
Reply
#7

Quote:
Originally Posted by TzAkS.
View Post
Use %d for numbers
Ahh true, thanks a lot.

Now for trying to get NPCs to connect -.- They connect just stay about 15 seconds then quit -.-


But thank you everyone that gave me support in this, greatly appreciated
Reply
#8

Quote:
Originally Posted by Deal-or-die
View Post
Now for trying to get NPCs to connect -.- They connect just stay about 15 seconds then quit -.-
Have you done this at the top of all callbacks/funcs that might interfere with bots? Like register systems ect.

pawn Code:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid))return 1;
   
   
    //blah blah rest of code

    return 1;
}
Reply
#9

Quote:
Originally Posted by iggy1
View Post
Have you done this at the top of all callbacks/funcs that might interfere with bots? Like register systems ect.

pawn Code:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid))return 1;
   
   
    //blah blah rest of code

    return 1;
}
Ehh... If these are the only ones that may interfere,
'OnPlayerConnect, OnPlayerRequestClass, OnPlayerSpawn and OnPlayerRequestSpawn'
Then Yes i have... :/
The rest of my dialogs i am pretty sure i have also covered :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)