Coder Social home page Coder Social logo

qb-aircraftshop's Introduction

qb-aircraftshop

Private job-based dealership menu (works off closest player)

image

Financing a vehicle with configurable max payment amount and minimum downpayment percentage image

Financing preview header

image

Finance vehicle list

image

Make a payment or pay off vehicle in full

image

Dependencies:

PolyZone

qb-menu

qb-input

Config = {}
Config.UsingTarget = true -- If you are using qb-target (uses entity zones to target vehicles)
Config.Commission = 0.10 -- Percent that goes to sales person from a full airship sale 10%
Config.FinanceCommission = 0.05 -- Percent that goes to sales person from a finance sale 5%
Config.FinanceZone = vector3(-1698.83, -3150.0, 24.32) -- Where the finance menu is located
Config.PaymentWarning = 10 -- time in minutes that player has to make payment before repo
Config.PaymentInterval = 24 -- time in hours between payment being due
Config.MinimumDown = 40 -- minimum percentage allowed down
Config.MaximumPayments = 24 -- maximum payments allowed
Config.Shops = {
    ['LAVS'] = {
        ['Type'] = 'managed',  -- no player interaction is required to purchase a car
        ['Zone'] = {
            ['Shape'] = { --polygon that surrounds the shop
            vector2(-1673.08, -3100.58),
            vector2(-1676.84, -3106.01),
            vector2(-1680.66, -3103.83),
            vector2(-1707.15, -3159.72),
            vector2(-1647.6, -3194.32),
            vector2(-1609.24, -3150.01),
            vector2(-1604.57, -3140.66),
            vector2(-1673.08, -3100.58),
        },
        ['minZ'] = 4,  -- min height of the shop zone
        ['maxZ'] = 40  -- max height of the shop zone
    },

        ['Job'] = 'airdealer', -- Name of job or none
        ['ShopLabel'] = 'The Great AircraftShop (LSIA)',
        ['showBlip'] = true,
        ['Categories'] = {
            ['privatejet'] = 'Private Jet',
            ['helikopter'] = 'Helicopter'
        },
        ['TestDriveTimeLimit'] = 1, -- Time in minutes until the vehicle gets deleted
        ['Location'] = vector3(-1656.79, -3150.95, 13.99), -- Blip Location
        ['ReturnLocation'] = vector3(-1660.93, -3139.55, 13.99), -- Location to return vehicle, only enables if the aircraftshop has a job owned
        ['VehicleSpawn'] = vector4(-1691.08, -2938.44, 13.94, 243.23), -- Spawn location when vehicle is bought
        ['ShowroomVehicles'] = {
            [1] = {
                coords = vector4(-1643.79, -3164.68, 13.18, 323.65), -- where the vehicle will spawn on display
                defaultVehicle = 'luxor', -- Default display vehicle
                chosenVehicle = 'luxor', -- Same as default but is dynamically changed when swapping vehicles
            },
            [2] = {
                coords = vector4(-1675.2, -3146.09, 13.18, 326.76), -- where the vehicle will spawn on display
                defaultVehicle = 'havok', -- Default display vehicle
                chosenVehicle = 'havok', -- Same as default but is dynamically changed when swapping vehicles
            },
        },
        
    },
     -- Add your next table under this comma
}

License

QBCore Framework
Copyright (C) 2021 Joshua Eger

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.