#6

Quote:
Originally Posted by Burridge
This should really be made in the Script request thread. But I have a command which will chnage your color. You can have it. This is doen Via a menu.

pawn Код:
new Menu:ColorMenu;


pawn Код:
//The Command
if (strcmp("/color", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(ColorMenu, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  HideMenuForPlayer(ColorMenu, playerid);
    if(current == ColorMenu)
  {
    switch(row)
    {
      case 0:
            {
            SetPlayerColor(playerid, COLOR_GREEN);
            TogglePlayerControllable(playerid, true);
            }
            case 1:
            {
            SetPlayerColor(playerid, COLOR_LIME);
            TogglePlayerControllable(playerid, true);
            }
      case 2:
            {
            SetPlayerColor(playerid, COLOR_BLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 3:
            {
            SetPlayerColor(playerid, COLOR_YELLOW);
      TogglePlayerControllable(playerid, true);
      }
      case 4:
            {
            SetPlayerColor(playerid, COLOR_ORANGE);
      TogglePlayerControllable(playerid, true);
      }
      case 5:
            {
            SetPlayerColor(playerid, COLOR_GREY);
      TogglePlayerControllable(playerid, true);
      }
      case 6:
            {
            SetPlayerColor(playerid, COLOR_PINK);
      TogglePlayerControllable(playerid, true);
      }
      case 7:
            {
            SetPlayerColor(playerid, COLOR_PURPLE);
      TogglePlayerControllable(playerid, true);
      }
      case 8:
            {
            SetPlayerColor(playerid, COLOR_LIGHTBLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 9:
            {
            SetPlayerColor(playerid, COLOR_BLACK);
      TogglePlayerControllable(playerid, true);
      }
      case 10:
            {
            SetPlayerColor(playerid, COLOR_BROWN);
      TogglePlayerControllable(playerid, true);
      }
      case 11:
            {
            SetPlayerColor(playerid, COLOR_WHITE);
      TogglePlayerControllable(playerid, true);
      }
        }
    }
}
    return 1;
}
pawn Код:
ColorMenu = CreateMenu("Color Menu", 1, 50.0, 180.0, 200.0, 200.0);

    AddMenuItem(ColorMenu, 0, "Green");
    AddMenuItem(ColorMenu, 0, "Lime");
    AddMenuItem(ColorMenu, 0, "Blue");
    AddMenuItem(ColorMenu, 0, "Yellow");
    AddMenuItem(ColorMenu, 0, "Orange");
    AddMenuItem(ColorMenu, 0, "Grey");
    AddMenuItem(ColorMenu, 0, "Pink");
    AddMenuItem(ColorMenu, 0, "Purple");
    AddMenuItem(ColorMenu, 0, "Lightblue");
  AddMenuItem(ColorMenu, 0, "Black");
    AddMenuItem(ColorMenu, 0, "Brown");
    AddMenuItem(ColorMenu, 0, "White");
Will work perfectly if you put it in your code properly.
ok thanks alot, where do i put the last bit of it

i have done the new //at the top

and the onplayercommandtext //duh

but where does the addmenuitem code go?

thanks
Reply


Messages In This Thread
HELP - by wilcock33 - 09.08.2009, 17:04
Re: HELP - by Burridge - 09.08.2009, 17:44
Re: HELP - by Klutty - 09.08.2009, 22:13
Re: HELP - by iLinx - 09.08.2009, 22:17
Re: HELP - by Burridge - 10.08.2009, 01:31
Re: HELP - by wilcock33 - 10.08.2009, 11:48
Re: HELP - by Burridge - 10.08.2009, 11:54
Re: HELP - by wilcock33 - 10.08.2009, 11:57
Re: HELP - by wilcock33 - 10.08.2009, 12:05
Re: HELP - by Burridge - 10.08.2009, 12:55

Forum Jump:


Users browsing this thread: 1 Guest(s)