Jump to content

Teleport Car Issue


Recommended Posts

Hello guys, i have a problem, which i really can't understand. I made a map, and i added a drift meter, so i want when you reach 20000 points or something like that, teleport you to a position.(with your car of course as its race gamemode).

so i have this:

if(total >= 1) then 
        local vehicle=getPlayerOccupiedVehicle(player) 
        setVehicleFrozen(vehicle,true) 
        setElementPosition (vehicle, -441.2646484375, -2218.306640625, 84.912033081055) 
        setTimer(setVehicleFrozen,50,1,vehicle,false) 
    end 

i just put 1 for now to test, well, it teleports my car there, but my car stays there on the air, it does not fall down... i can accelerate, and wheels are moving, but the car stays there on the air, like there is no gravity.

Also i noticed if i make something like:

setElementVelocity(vehicle, 0, 0, -1) 

i hear a weird sound from the engine, and some blur, and the minimap is beging smaller, so its like the car is falling down, but i see my car stopped.. weird thing, maybe anyone has any idea?

Link to comment

Probably its a bug, i dont have any other explanation.. the weird thing is that i have a server, and a guy gave me a map, and he had a teleport script, and i checked it, and it was working fine, and it was the same with mine.. (well just some like different names etc.).. i just dont get it.

Link to comment

my teleporteditor script also freeze the vehicle for 50ms, the only diference is that i'm using the anonymus function (i do a lot more then just unfreeze after the timer) and there are no problems...

   if(total >= 1) then 
            local vehicle=getPedOccupiedVehicle(player) 
            setVehicleFrozen(vehicle,true) 
            setElementPosition (vehicle, -441.2646484375, -2218.306640625, 84.912033081055) 
            setTimer(function() 
                       setVehicleFrozen(vehicle,false) 
            end,50,1) 
  end 

you may also try unfreezing the vehicle several times

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