[Release] Engine ON/OFF Toggle

[This has been removed]

27 Likes

You should use

SetVehiclePetrolTankHealth( vehicle, 0 ) 

when you want to turn the engine off and

SetVehiclePetrolTankHealth( vehicle, 1000 )

when you want to turn it back on. This stops the engine from coming back on automatically.

3 Likes

It didn’t come back on, while I was testing it

1 Like

i think he means when you press w or when you get into the vehicle. He was wanting it to stay off until the player either presses a key or does a command.

I know what he meant, I tested it and the Engine stayed off until I reentered the command

1 Like

I installed it and it did nothing. What would of I did wrong?

Are you on an FX or CFX server?

Imm using it on my fx server

I am using it on a FX Server too and it is working for me fine.

Do you get any output in the debug console?

1 Like

This is what I get.

Capture

1 Like

Did you add start EngineToggle to the server.cfg?

You have to type the command into the ingame Chat, not the rcon

2 Likes

No. I added it and I did not type it in the rcon. Thats what it says every time I go to launch the server. I did nothing

So you start the server and it instantly gives you this error?

1 Like

Did you add /engine to your server.cfg? :man_facepalming:

You have to add start EngineToggle to it…

1 Like

In a bit ill make a small video so u can see

1 Like

The script now does not work, you run it on the server and it runs but at the second the character starts the vehicle so I do not know how to make it stay off, apart it says that it needs MYsql and I do not know how it works this move T_T

What? It doesn’t need mySQL

1 Like

Any way to add a rule that will tell the ped to leave the engine running when exit object, UNLESS told to shut off (by /engine)

1 Like

@Flatracer
Well when I run the character automatically starts the vehicle and in the CMD database where I run the server I get error script.lua (9): and I do not know what it means and it does not work correctly and I have not changed anything I just put it As it is and I put it in server.cfg and you turn it off and start it …

This resource doesn’t contains any script.lua file, so the error is probably something else.

About your other problem, I am going to fix this later

1 Like