Need Help 2
#2

OnPlayerClickPlayer detects when you double click on a player's name on the player list (TAB). To detect dialog pressing, you need to do something like this:

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapons", "Rifle\nDeagle", "Purchase", "Close");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 33);
                    SendClientMessage(playerid, -1, "You have purchased a rifle.");
                }

                case 1:
                {
                    GivePlayerWeapon(playerid, 24);
                    SendClientMessage(playerid, -1, "You have purchased a deagle.");
                }
            }
        }
    }

    return 0;
}
%d or %i - integers in format
%f - floats in format
%s - strings in format

Those are the ones you'll use the most.
Reply


Messages In This Thread
Need Help 2 - by ss2119 - 08.11.2012, 11:55
Re: Need Help 2 - by SuperViper - 08.11.2012, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)