Jump to content
apdapreturns

Stop a car from working?

Recommended Posts

I was doing this:

        private void Game_FrameRender(object sender, GraphicsEventArgs e)
        {
            if (Game.IsKeyDown(System.Windows.Forms.Keys.NumPad1))
            {
				...
				v.IsDriveable = !v.IsDriveable;
			...

But the ped can switch it back. Is there a proper way to let him not start it again?

EDIT1: Think about how the pursuits stop cars. I want to be able to do that while on foot so cars don't go flying past my sobriety checkpoint.

Edited by apdapreturns

Share this post


Link to post
Share on other sites
On 2/26/2016 at 5:58 PM, apdapreturns said:

I was doing this:


        private void Game_FrameRender(object sender, GraphicsEventArgs e)
        {
            if (Game.IsKeyDown(System.Windows.Forms.Keys.NumPad1))
            {
				...
				v.IsDriveable = !v.IsDriveable;
			...

But the ped can switch it back. Is there a proper way to let him not start it again?

EDIT1: Think about how the pursuits stop cars. I want to be able to do that while on foot so cars don't go flying past my sobriety checkpoint.

ah that isn't the correct way of doing it you really shouldn't do it in the game_framerender event

you need to likely do it in the main() function or some other function but to do what you want where there stopped and don't move it would be best to use a for or while loop to make the script constantly execute and turn their car off so they cannot go anywhere plus use this function instead:

v.IsEngineOn = false;

as the above code will basically stop the engine and make them stay put I used to use it in one of my other mods to make the car stay put(was obviously before lspdfr as I was trying to make a pullover function but that failed and lspdfr's function is alot better then mine)

Share this post


Link to post
Share on other sites

I've been using something like v.IsDrivable=false in my WIP ambient events plugin, though I'm also killing the engine health at the same time so I'm not sure if its that that's stopping them.

Share this post


Link to post
Share on other sites

I tend to use v.IsDrivable=false, however I loop this continously because otherwise I experience problems with it.

Using the actual native may prove to be more useful.

Share this post


Link to post
Share on other sites

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

×