23.05.2014, 22:09
You mean something like this?
I wouldn't recommend using that, it's just a rough example to help you.
pawn Код:
new StoreID[MAX_PLAYERS];
public OnPlayerClickPlayer(playerid, clickedplayerid, source) //Bibles example
{
ShowPlayerDialog(playerid, DIALOG_CLICKMENU, DIALOG_STYLE_LIST, "What do you want to do?", "Give Money\nGive EXP\nGive Fuel\n", "Continue", "Close");
StoreID[playerid] = clickedplayerid;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_CLICKPLAYER:
{
if(response)
{
switch(listitem)
{
case 0: //Lets give a player a defined amount of money...
{
ShowPlayerDialog(playerid, DIALOG_GIVEMONEY, DIALOG_STYLE_INPUT, "Give Money", "How much?", "Go", "Cancel");
}
}
}
}
case DIALOG_GIVEMONEY:
{
if(response)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(StoreID[playerid], x, y, x);
if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z)//Are you within 5 units?
{
GivePlayerMoney(StoreID[playerid], inputtext); //This will give the player the amount of moeny you entered
}
}
}
}
}