Jump to content

How could I do this?


pa3ck

Recommended Posts

Posted

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?

Posted
getElementMatrix 

- will have every time the same x,y,z offset position no mather of the rotation , and after use

attachElements 

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

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

Posted

What is the problem?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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