Dialog response not Sending Message [Input Dialog] -
Deal-or-die - 08.05.2012
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.
Re: Dialog response not Sending Message [Input Dialog] -
TzAkS. - 08.05.2012
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);
Re: Dialog response not Sending Message [Input Dialog] -
Jonny5 - 08.05.2012
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.
Re: Dialog response not Sending Message [Input Dialog] -
iggy1 - 08.05.2012
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.
Re: Dialog response not Sending Message [Input Dialog] -
Deal-or-die - 08.05.2012
Quote:
Originally Posted by TzAkS.
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
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
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
Re: Dialog response not Sending Message [Input Dialog] -
TzAkS. - 08.05.2012
Use %d for numbers
Re: Dialog response not Sending Message [Input Dialog] -
Deal-or-die - 08.05.2012
Quote:
Originally Posted by TzAkS.
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
Re: Dialog response not Sending Message [Input Dialog] -
iggy1 - 08.05.2012
Quote:
Originally Posted by Deal-or-die
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;
}
Re: Dialog response not Sending Message [Input Dialog] -
Deal-or-die - 08.05.2012
Quote:
Originally Posted by iggy1
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 :/