31.08.2009, 18:00
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;
}