local function HeliMainGunFire(playerObj)
    local vehicle = playerObj:getVehicle()
    if (vehicle and GetHeliType(vehicle)) and vehicle:getSeat(playerObj) == 0 then
        if not HeliList[GetHeliType(vehicle)].HasWeaponAimStatusBox then
            return
        end
        if isMouseButtonDown(1) then
            local Drag = getCell():getDrag(0)
            if Drag and (Drag.type == "Heli" or Drag.type == "HeliMissile") then
                return
            end
            if HeliRocketEnable then
                local AimCursor = ISHeliRocketAimingCursor:new("", "", playerObj)
                getCell():setDrag(AimCursor, 0)
            else
                local AimCursor = ISHeliAimingCursor:new("", "", playerObj)
                getCell():setDrag(AimCursor, 0)
            end

        else
            local Drag = getCell():getDrag(0)
            if Drag and (Drag.type == "Heli" or Drag.type == "HeliMissile") then
                getCell():setDrag(nil, 0)
                if Drag.instance then
                    Drag.instance = nil
                end
            end
        end
    else
        local Drag = getCell():getDrag(0)
        if Drag and (Drag.type == "Heli" or Drag.type == "HeliMG") then
            getCell():setDrag(nil, 0)
            if Drag.instance then
                Drag.instance = nil
            end
        end
    end
end

Events.OnPlayerUpdate.Add(HeliMainGunFire)

