Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward LoadDynamicHouses();
- public LoadDynamicHouses()
- {
- new rows = cache_num_rows(),
- time = GetTickCount(),
- total,
- query[128];
- if(!rows)
- {
- print("[Houses] Houses Loaded».");
- return 1;
- }
- for(new i; i < rows; i++)
- {
- cache_get_value_name_int(i, "id", HouseInfo[i][hID]);
- cache_get_value_name_float(i, "posx", HouseInfo[i][hPosX]);
- cache_get_value_name_float(i, "posy", HouseInfo[i][hPosY]);
- cache_get_value_name_float(i, "posz", HouseInfo[i][hPosZ]);
- cache_get_value_name_float(i, "exitx", HouseInfo[i][hExitX]);
- cache_get_value_name_float(i, "exity", HouseInfo[i][hExitY]);
- cache_get_value_name_float(i, "exitz", HouseInfo[i][hExitZ]);
- cache_get_value_name(i, "ownername", HouseInfo[i][hOwner]);
- strreplace(HouseInfo[i][hOwner], "_", " ");
- cache_get_value_name_int(i, "owner", HouseInfo[i][hOwnerID]);
- cache_get_value_name_int(i, "locked", HouseInfo[i][hLocked]);
- cache_get_value_name_int(i, "price", HouseInfo[i][hPrice]);
- cache_get_value_name_int(i, "levelbuy", HouseInfo[i][hLevelbuy]);
- cache_get_value_name_int(i, "cash", HouseInfo[i][hCash]);
- cache_get_value_name_int(i, "exitint", HouseInfo[i][hExitInt]);
- cache_get_value_name_int(i, "exitvw", HouseInfo[i][hExitVW] );
- cache_get_value_name_int(i, "posint", HouseInfo[i][hPosInt] );
- cache_get_value_name_int(i, "posvw", HouseInfo[i][hPosVW]);
- cache_get_value_name_float(i, "checkx", HouseInfo[i][hCheckPosX]);
- cache_get_value_name_float(i, "checky", HouseInfo[i][hCheckPosY]);
- cache_get_value_name_float(i, "checkz", HouseInfo[i][hCheckPosZ]);
- cache_get_value_name_int(i, "radio", HouseInfo[i][hRadio] );
- cache_get_value_name_int(i, "lock", HouseInfo[i][hLock]);
- cache_get_value_name_int(i, "alarm", HouseInfo[i][hAlarm]);
- cache_get_value_name_int(i, "door", HouseInfo[i][hDoor]);
- cache_get_value_name_int(i, "ddoor", HouseInfo[i][hDDoor]);
- cache_get_value_name_int(i, "class", HouseInfo[i][hClass]);
- cache_get_value_name_int(i, "heal", HouseInfo[i][hHeal]);
- cache_get_value_name_int(i, "heal_amount", HouseInfo[i][hHealAmount]);
- cache_get_value_name_int(i, "cupboard", HouseInfo[i][hCupboard]);
- cache_get_value_name_float(i, "furniture_radius", HouseInfo[i][hFurnitureRadius]);
- HouseInfo[i][hFurniture] = 0;
- HouseInfo[i][hOutsideFurniture] = 0;
- new str_inv[10];
- for(new a = 0; a < MAX_HOUSE_INVENTORY; a++)
- {
- format(str_inv, sizeof(str_inv), "inv_%i", a+1);
- cache_get_value_name_int(i, str_inv, HouseInfo[i][hInv][a]);
- format(str_inv, sizeof(str_inv), "amount_%i", a+1);
- cache_get_value_name_int(i, str_inv, HouseInfo[i][hInvAmount][a]);
- }
- UpdateHouseText(i);
- UpdateHouseDoor(i);
- HouseInfo[i][hCheckPoint] =
- CreateDynamicCP(HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ], 1.0, HouseInfo[i][hPosVW], HouseInfo[i][hPosInt], -1, 2.0);
- //format(query, sizeof(query), "SELECT * FROM `furnitures` WHERE `houseid`='%i'", HouseInfo[i][hID]);
- //mysql_tquery(dbCon, query, "OnFurnituresLoad", "i", i);
- total++;
- }
- printf("[Houses] Case - %i. printif - %i. timp: %i ms.", rows, total, GetTickCount()-time);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement