Help furniture
#3

I believe he means in this code:
Код:
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;
}
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
Код:
           cache_get_value_int(i, "ID",            FurnitureInfo[x][fiID]);
would become
Код:
           cache_get_value_int(i, "ID",            FurnitureInfo[i][fiID]);
so on and so forth for each of your variables.
Reply


Messages In This Thread
Help furniture - by HypCosmin - 17.01.2019, 12:40
Re: Help furniture - by HypCosmin - 17.01.2019, 15:25
Re: Help furniture - by Chyakka - 17.01.2019, 15:30
Re: Help furniture - by HypCosmin - 17.01.2019, 15:40
Re: Help furniture - by HypCosmin - 17.01.2019, 17:12
Re: Help furniture - by HypCosmin - 18.01.2019, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)