Weather dialog
#1

Hello,I have problem with dialog.What i want to do is set game weather using dialog (DIALOG_STYLE_IMPUT)
Example: /weather,when shows dialog and player have to write weather ID.
Code:

Command:
Код:
COMMAND:weather(playerid, params[])
{
	ShowPlayerDialog(playerid,WEATHER,DIALOG_STYLE_INPUT,"Weather","Write weather ID","Write","Cancel");
	return 1;
}
Ondialog...:
Код:
if(dialogid == WEATHER)
	{
        if(response)
        {
			new Weather;
			SetWeather(Weather);
	    }
        return 1;
    }
    return 1;
}
It doesn't work,i don't know why.Maybe someone knows the problem?

P.S. I apologise for my bad english skills
Reply
#2

You're returning 1 in OnDialogResponse, change that to return 0. Return 1 won't work if you're using dialogs in Filterscripts.
Reply
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == WEATHER)
    {
        if(response)
        {
            new Weather = strval(inputtext);
            SetWeather(Weather);
        }
    }
    return 0;
}
Reply
#4

Quote:
Originally Posted by Mean
Посмотреть сообщение
You're returning 1 in OnDialogResponse, change that to return 0. Return 1 won't work if you're using dialogs in Filterscripts.
I using GameMode,so no need to change?


Quote:
Originally Posted by iTorran
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == WEATHER)
    {
        if(response)
        {
            new Weather = strval(inputtext);
            SetWeather(Weather);
        }
    }
    return 0;
}
Thank you iTorran it works!
Reply
#5

Quote:
Originally Posted by Zaec
Посмотреть сообщение
I using GameMode,so no need to change?




Thank you iTorran it works!
You misread my post.
See what iTorran did there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)