Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. public Load_Houses() //Chargement des houses
  2. {
  3.  
  4. new rows, fields, string[256];
  5. cache_get_data(rows, fields);
  6.  
  7. if(cache_num_rows() > 0)
  8. {
  9. for(new i; i < rows; i++)
  10. {
  11. hInfo[i][hSQL] = cache_get_field_content_int(i, "id");
  12. hInfo[i][hPosX] = cache_get_field_content_float(i, "x");
  13. hInfo[i][hPosY] = cache_get_field_content_float(i, "y");
  14. hInfo[i][hPosZ] = cache_get_field_content_float(i, "z");
  15. hInfo[i][hPrix] = cache_get_field_content_int(i, "prix");
  16.  
  17. hInfo[i][hInX] = cache_get_field_content_float(i, "in_x");
  18. hInfo[i][hInY] = cache_get_field_content_float(i, "in_y");
  19. hInfo[i][hInZ] = cache_get_field_content_float(i, "in_z");
  20.  
  21. hInfo[i][hExterior_Int] = cache_get_field_content_int(i, "exterior_world");
  22. hInfo[i][hExterior_World] = cache_get_field_content_int(i, "exterior_int");
  23.  
  24. hInfo[i][hInterior_Int] = cache_get_field_content_int(i, "interior_world");
  25. hInfo[i][hInterior_World] = cache_get_field_content_int(i, "interior_int");
  26.  
  27. hInfo[i][hOwnerSQL] = cache_get_field_content_int(i, "owner_sql");
  28.  
  29.  
  30. hInfo[i][hPickup] = CreatePickup(1239, 0, hInfo[i][hPosX], hInfo[i][hPosY], hInfo[i][hPosZ], hInfo[i][hExterior_World]);
  31.  
  32. if(hInfo[i][hOwnerSQL] > 0)
  33. {
  34. format(string, sizeof(string), "Maison (id %d)\nPropriétaire: %s", hInfo[i][hSQL], pInfo[hInfo[i][hOwnerSQL]][pUsername]);
  35. }
  36.  
  37. else
  38. {
  39. format(string, sizeof(string), "Maison en vente (id %d)\nPrix: $%d", hInfo[i][hSQL], hInfo[i][hPrix]);
  40. }
  41.  
  42. hInfo[i][hText] = Create3DTextLabel(string, -1, hInfo[i][hPosX], hInfo[i][hPosY], hInfo[i][hPosZ]+0.7, 10.0, hInfo[i][hExterior_World], 0);
  43.  
  44. hInfo[i][hExist] = true;
  45.  
  46. }
  47.  
  48. }
  49.  
  50. printf("%d houses trouvés dans la database", rows);
  51.  
  52. return true;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement