SHARE
TWEET

Untitled

a guest Jan 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public LoadHouses()
  2. {
  3.     new str[250];
  4.     new query[1000];
  5.     //for(new i=1;i<MAX_HOUSES;i++)
  6.     for(new i=0, rows = cache_get_row_count(); i<rows; i++)
  7.     {
  8.         DestroyPickup(HouseInfo[i][hPickup]);
  9.         DestroyDynamic3DTextLabel(HouseInfo[i][hLabel]);
  10.         cache_get_field_content(i, "Owner", HouseInfo[i][hOwner], dbhandle, MAX_PLAYER_NAME);
  11.         HouseInfo[i][hID]             = cache_get_field_content_int(i, "ID", dbhandle);
  12.         HouseInfo[i][hOutPos][0]      = cache_get_field_content_float(i, "Out_X", dbhandle);
  13.         HouseInfo[i][hOutPos][1]      = cache_get_field_content_float(i, "Out_Y", dbhandle);
  14.         HouseInfo[i][hOutPos][2]      = cache_get_field_content_float(i, "Out_Z", dbhandle);
  15.         HouseInfo[i][hIntPos][0]      = cache_get_field_content_float(i, "Int_X", dbhandle);
  16.         HouseInfo[i][hIntPos][1]      = cache_get_field_content_float(i, "Int_Y", dbhandle);
  17.         HouseInfo[i][hIntPos][2]      = cache_get_field_content_float(i, "Int_Z", dbhandle);
  18.         HouseInfo[i][hOutInterior]    = cache_get_field_content_int(i, "OutInt", dbhandle);
  19.         HouseInfo[i][hOutWorld]       = cache_get_field_content_int(i, "OutWorld", dbhandle);
  20.         HouseInfo[i][hInsideInterior] = cache_get_field_content_int(i, "InsideInt", dbhandle);
  21.         HouseInfo[i][hInsideWorld]    = cache_get_field_content_int(i, "InsideWorld", dbhandle);
  22.         HouseInfo[i][hLocked]         = cache_get_field_content_int(i, "Locked", dbhandle);
  23.         HouseInfo[i][hForSell]        = cache_get_field_content_int(i, "ForSell", dbhandle);
  24.         HouseInfo[i][hPrice]          = cache_get_field_content_int(i, "Price", dbhandle);
  25.         if(HouseInfo[i][hForSell] == 1)
  26.         {
  27.             HouseInfo[i][hPickup] = CreatePickup(1273, 23, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2], -1);
  28.             format(str, sizeof(str), "This house is for sell!\nPrice: %d\nType /buyhouse to buy it.\nType /enter to go inside.", HouseInfo[i][hPrice]);
  29.             HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str ,COLOR_ORANGE, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
  30.         }
  31.         else
  32.         {
  33.             HouseInfo[i][hPickup] = CreatePickup(1273, 23, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2], -1);
  34.             format(str, sizeof(str), "House\nOwner: %s\nTo enter inside type /enter.", HouseInfo[i][hOwner]);
  35.             HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str ,COLOR_ORANGE, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
  36.         }
  37.     }
  38.     return 1;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top