Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. enum tInfo
  2. {
  3. tID,
  4. tPosX,
  5. tPosY,
  6. tPosZ,
  7. tName[128],
  8. tSkill,
  9. tTime
  10. };
  11.  
  12. new TruckInfo[MAX_TRUCK_POS][tInfo];
  13. new truckss = 0;
  14.  
  15. function init_truck() {
  16. mysql_pquery(SQL, "SELECT * FROM `truck`;", "loadTruck", "");
  17. }
  18.  
  19. function loadTruck()
  20. {
  21. truckss = cache_num_rows();
  22. for(new i = 1; i <= truckss; i++)
  23. {
  24. new t = i - 1;
  25. TruckInfo[i][tID] = cache_get_field_content_int(t, "LocationID");
  26. TruckInfo[i][tPosX] = cache_get_field_content_int(t, "LocationX");
  27. TruckInfo[i][tPosY] = cache_get_field_content_int(t, "LocationY");
  28. TruckInfo[i][tPosZ] = cache_get_field_content_int(t, "LocationZ");
  29. cache_get_field_content(t, "LocationName", TruckInfo[i][tName], SQL, 130);
  30. TruckInfo[i][tSkill] = cache_get_field_content_int(t, "LocationSkill");
  31. TruckInfo[i][tTime] = cache_get_field_content_int(t, "LocationTime");
  32. }
  33. printf("[LOADING] %d trucks locations.",truckss);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement