Homie3 Posted December 22, 2012 Share Posted December 22, 2012 Hey Ho, I want to move the attached object "heli" with "setElementAttachedOffsets"... When I type the command "hoch" it just disappears... Please help me guys I tried everything. function boot ( player, command ) local derspieler = ( player ) local x, y, z = getElementPosition ( derspieler ) boot1 = createVehicle(453, x + 30, y, z) bahn = createObject(8171, x + 30, y, z) bahn1 = createObject(8171, x + 30, y, z) bahn2 = createObject(8171, x + 30, y, z) heli = createObject(9241, x + 30, y, z) setVehicleDamageProof(boot1, true) attachElements ( bahn, boot1, 25, 0, 1, 0, 0, 0 ) attachElements ( bahn1, boot1, -25, 0, 1, 0, 0, 0 ) attachElements ( bahn2, boot1, 0, 0, 0.5, 0, 0, 0 ) attachElements ( heli, boot1, 0, -50, 0.5, 0, 0, 0 ) local myBlib = createBlipAttachedTo ( boot1, 57 ) end addCommandHandler ( "boot", boot ) function nachOben ( player, command ) local x, y, z = getElementPosition ( boot1 ) [color=#FF0000] setElementAttachedOffsets (heli, x, y, 1)[/color] end addCommandHandler ( "hoch", nachOben ) Link to comment
denny199 Posted December 22, 2012 Share Posted December 22, 2012 Because you are attaching the heli to the boat at the boat itself the location, so example, the boat is at 2000,20,10 it will attach the heli at that location at the boat, so 2000 steps away. so: local x, y, z = getElementPosition ( boot1 ) is wrong Link to comment
Homie3 Posted December 22, 2012 Author Share Posted December 22, 2012 Thanks for the fast reply! But now when I'm changing the x, y or z position of the "heli" it's standing at the same position of the boat, everytime. ---------------------------------- Okay now i solved the Problem! 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