Need help with this
#1

Ok so i have made a menu

I have made it so when the player walks into the icon it shows the menu.

The Problem:
When the player wants to choose nothing on the menu and carry on doing what they was doing, when you press enter to exit the menu the menu just pops up again because they are still on the icon so i want to make it so when they exit the menu it will spawn them 1 meter away from the icon so they dont run into the same problem.

Thanks
Reply
#2

We are not psychic you know

Post your code so people can see if they can spot what the problem is
Reply
#3

If they player exits the menu i want them to spawn about 1metre away from it

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if (pickupid == AirportIconLV)
    {
        ShowMenuForPlayer(AirportLV, playerid);
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "State your destination"); //
    }
    else if (pickupid == AirportIconAA)
    {
        ShowMenuForPlayer(AirportAA, playerid);
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "State your destination"); //
    }
    return 1;
}
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == AirportLV)
  {
    switch(row)
    {
      case 0:{
        SetPlayerPos(playerid, 401.5049,2529.6296,16.5724);
                SendClientMessage(playerid, 0xFFFF00FF, "Welcome to the Abandoned Airport.");
                GivePlayerMoney(playerid, -2000);
            TogglePlayerControllable(playerid, 1);
      }
    }
  }

  new Menu:current1;
  current1 = GetPlayerMenu(playerid);
  if(current1 == AirportAA)
  {
    switch(row)
    {
      case 0:{
        SetPlayerPos(playerid, 1697.8367,1451.0958,10.7688);
                SendClientMessage(playerid, 0xFFFF00FF, "Welcome to Las Ventures Airport.");
                GivePlayerMoney(playerid, -2000);
                TogglePlayerControllable(playerid, 1);
      }
    }
  }
    return 1;
}
pawn Код:
public OnPlayerExitedMenu(playerid)
{
    TogglePlayerControllable(playerid, 1);
    new Float:x, Float:y, Float:z;
    SetPlayerPos(playerid, x, y, z+1); //
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)