Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ReloadHouseFurnitures(houseid)
- {
- for(new i; i < MAX_HOUSE_FURNITURES; i++)
- {
- DestroyDynamicObject(HouseInfo[houseid][Furniture][i]);
- HouseInfo[houseid][Furniture][i] = 0;
- }
- new query[186];
- mysql_format(sql, query, sizeof query, "SELECT * FROM house_furnitures hf INNER JOIN house_textures ht ON hf.house_id = ht.house_id WHERE hf.house_id = %d", houseid);
- mysql_tquery(sql, query, "OnLoadHouseFurnitures", "d", houseid);
- }
- forward OnLoadHouseFurnitures(houseid);
- public OnLoadHouseFurnitures(houseid)
- {
- if(!cache_get_row_count()) return 1;
- new objectid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, textureid[16];//, material_index, material_model_id, material_txd[32], material_texture[32], material_color;
- new query[128], Cache:result, model, txd[32], texture[32], color;
- for(new i; i < cache_get_row_count(); i++)
- {
- objectid = cache_get_field_content_int(i, "object_id");
- x = cache_get_field_content_float(i, "x");
- y = cache_get_field_content_float(i, "y");
- z = cache_get_field_content_float(i, "z");
- rx = cache_get_field_content_float(i, "rx");
- ry = cache_get_field_content_float(i, "ry");
- rz = cache_get_field_content_float(i, "rz");
- textureid[0] = cache_get_field_content_int(i, "texture_0");
- textureid[1] = cache_get_field_content_int(i, "texture_1");
- textureid[2] = cache_get_field_content_int(i, "texture_2");
- textureid[3] = cache_get_field_content_int(i, "texture_3");
- textureid[4] = cache_get_field_content_int(i, "texture_4");
- textureid[5] = cache_get_field_content_int(i, "texture_5");
- textureid[6] = cache_get_field_content_int(i, "texture_6");
- textureid[7] = cache_get_field_content_int(i, "texture_7");
- textureid[8] = cache_get_field_content_int(i, "texture_8");
- textureid[9] = cache_get_field_content_int(i, "texture_9");
- textureid[10] = cache_get_field_content_int(i, "texture_10");
- textureid[11] = cache_get_field_content_int(i, "texture_11");
- textureid[12] = cache_get_field_content_int(i, "texture_12");
- textureid[13] = cache_get_field_content_int(i, "texture_13");
- textureid[14] = cache_get_field_content_int(i, "texture_14");
- textureid[15] = cache_get_field_content_int(i, "texture_15");
- HouseInfo[houseid][Furniture][i] = CreateDynamicObject(objectid, x, y, z, rx, ry, rz, HouseInfo[houseid][ID], HouseInfo[houseid][Interior2]);
- for(new j; j <= 15; j++)
- {
- if(textureid[j] > 0)
- {
- model = cache_get_field_content_int(0, "model");
- cache_get_field_content(0, "txd", txd);
- cache_get_field_content(0, "texture", texture);
- color = cache_get_field_content_int(0, "color");
- SetDynamicObjectMaterial(HouseInfo[houseid][Furniture][i], j, model, txd, texture, color);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement