[Tutorial] Creating a Mesage Dialog for your script
#1

NOTE: We will use a vip commands menu for this.

The First Start
Open Pawno.
Click "New" at the top.
Then do these steps:

At the top, after
pawn Код:
#include <a_samp>
,
Put this:
pawn Код:
#define DIALOG_VIPHELP 1
.
The Middle Front
Then go to:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
.

It should look like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}
Change "/mycommand" to your liking. I will be using /vcmds for this tutorial since i am creating a vip menu.
The Final Push
Change:
pawn Код:
//Do something here
to:
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Vip Commands", "VIP COMMANDS\n/healme\n/vcmds\n/armourme\n/vipkill\nMORE COMMANDS TO COME", "OK", "Cancel");
NOTE: Make sure that is all on one line, not two.

Then, Press The compile button at the top (or F5), and you should get:
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Congratulations. You just created your message dialog!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)