Hello everyone,
I set out to create a vehicle drain system, but I would like to add consequences when we exceed the drain limit.
When I use this piece of code, it tells me directly that the vehicle is below its values, out of values and much higher.
In the snippet below you will see Show3500KM <= 1
While my In-Game counter is at 750 and it declares my vehicle below 1
Citizen.CreateThread(function()
while true do
Citizen.Wait(250)
if IsPedInAnyVehicle(PlayerPedId(), false) then
local veh = GetVehiclePedIsIn(PlayerPedId(),false)
local driver = GetPedInVehicleSeat(veh, -1)
if driver == PlayerPedId() then
if show3500KM >= 1 then
print("VIDANGE -1")
-- SetVehicleDirtLevel(veh, 15.0)
--SetVehicleEngineHealth(veh, 1000000000)
end
end
else
Citizen.Wait(15000)
end
Citizen.Wait(1)
end
end)
How can I get it to take the right value?