Jump to content

Teleports


Recommended Posts

I need this script to only teleport a player, not any other element, also wont teleport them while in a car. I got it working but i edited it a little and fergot what i did and now it teleports everything, even this dxdraw text i have in the marker.

miniadminbase = createMarker(-1749, -3030, 53.6, 'cylinder', 1.5, 255, 0, 0, 150) 
  
function duty(player, matchingDimension) 
 if getElementType (player) then 
 setElementPosition (player, 0, 0, 5 ) 
 end 
end 
addEventHandler("onMarkerHit",miniadminbase,duty) 

Thanks :D

Edited by Guest
Link to comment

Try this:

local miniadminbase = createMarker(-1749, -3030, 53.6, 'cylinder', 1.5, 255, 0, 0, 150)  
  
function duty(element, matchingDimension) 
    if getElementType(element) == "player" and matchingDimension then -- if the element is a player in the same dimension 
        if not isPedInVehicle(element) then -- if the player is not in a vehicle 
            setElementPosition (element, 0, 0, 5 ) -- move the player to coords 
        end 
    end 
end 
addEventHandler("onMarkerHit",miniadminbase,duty) 

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