[Release] Engine ON/OFF Toggle

engine
toggle
chatcommand

#64

you’re the best, thank you buddy


#65

Update



I added a second Version, check the first Post




#66

what’s the 2nd version for? any different from the first or duplicate ?


#67

Lol. check the first post :grin:


#68

oooh my bad buddy sorry, thanks a lot


#69

out of curiosity what happens when you exit the vehicle? does it shut off or stay running?


#70

The vehicle stays running.


#71

After some testing I determined that this script does not work properly for helicopters and planes. When getting in you have to manually start them like normal but when you get out the engine does not stay running. Also once you get back in, the engine auto starts. Turning the engine off keeps it off like normal too.

All other vehicles seem to work as intended with the script. Just aircraft that I noticed caused issues.


#72

Thanks for the feedback, I will look into this.


#73

Any updates on this? I have been combing through and trying a few things out myself too, but haven’t had any luck.


#74

I hadn’t much time to work on this, I will do so today.


#75

Unfortunately I wasn’t able to find a solution for this problem. But atleast I was able to fix this for planes with a jet engine. I will release it soon.


#76

I’ve also determined this script has caused some desync on my server with players. Removing this script stopped the desync.


#77

could you make a version with a button? the one that the engine is always off when you get in a vehicle unless you kept it running.


#78

I updated both version and used each for ~30 Minutes, I didn’t notice any framedrops and hope the problem is fully fixed.

I am looking forward to your feedback.


#80

Updated to v2.1.0



  • Fixed the problem with Helicopters & Planes
  • Added chat confirmations


Download in the First Post!




#81

Mine seems to be working fine despite this popping up in the command window when starting the server.

InvokeNative: execution failed: type must be object, but is array
Error loading script server/server.lua in resource EngineToggle: Execution of na
tive 000000008e8cc653 in script host failed.
stack traceback:
[C]: in upvalue '_in’
citizen:/scripting/lua/natives_server.lua:190: in function 'PerformHttpR
equestInternal’
citizen:/scripting/lua/scheduler.lua:233: in function 'PerformHttpReques
t’
server/server.lua:12: in main chunk
Failed to load script server/server.lua.

Any idea why this might be happening?


#82

Any way to add in a hot key for this instead of the chat command?


#83

I am sorry, but I don’t know why this happens, this just seems to happen for some ppl.

Tell me which Key and I will do this for you.


#84

The u key if it’s possible. I’m using the toggle on at enter version. Thank You!