Jump to content

I'm going to need a huge ass mathbook...


Recommended Posts

Okay, I'd be so freaking greatful if somebody could assist me in some math, I mean REALLY greatful.

Here's the situation: I need a math function that will calculate the attachElements offsets for a 3.D position in space. This however, might need adjusting in GTA.

If somebody could get this, I would really love them.

attachElements(element, anotherElement, get3dPointToOffsets(x, y, z))

Link to comment

Okay, this was figured out, however, I based my code off the default briefcase script.

local x, y, z = getPedBonePosition(v.player, 25)
local rx, ry, rz = getElementRotation(v.player)
local xOffset = .1 * math.cos(math.rad(rz))
local yOffset = .1 * math.sin(math.rad(rz))
setElementPosition(v.briefcase, x+xOffset, y+yOffset, z)
setElementRotation(v.briefcase, rx, ry, rz+rotationOffset)

I'm having problems adjusting my x, y, z coordinates so it fits.

What I'm trying to do: Make a player carry a box, similar to the burglar script.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...