Jump to content

Interior Teleporting


JamesCIT

Recommended Posts

Well hello guys , i changed my Server mode Race > RPG so the interior Teleport was working but when i made it RPG etc it doesn't makes me teleport as a player here is the lua

marker = createMarker(1420.26, -1166.06, 23.83, "arrow", 20, 33, 1, 255) 
  
function teleport(player) 
if getElementType(player)=="player" then 
local vehicle=getPedOccupiedVehicle(player) 
if source == marker then 
setElementPosition(vehicle, 2544.8000488281, 1705.9000244141, 584.59997558594) 
setElementFrozen(vehicle, true) 
setTimer(setElementFrozen, 1000, 1, vehicle, false) 
end 
end 
end 
addEventHandler("onClientMarkerHit", getRootElement(), teleport)  
  

Link to comment

You should check for the vehicle itself.

if getPedOccupiedVehicle(player) then

You also never froze the vehicle, you only unfroze it.

And if you want it to change your interior, you need to use setElementInterior.

onClientMarkerHit is also a client-side event. So make sure your meta file declares your script as client-side.

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