Dialogs Not Working Need Help
#1

Hey guyz i made a /teles

But its not Working It Show the Dialogs When i select a Teleport It just DOesnt Teleports Me
Please Help Me Guyz If Someone Help's Me i will make him Level 2 admin On My server

This is my Whole Code

Код:
if (strcmp("/teles", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel");
		return 1;
	}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    	if(dialogid == 100) // Teleport Dialog
        {
        	if(response)
        	{
                if(listitem == 0)
                {
                ShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, "Stunts", "Las Venturas \nSan Fierro \nLos Santos\nLos Santos Airport (/lsair) \nLas Venturas Airport (/lvair) \nSan Fierro Airport (/sfair) \nOld airport (/aa) \nSky road (/skyroad) \nStunt zone (/sz) \n{FF0000}Back", "Select", "Cancel");
                }
                if(listitem == 1)
                {
                ShowPlayerDialog(playerid, 102, DIALOG_STYLE_LIST, "Jumps", " DeathJump (/dj) \nTunnelJump (/tj) \nGlassjump (/gj) \nPipejump (/pj) \nEpicLoop (/epicloop) \n{FF0000}Back", "Select", "Cancel");
                }
                if(listitem == 2)
                {
                ShowPlayerDialog(playerid, 103, DIALOG_STYLE_LIST, "Parkour", "BMX Parkour (/bmxparkour) \nNrg Parkour (/nrgparkour) \n{FF0000}Back", "Select", "Cancel");
                }
                if(listitem == 3)
                {
                ShowPlayerDialog(playerid, 104, DIALOG_STYLE_LIST, "Fun", "Party (/party) \nBasketCar (/basketcar) \nDrift  (/drift) \nDrift 2 (/drift2)\n HayClimb (/hayclimb) \n{FF0000}Back", "Select", "Cancel");
                }
                }
		if(dialogid == 101) //Stunts
		{
  			if(response)
  			{
                if(listitem == 0)
                {
                SetPlayerPos(playerid, 2158.7890, 1685.0032, 10.6952);
                }
                if(listitem == 1)
                {
                SetPlayerPos(playerid, -2682.5593, 1365.2080, 17.1303);
                }
                if(listitem == 2)
                {
                SetPlayerPos(playerid, 2683.5842,1343.8342,17.1303);
                }
                if(listitem == 3)
                {
                SetPlayerPos(playerid, 395.1491,2438.6826,16.2271);//leave it
                }
                if(listitem == 4)
                {
                SetPlayerPos(playerid, 1318.3764, 1283.3530, 10.8203);//lvair
                }
                if(listitem == 5)
                {
                SetPlayerPos(playerid, -1185.0847, 53.9153, 14.1484);//sfair
                }
                if(listitem == 6)
                {
                SetPlayerPos(playerid, 422.7575, 2499.1591, 16.8386);//aaa
                }
                if(listitem == 7)
                {
                SetPlayerPos(playerid, -420.3807, -3014.2290, 39.5643);//skyroad
                }
                if(listitem == 8)
                {
                SetPlayerPos(playerid, -2029.9190, -118.1346, 38.9218);//sz
                }
                if(listitem == 9)
                {
                ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel");
                }

		if(dialogid == 102) //jumps
		{
 			if(response)
 			{
                 if(listitem == 0)
                 {
                 SetPlayerPos(playerid, -884.6852, 1623.2860, 775.1500);//dj
                 }
                 if(listitem == 1)
                 {
                 SetPlayerPos(playerid, -53.0427, -1662.3357, 2096.4543);//tj
                 }
                 if(listitem == 2)
                 {
                 SetPlayerPos(playerid, 1092.8978, 1646.5061, 542.6012);//gj
                 }
                 if(listitem == 3)
                 {
                 SetPlayerPos(playerid, 1556.7491, 1846.6258, 684.5643);//pj
                 }
                 if(listitem == 4)
                 {
                 SetPlayerPos(playerid, -1931.565918, 309.230560, 536.557068);//epicloop
                 }
                 if(listitem == 5) // Back
                 {
                 ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel");
                 }
                }
             }
		if(dialogid == 103) //parkour
           	{
           	if(response)
                {
                if(listitem == 0)
                {
                SetPlayerPos(playerid, 2781.2866, -1752.6925, 118.5303);//bmx
                }
                if(listitem == 1)
                {
                SetPlayerPos(playerid, 2760.4948, -1749.2545, 42.9809);//nrg
                }
                 
                if(listitem == 2) // Back
                {
                ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel");
                }
                }
             }
                }
		if(dialogid == 104) //Fun
           {
                if(response)
                {
                if(listitem == 0)
                {
                SetPlayerPos(playerid, 1531.07, 2459.84, 454.64);//party
                }
                if(listitem == 1)
                {
                SetPlayerPos(playerid, 3362.3542, -1550.2255, 323.2114);//bs
                }
                if(listitem == 2)
                {
                SetPlayerPos(playerid, -303.4065, 1532.6916, 75.3593);//drift
                }
                if(listitem == 3)
                {
                SetPlayerPos(playerid, 1955.3232, 1575.2944, 25.7714);//drift2
                }
                if(listitem == 4)
                {
                SetPlayerPos(playerid, 2687.9692, 2819.4463, 518.0095);//hayclimb
                }
                if(listitem == 5) // Back
                {
                ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel");
                }
               		 }
				}
			}
 }
	return 0;
 }
Reply
#2

Your OnDialogResponse callback is not called, try return 1; instead of return 0; at the end.
Reply
#3

If you are using
FilterScript -> return 0;
GameMode -> return 1;
at the end of the Callback.
pawn Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case 100:
        {                        // Teleport Dialog
            if( response )
            {
                switch( listitem )
                {
                    case 0: ShowPlayerDialog( playerid, 101, DIALOG_STYLE_LIST, "Stunts", "Las Venturas \nSan Fierro \nLos Santos\nLos Santos Airport (/lsair) \nLas Venturas Airport (/lvair) \nSan Fierro Airport (/sfair) \nOld airport (/aa) \nSky road (/skyroad) \nStunt zone (/sz) \n{FF0000}Back", "Select", "Cancel" );
                    case 1: ShowPlayerDialog( playerid, 102, DIALOG_STYLE_LIST, "Jumps", " DeathJump (/dj) \nTunnelJump (/tj) \nGlassjump (/gj) \nPipejump (/pj) \nEpicLoop (/epicloop) \n{FF0000}Back", "Select", "Cancel" );
                    case 2: ShowPlayerDialog( playerid, 103, DIALOG_STYLE_LIST, "Parkour", "BMX Parkour (/bmxparkour) \nNrg Parkour (/nrgparkour) \n{FF0000}Back", "Select", "Cancel" );
                    case 3: ShowPlayerDialog( playerid, 104, DIALOG_STYLE_LIST, "Fun", "Party (/party) \nBasketCar (/basketcar) \nDrift  (/drift) \nDrift 2 (/drift2)\n HayClimb (/hayclimb) \n{FF0000}Back", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 101:
        {                   //Stunts
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 2158.7890, 1685.0032, 10.6952 );
                    case 1: SetPlayerPos( playerid, -2682.5593, 1365.2080, 17.1303 );
                    case 2: SetPlayerPos( playerid, 2683.5842, 1343.8342, 17.1303 );
                    case 3: SetPlayerPos( playerid, 395.1491, 2438.6826, 16.2271 );
                    case 4: SetPlayerPos( playerid, 1318.3764, 1283.3530, 10.8203 );
                    case 5: SetPlayerPos( playerid, -1185.0847, 53.9153, 14.1484 );
                    case 6: SetPlayerPos( playerid, 422.7575, 2499.1591, 16.8386 );
                    case 7: SetPlayerPos( playerid, -420.3807, -3014.2290, 39.5643 );
                    case 8: SetPlayerPos( playerid, -2029.9190, -118.1346, 38.9218 );
                    case 9: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 102:
        {            //jumps
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, -884.6852, 1623.2860, 775.1500 );
                    case 1: SetPlayerPos( playerid, -53.0427, -1662.3357, 2096.4543 );
                    case 2: SetPlayerPos( playerid, 1092.8978, 1646.5061, 542.6012 );
                    case 3: SetPlayerPos( playerid, 1556.7491, 1846.6258, 684.5643 );
                    case 4: SetPlayerPos( playerid, -1931.565918, 309.230560, 536.557068 );
                    case 5: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 103:
        {             //parkour
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 2781.2866, -1752.6925, 118.5303 );
                    case 1: SetPlayerPos( playerid, 2760.4948, -1749.2545, 42.9809 );
                    case 2: ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 104:
        {                 //Fun
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 1531.07, 2459.84, 454.64 );
                    case 1: SetPlayerPos( playerid, 3362.3542, -1550.2255, 323.2114 );
                    case 2: SetPlayerPos( playerid, -303.4065, 1532.6916, 75.3593 );
                    case 3: SetPlayerPos( playerid, 1955.3232, 1575.2944, 25.7714 );
                    case 4: SetPlayerPos( playerid, 2687.9692, 2819.4463, 518.0095 );
                    case 5: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
    }
    return 0;
}
Reply
#4

Quote:
Originally Posted by Xtreme_playa
Посмотреть сообщение
Your OnDialogResponse callback is not called, try return 1; instead of return 0; at the end.
still not working
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
If you are using
FilterScript -> return 0;
GameMode -> return 1;
at the end of the Callback.
pawn Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case 100:
        {                        // Teleport Dialog
            if( response )
            {
                switch( listitem )
                {
                    case 0: ShowPlayerDialog( playerid, 101, DIALOG_STYLE_LIST, "Stunts", "Las Venturas \nSan Fierro \nLos Santos\nLos Santos Airport (/lsair) \nLas Venturas Airport (/lvair) \nSan Fierro Airport (/sfair) \nOld airport (/aa) \nSky road (/skyroad) \nStunt zone (/sz) \n{FF0000}Back", "Select", "Cancel" );
                    case 1: ShowPlayerDialog( playerid, 102, DIALOG_STYLE_LIST, "Jumps", " DeathJump (/dj) \nTunnelJump (/tj) \nGlassjump (/gj) \nPipejump (/pj) \nEpicLoop (/epicloop) \n{FF0000}Back", "Select", "Cancel" );
                    case 2: ShowPlayerDialog( playerid, 103, DIALOG_STYLE_LIST, "Parkour", "BMX Parkour (/bmxparkour) \nNrg Parkour (/nrgparkour) \n{FF0000}Back", "Select", "Cancel" );
                    case 3: ShowPlayerDialog( playerid, 104, DIALOG_STYLE_LIST, "Fun", "Party (/party) \nBasketCar (/basketcar) \nDrift  (/drift) \nDrift 2 (/drift2)\n HayClimb (/hayclimb) \n{FF0000}Back", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 101:
        {                   //Stunts
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 2158.7890, 1685.0032, 10.6952 );
                    case 1: SetPlayerPos( playerid, -2682.5593, 1365.2080, 17.1303 );
                    case 2: SetPlayerPos( playerid, 2683.5842, 1343.8342, 17.1303 );
                    case 3: SetPlayerPos( playerid, 395.1491, 2438.6826, 16.2271 );
                    case 4: SetPlayerPos( playerid, 1318.3764, 1283.3530, 10.8203 );
                    case 5: SetPlayerPos( playerid, -1185.0847, 53.9153, 14.1484 );
                    case 6: SetPlayerPos( playerid, 422.7575, 2499.1591, 16.8386 );
                    case 7: SetPlayerPos( playerid, -420.3807, -3014.2290, 39.5643 );
                    case 8: SetPlayerPos( playerid, -2029.9190, -118.1346, 38.9218 );
                    case 9: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 102:
        {            //jumps
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, -884.6852, 1623.2860, 775.1500 );
                    case 1: SetPlayerPos( playerid, -53.0427, -1662.3357, 2096.4543 );
                    case 2: SetPlayerPos( playerid, 1092.8978, 1646.5061, 542.6012 );
                    case 3: SetPlayerPos( playerid, 1556.7491, 1846.6258, 684.5643 );
                    case 4: SetPlayerPos( playerid, -1931.565918, 309.230560, 536.557068 );
                    case 5: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 103:
        {             //parkour
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 2781.2866, -1752.6925, 118.5303 );
                    case 1: SetPlayerPos( playerid, 2760.4948, -1749.2545, 42.9809 );
                    case 2: ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 104:
        {                 //Fun
            if( response )
            {
                switch( listitem )
                {
                    case 0: SetPlayerPos( playerid, 1531.07, 2459.84, 454.64 );
                    case 1: SetPlayerPos( playerid, 3362.3542, -1550.2255, 323.2114 );
                    case 2: SetPlayerPos( playerid, -303.4065, 1532.6916, 75.3593 );
                    case 3: SetPlayerPos( playerid, 1955.3232, 1575.2944, 25.7714 );
                    case 4: SetPlayerPos( playerid, 2687.9692, 2819.4463, 518.0095 );
                    case 5: ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Teleport Categories", "Stunts\nJumps\nParkours\nFun", "Select", "Cancel" );
                }
            }
            return 1;
        }
    }
    return 0;
}
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 76) : error 002: only a single statement (or expression) can follow each "case"
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 76) : warning 215: expression has no effect
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 80) : error 014: invalid statement; not in switch
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 80) : warning 215: expression has no effect
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 80) : error 001: expected token: ";", but found ":"
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 80) : error 029: invalid expression, assumed zero
D:\samp03dsvr_R2\samp03\gamemodes\tmp_fm_gm.pwn(41 80) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#6

Where did you added. It compiles fine
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Show lines 4170 to 4185
Reply
#7

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Where did you added. It compiles fine
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Show lines 4170 to 4185
i added it In The end Of The GM
I mean in OnDialogResponse

This is the Lines You asked FOr

Код:
               switch( listitem )
                {
                    case 0: ShowPlayerDialog( playerid, 101, DIALOG_STYLE_LIST, "Stunts", "Las Venturas \nSan Fierro \nLos Santos\nLos Santos Airport (/lsair) \nLas Venturas Airport (/lvair) \nSan Fierro Airport (/sfair) \nOld airport (/aa) \nSky road (/skyroad) \nStunt zone (/sz) \n{FF0000}Back", "Select", "Cancel" );
                    case 1: ShowPlayerDialog( playerid, 102, DIALOG_STYLE_LIST, "Jumps", " DeathJump (/dj) \nTunnelJump (/tj) \nGlassjump (/gj) \nPipejump (/pj) \nEpicLoop (/epicloop) \n{FF0000}Back", "Select", "Cancel" );
                    case 2: ShowPlayerDialog( playerid, 103, DIALOG_STYLE_LIST, "Parkour", "BMX Parkour (/bmxparkour) \nNrg Parkour (/nrgparkour) \n{FF0000}Back", "Select", "Cancel" );
                    case 3: ShowPlayerDialog( playerid, 104, DIALOG_STYLE_LIST, "Fun", "Party (/party) \nBasketCar (/basketcar) \nDrift  (/drift) \nDrift 2 (/drift2)\n HayClimb (/hayclimb) \n{FF0000}Back", "Select", "Cancel" );
                    return 1;
                }
            }
        }
        case 101:
        {                   //Stunts
            if( response )
            {
                switch( listitem )
                {
Reply
#8

sorry i didnt check you script totally, i believe its missing return 1; before return 0; at the end.
Reply
#9

Quote:
Originally Posted by Xtreme_playa
Посмотреть сообщение
sorry i didnt check you script totally, i believe its missing return 1; before return 0; at the end.
What are you Trying To Say
Reply
#10

It's the return 1; after ther case. Replace it with
Код:
               switch( listitem )
                {
                    case 0: ShowPlayerDialog( playerid, 101, DIALOG_STYLE_LIST, "Stunts", "Las Venturas \nSan Fierro \nLos Santos\nLos Santos Airport (/lsair) \nLas Venturas Airport (/lvair) \nSan Fierro Airport (/sfair) \nOld airport (/aa) \nSky road (/skyroad) \nStunt zone (/sz) \n{FF0000}Back", "Select", "Cancel" );
                    case 1: ShowPlayerDialog( playerid, 102, DIALOG_STYLE_LIST, "Jumps", " DeathJump (/dj) \nTunnelJump (/tj) \nGlassjump (/gj) \nPipejump (/pj) \nEpicLoop (/epicloop) \n{FF0000}Back", "Select", "Cancel" );
                    case 2: ShowPlayerDialog( playerid, 103, DIALOG_STYLE_LIST, "Parkour", "BMX Parkour (/bmxparkour) \nNrg Parkour (/nrgparkour) \n{FF0000}Back", "Select", "Cancel" );
                    case 3: ShowPlayerDialog( playerid, 104, DIALOG_STYLE_LIST, "Fun", "Party (/party) \nBasketCar (/basketcar) \nDrift  (/drift) \nDrift 2 (/drift2)\n HayClimb (/hayclimb) \n{FF0000}Back", "Select", "Cancel" );
                }
            }
            return 1;
        }
        case 101:
        {                   //Stunts
            if( response )
            {
                switch( listitem )
                {
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)