forked from Simnation/Main
ed
This commit is contained in:
parent
88ffeb3375
commit
87623c8379
27 changed files with 2865 additions and 1705 deletions
|
@ -0,0 +1,33 @@
|
|||
|
||||
-- get vehicle fuel level
|
||||
function GetFuelLevel(vehicle)
|
||||
if (GetResourceState("LegacyFuel") == "started") then
|
||||
return exports["LegacyFuel"]:GetFuel(vehicle)
|
||||
elseif (GetResourceState("ox_fuel") == "started") then
|
||||
return Entity(vehicle).state.fuel or GetVehicleFuelLevel(vehicle)
|
||||
elseif (GetResourceState("myFuel") == "started") then
|
||||
return exports["myFuel"]:GetFuel(vehicle)
|
||||
else
|
||||
return GetVehicleFuelLevel(vehicle)
|
||||
end
|
||||
end
|
||||
|
||||
-- set vehicle fuel level
|
||||
function SetFuelLevel(vehicle, fuelLevel)
|
||||
if (GetResourceState("LegacyFuel") == "started") then
|
||||
exports["LegacyFuel"]:SetFuel(vehicle, fuelLevel)
|
||||
elseif (GetResourceState("ox_fuel") == "started") then
|
||||
Entity(vehicle).state.fuel = fuelLevel
|
||||
elseif (GetResourceState("myFuel") == "started") then
|
||||
exports["myFuel"]:SetFuel(vehicle, fuelLevel)
|
||||
else
|
||||
SetVehicleFuelLevel(vehicle, fuelLevel)
|
||||
end
|
||||
end
|
||||
|
||||
-- notification (only used for the delete timer)
|
||||
function ShowNotification(text)
|
||||
SetNotificationTextEntry('STRING')
|
||||
AddTextComponentSubstringPlayerName(text)
|
||||
return DrawNotification(false, true)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue