Guest User

Problem

a guest
Jan 25th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.79 KB | None | 0 0
  1.  
  2.     //ox, oy, oz is position to start drawing
  3.     //or[3] is first object rotation faced to shoot pos
  4.     new Float:Dist = VectorSize(X, Y, Z);
  5.     //first
  6.         id = CreateObject(19082, ox, oy, oz, 0.0, 0.0, 0.0);
  7.     SetObjectFaceCoords3D(id, fX, fY, fZ);
  8.     GetObjectRot(id, or[0], or[1], or[2]);
  9.     //calc Z
  10.         new Float:alfa = or[1]-180;
  11.     new Float:cz = floatsin(alfa, degrees) * floatsin(90-(alfa/2), degrees) * 20.02; //19082 X offset = 10.01
  12.        
  13.         for(new i=0;i<ldst-2;i++) //ldst - distance from start to shoot pos
  14.     {
  15.         ox-=floatcos(or[2], degrees)*20.02;
  16.             oy-=floatsin(or[2], degrees)*20.02;
  17.         oz+=cz;
  18.         id = CreateObject(19082, ox, oy, oz, 0.0, 0.0, 0.0);
  19.         SetObjectRot(id, or[0], or[1], or[2]);
  20.  
  21.         }
  22.         printf("Angle: %.1f, Heigh: %.2f", alfa, cz);
Advertisement
Add Comment
Please, Sign In to add comment