Hello everyone, I need help with one thing, I take care of cars, motorcycles etc. I have the engine off and it doesn’t start automatically when the player enters the car, I’ve been looking all day and I can’t find how, I only found this SET_VEHICLE_ENGINE_ON but I’m not very good at programming, I don’t know if anyone can help me, thank you very much !!
Hello. I put a little thing together. Didn’t do any checks to see if the engine was on because idk if that exists.
Citizen.CreateThread(function()
while true do
local ped = PlayerPedId();
local veh = GetVehiclePedIsUsing(ped);
if veh then -- if they aren't in a veh, it would be nil, so, make sure it exists...
local driver = GetPedInVehicleSeat(veh, -1) -- get the driver of the veh
if ped == driver then -- if you are driver then
SetVehicleEngineOn(veh, true, true, false) -- turn vehicle engine on
end
end
Citizen.Wait(1) -- Create a buffer in the loop
end
end)