SA-MP Forums Archive
Dialog problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog problem (/showthread.php?tid=125304)



Dialog problem - Razvann - 03.02.2010

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid==1)
	{
		if(response)
		{
		  SendClientMessage(playerid, COLOR_RED, "You have clicked 'Accept' so you accept the rules!");
		}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_RED, "You have clicked 'Decline' so you don't accept the rules!");
		  Kick(playerid);
		}
		return 1;
}
I have this, when I click Accept it shows me with red and when I click Decline it doesen't send me any message.Why?


Re: Dialog problem - Babul - 03.02.2010

only one single } was on the wrong place. this should fix it:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid==1)
	{
		if(response)
		{
			SendClientMessage(playerid, COLOR_RED, "You have clicked 'Accept' so you accept the rules!");
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You have clicked 'Decline' so you don't accept the rules!");
			Kick(playerid);
		}
	}
	return 1;
}