Jump to content

Attach vehicle to marker


Recommended Posts

Posted

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

Posted

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.

Posted
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:

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

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

Posted
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

Posted

Thank you all, but I don't need this anymore because I found the resource "glue2" and it works better than what I was trying to do... Thanks anyways... you guys rock! :mrgreen:

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