Help? Again?
#1

Ok, I have another question... This time i did try to search several different things. I need a Menu generator or a pre-made menu thing. I'm making a "Buy" menu for at 24/7. Everything i typer i kept getting "Your search query didn't return any matches."



Thanks for all your guys help.
Reply
#2

Hmm..Maybe you don't wanna do menu, coz they are ugly . (In My Opinion) Maybe you could try Dialogs. They are more comfortable and prettier.


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

It's gonna be a drug menu like

Crack ($20)
Weed ($50)
.....
.....
.....
Reply
#4

Yep, Dialog has same system.

Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drugs", "Crack $20\nWeed $50", "Buy", "Cancel"); //example how to start.
and response, if player clicks somewhere
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
  if (dialogid == 1) //checking dialogid
  {
    if (response == 1) //buy has been pressed
    {
      switch (listitem) //a switch, not going to explain it here
      {
        case 0:; //if player chooses crack, what script gonna do
        case 1:; //if player chooses weed, what script gonna do
       
      }
     
    }
    else //pressed cancel
    {
      SendClientMessage(playerid, 0xFFFFFFFF, "You closed a menu"); //i f player pressed cancel
    }
    return 1; //returns 1, it has been handled
  }
  return 0;
}
Reply
#5

Wow, That's pretty complicated lol
Reply
#6

Look one post up, i posted a little example.
Reply
#7

Ok, HOw can i add stuff to the on player dialog, like i want: Beer, Weed, Crack, Pills, Acid.
Reply
#8

Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drugs", "Crack $20\nWeed $50", "Buy", "Cancel"); //example how to start.
Look "Crack $20\nWeed $50".

\n means break(new item)

just add those things crack\nbeer\nweed\n etc
Reply
#9

Thx so much for your help. But one more question. Would i put this in a new script or my game mode. What would i put it under?


OnPlayerCommandText ()?
Reply
#10

It dependes where you wanna open the menu for player..under a command..like

CMDpenmenu(playerid, params[])
{
#pragma unused params
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drugs", "Crack $20\nWeed $50", "Buy", "Cancel"); //example how to start.
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)