Dialog help(teleport menu) and ShowPlayerMarkers();
#1

I need help with teleport menu when I type /teleports it shows up the "first" menu but when I click on somthing on that menu it wont open the next menu.. Help please


And even if I have:
Код:
ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL)
on
Код:
GameModeInit()
it wont show markers on the gps/map Help?
Код:
OnPlayerSpawn(playerid)  	SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
Teleport menu Code!
Код:
#include <a_samp>

// Defines
#define FILTERSCRIPT
#define DIALOGID 3300
#define MAX 69 // Change this to the max players in your server.cfg



public OnPlayerCommandText(playerid, cmdtext[])
{
		if (strcmp("/Teleports", cmdtext, true, 10) == 0)
		{
			ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMonster\nRally Cross\nStunt", "Select", "Cancel");
			return 1;
		}
		return 1;
	}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOGID) // Teleport Dialog
	{
		if(response)
		{
   			if(listitem == 0) // Drift
			{
				ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Drift", "Drift Airport \nSanta Marina \nGrove Street \nCity Hall \nPolice Station \nBank \nOcean Docks \nCrazybob's House \nJefferson Motel \nAbove Drift \nBack", "Select", "Cancel");
			}
			if(listitem == 1) // Monster
			{
				ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Monster", "Monster Airport \nCity Hall \nBank \nOcean Flats \nMissionary Hill \nJizzys Pleasure Dome \nPolice Station  \nBack", "Select", "Cancel");
			}
			if(listitem == 2) // Rally Cross
			{
				ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "Rally Cross", "Rally Cross Airport \nArea69 \nCity Hall \nPolice Station \nCaligulas Casino \nStarfish Casino \nBank \nPrickle Pine \nBandit Stadium \nLast Dime Motel \nAbove Rally Cross \nBack", "Select", "Cancel");
   			}
			if(listitem == 3) // Stunt
			{
				ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "Stunt", "Verdant Meadows \nBayside \nPalominmo Creek \nMontgomery \nBlueberry \nDrylake \nSniper Death Match \nBike Race \nCar Race \nMount Chilliad Cabin \nTop of Mount Chilliad \nMount Chilliad \nBack", "Select", "Cancel");
   			}
		}
		return 1;
	}

	if(dialogid == DIALOGID+1) // Drift
	{
		if(response)
		{
			if(listitem == 0) // 
			{
    			SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, -329.3348,1536.3771,76.6117);
			}
			if(listitem == 1) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 2265.3010,1399.5085,42.8203);
			}
			if(listitem == 2) // 
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, -2489.8352,-616.3492,132.5658);
			}
			if(listitem == 3) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 2243.2185,1963.3853,31.7797);
			}
			if(listitem == 4) // 
			{
				SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
	   		 	SetPlayerFacingAngle(playerid, 90);
			}
			if(listitem == 5) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 1886.9543,1813.2212,18.9339);
			}
			if(listitem == 6) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 2791.1782,-2534.6309,13.6303);
			}
			if(listitem == 7) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, -766.7427,-1730.1228,95.9759);
			}
			if(listitem == 8) //
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 711.8475,2581.5981,25.2460);
			}
			if(listitem == 9) //
			{
				SetPlayerPos(playerid, -2418.8452,81.8775,34.6797);
		 		SetPlayerInterior(playerid, 0);
			}
			if(listitem == 10) // 
  			{
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
			}
		}
		return 1;
	}

	if(dialogid == DIALOGID+2) // Monster
	{
		if(response)
		{
			if(listitem == 0) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 1) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 2) // 
			{
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 3) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 4) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 5) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 6) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 7) //
			{
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
			}
		}
		return 1;
	}

	if(dialogid == DIALOGID+3) // Rally Cross
	{
		if(response)
		{
			if(listitem == 0) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 1) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
        		SetPlayerInterior(playerid,0);
			}
			if(listitem == 2) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
	    		SetPlayerFacingAngle(playerid, 90);
			}
			if(listitem == 3) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 4) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 5) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 6) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 7) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 8) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 9) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 10) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
    			SetPlayerInterior(playerid, 0);
			}
			if(listitem == 11) // Back
			{
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
			}
		}
		return 1;
	}
	
	if(dialogid == DIALOGID+4) // Stunt
	{
		if(response)
		{
			if(listitem == 0) // 
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
			}
			if(listitem == 1) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 2) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 3) // 
			{
				SetPlayerInterior(playerid, 0);
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
			}
			if(listitem == 4) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid, 0);
			}
			if(listitem == 5) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 6) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 7) //
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
		 		SetPlayerInterior(playerid,4);

			}
			if(listitem == 8) //
			{
		    	SetPlayerInterior(playerid,7);
            	SetPlayerPos(playerid, 0.0, 0.0, 0.0);
			}
			if(listitem == 9) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 10) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 11) // 
			{
				SetPlayerPos(playerid, 0.0, 0.0, 0.0);
				SetPlayerInterior(playerid,0);
			}
			if(listitem == 12) // Back
			{
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
			}
		}
		return 1;
	}
	return 0;
 }
Reply
#2

It won't show the next dialog because you have to return 1; at OnDialogResponse on GM, or because this dialogid is already used.

Show us how is COLOR_NORMAL_PLAYER defined, it have to don't have transparency to be shown on map.
Reply
#3

^^as he said
Reply
#4

#define COLOR_NORMAL_PLAYER 0xFFFF0000

I'll try the menu now.
Reply
#5

try to change " if(listitem == 0) " to " case 0: " for an example, try to switch all to "cases" it might be the problem
(it's optional, yours is right too, I think)
Reply
#6

#define COLOR_NORMAL_PLAYER 0xFFFF0000

I'll try the menu now.

EDIT: I removed all return from OnPlayerDialogRepons on the filterscript and the gamemode.
Reply
#7

The
Код:
case 0:
gave me multiple errors/too many errors on same line.
Reply
#8

I need help someone?


I did as it said on samp wiki added return 0 but now doesn't even the menu show? Help!
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WELCOME)
    {
      //Code
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
 
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
Reply
#9

FIXED
pawn Код:
#include <a_samp>

// Defines
#define FILTERSCRIPT
#define DIALOGID 3300
#define MAX 69 // Change this to the max players in your server.cfg

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/Teleports", cmdtext, true, 10) == 0)
        {
            ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMonster\nRally Cross\nStunt", "Select", "Cancel");
            return 1;
        }
        return 0;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGID) // Teleport Dialog
    {
        if(response)
        {
            if(listitem == 0) // Drift
            {
                ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Drift", "Drift Airport \nSanta Marina \nGrove Street \nCity Hall \nPolice Station \nBank \nOcean Docks \nCrazybob's House \nJefferson Motel \nAbove Drift \nBack", "Select", "Cancel");
            }
            else if(listitem == 1) // Monster
            {
                ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Monster", "Monster Airport \nCity Hall \nBank \nOcean Flats \nMissionary Hill \nJizzys Pleasure Dome \nPolice Station  \nBack", "Select", "Cancel");
            }
            else if(listitem == 2) // Rally Cross
            {
                ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "Rally Cross", "Rally Cross Airport \nArea69 \nCity Hall \nPolice Station \nCaligulas Casino \nStarfish Casino \nBank \nPrickle Pine \nBandit Stadium \nLast Dime Motel \nAbove Rally Cross \nBack", "Select", "Cancel");
            }
            else if(listitem == 3) // Stunt
            {
                ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "Stunt", "Verdant Meadows \nBayside \nPalominmo Creek \nMontgomery \nBlueberry \nDrylake \nSniper Death Match \nBike Race \nCar Race \nMount Chilliad Cabin \nTop of Mount Chilliad \nMount Chilliad \nBack", "Select", "Cancel");
            }
            return 1;
        }
    }

    else if(dialogid == DIALOGID+1) // Drift
    {
        if(response)
        {
            if(listitem == 0) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -329.3348,1536.3771,76.6117);
            }
            else if(listitem == 1) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 2265.3010,1399.5085,42.8203);
            }
            else if(listitem == 2) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -2489.8352,-616.3492,132.5658);
            }
            else if(listitem == 3) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 2243.2185,1963.3853,31.7797);
            }
            else if(listitem == 4) //
            {
                SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
                SetPlayerFacingAngle(playerid, 90);
            }
            else if(listitem == 5) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 1886.9543,1813.2212,18.9339);
            }
            else if(listitem == 6) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 2791.1782,-2534.6309,13.6303);
            }
            else if(listitem == 7) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -766.7427,-1730.1228,95.9759);
            }
            else if(listitem == 8) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 711.8475,2581.5981,25.2460);
            }
            else if(listitem == 9) //
            {
                SetPlayerPos(playerid, -2418.8452,81.8775,34.6797);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 10) //
            {
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
            }
            return 1;
        }
       
    }

    else if(dialogid == DIALOGID+2) // Monster
    {
        if(response)
        {
            if(listitem == 0) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 1) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 2) //
            {
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 3) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 4) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 5) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 6) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 7) //
            {
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
            }
            return 1;
        }
       
    }

    else if(dialogid == DIALOGID+3) // Rally Cross
    {
        if(response)
        {
            if(listitem == 0) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 1) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 2) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerFacingAngle(playerid, 90);
            }
            else if(listitem == 3) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 4) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 5) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 6) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 7) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 8) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 9) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 10) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 11) // Back
            {
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
            }
            return 1;
        }
       
    }

    else if(dialogid == DIALOGID+4) // Stunt
    {
        if(response)
        {
            if(listitem == 0) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
            }
            else if(listitem == 1) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 2) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 3) //
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
            }
            else if(listitem == 4) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid, 0);
            }
            else if(listitem == 5) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 6) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 7) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,4);

            }
            else if(listitem == 8) //
            {
                SetPlayerInterior(playerid,7);
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
            }
            else if(listitem == 9) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 10) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 11) //
            {
                SetPlayerPos(playerid, 0.0, 0.0, 0.0);
                SetPlayerInterior(playerid,0);
            }
            else if(listitem == 12) // Back
            {
                ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport Categories", "Drift\nMontser\nRally Cross\nStunt", "Select", "Cancel");
            }
            return 1;
        }
       
    }
    return 0;
 }
Reply
#10

It's not working for me I bet something is wrong on my gamemode.


Gamemode:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 100)
    {
        if(response)
        {
            SendClientMessage(playerid,COLOR_NORMAL_PLAYER,"Thanks for accepting rules.");
        }
        else if(response == 0)
        {
            SendClientMessage(playerid,COLOR_NORMAL_PLAYER,"You declined the rules.");
            Kick(playerid);
        }
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)