03.09.2016, 19:14
Hello,
I'm trying to make a simple inventory system, but there is a problem with storing the name of the object.
These are the enums:
This is the code with the error:
I'm trying to make a simple inventory system, but there is a problem with storing the name of the object.
These are the enums:
PHP код:
enum Obj
{
Object[MAX_PLAYER_OBJECTS],
}
enum objinfo
{
Name[126],
}
new Inventory[MAX_PLAYERS][Obj];
new InventoryInfo[MAX_PLAYERS][Obj][objinfo];
PHP код:
forward LoadInventory(playerid);
public LoadInventory(playerid)
{
objamount = cache_get_row_count();
for(new i; i < objamount; i++)
{
Inventory[playerid][Object][i] = cache_get_field_content_int(i, "ObjectID"); //this works
cache_get_field_content(i, "Name", InventoryInfo[playerid][i][Name]); // this has warning 213: tag mismatch
}
}