List style Dialog Help
#1

Script:

Code:
dcmd_elevator(playerid, params[])
{
	if(PlayerInfo[playerid][Special] == 1)
	{
		if(IsPlayerInRangeOfPoint(playerid,1,2296.523193,2468.725341,10.820312)) //garage elevator
		{
		  ShowPlayerDialog(playerid, 911,DIALOG_STYLE_LIST,"Choose a floor...","R\nM\nB2\nB3","Use","Leave");
		}
		if(IsPlayerInRangeOfPoint(playerid,1,2268.147949,2448.327880,3.531250)) //impound lot elevator
		{
		  ShowPlayerDialog(playerid, 912,DIALOG_STYLE_LIST,"Choose a floor...","R\nM\nB1\nB3","Use","Leave");
		}
		if(IsPlayerInRangeOfPoint(playerid,1,2267.936523,2448.448486,-7.195312)) //swat level elevator
		{
		  ShowPlayerDialog(playerid, 913,DIALOG_STYLE_LIST,"Choose a floor...","R\nM\nB1\nB2","Use","Leave");
		}
		if(IsPlayerInRangeOfPoint(playerid,1,2268.9697,2458.9207,38.6837)) //roof elevator
		{
		  ShowPlayerDialog(playerid, 914,DIALOG_STYLE_LIST,"Choose a floor...","M\nB1\nB2\nB3","Use","Leave");
		}
		if(IsPlayerInRangeOfPoint(playerid,1,237.3105,195.6100,1008.1719)) //main elevator
		{
		  ShowPlayerDialog(playerid, 915,DIALOG_STYLE_LIST,"Choose a floor...","R\nB1\nB2\nB3","Use","Leave");
		}
	}
	#pragma unused params
	return 1;
}
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 911 && response)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 912 && response)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 913 && response)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 914 && response)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 1:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 915 && response)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerInterior(playerid,0);
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 2:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	
	return 1;
}
Problems:

When I go in the game and type /elevator, the dialog pops up I select my floor and click Use then its just disapears and nothing happens... How do I fix it?
Reply
#2

bump
Reply
#3

No ones helping me but I realy need this, I have alot of dialogs that arnt working and if I can get this one solved then I can do alot more!
Reply
#4

Maybe add a "if caseX:." I was never good with dialogs.
Reply
#5

here ya go try this
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 911 && response == 1)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 912 && response == 1)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 913 && response == 1)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 914 && response == 1)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerInterior(playerid,3);
			  SetPlayerPos(playerid,237.3105,195.6100,1008.1719);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 1:
			{
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid,270);
			}
			case 2:
			{
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}
	if(dialogid == 915 && response == 1)
	{
	  switch(listitem)
	  {
	    case 0:
	    {
	      SetPlayerInterior(playerid,0);
	      SetPlayerPos(playerid,2268.9697,2458.9207,38.6837);
	      SetPlayerFacingAngle(playerid,0);
			}
			case 1:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2296.523193,2468.725341,10.820312);
			  SetPlayerFacingAngle(playerid, 270);
			}
			case 2:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2268.147949,2448.327880,3.531250);
			  SetPlayerFacingAngle(playerid, 180);
			}
			case 3:
			{
			  SetPlayerInterior(playerid,0);
			  SetPlayerPos(playerid,2267.936523,2448.448486,-7.195312);
			  SetPlayerFacingAngle(playerid,180);
			}
		}
	}

	return 1;
}
Reply
#6

Still nothing happens I did both buttons too
Reply
#7

Try to debug your error out

just put a print statment in OnDialogResponse

pawn Code:
printf("OnDialogResponse(%d, %d, %d, %d, \"%s\");", playerid, dialogid, response, listitem, inputtext);
Reply
#8

I do believe your supposed to use \r\n before all new list items..

ex:
Code:
Bla\r\nPenis\r\nDildo\r\nSexy
Reply
#9

Quote:
Originally Posted by ♣ Joker ♠
Try to debug your error out

just put a print statment in OnDialogResponse

pawn Code:
printf("OnDialogResponse(%d, %d, %d, %d, \"%s\");", playerid, dialogid, response, listitem, inputtext);
I put one at

Code:
public OnDialogResponse(playerid, ECT.)
{
    (--HERE--)
a). Is that the right place
b). Nothing appeared on the samp-server
Reply
#10

Quote:
Originally Posted by Tyler_Idy
Quote:
Originally Posted by ♣ Joker ♠
Try to debug your error out

just put a print statment in OnDialogResponse

pawn Code:
printf("OnDialogResponse(%d, %d, %d, %d, \"%s\");", playerid, dialogid, response, listitem, inputtext);
I put one at

Code:
public OnDialogResponse(playerid, ECT.)
{
    (--HERE--)
a). Is that the right place
b). Nothing appeared on the samp-server
a) yes, as first line right after the brace
b) if you opened the dialog and clicked something and nothing appeared means that the public gets not called!
Possible reason: Some filterscript stops it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)