Jump to content

how ?


mjau

Recommended Posts

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

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

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

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
Link to comment

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

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

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