Guest User

Untitled

a guest
Jul 17th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. native GetCoordinateOffsets(Float:x, Float:y, Float:, Float:angle, Float:offx, Float:offy, Float:offz, &Float:outx, &Float:outy, &Float:outz);
  3.  
  4. x, y, z - The position of the source coordinates
  5. angle - The angle from that coordinate (player/vehicle/object angle)
  6. offx, offy, offz - The offsets in the X (left/right), y (forward/back) and z (up/down) directions.
  7. outx, outy, outyz - The result coordinates at the offset.
  8.  
  9. */
  10.  
  11. stock GetCoordinateOffsets(Float:x, Float:y, Float:z, Float:angle, Float:offx, Float:offy, Float:offz, &Float:outx, &Float:outy, &Float:outz)
  12. {
  13.     outx = x + (floatcos(angle, degrees) * offx) - (floatsin(angle, degrees) * offy);
  14.     outy = y + (floatsin(angle, degrees) * offx) + (floatcos(angle, degrees) * offy);
  15.  
  16.     outz = z+offz;
  17.     return 1;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment