Advertisement
CharC

NoiraFerris

Dec 19th, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.72 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. /*
  4. NORIA 0.3/FerrisWheel 0.3
  5. Créditos/Credits: Versión antigua/Old version: Backwardsman97 Nueva versión/New version: adri1
  6. NORIA 0.1/FerrisWheel 0.1 por/by Backwardsman97: http://forum.sa-mp.com/showthread.php?t=78317
  7. */
  8. forward Rotacion();
  9. new Radios1[20];
  10. new Radios2[20];
  11. new Cabinas[20];
  12. new Luces[20];
  13. new Objetos[8];
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     Objetos[0] = CreateObject(1391, 1946.39, 1533.88, 32.59,   35.00, 0.00, 0.00);
  18.     Objetos[1] = CreateObject(1391, 1946.60, 1519.14, 32.59,   -35.00, 0.00, 0.00);
  19.     Objetos[2] = CreateObject(1391, 1946.64, 1526.56, 33.43,   0.00, 0.00, 0.00);
  20.     Objetos[3] = CreateObject(1391, 1938.01, 1526.94, 33.43,   0.00, 0.00, 0.00);
  21.     Objetos[4] = CreateObject(1391, 1937.96, 1519.45, 32.59,   -35.00, 0.00, 0.00);
  22.     Objetos[5] = CreateObject(1391, 1937.99, 1534.36, 32.59,   35.00, 0.00, 0.00);
  23.     Objetos[6] = CreateObject(8832, 1942.31, 1530.94, 11.08,   0.00, 3.00, 90.00);
  24.     Objetos[7] = CreateObject(8832, 1942.29, 1503.70, 11.19,   0.00, -3.00, 90.00);
  25.  
  26.     new Float:y,Float:z,Float:dis,Float:Rot;
  27.     Radios1[0] = CreateObject(3398,1943.8535,1526.9259,55.33241,0,Rot,270);
  28.     for(new i=1; i<19; i++)
  29.     {
  30.         y=1526.9259; z=55.33241;
  31.         ObtDirecXYDePosicion((Rot -= 18.9),y,z,14.09467);
  32.         dis = floatsqroot(((1526.9259 - y) * (1526.9259 - y)) + ((z - 55.33241) * (z - 55.33241)));
  33.         Radios1[i] = CreateObject(3398,1943.8535,y,z-dis,0,Rot,270);
  34.     }
  35.     Rot = 0;
  36.     Radios2[0] = CreateObject(3398,1940.8535,1526.9259,55.33241,0,Rot,270);
  37.     Cabinas[0] = CreateObject(18879, 1942.39, 1526.85, 66.19,   0.00, 0.00, 90.00);
  38.     Luces[0] = CreateObject(354, 1942.39, 1526.85, 66.19,   0.00, 0.00, 90.00);
  39.     for(new i=1; i<19; i++)
  40.     {
  41.         y=1526.9259; z=55.33241;
  42.         ObtDirecXYDePosicion((Rot -= 18.9),y,z,14.09467);
  43.         dis = floatsqroot(((1526.9259 - y) * (1526.9259 - y)) + ((z - 55.33241) * (z - 55.33241)));
  44.         Radios2[i] = CreateObject(3398,1940.8535,y,z-dis,0,Rot,270);
  45.         y=1526.9259; z=55.33241;
  46.         ObtDirecXYDePosicion(Rot,y,z,28.18934);
  47.         Cabinas[i] = CreateObject(18879, 1942.39,y,z-dis,0,0,90.00);
  48.         y=1526.9259; z=55.33241;
  49.         ObtDirecXYDePosicion(Rot,y,z,28.18934);
  50.         Luces[i] = CreateObject(354, 1942.39,y,z-dis,0,0,90.00);
  51.     }
  52.     SetTimer("Rotacion",50,1);//In english: Rotation
  53.     return 1;
  54. }
  55.  
  56. public OnFilterScriptExit()
  57. {
  58.     for(new i; i<20; i++)
  59.     {
  60.         DestroyObject(Radios1[i]);
  61.         DestroyObject(Radios2[i]);
  62.         DestroyObject(Cabinas[i]);
  63.         DestroyObject(Luces[i]);
  64.         DestroyObject(Objetos[i]);
  65.     }
  66.     return 1;
  67. }
  68.  
  69. public Rotacion()
  70. {
  71.     new Float:y,Float:y2,Float:z,Float:dis;
  72.     for(new i=0; i<19; i++)
  73.     {
  74.         //MoverRadioPrimario/MoveFirstSpoke
  75.         GetObjectRot(Radios1[i],y2,y2,z);
  76.         SetObjectRot(Radios1[i],0,y2-=0.25,270);
  77.         y=1526.9259; z=55.33241;
  78.         ObtDirecXYDePosicion(y2,y,z,14.09467);
  79.         dis = floatsqroot(((1526.9259 - y) * (1526.9259 - y)) + ((z - 55.33241) * (z - 55.33241)));
  80.         SetObjectPos(Radios1[i],1943.8535,y,z-dis);
  81.         //MoverRadioSecundario/MoveSecondSpoke
  82.         GetObjectRot(Radios2[i],y2,y2,z);
  83.         SetObjectRot(Radios2[i],0,y2-=0.25,270);
  84.         y=1526.9259; z=55.33241;
  85.         ObtDirecXYDePosicion(y2,y,z,14.09467);
  86.         dis = floatsqroot(((1526.9259 - y) * (1526.9259 - y)) + ((z - 55.33241) * (z - 55.33241)));
  87.         SetObjectPos(Radios2[i],1940.8535,y,z-dis);
  88.         //MoverCabinas/MovePlatforms
  89.         y=1526.9259; z=55.33241;
  90.         ObtDirecXYDePosicion(y2+0.2,y,z,24.18934);
  91.         SetObjectPos(Cabinas[i],1942.39,y,z-dis);
  92.         //MoverLuces/MoveLights
  93.         y=1526.9259; z=55.33241;
  94.         ObtDirecXYDePosicion(y2+0.2,y,z,24.18934);
  95.         SetObjectPos(Luces[i],1942.39,y,z-dis);
  96.     }
  97.     return 1;
  98. }
  99.  
  100. stock ObtDirecXYDePosicion(Float:direction, &Float:x, &Float:y, Float:dist)
  101. {
  102.     x += (dist * floatsin(-direction, degrees));
  103.     y += (dist * floatcos(-direction, degrees));
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement