[Release] Engine ON/OFF Toggle

engine
toggle
chatcommand

#1

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

Changelog
  • [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
Preview

https://forum.fivem.net/uploads/default/original/3X/0/b/0bd1beadc3e7feb0d82c7cfc11f406077c42dbe4.mp4

https://forum.fivem.net/uploads/default/original/3X/5/0/50d20a21a7df289c28f7a3a64feb2e48e024b75a.mp4

https://forum.fivem.net/uploads/default/original/3X/f/3/f3fcff6789d3dc160b91be19000ff1fd24abdbfe.mp4


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
#2

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

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


#4

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.


#5

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


#6

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


#7

Are you on an FX or CFX server?


#8

Imm using it on my fx server


#9

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?


#10

This is what I get.

Capture


#11

Did you add start EngineToggle to the server.cfg?

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


#12

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


#13

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


#14

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

You have to add start EngineToggle to it…


#15

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


#16

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


#17

What? It doesn’t need mySQL


#18

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)


#19

@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 …


#20

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