Dialog Help.
#1

Command to Access the dialog:
Код:
	if (strcmp("/ab", cmdtext, true, 3) == 0)
	{
	if(PlayerInfo[playerid][AdminLevel] >= 1)
	{
 		ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "Admin Base", "1.Bridge Up\r\n2.Bridge Down\r\n3.Entrance Open\r\n4.Entrance Close\r\n5.Runway Extend\r\n6.Runway Retract\r\n7.Runway Gate Open\n\8.Runway Gate Close","Select", "Close");
	}
	else
	{
		SendClientMessage(playerid,0xFF0000AA,"Bad Command. Type /cmds for available commands depending on your chosen job/skill");
	}
	return 1;
	}
Dialog:
Код:
		
if(dialogid == 3)
    	{
        switch(3)
        {
            case 1:
                {
                    MoveObject(Bridge,262.30819702148, 2998.6782226563, 10.946338653564, 3.00); // UP
                }
            case 2:
                {
                    MoveObject(Bridge,262.30819702148,2998.6782226563,-27.553661346436, 3.00); // DOWN
                }
            case 3:
                {
                    MoveObject(Abg2,250.58392333984,3113.0004882813,15.086917877197,3.00); // OPEN
                }
            case 4:
                {
       				MoveObject(Abg2,262.33248901367, 3113.1955566406, 15.086917877197, 3.00); // CLOSE
                }
            case 5:
                {
   					MoveObject(Runway,84.14793396,3430.49975586,12.99578094,3.00); // OPEN
                }
            case 6:
                {
                    MoveObject(Runway,84.10546875, 3252.544921875, 12.995780944824,3.00); // CLOSE
                }
            case 7:
                {
 					MoveObject(Fence,167.64741516, 3358.28222656, 15.24813843, 3.00); // OPEN
                }
            case 8:
                {
					MoveObject(Fence,126.14834594727, 3358.478515625, 15.248138427734,3.00); // CLOSE
                }
            }
        }
    }
    return 0;
}
The problem is that when i want the objects to move nothing happens.
Reply
#2

Try replacing "switch(3)" with "switch(listitem)", without the "" ofcourse.
Reply
#3

No difference, thanks for the help tho
Reply
#4

cases starts from 0 not 1
case 0:
case 1:
case 2: etc..
Reply
#5

Still not working ;( It worked when i had these in dcmd form.
Reply
#6

show the code, where the cases are right
Reply
#7

Код:
	if(dialogid == 3)
    	{
        switch(listitem)
        {
            case 0:
                {
                    MoveObject(Bridge,262.30819702148,2998.6782226563,10.946338653564, 3.00); // UP
                }
            case 1:
                {
                    MoveObject(Bridge,262.30819702148,2998.6782226563,-27.553661346436, 3.00); // DOWN
                }
            case 2:
                {
                    MoveObject(Abg2,250.58392333984,3113.0004882813,15.086917877197,3.00); // OPEN
                }
            case 3:
                {
       				MoveObject(Abg2,262.33248901367,3113.1955566406,15.086917877197, 3.00); // CLOSE
                }
            case 4:
                {
   					MoveObject(Runway,84.14793396,3430.49975586,12.99578094,3.00); // OPEN
                }
            case 5:
                {
                    MoveObject(Runway,84.10546875,3252.544921875,12.995780944824,3.00); // CLOSE
                }
            case 6:
                {
 					MoveObject(Fence,167.64741516,3358.28222656,15.24813843, 3.00); // OPEN
                }
            case 7:
                {
					MoveObject(Fence,126.14834594727,3358.478515625,15.248138427734,3.00); // CLOSE
                }
            }
        }
    }
    return 0;
}
Reply
#8

Somebody?
Reply
#9

This should work
pawn Код:
#define GATETHINGYIGUESS 1

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case GATETHINGYIGUESS:
        {
            switch(listitem)
            {
                case 0:
                {
                    MoveObject(Bridge,262.30819702148,2998.6782226563,10.946338653564, 3.00); // UP
                }
               
                case 1:
                {
                    MoveObject(Bridge,262.30819702148,2998.6782226563,-27.553661346436, 3.00); // DOWN
                }
               
                case 2:
                {
                    MoveObject(Abg2,250.58392333984,3113.0004882813,15.086917877197,3.00); // OPEN
                }
               
                case 3:
                {
                    MoveObject(Abg2,262.33248901367,3113.1955566406,15.086917877197, 3.00); // CLOSE
                }
               
                case 4:
                {
                    MoveObject(Runway,84.14793396,3430.49975586,12.99578094,3.00); // OPEN
                }
               
                case 5:
                {
                    MoveObject(Runway,84.10546875,3252.544921875,12.995780944824,3.00); // CLOSE
                }
            }
        }
    }
    return 1;
}
Reply
#10

Код:
#define AdminBaseDialog 1
Код:
	if (strcmp("/ab", cmdtext, true, 3) == 0)
	{
	if(PlayerInfo[playerid][AdminLevel] >= 1)
	{
 		ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "Admin Base", "1.Bridge Up\r\n2.Bridge Down\r\n3.Entrance Open\r\n4.Entrance Close\r\n5.Runway Extend\r\n6.Runway Retract\r\n7.Runway Gate Open\n\8.Runway Gate Close","Select", "Close");
	}
	else
	{
		SendClientMessage(playerid,0xFF0000AA,"Bad Command. Type /cmds for available commands depending on your chosen job/skill");
	}
	return 1;
	}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 1)
    {
     // SOMETHING
    }
    if (dialogid == 2)
    {
 // SOMETHING
		}
		if (dialogid == 3)
		{
    		switch(dialogid)
    		{
        		case AdminBaseDialog:
        		{
            		switch(listitem)
            		{
                		case 0:
               			{
               				MoveObject(Bridge,262.30819702148,2998.6782226563,10.946338653564, 3.00); // UP
               			}

		                case 1:
		                {
		                    MoveObject(Bridge,262.30819702148,2998.6782226563,-27.553661346436, 3.00); // DOWN
		                }

		                case 2:
		                {
		                    MoveObject(Abg2,250.58392333984,3113.0004882813,15.086917877197,3.00); // OPEN
		                }

		                case 3:
		                {
		                    MoveObject(Abg2,262.33248901367,3113.1955566406,15.086917877197, 3.00); // CLOSE
		                }

		                case 4:
		                {
		                    MoveObject(Runway,84.14793396,3430.49975586,12.99578094,3.00); // OPEN
		                }

		                case 5:
		                {
		                    MoveObject(Runway,84.10546875,3252.544921875,12.995780944824,3.00); // CLOSE
						}
      					case 6:
                		{
 							MoveObject(Fence,167.64741516,3358.28222656,15.24813843, 3.00); // OPEN
                		}
            			case 7:
                		{
							MoveObject(Fence,126.14834594727,3358.478515625,15.248138427734,3.00); // CLOSE
                		}
					}
				}
            }
        }
    }
    return 1;
}
Still doesn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)