17.01.2019, 15:30
I believe he means in this code:
Your array index never changed, because you declare x even though you're incrementing i in the for loop.
So your objects are permanently being created in the first index of the array, which is why you only have the last object being created.
So
would become
so on and so forth for each of your variables.
Код:
pc LoadFurnitures() { new objects = 0; Total_FUR_Created = cache_num_rows(); new i,x; for(i=0;i<Total_FUR_Created;i++) { objects ++; cache_get_value_int(i, "ID", FurnitureInfo[x][fiID]); cache_get_value_int(i, "Model", FurnitureInfo[x][fiModel]); cache_get_value_float(i, "X", FurnitureInfo[x][fiX]); cache_get_value_float(i, "Y", FurnitureInfo[x][fiY]); cache_get_value_float(i, "Z", FurnitureInfo[x][fiZ]); cache_get_value_float(i, "RotX", FurnitureInfo[x][fiRotX]); cache_get_value_float(i, "RotY", FurnitureInfo[x][fiRotY]); cache_get_value_float(i, "RotZ", FurnitureInfo[x][fiRotZ]); cache_get_value_int(i, "Virtual", FurnitureInfo[x][fiVirtual]); cache_get_value_int(i, "House", FurnitureInfo[x][fiHouse]); FurnitureInfo[x][fiObject] = CreateDynamicObject(FurnitureInfo[x][fiModel], FurnitureInfo[x][fiX], FurnitureInfo[x][fiY], FurnitureInfo[x][fiZ], FurnitureInfo[x][fiRotX], FurnitureInfo[x][fiRotY], FurnitureInfo[x][fiRotZ], FurnitureInfo[x][fiVirtual], -1, -1, 200.0); } print("============================================================="); printf("[GAMEMODE]: Furniture Sistem Loaded %d object's", objects); print("=============================================================\n"); return 1; }
So your objects are permanently being created in the first index of the array, which is why you only have the last object being created.
So
Код:
cache_get_value_int(i, "ID", FurnitureInfo[x][fiID]);
Код:
cache_get_value_int(i, "ID", FurnitureInfo[i][fiID]);