mjau Posted August 2, 2011 Share Posted August 2, 2011 How can i somehow atach a marker who still works or a colshape to a vehicle i want the marker to teleport me inot the andro interior and ive aleready fixed that but the attached marker dont work Link to comment
Castillo Posted August 2, 2011 Share Posted August 2, 2011 Dude, I don't understand anything, could you try to explain yourself again better? Link to comment
Fentas Posted August 2, 2011 Share Posted August 2, 2011 He means that when he attach the marker to a vehicle and move/drive the vehicle ( in his case is the Andromada ) the marker stops working.Thats an MTA bug i believe.There are other more complicated way's to do/fix your problem. Link to comment
bandi94 Posted August 2, 2011 Share Posted August 2, 2011 function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) end addCommandHandler ( "attach", markerattach ) Link to comment
mjau Posted August 2, 2011 Author Share Posted August 2, 2011 That just attahced the marker it wont work after ive attached it More explained I have an andromada and i want to create a arrow behind it and when a player hit that arrow they get set into the andromada interior I have the code to set the interior but the marker dont work when it is attahced Link to comment
JR10 Posted August 2, 2011 Share Posted August 2, 2011 That's because the marker is local and there is no way else you can get it. Try: function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) addEventHandler("onMarkerHit", Marker, function(hitElement) if getElementType(hitElement) ~= "player" then return end --code to set the player to the anadorma interior end) end addCommandHandler ( "attach", markerattach ) Link to comment
mjau Posted August 2, 2011 Author Share Posted August 2, 2011 (edited) tried and dont work heres my full code function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) addEventHandler( "onMarkerHit", Marker, movehim ) function movehim(hitElement) if getElementType(hitElement) ~= "player" then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end end addCommandHandler ( "attach", markerattach ) Edit tried another thing stil dont work function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 4 ) addEventHandler("onMarkerHit", Marker, test function test(hitElement) if getElementType(hitElement) ~= "player" then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end) end addCommandHandler ( "attach", markerattach ) Edited August 3, 2011 by Guest Link to comment
JR10 Posted August 3, 2011 Share Posted August 3, 2011 Try: function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) function movehim(hitElement) if getElementType(hitElement) ~= "player" then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end addEventHandler( "onMarkerHit", Marker, movehim ) end addCommandHandler ( "attach", markerattach ) Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 marker shows but nothing happens when i enter it Link to comment
Maurize Posted August 3, 2011 Share Posted August 3, 2011 plane = createVehicle( ... ) tmarker = createMarker( ... ) attachElements( marker, plane, ... ) function markerHit( hitPlayer ) setElementInterior( hitPlayer, 9, 315.48, 984.13, 1959.11 ) end addEventHandler( "onMarkerHit", tmarker, markerHit ) Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 ehh if u didnt knew attached markers dont work thats why i am asking had something like that before but didnt work Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 You need to use a colshape... createColTube Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 ok so then how can i attach a colshape to the andromada Link to comment
Jaysds1 Posted August 3, 2011 Share Posted August 3, 2011 use createColShape, then setElementInterior(the andromada interior) end Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 no, its createColTube. The col tube should be the size of the marker. Then, attatch the colTube to the marker, and the marker to the ship. Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) local colTube = createColTube ( 0, 0, 0, 1, 1 ) attachElements ( Marker, vehicle, 0, 0, 5 ) attachElements ( colTube, Marker, 0, 0, 5 ) function movehim(hitElement) if getElementType(hitElement) ~= "player" then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end addEventHandler( "onColShapeHit", colTube, movehim ) end addCommandHandler ( "attach", markerattach ) No erros but nothig happens when i enter the marker Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 can you post the movehim function here as well? Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 if you look the movehim function is there it sets him to andro interior but dont work Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 Ohh shit sorry, wasn't looking closely. Try this: function createAndroMarker(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) local marker = createMarker(0, 0, 0, "arrow", 1, 255, 0, 0, 170) local colTube = createColTube(0, 0, 0, 1, 1) attachElements(marker, vehicle, 0, 0, 5) attachElements(colTube, marker, 0, 0, 5) addEventHandler("onColShapeHit", colTube, warpPlayerIntoAndro, false) end addCommandHandler("attatch", createAndroMarker) function warpPlayerIntoAndro(hitElement, dimensionMatch) if getElementType(hitElement) ~= "player" then return end if not dimensionMatch then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 ..errors? tried adding some outputDebugStrings in there? Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 i dont know how to do such things could u ? and no i dont get any errors Link to comment
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 Add this to the warpPlayerIntoAndro function, first thing: outputDebugString("Warp function triggered") Try it, and if you dont see "Warp function triggered", then the error is in addEventHandler. Which I think is just another MTA bug. Link to comment
mjau Posted August 3, 2011 Author Share Posted August 3, 2011 tried and your right i dont see it but i know it is possible cuz SAES did sumething like that before they got new ways of recruitng people 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