17.04.2011, 21:00
Guys, i want to make a list with buyable items in my 27/4 shop, when someone enter the shop will type /buy and a list will appear, how to make this?
CMD:buy(playerid, params[])
{
if(!IsPlayerInRangeofPoint(playerid, 6.0, 0.000,0.0000,0.0000))
return SendClientMessage(playerid, COLOR_RED, ""You're not in the shop!");
ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Shop", "Item 1/nItem 2/nItem 3", "Buy", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1337)
{
if(!response) return 1;
switch(listitem)
{
case 0: // Item 1
case 1: // Item 2
case 2: // Item 3
}
}
return 1;
}