JamesCIT Posted September 4, 2015 Share Posted September 4, 2015 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
Noki Posted September 4, 2015 Share Posted September 4, 2015 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
JR10 Posted September 5, 2015 Share Posted September 5, 2015 The script should be server-side though, since you're handling other players than the localPlayer. Link to comment
Noki Posted September 5, 2015 Share Posted September 5, 2015 JR10 is correct. If you're going to make your code server-sided (which you should), nstead of using onClientMarkerHit, use onMarkerHit. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now