05.06.2012, 12:14
ON TOP OF YOUR SCRIPT:
Then, this is the command using ZCMD:
Then, OnDialogResponse callback:
pawn Код:
#define DIALOG_ATM 5461
pawn Код:
COMMAND:atm(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2, atmX, atmY, atmZ))
{
ShowPlayerDialog(playerid, DIALOG_ATM, DIALOG_STYLE_LIST, "ATM selection list", "1. Deposit money\n2. Withdraw money", "Select", "Cancel");
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_ATM:
{
if(!response) return SendClientMessage(playerid,, COLOR_WHITE, "You have decided to cancel");
if(response)
{
switch(listitem)
{
case 0: // first item: "deposit money"
{
// code here
}
case 1: // second item: "withdraw money"
{
// code here
}
}
}
}
}
return 1;
}