[Release] Engine ON/OFF Toggle



Hey guys, this time it is just a really simple Engine Toggle.

You can configure it to use a key or a command, default is using a command.
—> Type /engine to turn the engine ON or OFF
or, if you set UseKey to true in the config.lua
—> Press the INPUT_REPLAY_SCREENSHOT button (Default: U) to turn the engine ON or OFF

There is also the option, that the engine turn automatically ON after entering the vehicle.
Set OnAtEnter to true to use this function.

The engine keeps running, when you leave without turning the engine off.

If you are using @WolfKnight’s RP Vehicle Damage System and are having problems, use the version at the bottom of this post.

EngineToggle [2.3.0].rar (2.2 KB)

VirusTotal Scan

  • [1.0.0]
    – Initial Release
  • [2.0.0]
    – FPS Improvements
  • [2.1.0]
    – Helicopter & Plane Fix
  • [2.2.0]
    – Fixed conflicts with WolfKnight’s RP Vehicle Damage System [1.0.1]
  • [2.3.0]
    – Added a config file
    – Added the option to use a key instead of a command
    – Added the option to toggle the engine automatically after entering the vehicle




To Do
  • Fix conflicts with Realistic Vehicle Failure Systems

WolfKnight's RP Vehicle Damage System - Non-Conflicting Version

Full credits to @WolfKnight, I just added two lines to send the current state to my resource.

wk_vehdamage.rar (1.2 KB)

VirusTotal Scan

Like! Found a bug? Any suggestion? Feel free to comment below!

[Release] ActionMenu [1.0.1] (Updated April 2018)
/text <ID> help needed
Engine on/off startup sound

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.


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


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


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?


This is what I get.



Did you add start EngineToggle to the server.cfg?

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


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?


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

You have to add start EngineToggle to it…


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


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


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)


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