Advertisement
ipsBruno

Untitled

Jul 27th, 2014
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2. stock DiagonalRoute(Float:nx, Float:ny, Float: nz, Float:px, Float:py, Float:pz) {
  3.  
  4. if(floatround(nz) != floatround(pz)) {
  5.  
  6. return false;
  7. }
  8.  
  9. if((nx > px)) {
  10. while(nx > px) {
  11. nx -= 1.0;
  12.  
  13. while(ny > py) {
  14.  
  15. ny -= 1.0;
  16.  
  17. MapAndreas_FindZ_For2DCoord(nx, ny, nz);
  18.  
  19. if(floatabs((nz) - (pz)) > 2.5) {
  20.  
  21. return false;
  22. }
  23. }
  24.  
  25. while(ny < py) {
  26. ny += 1.0;
  27.  
  28. MapAndreas_FindZ_For2DCoord(nx, ny, nz);
  29.  
  30.  
  31. if(floatabs((nz) - (pz)) > 2.5) {
  32.  
  33. return false;
  34. }
  35.  
  36. }
  37. }
  38. }
  39. else {
  40.  
  41. while(nx < px) {
  42. nx += 1.0;
  43.  
  44. while(ny > py) {
  45.  
  46. ny -= 1.0;
  47.  
  48. MapAndreas_FindZ_For2DCoord(nx, ny, nz);
  49.  
  50.  
  51. if(floatabs((nz) - (pz)) > 2.5) {
  52.  
  53. return false;
  54. }
  55. }
  56.  
  57. while(ny < py) {
  58. ny += 1.0;
  59.  
  60. MapAndreas_FindZ_For2DCoord(nx, ny, nz);
  61.  
  62.  
  63. if(floatabs((nz) - (pz)) > 2.5) {
  64. return false;
  65. }
  66.  
  67. }
  68. }
  69. }
  70.  
  71. return true;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement