Dialogs get messed up
#1

I've got problem, I have 2 dialogs, one for the stadium and one for a liquorshop, the problem is: when i go to liquorshop and buy something, i can buy it, no problems there, but when i go to the stadium, i get another dialog with options like hotring and bloodbowl, but the same responses as in the liquor shop, for example, when i press in the stadiumdialog: "Hotring", i get a bottle of beer.

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
	if(streamid == liquorcp)
	{
    ShowPlayerDialog(playerid, liquordialog, DIALOG_STYLE_LIST, "What do you want to buy?", "Sprunk ($10)\nBeer ($20)\nWine ($30)\nCigar ($20)", "Purchase", "Cancel");
    return 1;
  }

	else if(streamid == stadiumcp)
	{
    ShowPlayerDialog(playerid, stadiumdialog, DIALOG_STYLE_LIST, "Which minigame do you want to join?", "Mower DM\nHotring\nBloodring\nKickstart\n8-Track", "Join", "Cancel");
    return 1;
  }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == liquordialog)
  {
		if(response == 1 && dialogid == liquordialog)
		{
		switch(listitem)
		{
      case 0:
      {
        if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        GivePlayerMoney(playerid, -10);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
        SendClientMessage(playerid, 0xFFFFFF, "You bought a can of Sprunk.");
        return 1;
      }
      case 1:
      {
        if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        GivePlayerMoney(playerid, -20);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
        SendClientMessage(playerid, 0xFFFFFF, "You bought a beer.");
        return 1;
      }
      case 2:
      {
        if(GetPlayerMoney(playerid) < 30) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        GivePlayerMoney(playerid, -30);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        SendClientMessage(playerid, 0xFFFFFF, "You bought a bottle of wine.");
        return 1;
      }
      case 3:
      {
        if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        GivePlayerMoney(playerid, -20);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
        SendClientMessage(playerid, 0xFFFFFF, "You bought a cigar.");
        return 1;
			}
    }
    }
  }
  else if(dialogid == stadiumdialog)
  {
		if(response == 1 && dialogid == stadiumdialog)
		{
			switch(listitem)
			{
      	case 0:
      	{
		    	new playermower;
	      	playermower = CreateVehicle(572,-1401.4250488281,106.87026977539,1031.9134521484,0,-1,-1,6000);
	      	GivePlayerWeapon(playerid, 28, 99999);
	      	SetPlayerArmedWeapon(playerid, 28);
	      	SetPlayerInterior(playerid, 1);
	      	LinkVehicleToInterior(playermower, 1);
	      	PutPlayerInVehicle(playerid, playermower, 0);
        	SendClientMessage(playerid, 0xFFA500AA, "Welcome at the 'Mower DM'");
        	return 1;
      	}
      	case 1: //hotring
      		{
        	SetPlayerPos(playerid, -1403.6373291016, 898.77893066406, 1041.1672363281);
        	SetPlayerInterior(playerid, 15);
        	LinkVehicleToInterior (blood1, 15);
        	LinkVehicleToInterior (blood2, 15);
        	LinkVehicleToInterior (blood3, 15);
        	LinkVehicleToInterior (blood4, 15);
        	LinkVehicleToInterior (blood5, 15);
        	LinkVehicleToInterior (blood6, 15);
        	LinkVehicleToInterior (blood7, 15);
        	LinkVehicleToInterior (blood8, 15);
        	LinkVehicleToInterior (blood9, 15);
        	LinkVehicleToInterior (blood10, 15);
        	LinkVehicleToInterior (blood11, 15);
        	LinkVehicleToInterior (blood12, 15);
        	LinkVehicleToInterior (blood13, 15);
        	LinkVehicleToInterior (blood14, 15);
        	LinkVehicleToInterior (blood15, 15);
        	LinkVehicleToInterior (blood16, 15);
        	LinkVehicleToInterior (blood17, 15);
        	LinkVehicleToInterior (blood18, 15);
        	LinkVehicleToInterior (blood19, 15);
        	LinkVehicleToInterior (blood20, 15);
        	SendClientMessage(playerid, 0xFFA500AA, "Welcome at the Hotring!");
        	SendClientMessage(playerid, 0xFFA500AA, "Use /exitstadium to exit");
        	return 1;
      	}
      	case 2: //bloodring
      	{
        	SetPlayerPos(playerid, -1401.0682373047, 996.91662597656, 1023.7767333984);
        	SetPlayerInterior(playerid, 15);
        	LinkVehicleToInterior (blood1, 15);
        	LinkVehicleToInterior (blood2, 15);
        	LinkVehicleToInterior (blood3, 15);
        	LinkVehicleToInterior (blood4, 15);
        	LinkVehicleToInterior (blood5, 15);
        	LinkVehicleToInterior (blood6, 15);
        	LinkVehicleToInterior (blood7, 15);
        	LinkVehicleToInterior (blood8, 15);
        	LinkVehicleToInterior (blood9, 15);
        	LinkVehicleToInterior (blood10, 15);
        	LinkVehicleToInterior (blood11, 15);
        	LinkVehicleToInterior (blood12, 15);
        	LinkVehicleToInterior (blood13, 15);
        	LinkVehicleToInterior (blood14, 15);
        	LinkVehicleToInterior (blood15, 15);
        	LinkVehicleToInterior (blood16, 15);
        	LinkVehicleToInterior (blood17, 15);
        	LinkVehicleToInterior (blood18, 15);
        	LinkVehicleToInterior (blood19, 15);
        	LinkVehicleToInterior (blood20, 15);
        	SendClientMessage(playerid, 0xFFA500AA, "Welcome at the Bloodbowl!");
        	SendClientMessage(playerid, 0xFFA500AA, "Use /exitstadium to exit");
        	return 1;
      	}
      	case 3: //kickstart
      	{
        	SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
        	SetPlayerInterior(playerid, 14);
        	LinkVehicleToInterior (bike1, 14);
        	LinkVehicleToInterior (bike2, 14);
        	LinkVehicleToInterior (bike3, 14);
        	LinkVehicleToInterior (bike4, 14);
        	LinkVehicleToInterior (bike5, 14);
        	LinkVehicleToInterior (bike6, 14);
        	LinkVehicleToInterior (bike7, 14);
        	LinkVehicleToInterior (bike8, 14);
        	 	LinkVehicleToInterior (bike9, 14);
        	LinkVehicleToInterior (bike10, 14);
        	LinkVehicleToInterior (bike11, 14);
        	LinkVehicleToInterior (bike12, 14);
        	SendClientMessage(playerid, 0xFFA500AA, "Welcome at the Kickstart!");
        	SendClientMessage(playerid, 0xFFA500AA, "Use /exitstadium to exit");
        	return 1;
      	}
      	case 4: //8-track
      	{
        	SetPlayerPos(playerid, -1404.7045898438,-256.26327514648,1043.6533203125);
        	SetPlayerInterior(playerid, 7);
        	LinkVehicleToInterior (kart1, 7);
        	LinkVehicleToInterior (kart2, 7);
        	LinkVehicleToInterior (kart3, 7);
        	LinkVehicleToInterior (kart4, 7);
        	LinkVehicleToInterior (kart5, 7);
        	LinkVehicleToInterior (kart6, 7);
        	LinkVehicleToInterior (kart7, 7);
        	LinkVehicleToInterior (kart8, 7);
        	LinkVehicleToInterior (kart9, 7);
        	LinkVehicleToInterior (kart10, 7);
        	SendClientMessage(playerid, 0xFFA500AA, "Welcome at the 8-track!");
        	SendClientMessage(playerid, 0xFFA500AA, "Use /exitstadium to exit");
        	return 1;
      	}
    	}
  	}
  }
  return 1;
}
Reply
#2

http://forum.sa-mp.com/index.php?topic=138113.0
Reply
#3

Quote:
Originally Posted by ⒮⒠⒱⒠⒩⒮⒯⒜⒭
Ehm, I dont see what that has to do with my problem.
Reply
#4

I think it has everything to do with your problem... we'll try to fix it

replace your lines with these

pawn Код:
#define liquordialog (0)
pawn Код:
#define stadiumdialog (MAX_PLAYERS)
your next dialog would be

pawn Код:
#define nextdialog (MAX_PLAYERS*2) //Ignore this one
pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
    if(streamid == liquorcp)
    {
    ShowPlayerDialog(playerid, liquordialog+playerid, DIALOG_STYLE_LIST, "What do you want to buy?", "Sprunk ($10)\nBeer ($20)\nWine ($30)\nCigar ($20)", "Purchase", "Cancel");
    return 1;
  }

    else if(streamid == stadiumcp)
    {
    ShowPlayerDialog(playerid, stadiumdialog+playerid, DIALOG_STYLE_LIST, "Which minigame do you want to join?", "Mower DM\nHotring\nBloodring\nKickstart\n8-Track", "Join", "Cancel");
    return 1;
  }
    return 1;
}
Reply
#5

Ok thnx this works, , is this common problem btw?
Reply
#6

Other problem now: http://forum.sa-mp.com/index.php?topic=166299.0
Reply


Forum Jump:


Users browsing this thread: