Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <YSI/y_hooks>
- #include <YSY/y_timers>
- #include <YSI/y_commands>
- #define MAX_HOUSES (100)
- enum hInfo {
- hID,
- hOwner,
- hType, // 0 - small, 1 - medium, 2 - big
- Float:hExteriorX,
- Float:hExteriorY,
- Float:hExteriorZ,
- Float:hInteriorX,
- Float:hInteriorY,
- Float:hInteriorZ,
- hInterior,
- hRentPrice,
- hPrice,
- hLock,
- hUpgrades[1], // 0 - house /eat
- Text3D:hLabel,
- hPickup
- }
- new houseVariables[MAX_HOUSES][hInfo],
- Iterator:server_houses<MAX_HOUSES>;
- hook OnGameModeInit() {
- iniHouses();
- }
- function iniHouses() {
- new Cache:houses = mysql_query(SQL, "SELECT * FROM `server_houses`"), x;
- for(new i; i < cache_get_row_count(); i++;) {
- x = cache_get_field_content_int(i, "houseID");
- houseVariables[x][hOwner] = cache_get_field_content_int(i, "houseOwner");
- houseVariables[x][hType] = cache_get_field_content_int(i, "houseType");
- houseVariables[x][hExteriorX] = cache_get_field_content_float(i, "houseExteriorX");
- houseVariables[x][hExteriorY] = cache_get_field_content_float(i, "houseExteriorY");
- houseVariables[x][hExteriorZ] = cache_get_field_content_float(i, "houseExteriorZ");
- houseVariables[x][hInteriorX] = cache_get_field_content_float(i, "houseInteriorX");
- houseVariables[x][hInteriorY] = cache_get_field_content_float(i, "houseInteriorY");
- houseVariables[x][hInteriorZ] = cache_get_field_content_float(i, "houseInteriorZ");
- houseVariables[x][hInterior] = cache_get_field_content_int(i, "houseInterior");
- houseVariables[x][hRentPrice] = cache_get_field_content_int(i, "houseRentPrice");
- houseVariables[x][hPrice] = cache_get_field_content_int(i, "housePrice");
- houseVariables[x][hLock] = cache_get_field_content_int(i, "houseLock");
- houseVariables[x][hUpgrades][0] = cache_get_field_content_int(i, "houseEatUpgrade");
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement