Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendTarget(id)
- local id = tonumber(id)
- local res, ped = sampGetCharHandleBySampPlayerId(id)
- local mposX, mposY = getCharCoordinates(PLAYER_PED)
- local tarX, tarY = getCharCoordinates(ped)
- local b = 0 * math.pi / 360.0
- local h = 0 * math.pi / 360.0
- local a = getHeadingFromVector2d(tarX - mposX, tarY - mposY) * math.pi / 360.0
- local c1, c2, c3 = math.cos(h), math.cos(a), math.cos(b)
- local s1, s2, s3 = math.sin(h), math.sin(a), math.sin(b)
- local data = samp_create_sync_data('player')
- data.keysData = 132
- data.animationId = 1167
- data.animationFlags = 32776
- data.quaternion[0] = c1 * c2 * c3 - s1 * s2 * s3
- data.quaternion[3] = -( c1 * s2 * c3 - s1 * c2 * s3 )
- data.weapon = getCurrentCharWeapon(1)
- data.send()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement