Jump to content

[HELP]Why this Marker doesnt Teleport?


Recommended Posts

Im trying and trying to learn,Reading the wiki,Ask for help but this Wasted me o.O

local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, 'cylinder', 2.0, 255, 0, 0, 150)  
  
function MarkerHit( hitElement, setElementPosition ) 
    setElementPosition ( source, 0, 0, 0 )  
end 
addEventHandler( "onMarkerHit", setElementPosition, MarkerHit ) 

How can i fix it for you get on it and teleport to you onto a x y z position

Link to comment
Im trying and trying to learn,Reading the wiki,Ask for help but this Wasted me o.O
local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, 'cylinder', 2.0, 255, 0, 0, 150)  
  
function MarkerHit( hitElement, setElementPosition ) 
    setElementPosition ( source, 0, 0, 0 )  
end 
addEventHandler( "onMarkerHit", setElementPosition, MarkerHit ) 

How can i fix it for you get on it and teleport to you onto a x y z position

THIS Should work, you dont need that setElementPosition...

  
local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, 'cylinder', 2.0, 255, 0, 0, 150)  
  
function MarkerHit( hitElement, hitDimension ) 
    setElementPosition ( source, 0, 0, 0 )  
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  

Link to comment
local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, 'cylinder', 2.0, 255, 0, 0, 150)  
  
function markerhit( hitPlayer, matchingDimension ) 
    if (not isPedInVehicle(hitPlayer)) then 
        setElementPosition ( hitPlayer, 0, 0, 0 )  
    end 
end 
addEventHandler( "onMarkerHit", myMarker, markerhit ) 

Link to comment
  • MTA Team
local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, 'cylinder', 2.0, 255, 0, 0, 150)  
  
function markerhit( hitPlayer, matchingDimension ) 
    if (not isPedInVehicle(hitPlayer)) then 
        setElementPosition ( hitPlayer, 0, 0, 0 )  
    end 
end 
addEventHandler( "onMarkerHit", myMarker, markerhit ) 

That would return an error at some times when someone tries to hit it with a vehicle or so.

Server-side

local myMarker = createMarker(1882.3262939453, -1314.8422851563, 14.500373840332, "cylinder", 2.0, 255, 0, 0, 150) 
  
addEventHandler("onMarkerHit", myMarker, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "player" and matchingDimension then 
            if isPedInVehicle(hitElement) then return end 
            setElementPosition(hitElement, 0, 0, 3) 
        end 
    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...