SA-MP Forums Archive
Weather dialog - 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: Weather dialog (/showthread.php?tid=317794)



Weather dialog - Zaec - 12.02.2012

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


Re: Weather dialog - Mean - 12.02.2012

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


Re: Weather dialog - iTorran - 12.02.2012

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



Re: Weather dialog - Zaec - 12.02.2012

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!


Re: Weather dialog - Mean - 15.02.2012

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.