scaryface87 Posted July 16, 2014 Share Posted July 16, 2014 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) Link to comment
Et-win Posted July 16, 2014 Share Posted July 16, 2014 getElementPosition setElementPosition onClientRender addCommandHandler --[[And/Or:]] bindKey Link to comment
MTA Team botder Posted July 16, 2014 MTA Team Share Posted July 16, 2014 Keep it simple: https://wiki.multitheftauto.com/wiki/AttachElements Link to comment
Et-win Posted July 16, 2014 Share Posted July 16, 2014 Keep it simple:https://wiki.multitheftauto.com/wiki/AttachElements Nvm me Link to comment
scaryface87 Posted July 17, 2014 Author Share Posted July 17, 2014 function attach() vehicle = getPedOccupiedVehicle ( player ) object = getElementsByType("object") attachElements ( vehicle, object, 0, 0, 5 ) end addCommandHandler("attach",attach) isnt working Link to comment
Castillo Posted July 17, 2014 Share Posted July 17, 2014 "object" is a table of elements, you can't use it for attachElements. Link to comment
scaryface87 Posted July 18, 2014 Author Share Posted July 18, 2014 "object" is a table of elements, you can't use it for attachElements. So i cant make it? or how can i make it working Link to comment
MIKI785 Posted July 18, 2014 Share Posted July 18, 2014 You have to use specific object... create it using createObject or get it by ID using getElementByID. Link to comment
scaryface87 Posted July 18, 2014 Author Share Posted July 18, 2014 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) Link to comment
MIKI785 Posted July 18, 2014 Share Posted July 18, 2014 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) Link to comment
scaryface87 Posted July 18, 2014 Author Share Posted July 18, 2014 not working nothing in debug too Link to comment
Max+ Posted July 18, 2014 Share Posted July 18, 2014 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 ) Link to comment
scaryface87 Posted July 19, 2014 Author Share Posted July 19, 2014 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 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now