Inventory, help.
#1

Quote:

enum iInfo
{
iOccupato,
iSlot1,
iSlot2,
iSlot3,
iSlot4,
iSlot5,
iSlot6,
iSlot7,
iSlot8,
iSlot9,
iSlot10,
};
new InventarioInfo[500][iInfo];

I have a small problem with my inventory system.
I have this enum, how do I do so that I can enter two values?
for example, in Slot1 I want to put DesertEagle (30 ammunition).
Slot2: Drugs (5 grams)
Etc .. How do I insert two values in an enum line?

Thanks
Reply
#2

Like this?

Код:
enum iInfo
{
iOccupato,
iSlot1[2],
iSlot2[2],
iSlot3[2],
iSlot4,
iSlot5,
iSlot6,
iSlot7,
iSlot8,
iSlot9,
iSlot10,
};
new InventarioInfo[500][iInfo];
So you call for it like this:

Код:
InventarioInfo[playerid][iSlot1][0] = weaponid;
InventarioInfo[playerid][iSlot1][1] = ammo;
Reply
#3

And in saveinventory file what I write? I INI_WRITEINT or INI_WRITESTRING? How to save them both?
Reply
#4

The same as the example I gave to you,

It'd be like
Код:
INI_WriteInt("Weaponid",InventarioInfo[playerid][iSlot1][0]);
as that [0] holds the [iSlot1] first value, get it?
Reply
#5

Ok,thank's
Ok, and I come to Put What in slot 1 there is a lighter? Come I make a mean What an ad value equivalent to a lighter or a cigarette?
/Layinglighter
Reply
#6

You will need to make your own item system, mine is something like:

Код:
#define ITEM_cigarette 1
#define ITEM_lighter 2

InventarioInfo[playerid][iSlot1][0] = ITEM_cigarette;
InventarioInfo[playerid][iSlot1][1] = 2;
InventarioInfo[playerid][iSlot2][0] = ITEM_lighter;
InventarioInfo[playerid][iSlot2][1] = 1;
Reply
#7

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)