2 Dialogs ?
#1

Hey Guys I have an ask.

I have 2 Dialogs, 1 for the Bikeshop, and 1 for the Carshop,

and 2 Pickups , 1 for the Biekshop, and 1 for the Casrshop,

but when i enter the first Pickup, they open the Carshop dialog.
When i enter the 2 Pickup, they open the Carshop Dialog ?

But why they dont open the Bikeshop dialog ?

Here the code..


Код:
BikePickup = CreatePickup(1274, 1, 2131.628662 , -1148.841187 , 24.830555);
	BikeMenu = CreateMenu("Bikeshop", 2, 200.0, 100.0, 150.0, 150.0);
		AddMenuItem(OttoMenu, 0, "NRG-500");

		AddMenuItem(OttoMenu, 1, "5.000 $");
Код:
OttoPickup = CreatePickup(1274, 1, 563.659180, -1290.866577, 17.748238);
	OttoMenu = CreateMenu("Autohaus", 2, 200.0, 100.0, 150.0, 150.0);
		AddMenuItem(OttoMenu, 0, "Bullet");

		AddMenuItem(OttoMenu, 1, "30.000 $");
Код:
case 0: //Bullet
		if (IsPlayerConnected(playerid))
			{
			if (GetPlayerMoney(playerid) >= 30000)
			{
			CreateVehicle(541, 546.304199, -1281.4026, 17.748238 ,90.0,6,0,60000);
  		GivePlayerMoney(playerid, -30000);
    	SendClientMessage(playerid, COLOR_GREEN, "Du hast ein Auto gekauft! Hole es am Punkt ab!");
  		SetPlayerCheckpoint(playerid,546.304199, -1281.4026, 17.748238,5);
    	Checkpoint[playerid] = 1;
			}
  		}
Код:
case 1: //NRG
		if (IsPlayerConnected(playerid))
			{
			if (GetPlayerMoney(playerid) >= 5000)
			{
			CreateVehicle(522, 546.304199, -1281.4026, 17.748238 ,90.0,6,0,60000);
  		GivePlayerMoney(playerid, -5000);
  		SendClientMessage(playerid, COLOR_GREEN, "Du hast ein Auto gekauft! Hole es am Punkt ab!");
  		SetPlayerCheckpoint(playerid,546.304199, -1281.4026, 17.748238,5);
    	Checkpoint[playerid] = 1;
  		}
  		else
			{
  		SendClientMessage(playerid, COLOR_RED, "Du hast nicht genьgend Geld!");
  		}
  		}
Reply
#2

I doesn't exactly know where the fault is but, you can use Dialogs. A Player will able to click items.

https://sampwiki.blast.hk/wiki/Dialog_Styles << Styles for Dialog (Use the second)
https://sampwiki.blast.hk/wiki/ShowPlayerDialog << Create a dialog
https://sampwiki.blast.hk/wiki/OnDialogResponse << What must happend if the player is in the dialog..
Reply
#3

ah, you copied the menu and forgot to replace ALL "OttoMenu" with "BikeMenu", so in the BikeMenu the entries are still added to the "OttoMenu"...
Код:
	BikePickup = CreatePickup(1274, 1, 2131.628662 , -1148.841187 , 24.830555);
	BikeMenu = CreateMenu("Bikeshop", 2, 200.0, 100.0, 150.0, 150.0);
		AddMenuItem(OttoMenu, 0, "NRG-500");
		AddMenuItem(OttoMenu, 1, "5.000 $");
after replacing 2 more, you get this:
Код:
	BikePickup = CreatePickup(1274, 1, 2131.628662 , -1148.841187 , 24.830555);
	BikeMenu = CreateMenu("Bikeshop", 2, 200.0, 100.0, 150.0, 150.0);
		AddMenuItem(BikeMenu , 0, "NRG-500");
		AddMenuItem(BikeMenu , 1, "5.000 $");
Reply
#4

What do you have at OnPlayerPickUpPickup
Reply
#5

At OnPlayerPickup should be something like ShowMenuForPlayer
Reply
#6

Quote:
Originally Posted by Oxside
At OnPlayerPickup should be something like ShowMenuForPlayer
Correction, ShowDialogForPlayer();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)