Jump to content

Attach vehicle to marker


Recommended Posts

Ok, so I have looked around the forums and I have found a suitable code to attach a vehicle to a marker. My question is: I have a custom textured andromada replacement and I am wondering how to find the coordinates inside the cargohold to put the marker to attach the car to. I am a novice when it comes to this, so any help would be great! :D

Link to comment

Or just type /pos where you want it to be while this script is running:

--Client-side 
addCommandHandler("pos", 
     function() 
          local x, y, z = getElementPosition(localPlayer) 
          outputConsole("X: " .. x .. ", Y: " .. y .. ", Z: " .. z) 
     end 
) 

Just press F8 and copy and paste it in your script.

Link to comment
Or just type /pos where you want it to be while this script is running:
--Client-side 
addCommandHandler("pos", 
     function() 
          local x, y, z = getElementPosition(localPlayer) 
          outputConsole("X: " .. x .. ", Y: " .. y .. ", Z: " .. z) 
     end 
) 

Just press F8 and copy and paste it in your script.

If it's a client side you can use this function to copy it .

setClipboard 

:wink:

Link to comment
Or just type /pos where you want it to be while this script is running:
--Client-side 
addCommandHandler("pos", 
     function() 
          local x, y, z = getElementPosition(localPlayer) 
          outputConsole("X: " .. x .. ", Y: " .. y .. ", Z: " .. z) 
     end 
) 

Just press F8 and copy and paste it in your script.

He isn't talking about world coordinates. He means coordinates inside the vehicle. Just like SoldSnake14 said, think that you will have to just keep editing the script until you get it correct.

Link to comment
--syntax 
attachElements ( element theElement, element theAttachToElement, [ float xPosOffset, float yPosOffset,  
float zPosOffset, float xRotOffset, float yRotOffset, float zRotOffset ] ) 

attachElements (createMarker, vehicle,xPosOffset,yPosOffset,zPosOffset) 

This should help

Link to comment
Or just type /pos where you want it to be while this script is running:
--Client-side 
addCommandHandler("pos", 
     function() 
          local x, y, z = getElementPosition(localPlayer) 
          outputConsole("X: " .. x .. ", Y: " .. y .. ", Z: " .. z) 
     end 
) 

Just press F8 and copy and paste it in your script.

He isn't talking about world coordinates. He means coordinates inside the vehicle. Just like SoldSnake14 said, think that you will have to just keep editing the script until you get it correct.

Ah, well I didn't understand then... Sorry about that. Just do as he said then. Maybe you can try to mess with getElementBoundingBox

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