Jump to content

[HELP]Why this Marker doesnt Teleport?


Recommended Posts

Posted

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

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

Eat My Dust - DM/Deathmatch

350x20_00C3FF_FFFFFF_000000_000000.png

Posted

That'll teleport the marker, not the player, since you are using 'source' instead of 'hitElement'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
That'll teleport the marker, not the player, since you are using 'source' instead of 'hitElement'.

LOL sorry, i didnt notice that :D, hehehe, nice catch

Eat My Dust - DM/Deathmatch

350x20_00C3FF_FFFFFF_000000_000000.png

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

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

If I helped you, please click the like button on the right ;) Thanks!

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