Menu problems...
#1

I need help with my menu, I always suck at making menus and i tryed looking at a tutorial...and it still messed up.

Heres my menu so far...


Top of my script:

Код:
new Menu:ArmyWeps;
OnGameModeInit:

Код:
 ArmyWeps = CreateMenu("Army Weapons", 2, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(ArmyWeps, 0, "MP5");
	AddMenuItem(ArmyWeps, 0, "M4");
	AddMenuItem(ArmyWeps, 0, "Sniper");
	AddMenuItem(ArmyWeps, 0, "Sawnoff");
	AddMenuItem(ArmyWeps, 0, "Tec9");
	AddMenuItem(ArmyWeps, 0, "Desert Eagle");
OnPlayerSelectedMenuRow:

Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  	GetPlayerMenu(playerid);
	{
 	GivePlayerWeapon(playerid,29, 500);
 	GivePlayerWeapon(playerid,31, 500);
 	GivePlayerWeapon(playerid,34, 500);
 	GivePlayerWeapon(playerid,26, 500);
 	GivePlayerWeapon(playerid,32, 500);
 	GivePlayerWeapon(playerid,24, 500);
 	}
	return 1;
}
OnPlayerEnterStreamedCheckPoint:

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
  if(streamid == cp1) // army checkpoint
  {
    ShowMenuForPlayer(ArmyWeps, playerid);
  }
  return 1;
}
Thats it, The problem i'm having is though, when i go in game, and select any item like say "TEC9" it still gives me a desert eagle...same goes with any other weapon it only gives me desert eagles


Whats wrong? thanks
Reply
#2

good luck
Reply
#3

OnPlayerSelectedMenuRow needs to look like this:

pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
  if(CurrentMenu == ArmyWeps)
  {
    switch(row)
    {
      case 0:
      {
     
      }
      case 1:
      {
     
      }
      case 2:
      {

      }
      case 3:
      {

      }
        }
  }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Sergiy
OnPlayerSelectedMenuRow needs to look like this:

pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
  if(CurrentMenu == ArmyWeps)
  {
    switch(row)
    {
      case 0:
      {
     
      }
      case 1:
      {
     
      }
      case 2:
      {

      }
      case 3:
      {

      }
        }
  }
    return 1;
}
How do i make mine like that, i have no idea where to put what
Reply
#5

Never mind, I found out how and it works great!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)