Jump to content

how ?


mjau

Recommended Posts

Posted

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

Posted

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.

Posted
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  ) 
  

Posted

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

Posted

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  ) 

Posted (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 by Guest
Posted

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 ) 

Posted
plane = createVehicle( ... ) 
       tmarker = createMarker( ... ) 
       attachElements( marker, plane, ... ) 
  
    function markerHit( hitPlayer ) 
    setElementInterior( hitPlayer, 9, 315.48, 984.13, 1959.11 ) 
    end 
    addEventHandler( "onMarkerHit", tmarker, markerHit ) 

Posted

ehh xD if u didnt knew attached markers dont work thats why i am asking had something like that before but didnt work

Posted
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

Posted

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 
  

Posted

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.

Posted

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

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