Jump to content

Create a scene


NeXuS™

Recommended Posts

Hey.

I want to make a scene with a car, which is a taxi. I use setPedControlState to control it to the positions, but it sometimes goes longer, sometimes goes shorter. So, its little bit buggy. Is there any other way to do it?

  
local scene2 = createVehicle(420, 1947.1982421875, -1749.4130859375, 13.3828125, 0, 0, 90) 
local scene2sofor = createPed(255, 0, 0, 0) 
warpPedIntoVehicle(bemutatoPed, scene2, 2) 
warpPedIntoVehicle(scene2sofor, scene2) 
setTimer(function() 
setPedControlState(scene2sofor, "accelerate", true) 
setTimer(setPedControlState, 4500, 1, scene2sofor, "accelerate", false) 
setTimer(setPedControlState, 6000, 1, scene2sofor, "handbrake", true) 
end, 1500, 1) 
  

Link to comment

The way you're doing it currently is the way to go for the most realistic way, you just need to work on the timings. 2 timers isn't going to make your entire scene completely. You should add some distance checks, position checks, here and there a few variables holding states and so on.

Link to comment

I just did the timing already. But 5 out of 10 gets to x, 2 out of 10 gets x-2... etc.. What do you mean on position check?

if x > xmax then setPedControlState(ped, "brake_reverse", true) end  

or like that? Its a scene for register new account, so it cant be done that way. Maybe there are some settings that make the car always the right speed?

Link to comment
The way you're doing it currently is the way to go for the most realistic way, you just need to work on the timings. 2 timers isn't going to make your entire scene completely. You should add some distance checks, position checks, here and there a few variables holding states and so on.

Thanks, used your suggestion, and it was working. It is still buggy, but works fine.

https://www.youtube.com/watch?v=Fo12yK8ymac

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