01.11.2013, 19:03
Hey guys, I'm having some problems with multi dimensional arrays. So this is the FurnitureInfo:
Basically I want to 'attach' this to my house system. A house will have a maximum of 30(MAX_FURNITURE) furniture pieces.
The problem is that even though this gets succesfully executed:
.. FurnitureInfo[i][HouseInfo[i][hFurns] still keeps the default values, and in the database they're different.
Can you tell me what I did wrong?
pawn Код:
#define MAX_HOUSES 500
#define MAX_FURNITURE 30
enum frInfo
{
frID,
frModel,
frHouse,
frDesc[21],
Float:frPosX,
Float:frPosY,
Float:frPosZ,
Float:frRotX,
Float:frRotY,
Float:frRotZ,
frObject,
frPlaced
};
new FurnitureInfo[MAX_HOUSES][MAX_FURNITURE][frInfo];
The problem is that even though this gets succesfully executed:
pawn Код:
cache_get_field_content(index, "frID", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frID] = strval(result);
cache_get_field_content(index, "frModel", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frModel] = strval(result);
cache_get_field_content(index, "frPosX", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frPosX] = floatstr(result);
cache_get_field_content(index, "frPosY", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frPosY] = floatstr(result);
cache_get_field_content(index, "frPosZ", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frPosZ] = floatstr(result);
cache_get_field_content(index, "frRotX", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frRotX] = floatstr(result);
cache_get_field_content(index, "frRotY", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frRotY] = floatstr(result);
cache_get_field_content(index, "frRotZ", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frRotZ] = floatstr(result);
cache_get_field_content(index, "frDesc", result); strmid(FurnitureInfo[i][HouseInfo[i][hFurns]][frDesc], result, 0, 21, 21);
cache_get_field_content(index, "frPlaced", result); FurnitureInfo[i][HouseInfo[i][hFurns]][frPlaced] = strval(result);
Can you tell me what I did wrong?