ERROR 029: Help, please.
#9

Enums do save strings aslong as you define the string size.

Also, your array wouldn't work since you didn't define a playerid. You also won't really need to store the item name in your enum as you should be able to retrieve it from the array.

This is taken from my own inventory system, hopefully you can get the idea of what I'm trying to say:

The item array:

pawn Код:
new InventoryItems[MAX_INV_ITEMS][][] = {
//  ID      Name of Item        Obj ID

    {0,     "Untied Rope",      964},
    {1,     "Wood Blocks",      1463},
    {2,     "Hunting Knife",    335}
};
Storing them using these defines and variables:

pawn Код:
#define MAX_INV_SLOTS   5

// Store item ID inside of this
new pInv_Item[MAX_PLAYERS][MAX_INV_SLOTS];
new pInv_Value[MAX_PLAYERS][MAX_INV_SLOTS];
Retrieving the name from the array, this would work (please note: pInv_Item is actually the player's inventory, I will emphasize inside the [pawn] code:

pawn Код:
for(new i = 0; i < MAX_INV_SLOTS; i ++)
{
         InventoryItems[ pInv_Item[playerid][i] ][1][0]
}

// To explain the following;  "i" equals the player's inventory slot: which saves the item ID -- empty slots are "0", that's how you find them.

pInv_Item[playerid][i]
EDIT: Thanks Eth (:
Reply


Messages In This Thread
ERROR 029: Help, please. - by BrightLiteFilms - 03.06.2014, 13:04
Re: ERROR 029: Help, please. - by Eth - 03.06.2014, 13:09
Re: ERROR 029: Help, please. - by BrightLiteFilms - 03.06.2014, 13:14
Re: ERROR 029: Help, please. - by Eth - 03.06.2014, 13:17
Re: ERROR 029: Help, please. - by BrightLiteFilms - 03.06.2014, 13:21
Re: ERROR 029: Help, please. - by Eth - 03.06.2014, 13:23
Re: ERROR 029: Help, please. - by BrightLiteFilms - 03.06.2014, 13:27
Re: ERROR 029: Help, please. - by Eth - 03.06.2014, 13:29
Re: ERROR 029: Help, please. - by Dignity - 03.06.2014, 13:38
Re: ERROR 029: Help, please. - by BrightLiteFilms - 03.06.2014, 13:41

Forum Jump:


Users browsing this thread: 1 Guest(s)