Advertisement
Guest User

SpiderPork

a guest
Apr 23rd, 2009
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. /*
  2. * (c)Copyright 2009, Jason Gregory
  3. * VehicleMove Functions - Botdriver 0.1
  4. */
  5.  
  6. /* Includes */
  7.  
  8. #include <a_samp>
  9. #include <core>
  10. #include <float>
  11.  
  12. #define COLOR_LIGHTBLUE 0x33CCFFAA
  13.  
  14. /* News */
  15.  
  16. new Float:TeleportDestveh[MAX_PLAYERS][3];
  17.  
  18. /* Forwards */
  19.  
  20. forward xMoveVehicle(carid);
  21. forward yMoveVehicle(carid);
  22. forward zMoveVehicle(carid);
  23. forward MoveVehicle(carid);
  24.  
  25. /* Sonstiges/Misc */
  26.  
  27. /*native xMoveVehicle(carid);
  28. native yMoveVehicle(carid);
  29. native zMoveVehicle(carid);
  30. native MoveVehicle(carid);*/
  31.  
  32. public xMoveVehicle(carid)
  33. {
  34. new Float:x1,Float:y1,Float:z1;
  35. GetVehiclePos(carid, x1, y1, z1);
  36. {
  37. for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
  38. {
  39. if(PlayerToPoint(2.0, playerid, TeleportDestveh[playerid][0], y1, z1))
  40. {
  41. SendClientMessageToAll(COLOR_LIGHTBLUE, "X-Coord Position Reached");
  42. }
  43. else if(TeleportDestveh[playerid][0] > x1)
  44. {
  45. SetVehiclePos(carid, x1+1, y1, z1);
  46. }
  47.  
  48. if(TeleportDestveh[playerid][1] > x1)
  49. {
  50. SetVehiclePos(carid, x1+1, y1, z1);
  51. }
  52. else if(TeleportDestveh[playerid][0] < x1)
  53. {
  54. SetVehiclePos(carid, x1-1, y1, z1);
  55. return 1;
  56. }
  57. }
  58. }
  59. return 1;
  60. }
  61.  
  62. public yMoveVehicle(carid)
  63. {
  64. new Float:x2,Float:y2,Float:z2;
  65. GetVehiclePos(carid, x2, y2, z2);
  66. {
  67. for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
  68. {
  69. if(PlayerToPoint(2.0, carid, x2,TeleportDestveh[playerid][1],z2))
  70. {
  71. SendClientMessageToAll(COLOR_LIGHTBLUE, "Y-Coord Position Reached");
  72. }
  73. else if(TeleportDestveh[playerid][1] > y2)
  74. {
  75. SetVehiclePos(carid, x2, y2+1, z2);
  76. }
  77. else if(TeleportDestveh[playerid][1] < y2)
  78. {
  79. SetVehiclePos(carid, x2, y2-1, z2);
  80. }
  81. }
  82. }
  83. return 1;
  84. }
  85.  
  86. public zMoveVehicle(carid)
  87. {
  88. new Float:x3,Float:y3,Float:z3;
  89. GetVehiclePos(carid, x3, y3, z3);
  90. for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
  91. {
  92. if(PlayerToPoint(2.0, carid, x3, y3, TeleportDestveh[playerid][2]))
  93. {
  94. SendClientMessageToAll(COLOR_LIGHTBLUE, "Z-Coord Position Reached");
  95. }
  96. else if(TeleportDestveh[playerid][2] > z3)
  97. {
  98. SetVehiclePos(carid, x3, y3, z3+1);
  99. }
  100. else if(TeleportDestveh[playerid][2] < z3)
  101. {
  102. SetVehiclePos(carid, x3, y3, z3-1);
  103. }
  104. }
  105. return 1;
  106. }
  107.  
  108. public MoveVehicle(carid)
  109. {
  110. for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
  111. {
  112. if(PlayerToPoint(2.0, carid, TeleportDestveh[playerid][0], TeleportDestveh[playerid][1], TeleportDestveh[playerid][2]))
  113. {
  114. SendClientMessageToAll(COLOR_LIGHTBLUE, "X, Y and Z Coord Positions Reached");
  115. }
  116. else
  117. {
  118. xMoveVehicle(carid);
  119. yMoveVehicle(carid);
  120. zMoveVehicle(carid);
  121. }
  122. }
  123. return 1;
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement