Advertisement
Custura

Untitled

Apr 8th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. public Detector_Load()
  2. {
  3. static
  4. rows,
  5. fields;
  6.  
  7. cache_get_data(rows, fields, g_iHandle);
  8.  
  9. for (new i = 0; i < rows; i ++) if (i < MAX_METAL_DETECTORS)
  10. {
  11. MetalDetectors[i][detectorExists] = 1;
  12. MetalDetectors[i][detectorID] = cache_get_field_int(i, "detectorID");
  13. MetalDetectors[i][detectorPos][0] = cache_get_field_float(i, "detectorX");
  14. MetalDetectors[i][detectorPos][1] = cache_get_field_float(i, "detectorY");
  15. MetalDetectors[i][detectorPos][2] = cache_get_field_float(i, "detectorZ");
  16. MetalDetectors[i][detectorPos][3] = cache_get_field_float(i, "detectorAngle");
  17. MetalDetectors[i][detectorInterior] = cache_get_field_int(i, "detectorInterior");
  18. MetalDetectors[i][detectorWorld] = cache_get_field_int(i, "detectorWorld");
  19.  
  20. Detector_Refresh(i);
  21. }
  22. return 1;
  23. }
  24.  
  25. public LoadTurfs()
  26. {
  27. new result[100],index = 0;
  28. mysql_query(SQL,"SELECT * FROM `turfs` ORDER BY `turfs`.`ID` ASC");
  29. mysql_store_result();
  30. while(mysql_retrieve_row())
  31. {
  32. index++;
  33. new i = index;
  34. mysql_get_field("ID", result); TurfInfo[i][zID] = strval(result);
  35. mysql_get_field("Owned", result); TurfInfo[i][zOwned] = strval(result);
  36. mysql_get_field("Time", result); TurfInfo[i][zTime] = strval(result);
  37. mysql_get_field("MinX", result); TurfInfo[i][zMinX] = floatstr(result);
  38. mysql_get_field("MinY", result); TurfInfo[i][zMinY] = floatstr(result);
  39. mysql_get_field("MaxX", result); TurfInfo[i][zMaxX] = floatstr(result);
  40. mysql_get_field("MaxY", result); TurfInfo[i][zMaxY] = floatstr(result);
  41. }
  42. mysql_free_result();
  43. printf("[MySQL Turfs]: %d", index);
  44. return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement