MajiSP / maji-gasdelivery

A gas delivery job for QBCore with a decent size config.
43 stars 14 forks source link

Filling up #10

Open AntMars008 opened 6 months ago

AntMars008 commented 6 months ago

I can't seem to fill up the station when I get to it. I see the YouTube video third eye's on the back top area of the tanker, but I get nothing when I do the same. Do I need to have the tanker in a specific spot close to the prop?

arpan8925 commented 6 months ago

Same Issue here, not getting anything to refuel the stations, no eye target is working.

arpan8925 commented 6 months ago

@MajiSP

HumiPen commented 6 months ago

+1 @MajiSP

HumiPen commented 6 months ago

@arpan8925 @AntMars008

Temporarily put this in function 543 to 596, it will work.

function RefuelStation(location)
    refuelProp1 = CreateObject(refuelProp, location.x, location.y, location.z-1, true, false, false)
    FreezeEntityPosition(refuelProp1, true)
    SetEntityAsMissionEntity(refuelProp1, true, true)
    if cooldown == 1 then
        if Config.Target == 'qb' then
            for _, model in ipairs(trailerModels) do
                local modelHash = tonumber(model)
                exports['qb-target']:AddTargetModel({modelHash}, {
                    options = {
                    {
                        num = 1,
                        event = "pumpRefuel",
                        icon = "fas fa-gas-pump",
                        label = "Grab Fuel Line",
                        action = function()
                            FreezeEntityPosition(trailerId, true)
                            nozzleInHand = true
                            TriggerEvent('pumpRefuel')
                        end,
                        canInteract = function()
                            if not nozzleInHand then
                                return true
                            else
                                return false
                            end
                        end
                    },
                    {
                        num = 2,
                        type = "client",
                        event = "ReturnNozzle",
                        icon = "fas fa-hand",
                        label = "Return Nozzle",
                        action = function()
                            nozzleInHand = false
                            FreezeEntityPosition(trailerId, false)
                            TriggerEvent('ReturnNozzle')
                        end,
                        canInteract = function()
                            if nozzleInHand and RefuelingStation == false then
                                return true
                            else
                                return false
                            end
                        end,
                    },
                },
                distance = 5.0
            })
            end
        end
    end
end
MajiSP commented 6 months ago

I'm currently busy with EMT school. No time to code. It's open source, someone will make a pull request. If it doesn't work, go to the previous version.

AntMars008 commented 6 months ago

Coolios! Will try the above and let you know.

arpan8925 commented 6 months ago

Its working after that changes