Jump to content

How could I do this?


pa3ck

Recommended Posts

Hi there, I'm trying to script some jobs, the first one is the delivery guy. What I want to do is, that a CP will be created behind the car, at the boot. It would be easy if the rotation of the car would not change, but it obviously changes, what would be the best way to do this?

Link to comment

Thanks for your help, but I have a little problem with it. This is a pic of the problem: http://i.imgur.com/2UreMY8.jpg and my code is:

addCommandHandler("matrix", function() 
function getMatrixLeft(m) 
        return m[1][1], m[1][2], m[1][3] 
end 
function getMatrixForward(m) 
        return m[2][1], m[2][2], m[2][3] 
end 
function getMatrixUp(m) 
        return m[3][1], m[3][2], m[3][3] 
end 
function getMatrixPosition(m) 
        return m[4][1], m[4][2], m[4][3] 
end 
local veh = getPedOccupiedVehicle(localPlayer) 
local mat = getElementMatrix(veh)   
local ax, ay, az = getElementPosition(veh) 
  
  
vx,vy,vz = getMatrixForward(mat)  
  
cp = createMarker(ax, ay, az, "checkpoint", 1) 
attachElements(cp, veh, vx, vy - 6, vz) 
end) 

I dont know if I'm on the right track...

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...