tag mismatch with enums
#1

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:
PHP код:
enum Obj
{
    
Object[MAX_PLAYER_OBJECTS],
}
enum objinfo
{
 
Name[126],
}
new 
Inventory[MAX_PLAYERS][Obj];
new 
InventoryInfo[MAX_PLAYERS][Obj][objinfo]; 
This is the code with the error:
PHP код:
forward LoadInventory(playerid);
public 
LoadInventory(playerid)
{
objamount cache_get_row_count();
      for(new 
iobjamounti++)
    {
        
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
    
}

Reply
#2

Why do you want to load everything into an array if you already got everything in the database?

To remove the tag mistake add "Obj:" in from of "i" = "Obj: i"
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Why do you want to load everything into an array if you already got everything in the database?

To remove the tag mistake add "Obj:" in from of "i" = "Obj: i"
Because I thought it would be easier if I store everything in an array so I can use it later on in my script.
What would be a smarter way to do this?
Reply
#4

I would leave it in the database because it offers you already everything you need, like sorting or searching for a specifc item
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)