Advertisement
Guest User

Untitled

a guest
May 30th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. forward loadHouses();
  2. public loadHouses() {
  3. cache_get_data(rows, fields);
  4. if(rows) {
  5. new id, pickup;
  6. for(new i; i < rows; i++) {
  7. id = cache_get_field_content_int(i, "id");
  8. hInfo[id][hID] = id;
  9. cache_get_field_content(i, "Name", hInfo[id][hName], handle, 32);
  10. cache_get_field_content(i, "Price", hInfo[id][hPrice], handle, 15);
  11. cache_get_field_content(i, "Description", hInfo[id][hDescription], handle, 32);
  12. cache_get_field_content(i, "Owner", hInfo[id][hOwner], handle, 32);
  13.  
  14. hInfo[id][heX] = cache_get_field_content_float(i, "eX");
  15. hInfo[id][heY] = cache_get_field_content_float(i, "eY");
  16. hInfo[id][heZ] = cache_get_field_content_float(i, "eZ");
  17. hInfo[id][hiX] = cache_get_field_content_float(i, "iX");
  18. hInfo[id][hiY] = cache_get_field_content_float(i, "iY");
  19. hInfo[id][hiZ] = cache_get_field_content_float(i, "iZ");
  20.  
  21. hInfo[id][hInterior] = cache_get_field_content_int(i, "Interior");
  22. hInfo[id][hSale] = cache_get_field_content_int(i, "Sale");
  23. hInfo[id][hDoor] = cache_get_field_content_int(i, "Door");
  24.  
  25. format(gMsg, 256, "House: %d\nOwner: %s\nDescription: %s\n", hInfo[id][hID], hInfo[id][hOwner], hInfo[id][hDescription]);
  26.  
  27. if(hInfo[id][hSale] == 1) {
  28. pickup = 1273;
  29. }
  30. else {
  31. pickup = 1272;
  32. }
  33.  
  34. hInfo[id][hPickup] = CreateDynamicPickup(pickup, 1, hInfo[id][heX], hInfo[id][heY], hInfo[id][heZ], -1, -1, -1, 20.0);
  35. hInfo[id][hLabel] = CreateDynamic3DTextLabel(gMsg, COLOR_YELLOW, hInfo[id][heX], hInfo[id][heY], hInfo[id][heZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
  36. }
  37. }
  38. else printf("No houses.");
  39. return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement