Jump to content

How to glue an vehicle / plane to an object?


Recommended Posts

Posted

Hello ,

How can i glue an vehicle and or plane to an object wich can move?

I wanna also deattach the plane / vehicle.

(like if there is an admin spawned car that i can use /gluecar that it glues the car for example)

Posted
  
function attach() 
vehicle = getPedOccupiedVehicle ( player ) 
object = getElementsByType("object") 
 attachElements ( vehicle, object, 0, 0, 5 ) 
end 
addCommandHandler("attach",attach) 
  

isnt working

Posted

Bad argument at getpedocupiedvehicle

and bad argument at attachelements expected argument at 1, got boolean

  
  
testMarker = createMarker(-1456.7243652344, 532.509765625, 18.010332107544, "cylinder", 7, 100, 100, 100) 
  
  
function attach() 
vehicle = getPedOccupiedVehicle ( player ) 
 attachElements ( vehicle, testMarker, 0, 0, 5 ) 
end 
addCommandHandler("attach",attach) 
  
  

Posted

Player isn't defined...

testMarker = createMarker(-1456.7243652344, 532.509765625, 18.010332107544, "cylinder", 7, 100, 100, 100) 
  
  
function attach(player) 
vehicle = getPedOccupiedVehicle ( player ) 
 attachElements ( vehicle, testMarker, 0, 0, 5 ) 
end 
addCommandHandler("attach",attach) 
  

Posted
not working nothing in debug too

--ClientSide ,

Marker = createMarker(-1456.7243652344, 532.509765625, 18.010332107544, "cylinder", 7, 100, 100, 100) 
addCommandHandler ( 'attach', 
function ( ) 
 local nMax = getPedOccupiedVehicle ( localPlayer ) 
   if ( nMax ) then 
   attachElements (Marker, nMax ) 
   end 
end 
) 
Posted

It was meant to be attached to the marker and not the marker to the vehicle

I tought something like this but it isnt working nothing in debugscript

  
  
Marker = createMarker(-1456.7243652344, 532.509765625, 18.010332107544, "cylinder", 7, 100, 100, 100) 
addCommandHandler ( 'attach', 
function ( ) 
 local nMax = getPedOccupiedVehicle ( localPlayer ) 
   if ( nMax ) then 
   attachElements (nMax, Marker ) 
   end 
end 
) 
  

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