Command
#10

You mean something like this?
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
                }
            }
        }
    }
}
I wouldn't recommend using that, it's just a rough example to help you.
Reply


Messages In This Thread
Command - by rumen98 - 23.05.2014, 20:09
Re: Command - by Fred1993 - 23.05.2014, 20:21
Re: Command - by iFiras - 23.05.2014, 20:27
Re: Command - by rumen98 - 23.05.2014, 20:37
Re: Command - by AndySedeyn - 23.05.2014, 20:43
Re: Command - by Fred1993 - 23.05.2014, 20:45
Re: Command - by rumen98 - 23.05.2014, 21:11
Re: Command - by AndySedeyn - 23.05.2014, 21:19
Re: Command - by rumen98 - 23.05.2014, 21:25
Re: Command - by Jacksta21 - 23.05.2014, 22:09

Forum Jump:


Users browsing this thread: 3 Guest(s)