25.05.2012, 05:51
(
Last edited by Blessed; 27/05/2012 at 03:44 PM.
)
INTRO
Although, most of you don't need this, but there are still some of those new PAWNer's out there, and this might deem useful to them. It is not hard to make a Dialog, and is probably the first thing I even learned in Scripting! I know this isn't much of an Intro, so I'm just going to move on...MAKING THE DIALOG
ShowPlayerDialog(playerid, dialogid, style, "Title", "info \n for new lines", "First Button", "Second Button");
Okay, this here tells you everything. This is the format for making a Dialog. Now there are 4 types of Dialog's, of which I'm not going to go into detail with but can be found here: https://sampwiki.blast.hk/wiki/Dialog_Styles
Now, There are several ways to make these... I'm going to make a simple /getgun (For Admins).
*NOTE* Remove
pawn Code:
if(PlayerInfo[playerid][pAdmin] >= 1)
Also, you see the
pawn Code:
>= 1
*So here is what I came up with:
pawn Code:
if(PlayerInfo[playerid][pAdmin] >= 1) return
ShowPlayerDialog(playerid, 1, 2, "Gun Menu","AK47\nM41",
"Get Gun", "Cancel");
However, this isn't it. If you click on Get Gun, you aren't going to get a gun. Heres the Second part.
PART 2
You must go to the 'public OnDialogResponse'pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(listitem == 0) GivePlayerWeapon(playerid, 30, 9999);
if(listitem == 1) GivePlayerWeapon(playerid, 31, 9999);
}
return 1;
}
If this helped you, +rep me.
-Blessed