Advertisement
Guest User

Untitled

a guest
Feb 11th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. // Copyright © 2011 by Pablo_Borsellino
  2. //__________________________________________________ ____________________________
  3. #include < a_samp >
  4. //__________________________________________________ ____________________________
  5. #define forEx( % 0, % 1) for (new % 1 = 0; % 1 <% 0; % 1++)
  6. //__________________________________________________ ___________________Setting's
  7. #define FERRIS_WHEEL_WAIT_TIME 3000 //Wait Time to enter a Cage
  8. #define FERRIS_WHEEL_SPEED 0.005 //Speed of turn (Standart 0.005)
  9. //__________________________________________________ ____________________________
  10. new Float: gFerrisCageOffsets[10][3] = {
  11. {
  12. 0.0699, 0.0600, -11.7500
  13. }, {
  14. -6.9100, -0.0899, -9.5000
  15. }, {
  16. 11.1600, 0.0000, -3.6300
  17. }, {
  18. -11.1600, -0.0399, 3.6499
  19. }, {
  20. -6.9100, -0.0899, 9.4799
  21. }, {
  22. 0.0699, 0.0600, 11.7500
  23. }, {
  24. 6.9599, 0.0 100, -9.5000
  25. }, {
  26. -11.1600, -0.0399, -3.6300
  27. }, {
  28. 11.1600, 0.0000, 3.6499
  29. }, {
  30. 7.0399, -0.0200, 9.3600
  31. }
  32. },
  33. FerrisWheelObjects[12],
  34. Float: FerrisWheelAngle = 0.0,
  35. FerrisWheelAlternate = 0;
  36.  
  37. //__________________________________________________ ____________________________
  38. forward RotateFerrisWheel();
  39.  
  40. //__________________________________________________ ____________________________
  41. public OnPlayerConnect(playerid) {
  42. RemoveBuildingForPlayer(playerid, 6463, 389.7734, -2028.4688, 19.8047, 0.5);
  43. RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2035.3828, 29.9531, 50);
  44. RemoveBuildingForPlayer(playerid, 6298, 389.7734, -2028.4688, 19.8047, 0.5);
  45. RemoveBuildingForPlayer(playerid, 6461, 389.7734, -2028.5000, 20.1094, 0.5);
  46. RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2028.5000, 32.2266, 50);
  47. return 1;
  48. }
  49.  
  50. //__________________________________________________ ____________________________
  51. public OnFilterScriptInit() {
  52. FerrisWheelObjects[10] = CreateObject(18877, 389.7734, -2028.4688, 22, 0, 0, 90, 300);
  53. FerrisWheelObjects[11] = CreateObject(18878, 389.7734, -2028.4688, 22, 0, 0, 90, 300);
  54. forEx((sizeof FerrisWheelObjects) - 2, x) {
  55. FerrisWheelObjects[x] = CreateObject(18879, 389.7734, -2028.4688, 22, 0, 0, 90, 300);
  56. AttachObjectToObject(FerrisWheelObjects[x], FerrisWheelObjects[10], gFerrisCageOffsets[x][0], gFerrisCageOffsets[x][1], gFerrisCageOffsets[x][2], 0.0, 0.0, 90, 0);
  57. }
  58. SetTimer("RotateFerrisWheel", FERRIS_WHEEL_WAIT_TIM E, false);
  59. forEx(MAX_PLAYERS, playerid) {
  60. RemoveBuildingForPlayer(playerid, 6463, 389.7734, -2028.4688, 19.8047, 0.5);
  61. RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2035.3828, 29.9531, 50);
  62. RemoveBuildingForPlayer(playerid, 6298, 389.7734, -2028.4688, 19.8047, 0.5);
  63. RemoveBuildingForPlayer(playerid, 6461, 389.7734, -2028.5000, 20.1094, 0.5);
  64. RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2028.5000, 32.2266, 50);
  65. }
  66. return 1;
  67. }
  68.  
  69. //__________________________________________________ ____________________________
  70. public OnFilterScriptExit() {
  71. forEx(sizeof FerrisWheelObjects, x) DestroyObject(FerrisWheelObje cts[x]);
  72. return 1;
  73. }
  74.  
  75. //__________________________________________________ ____________________________
  76. public OnObjectMoved(objectid) {
  77. if (objectid == FerrisWheelObjects[10]) SetTimer("RotateFerrisWheel", FERRIS_WHEEL_WAIT_TI ME, false);
  78. return 1;
  79. }
  80.  
  81. //__________________________________________________ ____________________________
  82. public RotateFerrisWheel() {
  83. FerrisWheelAngle += 36;
  84. if (FerrisWheelAngle >= 360) FerrisWheelAngle = 0;
  85. if (FerrisWheelAlternate) FerrisWheelAlternate = 0;
  86. else FerrisWheelAlternate = 1;
  87. new Float: FerrisWheelModZPos = 0.0;
  88. if (FerrisWheelAlternate) FerrisWheelModZPos = 0.05;
  89. MoveObject(FerrisWheelObjects[10], 389.7734, -2028.4688, 22.0 + FerrisWheelModZPos, FERRIS_WHEEL_SPE ED, 0, FerrisWheelAngle, 90);
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement