mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-19 06:46:03 +01:00
Fuel From Boat Engine + Removed Non-Used Code
This commit is contained in:
@@ -416,7 +416,7 @@ CreateThread(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local veh = vehicleInFront(ped, pedCoords)
|
local veh = vehicleInFront()
|
||||||
|
|
||||||
-- Animations for manually fueling and effect for sparying fuel.
|
-- Animations for manually fueling and effect for sparying fuel.
|
||||||
if holdingNozzle and nozzle then
|
if holdingNozzle and nozzle then
|
||||||
@@ -530,17 +530,25 @@ CreateThread(function()
|
|||||||
Wait(wait)
|
Wait(wait)
|
||||||
if GetSelectedPedWeapon(ped) == 883325847 and not holdingNozzle and not nozzleInVehicle then
|
if GetSelectedPedWeapon(ped) == 883325847 and not holdingNozzle and not nozzleInVehicle then
|
||||||
wait = 0
|
wait = 0
|
||||||
local veh = vehicleInFront(ped, pedCoords)
|
local veh = vehicleInFront()
|
||||||
if veh then
|
if veh then
|
||||||
local vehClass = GetVehicleClass(veh)
|
local vehClass = GetVehicleClass(veh)
|
||||||
local zPos = nozzleBasedOnClass[vehClass + 1]
|
local zPos = nozzleBasedOnClass[vehClass + 1]
|
||||||
local can = GetAmmoInPedWeapon(ped, 883325847)
|
local can = GetAmmoInPedWeapon(ped, 883325847)
|
||||||
|
local distance = 1.2
|
||||||
|
|
||||||
if vehClass == 8 and vehClass ~= 13 and not config.electricVehicles[GetHashKey(veh)] then
|
if vehClass == 8 and vehClass ~= 13 and not config.electricVehicles[GetHashKey(veh)] then
|
||||||
tankBone = GetEntityBoneIndexByName(veh, "petroltank")
|
tankBone = GetEntityBoneIndexByName(veh, "petroltank")
|
||||||
if tankBone == -1 then
|
if tankBone == -1 then
|
||||||
tankBone = GetEntityBoneIndexByName(veh, "engine")
|
tankBone = GetEntityBoneIndexByName(veh, "engine")
|
||||||
end
|
end
|
||||||
|
elseif vehClass == 14 and not config.electricVehicles[GetHashKey(veh)] then
|
||||||
|
tankBone = GetEntityBoneIndexByName(veh, "engine")
|
||||||
|
if tankBone == -1 then
|
||||||
|
tankBone = GetEntityBoneIndexByName(veh, "bodyshell")
|
||||||
|
else
|
||||||
|
distance = 2.0
|
||||||
|
end
|
||||||
elseif vehClass ~= 13 and not config.electricVehicles[GetHashKey(veh)] then
|
elseif vehClass ~= 13 and not config.electricVehicles[GetHashKey(veh)] then
|
||||||
tankBone = GetEntityBoneIndexByName(veh, "petroltank_l")
|
tankBone = GetEntityBoneIndexByName(veh, "petroltank_l")
|
||||||
if tankBone == -1 then
|
if tankBone == -1 then
|
||||||
@@ -548,7 +556,7 @@ CreateThread(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
tankPosition = GetWorldPositionOfEntityBone(veh, tankBone)
|
tankPosition = GetWorldPositionOfEntityBone(veh, tankBone)
|
||||||
if tankPosition and #(pedCoords - tankPosition) < 1.2 then
|
if tankPosition and #(pedCoords - tankPosition) < distance then
|
||||||
local fuel = GetFuel(veh)
|
local fuel = GetFuel(veh)
|
||||||
DrawText3D(tankPosition.x, tankPosition.y, tankPosition.z + zPos, math.floor(fuel) .. "% refuel [E]")
|
DrawText3D(tankPosition.x, tankPosition.y, tankPosition.z + zPos, math.floor(fuel) .. "% refuel [E]")
|
||||||
local ammo = GetAmmoInPedWeapon(ped, 883325847)
|
local ammo = GetAmmoInPedWeapon(ped, 883325847)
|
||||||
|
|||||||
Reference in New Issue
Block a user