Jump to content

setElementPosition makes me fly...


Woozie

Recommended Posts

Hi,

I'm getting a problem with setElementPosition, i made a teleport command, and when i use it inside a car i just teleport to the location.

But when i'm away from teleport place my car hit the floor and fly much fast.

I've tried with setElementVelocity, setElementRotation but nothing works...

Is there some way that i can teleport and stay parked?

Thank you.

Link to comment

Yea, there is a problem when warping yourself inside a vehicle, I suggest you check if the player is inside a vehicle, remove him from it, setElementPosition(vehicle) warp the vehicle, and then warpPedIntoVehicle.

if isPedInVehicle(player) then 
local vehicle = getPedOccupiedVehicle(player) 
removePedFromVehicle(player) 
setElementPosition(vehicle, 0, 0, 0) 
setTimer(warpPedIntoVehicle, 300, 1, player, vehicle) 

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