Jump to content

Entering TP marker doesn't work


marty000123

Recommended Posts

Posted (edited)

Hi.

 
 marker = createMarker(-2712.5,217.6,4, "corona", 1,255,255,0)
	function teleport(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
setElementPosition(vehicle, -2722, 207, -9)
setElementFrozen(vehicle, true)
setTimer(setElementFrozen, 1000, 1, vehicle, false)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), teleport) 

The point of this script is to TP the player and it's vehicle to the given setElementPosition. A friend of mine made this, but we couldn't figure out why it doesn't work. When you get into the marker, you should get TP'd to the wanted destination, but it doesn't, it doesn't TP you anywhere. It doesn't work while on foot and it doesn't work when you're in a vehicle. Again, help would be very appreciated!

Marty

Edited by marty000123
Posted
 marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 )
 addEventHandler ( 'onClientMarkerHit',marker,
function ( aPlayer )
    if aPlayer == localPlayer then
            local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer
            setElementPosition ( aMove,-2722,207,-9 )
            setElementFrozen ( aMove,true )
            setTimer ( setElementFrozen,1000,1,aMove,false )
        end
    end
)

Try this.

Posted
11 hours ago, iPrestege said:

 marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 )
 addEventHandler ( 'onClientMarkerHit',marker,
function ( aPlayer )
    if aPlayer == localPlayer then
            local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer
            setElementPosition ( aMove,-2722,207,-9 )
            setElementFrozen ( aMove,true )
            setTimer ( setElementFrozen,1000,1,aMove,false )
        end
    end
)

Try this.

Hi, thanks for the help. Sadly, it didn't work. It didn't give me a warning/error in debugscript 3, but it just doesn't want to RP me or my car.

http://imgur.com/a/D9OGY

Posted
1 hour ago, pa3ck said:

Yeah.. it's not a server side script change it to type client.

Thanks for the tip, it now works!

But there's just one major issue, it only TP's when I'm on foot and it doesn't TP me and my car when I'm inside of a vehicle, which is the point of this script. Help?

Posted (edited)

It's strange it does not work, through i did not test it.

Are there errors clientside? I'm going to test ASAP

 

Update: It works for me, i used @iPrestege code. No errors and both on foot and inside veh trigger the teleport

Edited by LoPollo
  • Like 1

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