Advertisement
Guest User

getXYInFrontOfPlayer

a guest
Jul 19th, 2010
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. function getXYInFrontOfPlayer( player, distance )
  2.     local x, y, z = getElementPosition( player )
  3.     local rot = getPedRotation( player ) --Was first getPlayerRotation, but this wasn't the bug.
  4.     x = x + ( math.sin( math.rad ( -rot ) ) * distance ) --This,
  5.     y = y + ( math.cos( math.rad ( -rot ) ) * distance ) --And this where the bug. I've added ( and ), and a - in front of rot.
  6.     return x, y
  7. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement