How to show the bag?
#4

pawn Код:
//============ Defines of Bag IDS
#define MAX_ITEMS 10
#define BAGCOUNT 5
#define ecard 1
#define smedal 2
#define gmedal 3
#define mayorsig 4
#define swatsig 5
#define sdoc1 6
#define sdoc2 7
#define sdoc3 8
#define sdoc4 9
#define sdocfull 10
pawn Код:
new Bags[MAX_PLAYERS][BAGCOUNT];
new ItemNames[MAX_ITEMS][32] =
{
{"Electronic Card"},
{"S Medal"},
{"G Medal"},
{"Mayor Sig"},
{"Swat Sig"},
{"S Document 1"},
{"S Document 2"},
{"S Document 3"},
{"S Document 4"},
{"S Full Document"}
};

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mybag", true) == 0)
    {
        new bagitem[128];
        SendClientMessage(playerid, YELLOW, "-----------------------------------------------");
        SendClientMessage(playerid, YELLOW, "      Your Bag");
        SendClientMessage(playerid, YELLOW, "-----------------------------------------------");
        for (new i = 0; i < 5; i++)
        {
            if (Bags[playerid][i] == 0) format(bagitem, sizeof(bagitem), "Bag %d: empty", i);
            else
            {
                format(bagitem, sizeof(bagitem), "Bag %d: %s", i, ItemNames[Bags[playerid][i] - 1]);
                SendClientMessage(playerid, YELLOW, bagitem);
            }
        }
        SendClientMessage(playerid, YELLOW, "-----------------------------------------------");
        return 1;
    }
    return 0;
}
Untested!
Reply


Messages In This Thread
How to show the bag? - by mirkoiz - 31.08.2009, 10:11
Re: Another Problem: How to show the bag? - by mirkoiz - 31.08.2009, 14:01
Re: How to show the bag? - by mirkoiz - 31.08.2009, 17:39
Re: How to show the bag? - by Clavius - 31.08.2009, 18:00
Re: How to show the bag? - by mirkoiz - 31.08.2009, 18:25
Re: How to show the bag? - by Clavius - 31.08.2009, 18:38
Re: How to show the bag? - by Clavius - 31.08.2009, 18:50
Re: How to show the bag? - by coole210 - 31.08.2009, 19:18
Re: How to show the bag? - by mirkoiz - 01.09.2009, 21:16
Re: How to show the bag? - by coole210 - 01.09.2009, 22:54

Forum Jump:


Users browsing this thread: 1 Guest(s)