Prevent a car from braking? (decelerate) (Stopping, not breaking).
#1

Title says all,

is it possible, if so, how?
Reply
#2

As far as I know it's only possible to prevent a vehicle from gaining speed.
At this time I do not believe it's possible to prevent a vehicle from reducing it's speed.
There are ways to make a vehicle maintain it's speed, but it can be over run by pressing the brake.
Reply
#3

Use SetVehicleVelocity and detect when they hit their braking key (whether it be their Spacebar or S by default).
Reply
#4

Quote:
Originally Posted by Banana_Ghost
Посмотреть сообщение
Use SetVehicleVelocity and detect when they hit their braking key (whether it be their Spacebar or S by default).
Not sure if that would work, but if it does you will have some sort of "not smooth driving". Car stopping for a sec, then accelerating. That will look awkward
Reply
#5

Quote:
Originally Posted by Sime30
Посмотреть сообщение
Not sure if that would work, but if it does you will have some sort of "not smooth driving". Car stopping for a sec, then accelerating. That will look awkward
It'll work to serve it's purpose (it will look awkward though).
Reply
#6

I was hoping to detect when they press 'S' or the decelerate key.
Reply
#7

Quote:
Originally Posted by Dokins
Посмотреть сообщение
I was hoping to detect when they press 'S' or the decelerate key.
The only solution is the one listed above, though it'll be very glitched and look bad which is why I didn't suggest doing it.
Reply
#8

I was hoping something like, if they press 's' nothing happens? or their decelerate key.
Reply
#9

Turn the engine off using SetVehicleParamsEx (https://sampwiki.blast.hk/wiki/SetVehicleParamsEx). That will of course prevent accelaration as well.
Reply
#10

Quote:
Originally Posted by Dokins
Посмотреть сообщение
I was hoping something like, if they press 's' nothing happens? or their decelerate key.
Nope, there is no way to bypass it.
I do have an idea though, I will test it out then post the code here if it works.

Quote:
Originally Posted by rymax99
Посмотреть сообщение
Turn the engine off using SetVehicleParamsEx (https://sampwiki.blast.hk/wiki/SetVehicleParamsEx). That will of course prevent accelaration as well.
This will make it decelerate as-well, as the engine is off.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)