Advertisement
GoxaShow

Untitled

Feb 14th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function sendTarget(id)
  2. local id = tonumber(id)
  3. local res, ped = sampGetCharHandleBySampPlayerId(id)
  4. local mposX, mposY = getCharCoordinates(PLAYER_PED)
  5. local tarX, tarY = getCharCoordinates(ped)
  6. local b = 0 * math.pi / 360.0
  7. local h = 0 * math.pi / 360.0
  8. local a = getHeadingFromVector2d(tarX - mposX, tarY - mposY) * math.pi / 360.0
  9. local c1, c2, c3 = math.cos(h), math.cos(a), math.cos(b)
  10. local s1, s2, s3 = math.sin(h), math.sin(a), math.sin(b)
  11.  
  12. local data = samp_create_sync_data('player')
  13. data.keysData = 132
  14. data.animationId = 1167
  15. data.animationFlags = 32776
  16. data.quaternion[0] = c1 * c2 * c3 - s1 * s2 * s3
  17. data.quaternion[3] = -( c1 * s2 * c3 - s1 * c2 * s3 )
  18. data.weapon = getCurrentCharWeapon(1)
  19. data.send()
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement