Skip to content

Instantly share code, notes, and snippets.

View userMacieG's full-sized avatar
👋
https://lorewave.com/

Maciej Ratyński userMacieG

👋
https://lorewave.com/
View GitHub Profile
@userMacieG
userMacieG / engine.lua
Last active March 22, 2024 12:19
Turn engine on and off via key (ox_lib)
lib.onCache('ped', function(value)
SetPedConfigFlag(value, 241, true) -- PED_FLAG_DISABLE_STOPPING_VEHICLE_ENGINE
SetPedConfigFlag(value, 429, true) -- PED_FLAG_DISABLE_STARTING_VEHICLE_ENGINE
end)
lib.addKeybind({
name = 'engine',
description = 'Engine',
defaultKey = 'Y',
onPressed = function(self)
@userMacieG
userMacieG / engine.lua
Last active October 27, 2022 23:42
Turn engine on and off via key
local playerPed = PlayerPedId()
Citizen.CreateThread(function()
while true do
local currentPlayerPed = PlayerPedId()
if currentPlayerPed ~= playerPed then
playerPed = currentPlayerPed
SetPedConfigFlag(playerPed, 241, true) -- PED_FLAG_DISABLE_STOPPING_VEHICLE_ENGINE