Files
Elite-Gaming-FiveM/resources/Engine-Toggle/cl_vengine.lua
T
Jacob 775709ddef New Improvements & Bug Fixes
+ Added new Wheel-Damage script which causes wheels to fly off if the car is hit hard.
+ Added newer version of the police siren LVC menu.
+ Changed a bunch of keybinds in order to facilitate FivePD.
+ Readded the accidentally removed emote menu and removed NoDriveBy.
+ Updated the server theme alittle away from just RP.
+ Updated to server artifacts version to 6372
2023-04-02 20:38:32 +01:00

43 lines
1.7 KiB
Lua

-- Configuration
local button = 9999 -- 167 (F6 by default) Removed
local commandEnabled = true -- (false by default) If you set this to true, typing "/engine" in chat will also toggle your engine.
-- You're all set now!
-- Code, no need to modify this, unless you know what you're doing or you want to fuck shit up.
-- No support will be provided if you modify this part below.
Citizen.CreateThread(function()
if commandEnabled then
RegisterCommand('engine', function()
toggleEngine()
end, false)
end
while true do
Citizen.Wait(0)
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
if (IsControlJustReleased(0, button) or IsDisabledControlJustReleased(0, button)) and vehicle ~= nil and vehicle ~= 0 and GetPedInVehicleSeat(vehicle, 0) then
toggleEngine()
end
end
end)
function toggleEngine()
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local veheng = GetIsVehicleEngineRunning(vehicle)
if vehicle ~= nil and vehicle ~= 0 and GetPedInVehicleSeat(vehicle, 0) then
SetVehicleEngineOn(vehicle, (not GetIsVehicleEngineRunning(vehicle)), false, true)
--Added notifications for engine toggling
if veheng then
exports['EGRP-Notifications']:CaptionIcon("Vehicle System", "Engine has been turned off!", "top", 3000, "dark", "", true, "mdi-engine-off")
elseif not veheng then
exports['EGRP-Notifications']:CaptionIcon("Vehicle System","Engine has been turned on!", "top", 3000, "dark", "", true, "mdi-engine")
end
--exports['EGRP-Notifications']:Icon("Engine has been toggled!", "top", 5000, "dark", "", true, "mdi-engine")
end
end