Hunter567T Posted August 18, 2010 Share Posted August 18, 2010 I have made a script that creates a andromada and a marker. Then it attaches them together they move but the place where the marker warps you to the other spot doesn't move. Any help please? Link to comment
50p Posted August 18, 2010 Share Posted August 18, 2010 I don't get it... How can place move where you warp? Show some code and try to explain in more detail. Link to comment
TDK Posted August 18, 2010 Share Posted August 18, 2010 I don't get it... How can place move where you warp? Show some code and try to explain in more detail. maybe : androm=createVehicle(592,x,y,z,rx,ry,rx) mark=createMarker (0.0.0.corona.10,255) AttachElements(androm,mark,0,0,0) setElementData(mark, "mark") ---- IT,s only sketch!!!) Edit by varez: Fixed typo in your script. Link to comment
dzek (varez) Posted August 18, 2010 Share Posted August 18, 2010 why you put that setElementData ? edit: Ahh! I think i got what he means! He created vehicle, attached marker, but the market hit position stays the same - even when he drive his vehicle, moving marker position with vehicle. Show us your code Hunter567T! Link to comment
Hunter567T Posted August 18, 2010 Author Share Posted August 18, 2010 Ok here is the code. I want to make the marker attached to the andromada. But when i attach the marker only the marker moves and the markerhit place doesnt move. local andromada = createVehicle ( 592, 1073.08, 3979.52, 2.59, 0, 0, 180 ) local goThere = createMarker( 1073.09, 3994.62, 1.60, 'arrow', 1, 0, 0, 255, 150 ) local comeBack = createMarker( 315.74, 1036.47, 1942.36, 'cylinder', 6, 0, 0, 255, 150 ) -- The markers and the Andromada -- Attachment of the Marker to the Andromada attachElements ( goThere, andromada, 0, -20, 0 ) function MarkerHit( hitPlayer, matchingDimension ) setElementInterior( hitPlayer, 9, 315.74, 1020.47, 1950.36 ) -- Places the Player Inside The Andromada end addEventHandler( "onMarkerHit", goThere, MarkerHit ) function MarkerHit1( hitPlayer, matchingDimension ) local x,y,z = getElementPosition( andromada ) setElementPosition ( hitPlayer, andromada ) -- Places the Player just behind the Andromada -- needs working not finished end addEventHandler( "onMarkerHit", comeBack, MarkerHit1 ) Edit by varez: Changed code tags to lua tags. Please use lua tags next time. Link to comment
dzek (varez) Posted August 18, 2010 Share Posted August 18, 2010 dunno about your problem but this: function MarkerHit( hitPlayer, matchingDimension ) setElementInterior( hitPlayer, 9, 315.74, 1020.47, 1950.36 ) -- Places the Player Inside The Andromada end you arent checking what exactly hit marker. it could be another vehicle too - and you will warp that vehicle. Or any other element. use getElementType to check what hit marker. Checking if dimension is matching should be good too. And: Use [lua][/lua] tags instead of [code][/code] Link to comment
Hunter567T Posted August 18, 2010 Author Share Posted August 18, 2010 He created vehicle, attached marker, but the market hit position stays the same - even when he drive his vehicle, moving marker position with vehicle. Show us your code Hunter567T! Is there anyway to get the marker hit position to move with the marker? The marker moves when i drive but the marker hit position doesn't move. Link to comment
dzek (varez) Posted August 18, 2010 Share Posted August 18, 2010 I never tried that. To me it seems to be a bug, but i'm not sure. Code seems right, but i didn't test it. I will try it when I'll find 15 minutes. Link to comment
Wojak Posted August 18, 2010 Share Posted August 18, 2010 Is there anyway to get the marker hit position to move with the marker? The marker moves when i drive but the marker hit position doesn't move. no, there is no way, as I discovered long time ago https://forum.multitheftauto.com/viewtop ... 68#p301568 i reccomend to move this script client side and check the distance betwen andromada and the local player, as for: setElementPosition ( hitPlayer, andromada ) -- Places the Player just behind the Andromada -- needs working not finished use this client side function: https://wiki.multitheftauto.com/wiki/GetElementMatrix 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