├── stream
└── vehicle_paint_ramps.ytd
├── .github
├── auto_assign.yml
├── pull_request_template.md
├── workflows
│ ├── lint.yml
│ └── stale.yml
├── ISSUE_TEMPLATE
│ ├── feature-request.md
│ └── bug_report.md
└── contributing.md
├── fxmanifest.lua
├── README.md
├── html
├── index.html
├── style.css
└── script.js
├── carmodcols_gen9.meta
├── locales
├── en.lua
├── de.lua
├── es.lua
└── nl.lua
├── client
├── nitrous.lua
├── tunerchip.lua
├── drivingdistance.lua
├── main.lua
├── performance.lua
├── repair.lua
└── cosmetic.lua
├── config
├── config.lua
└── const.lua
├── carcols_gen9.meta
├── server
└── main.lua
└── LICENSE
/stream/vehicle_paint_ramps.ytd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qbcore-framework/qb-mechanicjob/HEAD/stream/vehicle_paint_ramps.ytd
--------------------------------------------------------------------------------
/.github/auto_assign.yml:
--------------------------------------------------------------------------------
1 | # Set to true to add reviewers to pull requests
2 | addReviewers: true
3 |
4 | # Set to true to add assignees to pull requests
5 | addAssignees: author
6 |
7 | # A list of reviewers to be added to pull requests (GitHub user name)
8 | reviewers:
9 | - /maintenance
10 |
11 | # A list of keywords to be skipped the process that add reviewers if pull requests include it
12 | skipKeywords:
13 | - wip
14 |
15 | # A number of reviewers added to the pull request
16 | # Set 0 to add all the reviewers (default: 0)
17 | numberOfReviewers: 0
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | **Describe Pull request**
2 | First, make sure you've read and are following the contribution guidelines and style guide and your code reflects that.
3 | Write up a clear and concise description of what your pull request adds or fixes and if it's an added feature explain why you think it should be included in the core.
4 |
5 | If your PR is to fix an issue mention that issue here
6 |
7 | **Questions (please complete the following information):**
8 | - Have you personally loaded this code into an updated qbcore project and checked all it's functionality? [yes/no] (Be honest)
9 | - Does your code fit the style guidelines? [yes/no]
10 | - Does your PR fit the contribution guidelines? [yes/no]
11 |
--------------------------------------------------------------------------------
/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'cerulean'
2 | game 'gta5'
3 | lua54 'yes'
4 | author 'Kakarot'
5 | description 'Allows players to repair/customize vehicles through a specified job'
6 | version '3.0.0'
7 |
8 | shared_scripts {
9 | '@qb-core/shared/locale.lua',
10 | 'locales/en.lua',
11 | 'locales/*.lua',
12 | 'config/*.lua',
13 | }
14 |
15 | client_scripts {
16 | 'client/*.lua',
17 | }
18 |
19 | server_scripts {
20 | '@oxmysql/lib/MySQL.lua',
21 | 'server/main.lua'
22 | }
23 |
24 | ui_page 'html/index.html'
25 |
26 | files {
27 | 'html/*',
28 | 'carcols_gen9.meta',
29 | 'carmodcols_gen9.meta'
30 | }
31 |
32 | data_file 'CARCOLS_GEN9_FILE' 'carcols_gen9.meta'
33 | data_file 'CARMODCOLS_GEN9_FILE' 'carmodcols_gen9.meta'
34 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 | on: [push, pull_request_target]
3 | jobs:
4 | lint:
5 | name: Lint Resource
6 | runs-on: ubuntu-latest
7 | steps:
8 | - uses: actions/checkout@v2
9 | with:
10 | ref: ${{ github.event.pull_request.head.sha }}
11 | - name: Lint
12 | uses: iLLeniumStudios/fivem-lua-lint-action@v2
13 | with:
14 | capture: "junit.xml"
15 | args: "-t --formatter JUnit"
16 | extra_libs: mysql+polyzone+qblocales
17 | - name: Generate Lint Report
18 | if: always()
19 | uses: mikepenz/action-junit-report@v3
20 | with:
21 | report_paths: "**/junit.xml"
22 | check_name: Linting Report
23 | fail_on_failure: false
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea for QBCore
4 | title: "[SUGGESTION]"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is.
12 |
13 | **Describe the feature you'd like**
14 | A clear and concise description of what you want to happen. and with as much detail as possible how it would function in your opinion. Please try to keep it unique.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered for people to have in mind just in case the main idea isn't liked but a derivative is.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2 | #
3 | # You can adjust the behavior by modifying this file.
4 | # For more information, see:
5 | # https://github.com/actions/stale
6 | name: Mark stale issues and pull requests
7 |
8 | on:
9 | schedule:
10 | - cron: '41 15 * * *'
11 |
12 | jobs:
13 | stale:
14 |
15 | runs-on: ubuntu-latest
16 | permissions:
17 | issues: write
18 | pull-requests: write
19 |
20 | steps:
21 | - uses: actions/stale@v5
22 | with:
23 | repo-token: ${{ secrets.GITHUB_TOKEN }}
24 | stale-issue-message: 'This issue has had 60 days of inactivity & will close within 7 days'
25 | stale-pr-message: 'This PR has had 60 days of inactivity & will close within 7 days'
26 | close-issue-label: 'Stale Closed'
27 | close-pr-label: 'Stale Closed'
28 | exempt-issue-labels: 'Suggestion'
29 | exempt-pr-labels: 'Suggestion'
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # qb-mechanicjob
2 | Mechanic Job for QB-Core Framework :mechanic:
3 |
4 | # License
5 |
6 | QBCore Framework
7 | Copyright (C) 2021 Joshua Eger
8 |
9 | This program is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | This program is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with this program. If not, see
21 |
22 |
23 | ## Dependencies
24 | - qb-core
25 | - qb-inventory
26 | - qb-target
27 |
28 | ## Screenshots
29 |
30 | ## Features
31 |
32 | ## Configuration
33 |
--------------------------------------------------------------------------------
/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | QB Tunerchip
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve or fix something
4 | title: "[BUG]"
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is. A stranger to qbcore should be able to read your bug report and understand how to reproduce it themselves and understand how the feature should work normally.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Use this item '....' (item's name from shared.lua if applicable)
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Questions (please complete the following information):**
27 | - When you last updated: [e.g. last week]
28 | - Are you using custom resource? which ones? [e.g. zdiscord, qb-target]
29 | - Have you renamed `qb-` to something custom? [e.g. yes/no]
30 |
31 | **Additional context**
32 | Add any other context about the problem here.
33 |
--------------------------------------------------------------------------------
/carmodcols_gen9.meta:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | YKTA_MONOCHROME
6 |
7 |
8 |
9 |
10 | YKTA_CHROMABERA
11 |
12 |
13 |
14 |
15 | YKTA_ELECTRO
16 |
17 |
18 |
19 |
20 | YKTA_SPRUNK_EX
21 |
22 |
23 |
24 |
25 | YKTA_HSW
26 |
27 |
28 |
29 |
30 | YKTA_NITE_DAY
31 |
32 |
33 |
34 |
35 | YKTA_SUNSETS
36 |
37 |
38 |
39 |
40 | YKTA_VICE_CITY
41 |
42 |
43 |
44 |
45 | YKTA_SYNTHWAVE
46 |
47 |
48 |
49 |
50 | YKTA_VERLIERER2
51 |
52 |
53 |
54 |
55 | YKTA_TEMPERATUR
56 |
57 |
58 |
59 |
60 | YKTA_FOUR_SEASO
61 |
62 |
63 |
64 |
65 | YKTA_THE_SEVEN
66 |
67 |
68 |
69 |
70 | YKTA_M9_THROWBA
71 |
72 |
73 |
74 |
75 | YKTA_BUBBLEGUM
76 |
77 |
78 |
79 |
80 | YKTA_FULL_RBOW
81 |
82 |
83 |
84 |
85 | YKTA_KAMENRIDER
86 |
87 |
88 |
89 |
90 | YKTA_CHRISTMAS
91 |
92 |
93 |
94 |
95 | YKTA_MONIKA
96 |
97 |
98 |
99 |
100 | YKTA_FUBUKI
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/locales/en.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | success = {
3 | tuned = 'Vehicle tuned',
4 | installed = '%s installed',
5 | repaired = 'Vehicle repaired',
6 | part_repaired = '%s repaired',
7 | tire_repaired = 'Tire repaired',
8 | cleaned = 'Vehicle cleaned',
9 | },
10 | warning = {
11 | not_tuned = 'Vehicle not tuned',
12 | no_materials = 'Not enough materials',
13 | },
14 | target = {
15 | duty = 'Toggle Duty',
16 | stash = 'Stash',
17 | shop = 'Shop',
18 | paint = 'Paint Vehicle',
19 | withdraw = 'Withdraw Vehicle',
20 | deposit = 'Deposit Vehicle',
21 | },
22 | menu = {
23 | none = 'None',
24 | back = 'Back',
25 | close = 'Close',
26 | submit = 'Submit',
27 | status = 'Status',
28 | vehicle_stats = 'Vehicle Stats',
29 | engine_health = 'Engine Health',
30 | body_health = 'Body Health',
31 | fuel_health = 'Fuel Tank Health',
32 | vehicle_list = 'Vehicle List',
33 | paint_vehicle = 'Paint Vehicle',
34 | radiator_repair = 'Radiator',
35 | axle_repair = 'Axle',
36 | fuel_repair = 'Fuel',
37 | clutch_repair = 'Clutch',
38 | brakes_repair = 'Brakes',
39 | paints = 'Paints',
40 | type = 'Type',
41 | metallic = 'Metallic',
42 | matte = 'Matte',
43 | chrome = 'Chrome',
44 | custom_color = 'Custom Color',
45 | section = 'Section',
46 | primary = 'Primary',
47 | secondary = 'Secondary',
48 | pearlescent = 'Pearlescent',
49 | interior = 'Interior',
50 | exterior = 'Exterior',
51 | wheels = 'Wheels',
52 | neons = 'Neons',
53 | xenon = 'Xenon Headlights',
54 | window_tint = 'Window Tints',
55 | plate = 'Plate',
56 | repair = 'Repair',
57 | unknown = 'Unknown',
58 | tire_smoke = 'Tire Smoke',
59 | standard = 'Standard',
60 | custom = 'Custom',
61 | toggle = 'Toggle',
62 | enabled = 'Enabled',
63 | disabled = 'Disabled',
64 | color = 'Color',
65 | front_toggle = 'Front Toggle',
66 | rear_toggle = 'Rear Toggle',
67 | left_toggle = 'Left Toggle',
68 | right_toggle = 'Right Toggle',
69 | stock = 'Stock',
70 | armor = 'Armor Level',
71 | brakes = 'Brakes Level',
72 | engine = 'Engine Level',
73 | transmission = 'Transmission Level',
74 | suspension = 'Suspension Level',
75 | turbo = 'Turbo',
76 | install_turbo = 'Install Turbo',
77 | uninstall_turbo = 'Uninstall Turbo',
78 | },
79 | progress = {
80 | nitrous = 'Connecting Nitrous',
81 | installing = 'Installing %s',
82 | repairing = 'Repairing %s',
83 | repair_vehicle = 'Repairing Vehicle',
84 | repair_tire = 'Repairing Tire',
85 | cleaning = 'Cleaning Vehicle',
86 | tuner_chip = 'Connecting Tuner',
87 | }
88 | }
89 |
90 | Lang = Lang or Locale:new({
91 | phrases = Translations,
92 | warnOnMissing = true
93 | })
94 |
--------------------------------------------------------------------------------
/locales/de.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | success = {
3 | tuned = 'Fahrzeug getunt',
4 | installed = '%s installiert',
5 | repaired = 'Fahrzeug repariert',
6 | part_repaired = '%s repariert',
7 | tire_repaired = 'Reifen repariert',
8 | cleaned = 'Fahrzeug gereinigt',
9 | },
10 | warning = {
11 | not_tuned = 'Fahrzeug nicht getunt',
12 | no_materials = 'Nicht genügend Materialien',
13 | },
14 | target = {
15 | duty = 'Dienst umschalten',
16 | stash = 'Lager',
17 | shop = 'Shop',
18 | paint = 'Fahrzeug lackieren',
19 | withdraw = 'Fahrzeug entnehmen',
20 | deposit = 'Fahrzeug einlagern',
21 | },
22 | menu = {
23 | none = 'Keine',
24 | back = 'Zurück',
25 | close = 'Schließen',
26 | submit = 'Absenden',
27 | status = 'Status',
28 | vehicle_stats = 'Fahrzeugstatistiken',
29 | engine_health = 'Motorzustand',
30 | body_health = 'Karosseriezustand',
31 | fuel_health = 'Tankzustand',
32 | vehicle_list = 'Fahrzeugliste',
33 | paint_vehicle = 'Fahrzeug lackieren',
34 | radiator_repair = 'Kühler',
35 | axle_repair = 'Achse',
36 | fuel_repair = 'Kraftstoff',
37 | clutch_repair = 'Kupplung',
38 | brakes_repair = 'Bremsen',
39 | paints = 'Lackierungen',
40 | type = 'Typ',
41 | metallic = 'Metallic',
42 | matte = 'Matt',
43 | chrome = 'Chrom',
44 | custom_color = 'Sonderfarbe',
45 | section = 'Sektion',
46 | primary = 'Primär',
47 | secondary = 'Sekundär',
48 | pearlescent = 'Perlglanz',
49 | interior = 'Innenraum',
50 | exterior = 'Außenbereich',
51 | wheels = 'Räder',
52 | neons = 'Neonlichter',
53 | xenon = 'Xenon-Scheinwerfer',
54 | window_tint = 'Scheibentönungen',
55 | plate = 'Kennzeichen',
56 | repair = 'Reparieren',
57 | unknown = 'Unbekannt',
58 | tire_smoke = 'Reifenqualm',
59 | standard = 'Standard',
60 | custom = 'Benutzerdefiniert',
61 | toggle = 'Umschalten',
62 | enabled = 'Aktiviert',
63 | disabled = 'Deaktiviert',
64 | color = 'Farbe',
65 | front_toggle = 'Vorne umschalten',
66 | rear_toggle = 'Hinten umschalten',
67 | left_toggle = 'Links umschalten',
68 | right_toggle = 'Rechts umschalten',
69 | stock = 'Standard',
70 | armor = 'Panzerungsstufe',
71 | brakes = 'Bremsstufe',
72 | engine = 'Motorstufe',
73 | transmission = 'Getriebe-Stufe',
74 | suspension = 'Fahrwerksstufe',
75 | turbo = 'Turbo',
76 | install_turbo = 'Turbo installieren',
77 | uninstall_turbo = 'Turbo deinstallieren',
78 | },
79 | progress = {
80 | nitrous = 'Nitro anschließen',
81 | installing = 'Installiere %s',
82 | repairing = 'Repariere %s',
83 | repair_vehicle = 'Fahrzeug reparieren',
84 | repair_tire = 'Reifen reparieren',
85 | cleaning = 'Fahrzeug reinigen',
86 | tuner_chip = 'Tuner-Chip anschließen',
87 | }
88 | }
89 |
90 | if GetConvar('qb_locale', 'en') == 'de' then
91 | Lang = Locale:new({
92 | phrases = Translations,
93 | warnOnMissing = true,
94 | fallbackLang = Lang,
95 | })
96 | end
--------------------------------------------------------------------------------
/locales/es.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | success = {
3 | tuned = 'Vehículo tuneado',
4 | installed = '%s instalado',
5 | repaired = 'Vehículo reparado',
6 | part_repaired = '%s reparado',
7 | tire_repaired = 'Neumático reparado',
8 | cleaned = 'Vehículo limpiado',
9 | },
10 | warning = {
11 | not_tuned = 'Vehículo no tuneado',
12 | no_materials = 'Materiales insuficientes',
13 | },
14 | target = {
15 | duty = 'Entrar/Salir de servicio',
16 | stash = 'Almacenamiento',
17 | shop = 'Tienda',
18 | paint = 'Pintar vehículo',
19 | withdraw = 'Retirar vehículo',
20 | deposit = 'Depositar vehículo',
21 | },
22 | menu = {
23 | none = 'Ninguno',
24 | back = 'Volver',
25 | close = 'Cerrar',
26 | submit = 'Confirmar',
27 | status = 'Estado',
28 | vehicle_stats = 'Datos del vehículo',
29 | engine_health = 'Estado del motor',
30 | body_health = 'Estado de la carroceria',
31 | fuel_health = 'Estado del tanque',
32 | radiator_repair = 'Radiador',
33 | axle_repair = 'Eje',
34 | fuel_repair = 'Tanque',
35 | clutch_repair = 'Embrague',
36 | brakes_repair = 'Frenos',
37 | vehicle_list = 'Lista de vehículos',
38 | paint_vehicle = 'Pintar vehículo',
39 | paints = 'Pinturas',
40 | type = 'Tipo',
41 | metallic = 'Metálico',
42 | matte = 'Mate',
43 | chrome = 'Cromado',
44 | custom_color = 'Color personalizado',
45 | section = 'Sección',
46 | primary = 'Primario',
47 | secondary = 'Secundario',
48 | pearlescent = 'Nacarado',
49 | interior = 'Interior',
50 | exterior = 'Exterior',
51 | wheels = 'Ruedas',
52 | neons = 'Neones',
53 | xenon = 'Faros',
54 | window_tint = 'Polarizado',
55 | plate = 'Patente',
56 | repair = 'Reparar',
57 | unknown = 'Desconocido',
58 | tire_smoke = 'Humo en neumáticos',
59 | standard = 'Estándar',
60 | custom = 'Personalizado',
61 | toggle = 'Alternar',
62 | enabled = 'Activado',
63 | disabled = 'Desactivado',
64 | color = 'Color',
65 | front_toggle = 'Parte frontal',
66 | rear_toggle = 'Parte trasera',
67 | left_toggle = 'Parte izquierda',
68 | right_toggle = 'Parte derecha',
69 | stock = 'Acciones',
70 | armor = 'Nivel de blindaje',
71 | brakes = 'Nivel de frenos',
72 | engine = 'Nivel del motor',
73 | transmission = 'Nivel de transmisión',
74 | suspension = 'Nivel de suspensión',
75 | turbo = 'Turbo',
76 | install_turbo = 'Instalar turbo',
77 | uninstall_turbo = 'Desinstalar Turbo',
78 | },
79 | progress = {
80 | nitrous = 'Conectando nitro',
81 | installing = 'Instalando %s',
82 | repairing = 'Reparando %s',
83 | repair_vehicle = 'Reparando vehículo',
84 | repair_tire = 'Reparando neumáticos',
85 | cleaning = 'Limpiando el vehículo',
86 | tuner_chip = 'Conectando chip',
87 | }
88 | }
89 |
90 | if GetConvar('qb_locale', 'en') == 'es' then
91 | Lang = Locale:new({
92 | phrases = Translations,
93 | warnOnMissing = true,
94 | fallbackLang = Lang,
95 | })
96 | end
--------------------------------------------------------------------------------
/locales/nl.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | success = {
3 | tuned = 'Voertuig is getuned',
4 | installed = '%s Geïnstalleerd',
5 | repaired = 'Voertuig is gerepareerd',
6 | part_repaired = '%s gerepareerd',
7 | tire_repaired = 'Band gerepareerd',
8 | cleaned = 'Voertuig is gewassen',
9 | },
10 | warning = {
11 | not_tuned = 'Voertuig kan niet worden getuned',
12 | no_materials = 'Je hebt niet genoeg materialen',
13 | },
14 | target = {
15 | duty = 'In/uit dienst',
16 | stash = 'Opslag',
17 | shop = 'Winkel',
18 | paint = 'Voertuig spuiten',
19 | withdraw = 'Voertuig uithalen',
20 | deposit = 'Voertuig parkeren',
21 | },
22 | menu = {
23 | none = 'Geen',
24 | back = 'Terug',
25 | close = 'Sluiten',
26 | submit = 'Bevestig',
27 | status = 'Status',
28 | vehicle_stats = 'Voertuig statistieken',
29 | engine_health = 'Motorconditie',
30 | body_health = 'Frameconditie',
31 | fuel_health = 'Brandstoftankconditie',
32 | vehicle_list = 'Voertuiglijst',
33 | paint_vehicle = 'Voertuig spuiten',
34 | radiator_repair = 'Radiateur',
35 | axle_repair = 'As',
36 | fuel_repair = 'Brandstof',
37 | clutch_repair = 'Transmissie',
38 | brakes_repair = 'Remmen',
39 | paints = 'Lak',
40 | type = 'Type',
41 | metallic = 'Metallic',
42 | matte = 'Matt',
43 | chrome = 'Chrome',
44 | custom_color = 'Custom kleur',
45 | section = 'Sectie',
46 | primary = 'Primair',
47 | secondary = 'Secundair',
48 | pearlescent = 'Pearlescent',
49 | interior = 'Binnen',
50 | exterior = 'Buiten',
51 | wheels = 'Zjanten',
52 | neons = 'Neons',
53 | xenon = 'Xenon koplampen',
54 | window_tint = 'Ramen blinderen',
55 | plate = 'Nummerplak',
56 | repair = 'Repareren',
57 | unknown = 'Onbekend',
58 | tire_smoke = 'Bandensmoor',
59 | standard = 'Standaard',
60 | custom = 'Custom',
61 | toggle = 'Toggle',
62 | enabled = 'Activeren',
63 | disabled = 'Deactiveren',
64 | color = 'Kleur',
65 | front_toggle = 'Voorkant Toggle',
66 | rear_toggle = 'Achterkant Toggle',
67 | left_toggle = 'Links Toggle',
68 | right_toggle = 'Rechts Toggle',
69 | stock = 'Standaard',
70 | armor = 'Bepantsering Level',
71 | brakes = 'Remmen Level',
72 | engine = 'Motor Level',
73 | transmission = 'Transmissie Level',
74 | suspension = 'Ophanging Level',
75 | turbo = 'Turbo',
76 | install_turbo = 'Turbo installeren',
77 | uninstall_turbo = 'Turbo verwijderen',
78 | },
79 | progress = {
80 | nitrous = 'Nitro continugebruiken',
81 | installing = 'Installeren %s',
82 | repairing = 'Repareren %s',
83 | repair_vehicle = 'Voertuig repareren',
84 | repair_tire = 'Banden repareren',
85 | cleaning = 'Voertuig wassen',
86 | tuner_chip = 'Tunerchip connecteren',
87 | }
88 | }
89 |
90 | if GetConvar('qb_locale', 'en') == 'nl' then
91 | Lang = Lang or Locale:new({
92 | phrases = Translations,
93 | warnOnMissing = true,
94 | fallbackLang = Lang,
95 | })
96 | end
97 |
--------------------------------------------------------------------------------
/html/style.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100&display=swap");
2 |
3 | div {
4 | font-family: "Poppins", sans-serif;
5 | }
6 |
7 | body,
8 | html {
9 | margin: 0;
10 | height: 100%;
11 | display: flex;
12 | justify-content: center;
13 | align-items: center;
14 | font-family: Arial, sans-serif;
15 | }
16 |
17 | .tablet {
18 | position: relative;
19 | width: 40vw;
20 | height: 40vh;
21 | margin: auto;
22 | border: 16px solid black;
23 | border-right-width: 60px;
24 | border-left-width: 60px;
25 | border-radius: 36px;
26 | display: none;
27 | }
28 |
29 | .tablet:before {
30 | content: "";
31 | display: block;
32 | width: 5px;
33 | height: 60px;
34 | position: absolute;
35 | top: 50%;
36 | left: -30px;
37 | transform: translateY(-50%);
38 | background: #333;
39 | border-radius: 10px;
40 | }
41 |
42 | .tablet:after {
43 | content: "";
44 | display: block;
45 | width: 35px;
46 | height: 35px;
47 | position: absolute;
48 | top: 50%;
49 | right: -45px;
50 | transform: translateY(-50%);
51 | background: #333;
52 | border-radius: 50%;
53 | box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2); /* Adds shadow for depth */
54 | transition: transform 0.3s; /* For a smooth press effect */
55 | }
56 |
57 | .tablet:hover:after {
58 | transform: translateY(-50%) scale(0.95); /* Slight scaling on hover for feedback */
59 | }
60 |
61 | .tablet:active:after {
62 | transform: translateY(-50%) scale(0.9); /* More scaling when pressed for a push effect */
63 | }
64 |
65 | .screen {
66 | position: relative;
67 | width: 100%;
68 | height: 100%;
69 | background-color: #333;
70 | overflow: hidden;
71 | display: flex;
72 | justify-content: center;
73 | align-items: center;
74 | flex-direction: column;
75 | }
76 |
77 | .navbar {
78 | display: flex;
79 | justify-content: space-around;
80 | width: 100%;
81 | position: absolute;
82 | top: 0;
83 | left: 0;
84 | right: 0;
85 | padding-top: 10px;
86 | background: #222;
87 | }
88 |
89 | .nav-item {
90 | color: white;
91 | background: none;
92 | border: none;
93 | text-decoration: none;
94 | padding: 10px 15px;
95 | transition: background-color 0.3s;
96 | font-size: 1.5vh;
97 | cursor: pointer;
98 | }
99 |
100 | #content-area {
101 | display: flex;
102 | flex-wrap: wrap;
103 | flex-direction: row;
104 | width: 100%;
105 | height: 75%;
106 | padding-left: 8vw;
107 | }
108 |
109 | .input-label {
110 | display: block;
111 | margin-bottom: 8px; /* Adds space between the label and the input box. Adjust as needed. */
112 | }
113 |
114 | .input-container {
115 | color: white;
116 | font-weight: bolder;
117 | font-size: 1vh;
118 | margin-bottom: 12px;
119 | min-width: 30%;
120 | }
121 |
122 | .number-input {
123 | width: 50%; /* Adjust width as desired. */
124 | height: 30px; /* Adjust height as desired. */
125 | padding: 4px; /* Add some padding for better appearance. */
126 | box-sizing: border-box; /* Makes sure padding doesn't increase the size of the input. */
127 | }
128 |
129 | .button-group {
130 | display: flex;
131 | justify-content: space-around;
132 | align-items: center;
133 | padding: 20px 0;
134 | position: absolute;
135 | bottom: 0;
136 | width: 100%;
137 | }
138 |
139 | .action-button {
140 | padding: 10px 20px;
141 | border: none;
142 | background-color: #dc143c;
143 | border-radius: 0.3vh;
144 | color: white;
145 | cursor: pointer;
146 | transition: background-color 0.3s;
147 | }
148 |
149 | .description-box {
150 | display: flex;
151 | align-items: center; /* Vertically center the content */
152 | justify-content: center; /* Horizontally center the content */
153 | color: white;
154 | font-weight: bolder;
155 | width: 15vw;
156 | height: 50px; /* Or adjust as per your requirement */
157 | margin: 0 20px; /* Space between the buttons and the box */
158 | background-color: #333; /* Choose a background color */
159 | border-radius: 5px; /* Rounded corners */
160 | padding: 5px; /* Inner padding */
161 | box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); /* Optional shadow effect */
162 | }
163 |
--------------------------------------------------------------------------------
/client/nitrous.lua:
--------------------------------------------------------------------------------
1 | local vehicle, plate, netId
2 | local nitrousActive = false
3 | local nitrousVehicles = {}
4 |
5 | -- Functions
6 |
7 | local function ListenForNitrous()
8 | CreateThread(function()
9 | while true do
10 | Wait(0)
11 | if not vehicle then break end
12 | local ped = PlayerPedId()
13 | local isDriver = GetPedInVehicleSeat(vehicle, -1) == ped
14 | if isDriver then
15 | if IsControlJustPressed(0, 155) then
16 | AnimpostfxPlay('RaceTurbo', 0, true)
17 | TriggerServerEvent('qb-mechanicjob:server:syncNitrousFlames', netId, true)
18 | nitrousActive = true
19 | end
20 | if nitrousActive then -- per frame effect & updates
21 | SetVehicleBoostActive(vehicle, true)
22 | SetVehicleCheatPowerIncrease(vehicle, Config.NitrousBoost)
23 | nitrousVehicles[plate].level = nitrousVehicles[plate].level - Config.NitrousUsage
24 | TriggerEvent('hud:client:UpdateNitrous', nitrousVehicles[plate].level, nitrousVehicles[plate].hasnitro)
25 | end
26 | if IsControlJustReleased(0, 155) or nitrousVehicles[plate].level <= 0 then
27 | nitrousActive = false
28 | AnimpostfxStop('RaceTurbo')
29 | SetVehicleBoostActive(vehicle, false)
30 | TriggerServerEvent('qb-mechanicjob:server:syncNitrousFlames', netId, false)
31 | if nitrousVehicles[plate].level <= 0 then
32 | nitrousVehicles[plate].hasnitro = false
33 | TriggerServerEvent('qb-mechanicjob:server:syncNitrous', plate, false)
34 | TriggerEvent('hud:client:UpdateNitrous', 0, false)
35 | plate = nil
36 | vehicle = nil
37 | netId = nil
38 | break
39 | else
40 | TriggerServerEvent('qb-mechanicjob:server:syncNitrous', plate, true, nitrousVehicles[plate].level)
41 | end
42 | end
43 | else
44 | plate = nil
45 | vehicle = nil
46 | netId = nil
47 | nitrousActive = false
48 | TriggerEvent('hud:client:UpdateNitrous', 0, false)
49 | break
50 | end
51 | end
52 | end)
53 | end
54 |
55 | -- Handler
56 |
57 | AddEventHandler('gameEventTriggered', function(event)
58 | if event == 'CEventNetworkPlayerEnteredVehicle' then
59 | vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
60 | plate = QBCore.Functions.GetPlate(vehicle)
61 | netId = NetworkGetNetworkIdFromEntity(vehicle)
62 | QBCore.Functions.TriggerCallback('qb-mechanicjob:server:getnitrousVehicles', function(vehs)
63 | nitrousVehicles = vehs
64 | if nitrousVehicles[plate] and nitrousVehicles[plate].hasnitro and nitrousVehicles[plate].level > 0 then
65 | TriggerEvent('hud:client:UpdateNitrous', nitrousVehicles[plate].level, true)
66 | ListenForNitrous()
67 | end
68 | end)
69 | end
70 | end)
71 |
72 | -- Events
73 |
74 | RegisterNetEvent('qb-mechanicjob:client:syncNitrousFlames', function(net, toggle)
75 | if not NetworkDoesEntityExistWithNetworkId(net) then return end
76 | local veh = NetworkGetEntityFromNetworkId(net)
77 | SetVehicleNitroEnabled(veh, toggle)
78 | end)
79 |
80 | RegisterNetEvent('qb-mechanicjob:client:installNitrous', function()
81 | if IsPedInAnyVehicle(PlayerPedId(), false) then return end
82 | local closestVehicle, distance = QBCore.Functions.GetClosestVehicle()
83 | if closestVehicle == 0 or distance > 5.0 then return end
84 | local vehicleClass = GetVehicleClass(closestVehicle)
85 | if Config.IgnoreClasses[vehicleClass] then return end
86 | local vehiclePlate = QBCore.Functions.GetPlate(closestVehicle)
87 | if not vehiclePlate then return end
88 | if not IsNearBone(closestVehicle, 'engine') then return end
89 | ToggleHood(closestVehicle)
90 | QBCore.Functions.Progressbar('use_nos', Lang:t('progress.nitrous'), 5000, false, true, {
91 | disableMovement = true,
92 | disableCarMovement = true,
93 | disableMouse = false,
94 | disableCombat = true,
95 | }, {
96 | animDict = 'mini@repair',
97 | anim = 'fixing_a_player',
98 | flags = 1,
99 | }, {
100 | model = 'imp_prop_impexp_span_03',
101 | bone = 28422,
102 | coords = vec3(0.06, 0.01, -0.02),
103 | rotation = vec3(0.0, 0.0, 0.0),
104 | }, {}, function()
105 | ToggleHood(closestVehicle)
106 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'nitrous')
107 | TriggerServerEvent('qb-mechanicjob:server:syncNitrous', vehiclePlate, true, 100)
108 | if not nitrousVehicles[vehiclePlate] then
109 | nitrousVehicles[vehiclePlate] = { hasnitro = true, level = 100 }
110 | else
111 | nitrousVehicles[vehiclePlate].hasnitro = true
112 | nitrousVehicles[vehiclePlate].level = 100
113 | end
114 | end)
115 | end)
116 |
117 | -- Threads
118 |
119 | CreateThread(function()
120 | RequestNamedPtfxAsset('veh_xs_vehicle_mods')
121 | while not HasNamedPtfxAssetLoaded('veh_xs_vehicle_mods') do
122 | Wait(0)
123 | RequestNamedPtfxAsset('veh_xs_vehicle_mods')
124 | end
125 | end)
126 |
--------------------------------------------------------------------------------
/client/tunerchip.lua:
--------------------------------------------------------------------------------
1 | local initialData = {}
2 |
3 | local availableHandling = {
4 | 'fMass',
5 | 'fInitialDragCoeff',
6 | 'fDownforceModifier',
7 | 'nInitialDriveGears',
8 | 'fInitialDriveForce',
9 | 'fDriveInertia',
10 | 'fDriveBiasFront',
11 | 'fInitialDriveMaxFlatVel',
12 | 'fClutchChangeRateScaleUpShift',
13 | 'fClutchChangeRateScaleDownShift',
14 | 'fSteeringLock',
15 | 'fBrakeForce',
16 | 'fBrakeBiasFront',
17 | 'fHandBrakeForce',
18 | 'fTractionCurveMax',
19 | 'fTractionCurveMin',
20 | 'fTractionCurveLateral',
21 | 'fTractionSpringDeltaMax',
22 | 'fLowSpeedTractionLossMult',
23 | 'fTractionBiasFront',
24 | 'fCamberStiffnesss',
25 | 'fTractionLossMult',
26 | 'vecCentreOfMassOffset',
27 | 'vecInertiaMultiplier',
28 | 'fSuspensionForce',
29 | 'fSuspensionCompDamp',
30 | 'fSuspensionReboundDamp',
31 | 'fSuspensionUpperLimit',
32 | 'fSuspensionLowerLimit',
33 | 'fSuspensionRaise',
34 | 'fSuspensionBiasFront',
35 | 'fAntiRollBarForce',
36 | 'fAntiRollBarBiasFront',
37 | 'fRollCentreHeightFront',
38 | 'fRollCentreHeightRear',
39 | 'fPercentSubmerged',
40 | 'fCollisionDamageMult',
41 | 'fDeformationDamageMult',
42 | 'fWeaponDamageMult',
43 | 'fEngineDamageMult',
44 | 'fPetrolTankVolume',
45 | 'fOilVolume',
46 | 'nMonetaryValue'
47 | }
48 |
49 | -- Functions
50 |
51 | local function GetVehicleStats(vehicle)
52 | local vehicleStats = {}
53 | local plate = QBCore.Functions.GetPlate(vehicle)
54 |
55 | for _, handlingName in pairs(availableHandling) do
56 | local value
57 | if handlingName == 'nInitialDriveGears' or handlingName == 'nMonetaryValue' then
58 | value = GetVehicleHandlingInt(vehicle, 'CHandlingData', handlingName)
59 | else
60 | value = GetVehicleHandlingFloat(vehicle, 'CHandlingData', handlingName)
61 | end
62 | vehicleStats[handlingName] = value
63 | end
64 |
65 | if not initialData[plate] then
66 | initialData[plate] = vehicleStats
67 | end
68 |
69 | return vehicleStats
70 | end
71 |
72 | local function SetVehData(data)
73 | local vehicle = GetVehiclePedIsUsing(PlayerPedId())
74 | if not vehicle then return end
75 | for k, v in pairs(data) do
76 | local numValue = tonumber(v)
77 | if numValue then
78 | if k == 'nInitialDriveGears' or k == 'nMonetaryValue' then
79 | SetVehicleHandlingInt(vehicle, 'CHandlingData', k, math.floor(numValue))
80 | else
81 | SetVehicleHandlingFloat(vehicle, 'CHandlingData', k, numValue + 0.0)
82 | end
83 | end
84 | end
85 | end
86 |
87 | local function ResetVeh()
88 | local vehicle = GetVehiclePedIsUsing(PlayerPedId())
89 | if not vehicle then return end
90 | local plate = QBCore.Functions.GetPlate(vehicle)
91 | if not plate then return end
92 | if not initialData[plate] then return end
93 | for k, v in pairs(initialData) do
94 | local numValue = tonumber(v)
95 | if numValue then
96 | if k == 'nInitialDriveGears' or k == 'nMonetaryValue' then
97 | SetVehicleHandlingInt(vehicle, 'CHandlingData', k, math.floor(numValue))
98 | else
99 | SetVehicleHandlingFloat(vehicle, 'CHandlingData', k, numValue + 0.0)
100 | end
101 | end
102 | end
103 | end
104 |
105 | -- NUI Callbacks
106 |
107 | RegisterNUICallback('saveTune', function(data, cb)
108 | SetVehData(data)
109 | cb('ok')
110 | end)
111 |
112 | RegisterNUICallback('reset', function(_, cb)
113 | ResetVeh()
114 | TriggerEvent('qb-mechanicjob:client:openChip')
115 | cb('ok')
116 | end)
117 |
118 | RegisterNUICallback('closeTuner', function(_, cb)
119 | SetNuiFocus(false, false)
120 | cb('ok')
121 | end)
122 |
123 | -- Events
124 |
125 | RegisterNetEvent('qb-mechanicjob:client:checkTune', function()
126 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
127 | if vehicle == 0 or distance > 5.0 then return end
128 | local plate = QBCore.Functions.GetPlate(vehicle)
129 | if not plate then return end
130 | QBCore.Functions.TriggerCallback('qb-mechanicjob:server:checkTune', function(status)
131 | if status then
132 | QBCore.Functions.Notify(Lang:t('success.tuned'), 'success')
133 | else
134 | QBCore.Functions.Notify(Lang:t('warning.not_tuned'), 'error')
135 | end
136 | end, plate)
137 | end)
138 |
139 | RegisterNetEvent('qb-mechanicjob:client:openChip', function()
140 | local ped = PlayerPedId()
141 | local inVehicle = IsPedInAnyVehicle(ped, false)
142 | if inVehicle then
143 | local vehicle = GetVehiclePedIsUsing(ped)
144 | local vehicleClass = GetVehicleClass(vehicle)
145 | if Config.IgnoreClasses[vehicleClass] then return end
146 | local plate = QBCore.Functions.GetPlate(vehicle)
147 | QBCore.Functions.Progressbar('connect_laptop', Lang:t('progress.tuner_chip'), 2000, false, true, {
148 | disableMovement = true,
149 | disableCarMovement = true,
150 | disableMouse = false,
151 | disableCombat = true,
152 | }, {}, {}, {}, function()
153 | TriggerServerEvent('qb-mechanicjob:server:tuneStatus', plate)
154 | SetNuiFocus(true, true)
155 | SendNUIMessage({
156 | action = 'openTuner',
157 | stats = GetVehicleStats(vehicle)
158 | })
159 | end)
160 | end
161 | end)
162 |
--------------------------------------------------------------------------------
/client/drivingdistance.lua:
--------------------------------------------------------------------------------
1 | local vehicle, plate
2 | local vehicleComponents = {}
3 | local drivingDistance = {}
4 |
5 | -- Function
6 |
7 | local function InitializeVehicleComponents()
8 | if not Config.UseWearableParts then return end
9 | vehicleComponents[plate] = {}
10 | for part, data in pairs(Config.WearableParts) do
11 | vehicleComponents[plate][part] = data.maxValue
12 | end
13 | end
14 |
15 | local function ApplyComponentEffect(component) -- add custom effects here for each component in config
16 | if component == 'radiator' then
17 | local engineHealth = GetVehicleEngineHealth(vehicle)
18 | SetVehicleEngineHealth(vehicle, engineHealth - 50)
19 | elseif component == 'axle' then
20 | for i = 0, 360 do
21 | Wait(15)
22 | SetVehicleSteeringScale(vehicle, i)
23 | end
24 | elseif component == 'brakes' then
25 | SetVehicleHandbrake(vehicle, true)
26 | Wait(5000)
27 | SetVehicleHandbrake(vehicle, false)
28 | elseif component == 'clutch' then
29 | SetVehicleEngineOn(vehicle, false, false, true)
30 | SetVehicleUndriveable(vehicle, true)
31 | Wait(5000)
32 | SetVehicleEngineOn(vehicle, true, false, true)
33 | SetVehicleUndriveable(vehicle, false)
34 | elseif component == 'fuel' then
35 | local fuel = exports[Config.FuelResource]:GetFuel(vehicle)
36 | exports[Config.FuelResource]:SetFuel(vehicle, fuel - 10)
37 | end
38 | end
39 |
40 | local function DamageRandomComponent()
41 | if not Config.UseWearableParts then return end
42 | local componentKeys = {}
43 | for component, _ in pairs(Config.WearableParts) do
44 | componentKeys[#componentKeys + 1] = component
45 | end
46 | local componentToDamage = componentKeys[math.random(#componentKeys)]
47 | vehicleComponents[plate][componentToDamage] = math.max(0, vehicleComponents[plate][componentToDamage] - Config.WearablePartsDamage)
48 | if vehicleComponents[plate][componentToDamage] <= Config.DamageThreshold then
49 | ApplyComponentEffect(componentToDamage)
50 | end
51 | end
52 |
53 | local function GetDamageAmount(distance)
54 | for _, tier in ipairs(Config.MinimalMetersForDamage) do
55 | if distance >= tier.min and distance < tier.max then
56 | return tier.damage
57 | end
58 | end
59 | return 0
60 | end
61 |
62 | local function ApplyDamageBasedOnDistance(distance)
63 | if not Config.UseDistanceDamage then return end
64 | local damage = GetDamageAmount(distance)
65 | local engineHealth = GetVehicleEngineHealth(vehicle)
66 | SetVehicleEngineHealth(vehicle, engineHealth - damage)
67 | end
68 |
69 | local function TrackDistance()
70 | CreateThread(function()
71 | while true do
72 | Wait(0)
73 | if not vehicle then break end
74 |
75 | local ped = PlayerPedId()
76 | local isDriver = GetPedInVehicleSeat(vehicle, -1) == ped
77 | local speed = GetEntitySpeed(vehicle)
78 |
79 | if isDriver then
80 | if plate and speed > 5 then
81 | if not drivingDistance[plate] then
82 | drivingDistance[plate] = { distance = 0, lastCoords = GetEntityCoords(vehicle) }
83 | InitializeVehicleComponents()
84 | else
85 | local newCoords = GetEntityCoords(vehicle)
86 | local distance = #(drivingDistance[plate].lastCoords - newCoords)
87 | if distance < 5 then
88 | drivingDistance[plate].distance = drivingDistance[plate].distance + distance
89 | drivingDistance[plate].lastCoords = newCoords
90 | -- Engine damage
91 | local accumulatedDistance = drivingDistance[plate].distance
92 | if accumulatedDistance >= Config.MinimalMetersForDamage[1].min then
93 | ApplyDamageBasedOnDistance(accumulatedDistance)
94 | end
95 | -- Parts Damage
96 | local randomNumber = math.random(1, 1000)
97 | if randomNumber <= Config.WearablePartsChance then
98 | DamageRandomComponent()
99 | end
100 | end
101 | end
102 | end
103 | else
104 | if drivingDistance[plate] then
105 | TriggerServerEvent('qb-mechanicjob:server:updateDrivingDistance', plate, drivingDistance[plate].distance)
106 | TriggerServerEvent('qb-mechanicjob:server:updateVehicleComponents', plate, vehicleComponents[plate])
107 | end
108 | plate = nil
109 | vehicle = nil
110 | break
111 | end
112 | end
113 | end)
114 | end
115 |
116 | -- Handler
117 |
118 | AddEventHandler('gameEventTriggered', function(event)
119 | if event == 'CEventNetworkPlayerEnteredVehicle' then
120 | if not Config.UseDistance then return end
121 | vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
122 | local originalPlate = GetVehicleNumberPlateText(vehicle)
123 | if not originalPlate then return end
124 | plate = Trim(originalPlate)
125 | local vehicleClass = GetVehicleClass(vehicle)
126 | if Config.IgnoreClasses[vehicleClass] then return end
127 | TrackDistance()
128 | end
129 | end)
130 |
--------------------------------------------------------------------------------
/config/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.RequireJob = true -- do you need a mech job to use parts?
3 | Config.FuelResource = 'LegacyFuel' -- supports any that has a GetFuel() and SetFuel() export
4 |
5 | Config.PaintTime = 5 -- how long it takes to paint a vehicle in seconds
6 | Config.ColorFavorites = false -- add your own colors to the favorites menu (see bottom of const.lua)
7 |
8 | Config.NitrousBoost = 1.8 -- how much boost nitrous gives (want this above 1.0)
9 | Config.NitrousUsage = 0.1 -- how much nitrous is used per frame while holding key
10 |
11 | Config.UseDistance = true -- enable/disable saving vehicle distance
12 | Config.UseDistanceDamage = true -- damage vehicle engine health based on vehicle distance
13 | Config.UseWearableParts = true -- enable/disable wearable parts
14 | Config.WearablePartsChance = 1 -- chance of wearable parts being damaged while driving if enabled
15 | Config.WearablePartsDamage = math.random(1, 2) -- how much wearable parts are damaged when damaged if enabled
16 | Config.DamageThreshold = 25 -- how worn a part needs to be or below to apply an effect if enabled
17 | Config.WarningThreshold = 50 -- how worn a part needs to be to show a warning color in toolbox if enabled
18 |
19 | Config.MinimalMetersForDamage = { -- unused if Config.UseDistanceDamage is false
20 | { min = 5000, max = 10000, damage = 10 },
21 | { min = 15000, max = 20000, damage = 20 },
22 | { min = 25000, max = 30000, damage = 30 },
23 | }
24 |
25 | Config.WearableParts = { -- unused if Config.UseWearableParts is false (feel free to add/remove parts)
26 | radiator = { label = Lang:t('menu.radiator_repair'), maxValue = 100, repair = { steel = 2 } },
27 | axle = { label = Lang:t('menu.axle_repair'), maxValue = 100, repair = { aluminum = 2 } },
28 | brakes = { label = Lang:t('menu.brakes_repair'), maxValue = 100, repair = { copper = 2 } },
29 | clutch = { label = Lang:t('menu.clutch_repair'), maxValue = 100, repair = { copper = 2 } },
30 | fuel = { label = Lang:t('menu.fuel_repair'), maxValue = 100, repair = { plastic = 2 } },
31 | }
32 |
33 | Config.Shops = {
34 | mechanic = { -- City location
35 | managed = true,
36 | shopLabel = 'LS Customs',
37 | showBlip = true,
38 | blipSprite = 72,
39 | blipColor = 46,
40 | blipCoords = vector3(-346.02, -130.68, 39.02),
41 | duty = vector3(-348.18, -134.55, 39.59),
42 | stash = vector3(-346.02, -130.68, 39.02),
43 | paint = vector3(-324.11, -147.11, 39.10),
44 | vehicles = {
45 | withdraw = vector3(-369.30, -104.75, 38.38),
46 | spawn = vector4(-369.65, -107.8, 38.65, 70.52),
47 | list = { 'flatbed', 'towtruck', 'minivan', 'blista' }
48 | },
49 | },
50 | mechanic2 = { -- Harmony Location
51 | managed = true,
52 | shopLabel = 'LS Customs',
53 | showBlip = true,
54 | blipSprite = 72,
55 | blipColor = 46,
56 | blipCoords = vector3(1174.93, 2639.45, 37.75),
57 | duty = vector3(1185.86, 2638.70, 38.93),
58 | stash = vector3(1175.11, 2635.375, 37.78),
59 | paint = vector3(1181.29, 2634.69, 37.80),
60 | vehicles = {
61 | withdraw = vector3(1185.63, 2646.01, 37.91),
62 | spawn = vector4(1188.18, 2657.56, 37.79, 316.74),
63 | list = { 'flatbed', 'towtruck', 'minivan', 'blista' }
64 | },
65 | },
66 | mechanic3 = { -- Airport Location
67 | managed = true,
68 | shopLabel = 'LS Customs',
69 | showBlip = true,
70 | blipSprite = 72,
71 | blipColor = 46,
72 | blipCoords = vector3(-1154.92, -2006.41, 13.18),
73 | duty = vector3(-1149.17, -1998.27, 13.91),
74 | stash = vector3(-1146.40, -2002.05, 13.19),
75 | paint = vector3(-1170.60, -2014.90, 13.23),
76 | vehicles = {
77 | withdraw = vector3(-1142.04, -1994.58, 13.26),
78 | spawn = vector4(-1137.42, -1993.26, 13.14, 226.07),
79 | list = { 'flatbed', 'towtruck', 'minivan', 'blista' }
80 | },
81 | },
82 | bennys = { -- Default Bennys Location
83 | managed = true,
84 | shopLabel = 'Benny\'s Motorworks',
85 | showBlip = true,
86 | blipSprite = 72,
87 | blipColor = 46,
88 | blipCoords = vector3(-211.73, -1325.28, 30.89),
89 | duty = vector3(-202.92, -1313.74, 31.70),
90 | stash = vector3(-199.58, -1314.65, 31.08),
91 | paint = vector3(-202.42, -1322.16, 31.29),
92 | vehicles = {
93 | withdraw = vector3(0, 0, 0),
94 | spawn = vector4(-370.51, -107.88, 38.35, 72.56),
95 | list = { 'flatbed', 'towtruck', 'minivan', 'blista' }
96 | },
97 | },
98 | beeker = { -- Paleto Location
99 | managed = true,
100 | shopLabel = 'Beeker\'s Garage',
101 | showBlip = true,
102 | blipSprite = 72,
103 | blipColor = 46,
104 | blipCoords = vector3(109.95, 6627.34, 31.79),
105 | duty = vector3(101.74, 6620.04, 32.95),
106 | stash = vector3(107.00, 6629.88, 31.81),
107 | paint = vector3(102.17, 6626.08, 31.79),
108 | vehicles = {
109 | withdraw = vector3(107.08, 6614.90, 31.96),
110 | spawn = vector4(110.91, 6609.32, 31.81, 315.11),
111 | list = { 'flatbed', 'towtruck', 'minivan', 'blista' }
112 | },
113 | },
114 | }
115 |
--------------------------------------------------------------------------------
/client/main.lua:
--------------------------------------------------------------------------------
1 | PlayerData = {}
2 |
3 | -- Handlers
4 |
5 | AddEventHandler('OnResourceStart', function(resourceName)
6 | if (GetCurrentResourceName() ~= resourceName) then return end
7 | PlayerData = QBCore.Functions.GetPlayerData()
8 | end)
9 |
10 | AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
11 | PlayerData = QBCore.Functions.GetPlayerData()
12 | end)
13 |
14 | RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo)
15 | PlayerData.job = JobInfo
16 | end)
17 |
18 | RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
19 | PlayerData = {}
20 | end)
21 |
22 | -- Global Functions
23 |
24 | function Trim(plate)
25 | return (string.gsub(plate, '^%s*(.-)%s*$', '%1'))
26 | end
27 |
28 | function ToggleHood(vehicle)
29 | if GetVehicleDoorAngleRatio(vehicle, 4) > 0.0 then
30 | SetVehicleDoorShut(vehicle, 4, false)
31 | else
32 | SetVehicleDoorOpen(vehicle, 4, false, false)
33 | end
34 | end
35 |
36 | function IsNearBone(vehicle, bone)
37 | local playerCoords = GetEntityCoords(PlayerPedId())
38 | local vehicleBoneIndex = GetEntityBoneIndexByName(vehicle, bone)
39 | if vehicleBoneIndex ~= -1 then
40 | local bonePos = GetWorldPositionOfEntityBone(vehicle, vehicleBoneIndex)
41 | if #(playerCoords - bonePos) <= 1.5 then
42 | return true
43 | end
44 | end
45 | return false
46 | end
47 |
48 | function GetClosestWheel(vehicle)
49 | local playerCoords = GetEntityCoords(PlayerPedId())
50 | local closestWheelIndex
51 | for wheelIndex, wheelBone in pairs(Config.WheelBones) do
52 | local wheelBoneIndex = GetEntityBoneIndexByName(vehicle, wheelBone)
53 | if wheelBoneIndex ~= -1 then
54 | local wheelPos = GetWorldPositionOfEntityBone(vehicle, wheelBoneIndex)
55 | if #(playerCoords - wheelPos) <= 1.5 then
56 | closestWheelIndex = wheelIndex
57 | break
58 | end
59 | end
60 | end
61 | return closestWheelIndex
62 | end
63 |
64 | -- Local Functions
65 |
66 | local function SpawnListVehicle(model, spawnPoint)
67 | QBCore.Functions.TriggerCallback('QBCore:Server:SpawnVehicle', function(netId)
68 | local veh = NetToVeh(netId)
69 | SetVehicleNumberPlateText(veh, 'MECH' .. tostring(math.random(1000, 9999)))
70 | SetEntityHeading(veh, spawnPoint.w)
71 | exports[Config.FuelResource]:SetFuel(veh, 100.0)
72 | TriggerEvent('vehiclekeys:client:SetOwner', QBCore.Functions.GetPlate(veh))
73 | SetVehicleEngineOn(veh, true, true, false)
74 | end, model, spawnPoint, true)
75 | end
76 |
77 | local function VehicleList(shop)
78 | local vehicleMenu = { { header = Lang:t('menu.vehicle_list'), isMenuHeader = true } }
79 | local list = Config.Shops[shop].vehicles.list
80 | for i = 1, #list do
81 | local v = list[i]
82 | vehicleMenu[#vehicleMenu + 1] = {
83 | header = QBCore.Shared.Vehicles[v].name,
84 | params = {
85 | event = 'qb-mechanicjob:client:SpawnListVehicle',
86 | args = {
87 | spawnName = v,
88 | location = Config.Shops[shop].vehicles.spawn
89 | }
90 | }
91 | }
92 | end
93 | vehicleMenu[#vehicleMenu + 1] = {
94 | header = Lang:t('menu.close'),
95 | txt = '',
96 | params = {
97 | event = 'qb-menu:client:closeMenu'
98 | }
99 |
100 | }
101 | exports['qb-menu']:openMenu(vehicleMenu)
102 | end
103 |
104 | -- Events
105 |
106 | RegisterNetEvent('qb-mechanicjob:client:SpawnListVehicle', function(data)
107 | local vehicleSpawnName = data.spawnName
108 | local spawnPoint = data.location
109 | SpawnListVehicle(vehicleSpawnName, spawnPoint)
110 | end)
111 |
112 | -- Main Thread
113 |
114 | CreateThread(function()
115 | for k, v in pairs(Config.Shops) do
116 | if v.showBlip then
117 | local blip = AddBlipForCoord(v.blipCoords)
118 | SetBlipSprite(blip, v.blipSprite)
119 | SetBlipDisplay(blip, 4)
120 | SetBlipScale(blip, 0.6)
121 | SetBlipColour(blip, v.blipColor)
122 | SetBlipAsShortRange(blip, true)
123 | BeginTextCommandSetBlipName('STRING')
124 | AddTextComponentString(v.shopLabel)
125 | EndTextCommandSetBlipName(blip)
126 | end
127 |
128 | exports['qb-target']:AddCircleZone(k .. '_duty', v.duty, 0.5, {
129 | name = k .. '_duty',
130 | debugPoly = false,
131 | useZ = true
132 | }, {
133 | options = { {
134 | type = 'server',
135 | event = 'QBCore:ToggleDuty',
136 | label = Lang:t('target.duty'),
137 | icon = 'fas fa-user-clock',
138 | job = v.managed and k or nil
139 | } },
140 | distance = 2.0
141 | })
142 |
143 | exports['qb-target']:AddCircleZone(k .. '_stash', v.stash, 0.5, {
144 | name = k .. '_stash',
145 | debugPoly = false,
146 | useZ = true
147 | }, {
148 | options = { {
149 | label = Lang:t('target.stash'),
150 | icon = 'fas fa-box-open',
151 | job = v.managed and k or nil,
152 | type = 'server',
153 | event = 'qb-mechanicjob:server:stash',
154 | } },
155 | distance = 2.0
156 | })
157 |
158 | exports['qb-target']:AddCircleZone(k .. '_paintbooth', v.paint, 0.5, {
159 | name = k .. '_paintbooth',
160 | debugPoly = false,
161 | useZ = true
162 | }, {
163 | options = { {
164 | label = Lang:t('target.paint'),
165 | icon = 'fas fa-fill-drip',
166 | job = v.managed and k or nil,
167 | action = function()
168 | PaintCategories() -- cosmetics.lua
169 | end
170 | } },
171 | distance = 2.0
172 | })
173 |
174 | exports['qb-target']:AddCircleZone(k .. '_spawner', v.vehicles.withdraw, 0.5, {
175 | name = k .. '_spawner',
176 | debugPoly = false,
177 | useZ = true
178 | }, {
179 | options = {
180 | {
181 | label = Lang:t('target.withdraw'),
182 | icon = 'fas fa-car',
183 | job = v.managed and k or nil,
184 | canInteract = function()
185 | local inVehicle = GetVehiclePedIsUsing(PlayerPedId())
186 | if inVehicle ~= 0 then return false end
187 | return true
188 | end,
189 | action = function()
190 | VehicleList(k)
191 | end
192 | },
193 | {
194 | label = Lang:t('target.deposit'),
195 | icon = 'fas fa-car',
196 | job = k,
197 | canInteract = function()
198 | local inVehicle = GetVehiclePedIsUsing(PlayerPedId())
199 | if inVehicle == 0 then return false end
200 | return true
201 | end,
202 | action = function()
203 | SetEntityAsMissionEntity(GetVehiclePedIsUsing(PlayerPedId()), true, true)
204 | DeleteVehicle(GetVehiclePedIsUsing(PlayerPedId()))
205 | end
206 | }
207 | },
208 | distance = 5.0
209 | })
210 | end
211 | end)
212 |
--------------------------------------------------------------------------------
/client/performance.lua:
--------------------------------------------------------------------------------
1 | local function GetArmor(vehicle)
2 | local armorMenu = { { header = 'Armor', isMenuHeader = true, icon = 'fas fa-shield' } }
3 | for i = -1, GetNumVehicleMods(vehicle, 16) - 1 do
4 | local header = Lang:t('menu.armor') .. ': ' .. (i >= 0 and i or Lang:t('menu.stock'))
5 | local disabled = GetVehicleMod(vehicle, 16) == i
6 | local armorItem = {
7 | header = header,
8 | disabled = disabled,
9 | params = {
10 | event = 'qb-mechanicjob:client:install',
11 | args = {
12 | upgradeType = 'armor',
13 | modType = 16,
14 | upgradeIndex = i,
15 | vehicle = vehicle
16 | }
17 | }
18 | }
19 | armorMenu[#armorMenu + 1] = armorItem
20 | end
21 | exports['qb-menu']:openMenu(armorMenu, true)
22 | end
23 |
24 | local function GetBrakes(vehicle)
25 | local brakesMenu = { { header = 'Brakes', isMenuHeader = true, icon = 'fas fa-car' } }
26 | for i = -1, GetNumVehicleMods(vehicle, 12) - 1 do
27 | local header = Lang:t('menu.brakes') .. ': ' .. (i >= 0 and i or Lang:t('menu.stock'))
28 | local disabled = GetVehicleMod(vehicle, 12) == i
29 | local brakesItem = {
30 | header = header,
31 | disabled = disabled,
32 | params = {
33 | event = 'qb-mechanicjob:client:install',
34 | args = {
35 | upgradeType = 'brakes',
36 | modType = 12,
37 | upgradeIndex = i,
38 | vehicle = vehicle
39 | }
40 | }
41 | }
42 | brakesMenu[#brakesMenu + 1] = brakesItem
43 | end
44 | exports['qb-menu']:openMenu(brakesMenu, true)
45 | end
46 |
47 | local function GetEngine(vehicle)
48 | local engineMenu = { { header = 'Engine', isMenuHeader = true, icon = 'fas fa-oil-can' } }
49 | for i = -1, GetNumVehicleMods(vehicle, 11) - 1 do
50 | local header = Lang:t('menu.engine') .. ': ' .. (i >= 0 and i or Lang:t('menu.stock'))
51 | local disabled = GetVehicleMod(vehicle, 11) == i
52 | local engineItem = {
53 | header = header,
54 | disabled = disabled,
55 | params = {
56 | event = 'qb-mechanicjob:client:install',
57 | args = {
58 | upgradeType = 'engine',
59 | modType = 11,
60 | upgradeIndex = i,
61 | vehicle = vehicle
62 | }
63 | }
64 | }
65 | engineMenu[#engineMenu + 1] = engineItem
66 | end
67 | exports['qb-menu']:openMenu(engineMenu, true)
68 | end
69 |
70 | local function GetSuspension(vehicle)
71 | local suspensionMenu = { { header = 'Suspension', isMenuHeader = true, icon = 'fas fa-car' } }
72 | for i = -1, GetNumVehicleMods(vehicle, 15) - 1 do
73 | local header = Lang:t('menu.suspension') .. ': ' .. (i >= 0 and i or Lang:t('menu.stock'))
74 | local disabled = GetVehicleMod(vehicle, 15) == i
75 | local suspensionItem = {
76 | header = header,
77 | disabled = disabled,
78 | params = {
79 | event = 'qb-mechanicjob:client:install',
80 | args = {
81 | upgradeType = 'suspension',
82 | modType = 15,
83 | upgradeIndex = i,
84 | vehicle = vehicle
85 | }
86 | }
87 | }
88 | suspensionMenu[#suspensionMenu + 1] = suspensionItem
89 | end
90 | exports['qb-menu']:openMenu(suspensionMenu, true)
91 | end
92 |
93 | local function GetTransmission(vehicle)
94 | local transmissionMenu = { { header = 'Transmission', isMenuHeader = true, icon = 'fas fa-oil-can' } }
95 | for i = -1, GetNumVehicleMods(vehicle, 13) - 1 do
96 | local header = Lang:t('menu.transmission') .. ': ' .. (i >= 0 and i or Lang:t('menu.stock'))
97 | local disabled = GetVehicleMod(vehicle, 13) == i
98 | local transmissionItem = {
99 | header = header,
100 | disabled = disabled,
101 | params = {
102 | event = 'qb-mechanicjob:client:install',
103 | args = {
104 | upgradeType = 'transmission',
105 | modType = 13,
106 | upgradeIndex = i,
107 | vehicle = vehicle
108 | }
109 | }
110 | }
111 | transmissionMenu[#transmissionMenu + 1] = transmissionItem
112 | end
113 | exports['qb-menu']:openMenu(transmissionMenu, true)
114 | end
115 |
116 | local function GetTurbo(vehicle)
117 | local turboMenu = { { header = Lang:t('menu.turbo'), isMenuHeader = true, icon = 'fas fa-bolt' } }
118 | local txt = Lang:t('menu.install_turbo')
119 | local turbo = IsToggleModOn(vehicle, 18)
120 | if turbo then txt = Lang:t('menu.uninstall_turbo') end
121 | local turboItem = {
122 | header = Lang:t('menu.turbo'),
123 | txt = txt,
124 | params = {
125 | event = 'qb-mechanicjob:client:install',
126 | args = {
127 | upgradeType = 'turbo',
128 | turbo = turbo,
129 | vehicle = vehicle
130 | }
131 | }
132 | }
133 | turboMenu[#turboMenu + 1] = turboItem
134 | exports['qb-menu']:openMenu(turboMenu, true)
135 | end
136 |
137 | -- Events
138 |
139 | RegisterNetEvent('qb-mechanicjob:client:install', function(data)
140 | local upgradeIndex = data.upgradeIndex
141 | local modType = data.modType
142 | local partName = data.upgradeType
143 | local animDict = 'mini@repair'
144 | local anim = 'fixing_a_player'
145 | local shouldToggleHood = false
146 | if partName == 'engine' or partName == 'transmission' or partName == 'turbo' then
147 | shouldToggleHood = true
148 | elseif partName == 'armor' or partName == 'brakes' or partName == 'suspension' then
149 | animDict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@'
150 | anim = 'machinic_loop_mechandplayer'
151 | end
152 | QBCore.Functions.Progressbar('mechanic_install', string.format(Lang:t('progress.installing'), partName), 5000, false, true, {
153 | disableMovement = true,
154 | disableCarMovement = true,
155 | disableMouse = false,
156 | disableCombat = true,
157 | }, {
158 | animDict = animDict,
159 | anim = anim,
160 | flags = 1,
161 | }, {
162 | model = 'imp_prop_impexp_span_03',
163 | bone = 28422,
164 | coords = vec3(0.06, 0.01, -0.02),
165 | rotation = vec3(0.0, 0.0, 0.0),
166 | }, {}, function()
167 | if partName == 'turbo' then
168 | ToggleVehicleMod(data.vehicle, 18, not data.turbo)
169 | else
170 | SetVehicleMod(data.vehicle, modType, upgradeIndex, false)
171 | end
172 | if shouldToggleHood then ToggleHood(data.vehicle) end
173 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'veh_' .. partName)
174 | QBCore.Functions.Notify(string.format(Lang:t('success.installed'), partName), 'success')
175 | end, function()
176 | if shouldToggleHood then ToggleHood(data.vehicle) end
177 | end)
178 | end)
179 |
180 | RegisterNetEvent('qb-mechanicjob:client:installPart', function(item)
181 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
182 | if vehicle == 0 or distance > 5.0 then return end
183 | if GetVehicleModKit(vehicle) ~= 0 then SetVehicleModKit(vehicle, 0) end
184 | if item == 'veh_armor' or item == 'veh_brakes' or item == 'veh_suspension' then
185 | if GetClosestWheel(vehicle) == -1 then return end
186 | if item == 'veh_armor' then GetArmor(vehicle) end
187 | if item == 'veh_brakes' then GetBrakes(vehicle) end
188 | if item == 'veh_suspension' then GetSuspension(vehicle) end
189 | elseif item == 'veh_engine' or item == 'veh_transmission' or item == 'veh_turbo' then
190 | if IsPedInAnyVehicle(PlayerPedId(), false) then return end
191 | if not IsNearBone(vehicle, 'engine') then return end
192 | if GetVehicleDoorAngleRatio(vehicle, 4) <= 0.0 then SetVehicleDoorOpen(vehicle, 4, false, false) end
193 | if item == 'veh_engine' then GetEngine(vehicle) end
194 | if item == 'veh_transmission' then GetTransmission(vehicle) end
195 | if item == 'veh_turbo' then GetTurbo(vehicle) end
196 | end
197 | end)
198 |
--------------------------------------------------------------------------------
/carcols_gen9.meta:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | EVehicleModelColorMetallic_normal
7 | POLICE_SCANNER_COLOUR_black
8 | none
9 |
10 |
11 | 223 Anodized Monochrome
12 | vehicle_paint_ramp_fubuki001
13 |
14 |
15 |
16 | EVehicleModelColorMetallic_normal
17 | POLICE_SCANNER_COLOUR_yellow
18 | none
19 |
20 |
21 | 224 Day Night Flip
22 | vehicle_paint_ramp_fubuki002
23 |
24 |
25 |
26 | EVehicleModelColorMetallic_normal
27 | POLICE_SCANNER_COLOUR_pink
28 | none
29 |
30 |
31 | 225 Verlierer Flip
32 | vehicle_paint_ramp_fubuki003
33 |
34 |
35 |
36 | EVehicleModelColorMetallic_normal
37 | POLICE_SCANNER_COLOUR_green
38 | none
39 |
40 |
41 | 226 Anodized Sprunk
42 | vehicle_paint_ramp_fubuki004
43 |
44 |
45 |
46 | EVehicleModelColorMetallic_normal
47 | POLICE_SCANNER_COLOUR_pink
48 | none
49 |
50 |
51 | 227 Vice City Flip
52 | vehicle_paint_ramp_fubuki005
53 |
54 |
55 |
56 | EVehicleModelColorMetallic_normal
57 | POLICE_SCANNER_COLOUR_blue
58 | POLICE_SCANNER_PREFIX_dark
59 |
60 |
61 | 228 Synthwave Pearl
62 | vehicle_paint_ramp_fubuki006
63 |
64 |
65 |
66 | EVehicleModelColorMetallic_normal
67 | POLICE_SCANNER_COLOUR_blue
68 | POLICE_SCANNER_PREFIX_light
69 |
70 |
71 | 229 Seasons Flip
72 | vehicle_paint_ramp_fubuki007
73 |
74 |
75 |
76 | EVehicleModelColorMetallic_normal
77 | POLICE_SCANNER_COLOUR_yellow
78 | none
79 |
80 |
81 | 230 TBOGT Pearl
82 | vehicle_paint_ramp_fubuki008
83 |
84 |
85 |
86 | EVehicleModelColorMetallic_normal
87 | POLICE_SCANNER_COLOUR_blue
88 | POLICE_SCANNER_PREFIX_light
89 |
90 |
91 | 231 Bubblegum Pearl
92 | vehicle_paint_ramp_fubuki009
93 |
94 |
95 |
96 | EVehicleModelColorMetallic_normal
97 | POLICE_SCANNER_COLOUR_red
98 | none
99 |
100 |
101 | 232 Rainbow Prismatic
102 | vehicle_paint_ramp_fubuki010
103 |
104 |
105 |
106 | EVehicleModelColorMetallic_normal
107 | POLICE_SCANNER_COLOUR_orange
108 | none
109 |
110 |
111 | 233 Sunset Flip
112 | vehicle_paint_ramp_fubuki011
113 |
114 |
115 |
116 | EVehicleModelColorMetallic_normal
117 | POLICE_SCANNER_COLOUR_blue
118 | none
119 |
120 |
121 | 234 Visions Prismatic
122 | vehicle_paint_ramp_fubuki012
123 |
124 |
125 |
126 | EVehicleModelColorMetallic_normal
127 | POLICE_SCANNER_COLOUR_brown
128 | none
129 |
130 |
131 | 235 Maziora Prismatic
132 | vehicle_paint_ramp_fubuki013
133 |
134 |
135 |
136 | EVehicleModelColorMetallic_normal
137 | POLICE_SCANNER_COLOUR_red
138 | POLICE_SCANNER_PREFIX_bright
139 |
140 |
141 | 236 3DGlasses Flip
142 | vehicle_paint_ramp_fubuki014
143 |
144 |
145 |
146 | EVehicleModelColorMetallic_normal
147 | POLICE_SCANNER_COLOUR_green
148 | none
149 |
150 |
151 | 237 Christmas Flip
152 | vehicle_paint_ramp_fubuki015
153 |
154 |
155 |
156 | EVehicleModelColorMetallic_normal
157 | POLICE_SCANNER_COLOUR_red
158 | none
159 |
160 |
161 | 238 Temperature Prismatic
162 | vehicle_paint_ramp_fubuki016
163 |
164 |
165 |
166 | EVehicleModelColorMetallic_normal
167 | POLICE_SCANNER_COLOUR_red
168 | none
169 |
170 |
171 | 239 HSW Flip
172 | vehicle_paint_ramp_fubuki017
173 |
174 |
175 |
176 | EVehicleModelColorMetallic_normal
177 | POLICE_SCANNER_COLOUR_pink
178 | none
179 |
180 |
181 | 240 Anodized Electro
182 | vehicle_paint_ramp_fubuki018
183 |
184 |
185 |
186 | EVehicleModelColorMetallic_normal
187 | POLICE_SCANNER_COLOUR_green
188 | none
189 |
190 |
191 | 241 Monika Prismatic
192 | vehicle_paint_ramp_fubuki019
193 |
194 |
195 |
196 | EVehicleModelColorMetallic_normal
197 | POLICE_SCANNER_COLOUR_blue
198 | POLICE_SCANNER_PREFIX_light
199 |
200 |
201 | 242 Anodized Fubuki
202 | vehicle_paint_ramp_fubuki020
203 |
204 |
205 |
--------------------------------------------------------------------------------
/client/repair.lua:
--------------------------------------------------------------------------------
1 | -- Functions
2 |
3 | local function RepairPart(vehicle, plate, component)
4 | local materials = Config.WearableParts[component].repair
5 | local hasItems = exports['qb-inventory']:HasItem(materials)
6 | if not hasItems then
7 | QBCore.Functions.Notify(Lang:t('warning.no_materials'), 'error')
8 | return
9 | end
10 | local componentLabel = Config.WearableParts[component].label or component
11 | ToggleHood(vehicle)
12 | QBCore.Functions.Progressbar('repairing_vehicle', string.format(Lang:t('progress.repairing'), componentLabel), 10000, false, true, {
13 | disableMovement = true,
14 | disableCarMovement = true,
15 | disableMouse = false,
16 | disableCombat = true,
17 | }, {
18 | animDict = 'mini@repair',
19 | anim = 'fixing_a_player',
20 | flags = 1,
21 | }, {
22 | model = 'imp_prop_impexp_span_03',
23 | bone = 28422,
24 | coords = vec3(0.06, 0.01, -0.02),
25 | rotation = vec3(0.0, 0.0, 0.0),
26 | }, {}, function()
27 | ToggleHood(vehicle)
28 | QBCore.Functions.Notify(string.format(Lang:t('success.part_repaired'), componentLabel), 'success')
29 | for item, amount in pairs(materials) do
30 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item, amount)
31 | end
32 | TriggerServerEvent('qb-mechanicjob:server:repairVehicleComponent', plate, component)
33 | end, function()
34 | ToggleHood(vehicle)
35 | end)
36 | end
37 |
38 | -- Events
39 |
40 | RegisterNetEvent('qb-mechanicjob:client:PartsMenu', function()
41 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
42 | if vehicle == 0 or distance > 5.0 then return end
43 | if not IsNearBone(vehicle, 'engine') then return end
44 | local plate = QBCore.Functions.GetPlate(vehicle)
45 | if not plate then return end
46 | local vehicleClass = GetVehicleClass(vehicle)
47 | if Config.IgnoreClasses[vehicleClass] then return end
48 | QBCore.Functions.TriggerCallback('qb-mechanicjob:server:getVehicleStatus', function(status)
49 | if not status then return end
50 |
51 | local function getHealthColor(health)
52 | if health <= 250 then
53 | return 'red'
54 | elseif health <= 500 then
55 | return 'yellow'
56 | else
57 | return 'green'
58 | end
59 | end
60 |
61 | local engineHealth = GetVehicleEngineHealth(vehicle)
62 | local bodyHealth = GetVehicleBodyHealth(vehicle)
63 | local petrolTankHealth = GetVehiclePetrolTankHealth(vehicle)
64 |
65 | local vehicleMenu = {
66 | { header = Lang:t('menu.vehicle_stats'), isMenuHeader = true, icon = 'fas fa-gears' },
67 | { header = Lang:t('menu.engine_health'), txt = Lang:t('menu.status') .. ': ' .. '' .. math.ceil((engineHealth / 1000) * 100) .. '%', isMenuHeader = true },
68 | { header = Lang:t('menu.body_health'), txt = Lang:t('menu.status') .. ': ' .. '' .. math.ceil((bodyHealth / 1000) * 100) .. '%', isMenuHeader = true },
69 | { header = Lang:t('menu.fuel_health'), txt = Lang:t('menu.status') .. ': ' .. '' .. math.ceil((petrolTankHealth / 1000) * 100) .. '%', isMenuHeader = true },
70 | }
71 |
72 | -- Components
73 | for component, value in pairs(status) do
74 | local color = 'green'
75 | local percentage = math.ceil((value / Config.WearableParts[component].maxValue) * 100)
76 |
77 | if value <= Config.DamageThreshold then
78 | color = 'red'
79 | elseif value <= Config.WarningThreshold then
80 | color = 'yellow'
81 | end
82 |
83 | local statusText = '' .. percentage .. '%'
84 |
85 | vehicleMenu[#vehicleMenu + 1] = {
86 | header = Config.WearableParts[component].label or component,
87 | txt = Lang:t('menu.status') .. ': ' .. statusText,
88 | params = {
89 | isAction = true,
90 | event = function()
91 | RepairPart(vehicle, plate, component)
92 | end,
93 | args = {}
94 | }
95 | }
96 | end
97 | vehicleMenu[#vehicleMenu + 1] = {
98 | header = Lang:t('menu.close'),
99 | params = {
100 | event = 'qb-menu:client:closeMenu'
101 | }
102 | }
103 | exports['qb-menu']:openMenu(vehicleMenu)
104 | end, plate)
105 | end)
106 |
107 | RegisterNetEvent('qb-mechanicjob:client:repairVehicle', function()
108 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
109 | if vehicle == 0 or distance > 5.0 then return end
110 | if not IsNearBone(vehicle, 'engine') then return end
111 | local engineHealth = GetVehicleEngineHealth(vehicle)
112 | local bodyHealth = GetVehicleBodyHealth(vehicle)
113 | ToggleHood(vehicle)
114 | QBCore.Functions.Progressbar('repairing_vehicle', Lang:t('progress.repair_vehicle'), 10000, false, true, {
115 | disableMovement = true,
116 | disableCarMovement = true,
117 | disableMouse = false,
118 | disableCombat = true,
119 | }, {
120 | animDict = 'mini@repair',
121 | anim = 'fixing_a_player',
122 | flags = 1,
123 | }, {
124 | model = 'imp_prop_impexp_span_03',
125 | bone = 28422,
126 | coords = vec3(0.06, 0.01, -0.02),
127 | rotation = vec3(0.0, 0.0, 0.0),
128 | }, {}, function()
129 | SetVehicleEngineHealth(vehicle, engineHealth + 100)
130 | SetVehicleBodyHealth(vehicle, bodyHealth + 100)
131 | ToggleHood(vehicle)
132 | QBCore.Functions.Notify(Lang:t('success.repaired'), 'success')
133 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'repairkit')
134 | end, function()
135 | ToggleHood(vehicle)
136 | end)
137 | end)
138 |
139 | RegisterNetEvent('qb-mechanicjob:client:repairVehicleFull', function()
140 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
141 | if vehicle == 0 or distance > 5.0 then return end
142 | if not IsNearBone(vehicle, 'engine') then return end
143 | ToggleHood(vehicle)
144 | QBCore.Functions.Progressbar('repairing_vehicle', Lang:t('progress.repair_vehicle'), 10000, false, true, {
145 | disableMovement = true,
146 | disableCarMovement = true,
147 | disableMouse = false,
148 | disableCombat = true,
149 | }, {
150 | animDict = 'mini@repair',
151 | anim = 'fixing_a_player',
152 | flags = 1,
153 | }, {
154 | model = 'imp_prop_impexp_span_03',
155 | bone = 28422,
156 | coords = vec3(0.06, 0.01, -0.02),
157 | rotation = vec3(0.0, 0.0, 0.0),
158 | }, {}, function()
159 | SetVehicleEngineHealth(vehicle, 1000.0)
160 | SetVehicleBodyHealth(vehicle, 1000.0)
161 | SetVehicleDeformationFixed(vehicle)
162 | SetVehiclePetrolTankHealth(vehicle, 1000.0)
163 | SetVehicleFixed(vehicle)
164 | ToggleHood(vehicle)
165 | QBCore.Functions.Notify(Lang:t('success.repaired'), 'success')
166 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'advancedrepairkit')
167 | end, function()
168 | ToggleHood(vehicle)
169 | end)
170 | end)
171 |
172 | RegisterNetEvent('qb-mechanicjob:client:repairTire', function()
173 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
174 | if vehicle == 0 or distance > 5.0 then return end
175 | local closestWheel = GetClosestWheel(vehicle)
176 | if not closestWheel then return end
177 | QBCore.Functions.Progressbar('repairing_tire', Lang:t('progress.repair_tire'), 10000, false, true, {
178 | disableMovement = true,
179 | disableCarMovement = true,
180 | disableMouse = false,
181 | disableCombat = true,
182 | }, {
183 | animDict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
184 | anim = 'machinic_loop_mechandplayer',
185 | flags = 1,
186 | }, {
187 | model = 'prop_wheel_tyre',
188 | bone = 60309,
189 | coords = vec3(-0.05, 0.16, 0.32),
190 | rotation = vec3(-130.0, -55.0, 150.0),
191 | }, {}, function()
192 | SetVehicleTyreFixed(vehicle, closestWheel)
193 | QBCore.Functions.Notify(Lang:t('success.tire_repaired'), 'success')
194 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'tirerepairkit')
195 | end)
196 | end)
197 |
198 | RegisterNetEvent('qb-mechanicjob:client:cleanVehicle', function()
199 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
200 | if vehicle == 0 or distance > 5.0 then return end
201 | QBCore.Functions.Progressbar('cleaning_vehicle', Lang:t('progress.cleaning'), 10000, false, true, {
202 | disableMovement = true,
203 | disableCarMovement = true,
204 | disableMouse = false,
205 | disableCombat = true,
206 | }, {
207 | animDict = 'amb@world_human_maid_clean@',
208 | anim = 'base',
209 | flags = 1,
210 | }, {
211 | model = 'prop_sponge_01',
212 | bone = 28422,
213 | coords = vec3(0.0, 0.0, -0.01),
214 | rotation = vec3(90.0, 0.0, 0.0),
215 | }, {}, function()
216 | SetVehicleDirtLevel(vehicle, 0.0)
217 | QBCore.Functions.Notify(Lang:t('success.cleaned'), 'success')
218 | TriggerServerEvent('qb-mechanicjob:server:removeItem', 'cleaningkit')
219 | end)
220 | end)
221 |
222 | RegisterNetEvent('qb-mechanicjob:client:fixEverything', function()
223 | QBCore.Functions.TriggerCallback('qb-mechanicjob:server:hasPermission', function(hasPermission)
224 | if not hasPermission then return end
225 | local vehicle = GetVehiclePedIsUsing(PlayerPedId())
226 | SetVehicleUndriveable(vehicle, false)
227 | WashDecalsFromVehicle(vehicle, 1.0)
228 | SetVehicleEngineHealth(vehicle, 1000.0)
229 | SetVehicleBodyHealth(vehicle, 1000.0)
230 | SetVehiclePetrolTankHealth(vehicle, 1000.0)
231 | SetVehicleDirtLevel(vehicle, 0.0)
232 | SetVehicleDeformationFixed(vehicle)
233 | SetVehicleFixed(vehicle)
234 | for i = 0, 5 do
235 | SetVehicleTyreFixed(vehicle, i)
236 | end
237 | for i = 0, 7 do
238 | FixVehicleWindow(vehicle, i)
239 | end
240 | exports[Config.FuelResource]:SetFuel(vehicle, 100)
241 | QBCore.Functions.Notify(Lang:t('success.repaired'), 'success')
242 | end)
243 | end)
244 |
--------------------------------------------------------------------------------
/html/script.js:
--------------------------------------------------------------------------------
1 | const navbarOptions = {
2 | // https://forums.gta5-mods.com/topic/3842/tutorial-handling-meta
3 | power: [
4 | { id: "fMass", label: "Mass", description: "The weight of the vehicle in kg", min: 0, max: 10000 },
5 | { id: "fInitialDragCoeff", label: "Initial Drag Coefficient", description: "Increase to simulate aerodynamic drag", min: 0, max: 100 },
6 | { id: "fDownforceModifier", label: "Downforce Modifier", description: "Amount of downforce applied to the vehicle", min: 0, max: 100 },
7 | { id: "nInitialDriveGears", label: "Drive Gears", description: "Amount of vehicle gears", min: 1, max: 10 },
8 | { id: "fInitialDriveForce", label: "Drive Force", description: "Transmission force ouput", min: 0, max: 100 },
9 | { id: "fDriveInertia", label: "Drive Inertia", description: "How fast vehicle redlines", min: 0, max: 2 },
10 | { id: "fDriveBiasFront", label: "Drive Bias Front", description: "RWD: 0.0 | AWD: 0.5 | FWD: 1.0", min: 0, max: 1 },
11 | { id: "fInitialDriveMaxFlatVel", label: "Max Drive Velocity", description: "Speed at redline in top gear", min: 0, max: 1000 },
12 | { id: "fClutchChangeRateScaleUpShift", label: "Clutch Speed Upshift", description: "Higher value = faster shifts", min: 0, max: 100 },
13 | { id: "fClutchChangeRateScaleDownShift", label: "Clutch Speed Downshift", description: "Higher value = faster shifts", min: 0, max: 100 },
14 | ],
15 | braking: [
16 | { id: "fSteeringLock", label: "Steering Lock", description: "Maximum steering angle of the wheels", min: 0, max: 1 },
17 | { id: "fBrakeForce", label: "Brake Force", description: "Overall braking power", min: 0, max: 100 },
18 | { id: "fBrakeBiasFront", label: "Brake Bias Front", description: "Rear: 0.0 | Equal: 0.5 | Front: 1.0", min: 0, max: 1 },
19 | { id: "fHandBrakeForce", label: "Hand Brake Force", description: "Sets the strength of the handbrake", min: 0, max: 100 },
20 | ],
21 | traction: [
22 | { id: "fTractionCurveMax", label: "Max Traction Curve", description: "Cornering grip of the vehicle", min: 0, max: 100 },
23 | { id: "fTractionCurveMin", label: "Min Traction Curve", description: "Accelerating/braking grip of the vehicle", min: 0, max: 100 },
24 | { id: "fTractionCurveLateral", label: "Lateral Traction Curve", description: "Shape of lateral traction curve", min: 0, max: 100 },
25 | { id: "fTractionSpringDeltaMax", label: "Max Traction Spring Delta", description: "Distance above the ground the car will lose traction", min: 0, max: 100 },
26 | { id: "fLowSpeedTractionLossMult", label: "Low Speed Traction Loss Multiplier", description: "Lower: less burnout | Higher: more burnout", min: 0, max: 100 },
27 | { id: "fTractionBiasFront", label: "Traction Bias Front", description: "Rear: 0.1 | Equal: 0.5 | Front: 0.99", min: 0, max: 1 },
28 | { id: "fCamberStiffnesss", label: "Camber Stiffness", description: "Drifting grip", min: 0, max: 100 },
29 | { id: "fTractionLossMult", label: "Traction Loss Multiplier", description: "Grip on asphalt and mud", min: 0, max: 100 },
30 | ],
31 | suspension: [
32 | { id: "vecCentreOfMassOffset", label: "Centre of Mass Offset", description: "Shifts the center of gravity right,forwards,upwards", min: 0, max: 100 },
33 | { id: "vecInertiaMultiplier", label: "Inertia Multiplier", description: "Rotational inertia", min: 0, max: 100 },
34 | { id: "fSuspensionForce", label: "Suspension Force", description: "Suspension strength", min: 0, max: 100 },
35 | { id: "fSuspensionCompDamp", label: "Compression Damping", description: "Bigger values = stiffer", min: 0, max: 100 },
36 | { id: "fSuspensionReboundDamp", label: "Rebound Damping", description: "Bigger values = stiffer", min: 0, max: 100 },
37 | { id: "fSuspensionUpperLimit", label: "Suspension Upper Limit", description: "Visual limit of how far can wheels move up", min: 0, max: 100 },
38 | { id: "fSuspensionLowerLimit", label: "Suspension Lower Limit", description: "Visual limit of how far can wheels move down", min: 0, max: 100 },
39 | { id: "fSuspensionRaise", label: "Suspension Raise", description: "Body height off the wheels", min: 0, max: 100 },
40 | { id: "fSuspensionBiasFront", label: "Suspension Bias Front", description: "Front/back suspension strength", min: 0, max: 1 },
41 | { id: "fAntiRollBarForce", label: "Anti Roll Bar Force", description: "Larger numbers = less body roll", min: 0, max: 100 },
42 | { id: "fAntiRollBarBiasFront", label: "Anti Roll Bar Bias Front", description: "Front: 0 | Rear: 1", min: 0, max: 1 },
43 | { id: "fRollCentreHeightFront", label: "Roll Centre Height Front", description: "Larger numbers = less rollovers", min: -0.15, max: 0.15 },
44 | { id: "fRollCentreHeightRear", label: "Roll Centre Height Rear", description: "Larger numbers = less rollovers", min: -0.15, max: 0.15 },
45 | ],
46 | miscellaneous: [
47 | { id: "fPercentSubmerged", label: "Percent Submerged", description: "Percent submerged before considered drowned", min: 0, max: 100 },
48 | { id: "fCollisionDamageMult", label: "Collision Damage Multiplier", description: "Multipy collision damage", min: 0, max: 10 },
49 | { id: "fDeformationDamageMult", label: "Deformation Damage Multiplier", description: "Multipy body damage", min: 0, max: 10 },
50 | { id: "fWeaponDamageMult", label: "Weapon Damage Multiplier", description: "Multipy weapon damage", min: 0, max: 10 },
51 | { id: "fEngineDamageMult", label: "Engine Damage Multiplier", description: "Multipy engine damage", min: 0, max: 10 },
52 | { id: "fPetrolTankVolume", label: "Petrol Tank Volume", description: "Amount of petrol that will leak after damaging a vehicle's tank", min: 0, max: 100 },
53 | { id: "fOilVolume", label: "Oil Volume", description: "Amount of oil", min: 0, max: 100 },
54 | { id: "nMonetaryValue", label: "Monetary Value", description: "Determine NPC reaction to vehicle", min: 0, max: 1000000 },
55 | ],
56 | };
57 |
58 | let currentStats = {};
59 |
60 | const generateNavbarItems = () => {
61 | const navbar = document.querySelector(".navbar");
62 | navbar.innerHTML = "";
63 |
64 | Object.keys(navbarOptions).forEach((option) => {
65 | const button = document.createElement("button");
66 | button.classList.add("nav-item");
67 | button.id = option;
68 | button.textContent = option.charAt(0).toUpperCase() + option.slice(1);
69 | navbar.appendChild(button);
70 | });
71 | };
72 |
73 | const displayFieldsForNavbarOption = (option) => {
74 | const contentArea = document.getElementById("content-area");
75 | contentArea.innerHTML = "";
76 | const selectedOptions = navbarOptions[option];
77 |
78 | selectedOptions.forEach((option) => {
79 | const inputContainer = document.createElement("div");
80 | inputContainer.classList.add("input-container");
81 |
82 | const inputLabel = document.createElement("label");
83 | inputLabel.classList.add("input-label");
84 | inputLabel.htmlFor = option.id;
85 | inputLabel.textContent = option.label || option.id;
86 |
87 | const numberInput = document.createElement("input");
88 | numberInput.type = "number";
89 | numberInput.id = option.id;
90 | numberInput.classList.add("number-input");
91 | numberInput.value = currentStats[option.id] !== undefined ? currentStats[option.id] : "";
92 |
93 | if (option.min !== undefined) {
94 | numberInput.min = option.min;
95 | }
96 | if (option.max !== undefined) {
97 | numberInput.max = option.max;
98 | }
99 |
100 | if (option.description) {
101 | inputLabel.addEventListener("mouseover", () => {
102 | document.getElementById("table-description").textContent = option.description;
103 | });
104 |
105 | inputLabel.addEventListener("mouseout", () => {
106 | document.getElementById("table-description").textContent = "";
107 | });
108 | }
109 |
110 | inputContainer.appendChild(inputLabel);
111 | inputContainer.appendChild(numberInput);
112 | contentArea.appendChild(inputContainer);
113 | });
114 | };
115 |
116 | const openTuner = (stats) => {
117 | currentStats = stats;
118 | document.querySelector(".tablet").style.display = "block";
119 | generateNavbarItems();
120 | displayFieldsForNavbarOption("power");
121 | };
122 |
123 | const saveSettings = () => {
124 | const contentArea = document.getElementById("content-area");
125 | let data = {};
126 | let isInputValid = true;
127 |
128 | const inputContainers = contentArea.querySelectorAll(".input-container");
129 | inputContainers.forEach((container) => {
130 | const inputElement = container.querySelector(".number-input");
131 | if (inputElement) {
132 | const value = parseFloat(inputElement.value);
133 | const min = parseFloat(inputElement.min);
134 | const max = parseFloat(inputElement.max);
135 |
136 | if (value < min || value > max) {
137 | console.log(inputElement.id + " out of range");
138 | isInputValid = false;
139 | } else {
140 | data[inputElement.id] = value;
141 | }
142 | }
143 | });
144 |
145 | if (isInputValid) {
146 | fetch("https://qb-mechanicjob/saveTune", {
147 | method: "POST",
148 | headers: {
149 | "Content-Type": "application/json",
150 | },
151 | body: JSON.stringify(data),
152 | });
153 | }
154 | };
155 |
156 | const resetSettings = () => {
157 | fetch("https://qb-mechanicjob/reset", { method: "POST" });
158 | closeTuner();
159 | };
160 |
161 | const closeTuner = () => {
162 | document.querySelector(".tablet").style.display = "none";
163 | fetch("https://qb-mechanicjob/closeTuner", { method: "POST" });
164 | };
165 |
166 | document.addEventListener("click", function (event) {
167 | const targetId = event.target.id;
168 | const targetClass = event.target.className;
169 |
170 | if (targetClass === "nav-item") {
171 | displayFieldsForNavbarOption(targetId);
172 | return;
173 | }
174 |
175 | switch (targetId) {
176 | case "save-button":
177 | saveSettings();
178 | break;
179 | case "reset-button":
180 | resetSettings();
181 | break;
182 | case "cancel":
183 | closeTuner();
184 | break;
185 | }
186 | });
187 |
188 | document.addEventListener("keydown", function (event) {
189 | if (event.key === "Escape") {
190 | closeTuner();
191 | }
192 | });
193 |
194 | window.addEventListener("message", function (event) {
195 | var eventData = event.data;
196 | if (eventData.action == "openTuner") {
197 | openTuner(eventData.stats);
198 | }
199 | });
200 |
--------------------------------------------------------------------------------
/.github/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing to QBCore
2 |
3 | First of all, thank you for taking the time to contribute!
4 |
5 | These guidelines will help you help us in the best way possible regardless of your skill level. We ask that you try to read everything related to the way you'd like to contribute and try and use your best judgement for anything not covered.
6 |
7 | ### Table of Contents
8 |
9 | [Code of Conduct](#code-of-conduct)
10 |
11 | [I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
12 |
13 | [How Can I Contribute?](#how-can-i-contribute)
14 | * [Reporting Bugs](#reporting-bugs)
15 | * [Suggesting Features / Enhancements](#suggesting-features--enhancements)
16 | * [Your First Code Contribution](#your-first-code-contribution)
17 | * [Pull Requests](#pull-requests)
18 |
19 | [Styleguides](#styleguides)
20 | * [Git Commit Messages](#git-commit-messages)
21 | * [Lua Styleguide](#lua-styleguide)
22 | * [JavaScript Styleguide](#javascript-styleguide)
23 |
24 |
25 |
26 | ## Code of Conduct
27 |
28 | - Refrain from using languages other than English.
29 | - Refrain from discussing any politically charged or inflammatory topics.
30 | - Uphold mature conversations and respect each other; excessive profanity, hate speech or any kind of harassment will not be tolerated.
31 | - No advertising of any kind.
32 | - Follow these guidelines.
33 | - Do not mention members of github unless a question is directed at them and can't be answered by anyone else.
34 | - Do not mention any of the development team for any reason. We will read things as we get to them.
35 |
36 | ## I don't want to read this whole thing I just have a question!!!
37 |
38 | > **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
39 |
40 | * [QBCore Website](https://qbcore.org)
41 | * [QBCore Discord](https://discord.gg/qbcore)
42 | * [FiveM Discord - #qbcore channel](https://discord.gg/fivem)
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | ## How Can I Contribute?
54 |
55 | ### Reporting Bugs
56 |
57 | The easiest way to contribute for most people is just to report bugs you find cause if nobody reports it there's a chance we'll never know it exists and then we'll never fix it.
58 |
59 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out the bug-report template with the information it asks for helps us resolve issues faster.
60 |
61 | > **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
62 |
63 | #### Before Submitting A Bug Report
64 |
65 | * **Check the docs** There's a chance what you see as a bug might just work differently than you expect and if you think it could work better consider a feature enhancement report instead.
66 | * **Search the [discord](https://discord.gg/qbcore)** to see if anyone else has run into the issue and see if it was solved through user error or code changes. (if the code change isn't pending a PR and you know what you're doing consider submitting one following [Pull Requests](#pull-requests) )
67 | * **Determine which resource the problem should be reported in**. If the bug is related to the inventory for example report this bug under qb-inventory rather than under qb-core or some other resource.
68 | * **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
69 |
70 | #### How Do I Submit A (Good) Bug Report?
71 |
72 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your bug is related to, create an issue on that repository and provide the following information by filling in bug-report template.
73 |
74 | Explain the problem and include additional details to help maintainers reproduce the problem:
75 |
76 | * **Use a clear and descriptive title** for the issue to identify the problem.
77 | * **Describe the exact steps which reproduce the problem** in as many details as possible.
78 | * **Provide specific examples to demonstrate the steps**. If something happened with only a specific group or single item but not others, specify that.
79 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
80 | * **Explain which behavior you expected to see instead and why.**
81 | * **Include screenshots** which show the specific bug in action or before and after.
82 | * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
83 |
84 | Provide more context by answering these questions if possible:
85 |
86 | * **Did the problem start happening recently** (e.g. after updating to a new version of QBCore?) or was this always a problem?
87 | * If the problem started happening recently, **can you reproduce the problem in an older version of QBCore?** What's the most recent commit in which the problem doesn't happen?
88 | * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
89 |
90 | Include details about your setup:
91 |
92 | * **When was your QBCore last updated?**
93 | * **What OS is the server running on**?
94 | * **Which *extra* resources do you have installed?**
95 |
96 |
97 | ---
98 |
99 |
100 | ### Suggesting Features / Enhancements
101 |
102 | This section guides you through submitting an enhancement suggestion for QBCore, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion.
103 |
104 | Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in feature request template, including the steps that you imagine you would take if the feature you're requesting existed.
105 |
106 | #### Before Submitting An Enhancement Suggestion
107 |
108 | * **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to qbcore that people don't realize so take a look through the docs and stuff to make sure it's not already there.
109 | * **Check if there's already PR which provides that enhancement.**
110 | * **Determine which resource the enhancement should be suggested in.** if it fits with another resource suggest it in that resource. if it would be it's own resource suggest it in the main qb-core repository.
111 | * **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
112 |
113 | #### How Do I Submit A (Good) Enhancement Suggestion?
114 |
115 | Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your enhancement suggestion is related to, create an issue on that repository and provide the following information:
116 |
117 | * **Use a clear and descriptive title** for the issue to identify the suggestion.
118 | * **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
119 | * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
120 | * **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
121 | * **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of QBCore which the suggestion is related to.
122 | * **Explain why this enhancement would be useful.**
123 | * **Be creative and unique.** Stealing ideas from popular servers 1:1 detail isn't going to get accepted.
124 |
125 |
126 | ---
127 |
128 |
129 |
130 | ### Your First Code Contribution
131 |
132 | Unsure where to begin contributing to QBCore? You can start by looking through these `beginner` and `help-wanted` issues.
133 |
134 |
135 |
136 | ---
137 |
138 |
139 | ### Pull Requests
140 |
141 | The process described here has several goals:
142 |
143 | - Maintain QBCore's quality.
144 | - Fix problems that are important to users.
145 | - Engage the community in working toward the best possible QBCore.
146 | - Enable a sustainable system for QBCore's maintainers to review contributions.
147 |
148 | Please follow these steps to have your contribution considered by the maintainers:
149 |
150 | 1. Follow all instructions in The Pull Request template.
151 | 2. Follow the [styleguides](#styleguides).
152 | 3. Await review by the reviewer(s).
153 |
154 | While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
155 |
156 |
157 | ---
158 |
159 | ## Styleguides
160 |
161 | ### Git Commit Messages
162 |
163 | * Limit the first line to 72 characters or less.
164 | * Reference issues and pull requests liberally after the first line.
165 | * Consider starting the commit message with an applicable emoji:
166 | * :art: `:art:` when improving the format/structure of the code
167 | * :racehorse: `:racehorse:` when improving performance
168 | * :memo: `:memo:` when writing docs
169 | * :bug: `:bug:` when fixing a bug
170 | * :fire: `:fire:` when removing code or files
171 | * :white_check_mark: `:white_check_mark:` when adding tests
172 | * :lock: `:lock:` when dealing with security
173 | * :arrow_up: `:arrow_up:` when upgrading dependencies
174 | * :arrow_down: `:arrow_down:` when downgrading dependencies
175 | * :shirt: `:shirt:` when removing linter warnings
176 |
177 | ### Lua Styleguide
178 |
179 | All lua code should be done using all the best practices of proper lua using the easiest to read yet fastest/most optimized methods of execution.
180 |
181 | - Use 4 Space indentation
182 | - Aim for lua 5.4 (include `lua54 'yes'` in the fxmanifest.lua)
183 | - Use `PlayerPedId()` instead of `GetPlayerPed(-1)`
184 | - Use `#(vector3 - vector3)` instead of `GetDistanceBetweenCoords()`
185 | - Don't create unnecessary threads. always try to find a better method of triggering events
186 | - Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables
187 | - For distance checking loops set longer waits if you're outside of a range
188 | - Job specific loops should only run for players with that job, don't waste cycles
189 | - When possible don't trust the client, esspecially with transactions
190 | - Balance security and optimizations
191 | - [Consider this Lua Performance guide](https://springrts.com/wiki/Lua_Performance)
192 | - Use local varriables everywhere possible
193 | - Make use of config options where it makes sense making features optional or customizable
194 | - Instead of `table.insert(myTable, "Value")` use `myTable[#myTable + 1] = "Value"`
195 | - Instead of `table.insert(ages, "bob", 30)` use `ages["bob"] = 30`
196 |
197 |
198 | ### JavaScript Styleguide
199 |
200 | - Use 4 Space indentation
201 | - Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables.
202 |
--------------------------------------------------------------------------------
/server/main.lua:
--------------------------------------------------------------------------------
1 | local QBCore = exports['qb-core']:GetCoreObject()
2 | local vehicleComponents = {}
3 | local drivingDistance = {}
4 | local tunedVehicles = {}
5 | local nitrousVehicles = {}
6 |
7 | -- Functions
8 |
9 | function Trim(plate)
10 | return (string.gsub(plate, '^%s*(.-)%s*$', '%1'))
11 | end
12 |
13 | local function IsVehicleOwned(plate)
14 | local result = MySQL.scalar.await('SELECT 1 from player_vehicles WHERE plate = ?', { plate })
15 | if result then return true end
16 | return false
17 | end
18 |
19 | local function StartParticles(coords, netId, color)
20 | for _, playerId in ipairs(GetPlayers()) do
21 | local playerPed = GetPlayerPed(playerId)
22 | local playerCoords = GetEntityCoords(playerPed)
23 | local distance = #(coords - playerCoords)
24 | if distance < 10 then
25 | Player(playerId).state:set('paint_particles', true, false)
26 | TriggerClientEvent('qb-mechanicjob:client:startParticles', playerId, netId, color)
27 | end
28 | end
29 | end
30 |
31 | local function StopParticles()
32 | for _, playerId in ipairs(GetPlayers()) do
33 | if Player(playerId).state.paint_particles then
34 | Player(playerId).state:set('paint_particles', false, false)
35 | TriggerClientEvent('qb-mechanicjob:client:stopParticles', playerId)
36 | end
37 | end
38 | end
39 |
40 | local function LerpColor(colorFrom, colorTo, fraction)
41 | return {
42 | r = colorFrom.r + (colorTo.r - colorFrom.r) * fraction,
43 | g = colorFrom.g + (colorTo.g - colorFrom.g) * fraction,
44 | b = colorFrom.b + (colorTo.b - colorFrom.b) * fraction
45 | }
46 | end
47 |
48 | local function TransitionVehicleColor(vehicle, section, currentColor, targetColor, duration)
49 | local startTime = GetGameTimer()
50 | local endTime = startTime + duration
51 | while GetGameTimer() <= endTime do
52 | local currentTime = GetGameTimer()
53 | local fraction = (currentTime - startTime) / duration
54 | local newColor = LerpColor(currentColor, targetColor, fraction)
55 | if section == 'primary' then
56 | SetVehicleCustomPrimaryColour(vehicle, math.floor(newColor.r), math.floor(newColor.g), math.floor(newColor.b))
57 | elseif section == 'secondary' then
58 | SetVehicleCustomSecondaryColour(vehicle, math.floor(newColor.r), math.floor(newColor.g), math.floor(newColor.b))
59 | end
60 | Wait(0)
61 | end
62 | end
63 |
64 | local function GetPaintTypeIndex(type)
65 | if type == 'metallic' then return 0 end
66 | if type == 'matte' then return 12 end
67 | if type == 'chrome' then return 120 end
68 | return 0
69 | end
70 |
71 | -- Callbacks
72 |
73 | QBCore.Functions.CreateCallback('qb-mechanicjob:server:getnitrousVehicles', function(_, cb)
74 | cb(nitrousVehicles)
75 | end)
76 |
77 | QBCore.Functions.CreateCallback('qb-mechanicjob:server:checkTune', function(_, cb, plate)
78 | if not tunedVehicles[plate] then cb(false) end
79 | cb(tunedVehicles[plate])
80 | end)
81 |
82 | QBCore.Functions.CreateCallback('qb-mechanicjob:server:getVehicleStatus', function(_, cb, plate)
83 | if not vehicleComponents[plate] then cb(false) end
84 | cb(vehicleComponents[plate])
85 | end)
86 |
87 | QBCore.Functions.CreateCallback('qb-mechanicjob:server:hasPermission', function(source, cb)
88 | if QBCore.Functions.HasPermission(source, { 'god', 'admin', 'command' }) then
89 | cb(true)
90 | else
91 | cb(false)
92 | end
93 | end)
94 |
95 | -- Events
96 |
97 | RegisterNetEvent('qb-mechanicjob:server:stash', function(data)
98 | local src = source
99 | local shopName = data.job
100 | if not Config.Shops[shopName] then return end
101 | local Player = QBCore.Functions.GetPlayer(src)
102 | if not Player then return end
103 | if Config.Shops[shopName].managed and Player.PlayerData.job.name ~= shopName then return end
104 | local playerPed = GetPlayerPed(src)
105 | local playerCoords = GetEntityCoords(playerPed)
106 | local stashCoords = Config.Shops[shopName].stash
107 | if #(playerCoords - stashCoords) < 2.5 then
108 | local stashName = shopName .. '_stash'
109 | exports['qb-inventory']:OpenInventory(src, stashName, {
110 | maxweight = 4000000,
111 | slots = 100,
112 | })
113 | end
114 | end)
115 |
116 | RegisterNetEvent('qb-mechanicjob:server:sprayVehicleCustom', function(netId, section, type, color)
117 | local vehicle = NetworkGetEntityFromNetworkId(netId)
118 | local vehicleCoords = GetEntityCoords(vehicle)
119 | local paintTypeIndex = GetPaintTypeIndex(type)
120 | FreezeEntityPosition(vehicle, true)
121 | StartParticles(vehicleCoords, netId, color)
122 | local r, g, b
123 | if section == 'primary' then
124 | local _, colorSecondary = GetVehicleColours(vehicle)
125 | SetVehicleColours(vehicle, paintTypeIndex, colorSecondary)
126 | r, g, b = GetVehicleCustomPrimaryColour(vehicle)
127 | elseif section == 'secondary' then
128 | local colorPrimary, _ = GetVehicleColours(vehicle)
129 | SetVehicleColours(vehicle, colorPrimary, paintTypeIndex)
130 | r, g, b = GetVehicleCustomSecondaryColour(vehicle)
131 | end
132 | local currentColor = { r = r, g = g, b = b }
133 | TransitionVehicleColor(vehicle, section, currentColor, color, Config.PaintTime * 1000)
134 | StopParticles()
135 | FreezeEntityPosition(vehicle, false)
136 | end)
137 |
138 | RegisterNetEvent('qb-mechanicjob:server:sprayVehicle', function(netId, primary, secondary, pearlescent, wheel, colors)
139 | local vehicle = NetworkGetEntityFromNetworkId(netId)
140 | local vehicleCoords = GetEntityCoords(vehicle)
141 | FreezeEntityPosition(vehicle, true)
142 |
143 | if colors.primary then
144 | StartParticles(vehicleCoords, netId, colors.primary)
145 | Wait(Config.PaintTime * 1000)
146 | -- local _, colorSecondary = GetVehicleColours(vehicle)
147 | -- ClearVehicleCustomPrimaryColour(vehicle) -- does not exist yet
148 | -- SetVehicleColours(vehicle, tonumber(primary), colorSecondary)
149 | TriggerClientEvent('qb-mechanicjob:client:vehicleSetColors', -1, netId, 'primary', primary)
150 | StopParticles()
151 | end
152 |
153 | if colors.secondary then
154 | StartParticles(vehicleCoords, netId, colors.secondary)
155 | Wait(Config.PaintTime * 1000)
156 | -- local colorPrimary, _ = GetVehicleColours(vehicle)
157 | -- ClearVehicleCustomSecondaryColour(vehicle) -- does not exist yet
158 | -- SetVehicleColours(vehicle, colorPrimary, tonumber(secondary))
159 | TriggerClientEvent('qb-mechanicjob:client:vehicleSetColors', -1, netId, 'secondary', secondary)
160 | StopParticles()
161 | end
162 |
163 | if colors.pearlescent then
164 | StartParticles(vehicleCoords, netId, colors.pearlescent)
165 | Wait(Config.PaintTime * 1000)
166 | -- local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle) -- does not exist yet
167 | -- SetVehicleExtraColours(vehicle, tonumber(pearlescent) or pearlescentColor, tonumber(wheel) or wheelColor) -- does not exist yet
168 | TriggerClientEvent('qb-mechanicjob:client:vehicleSetColors', -1, netId, 'pearlescent', pearlescent)
169 | StopParticles()
170 | end
171 |
172 | if colors.wheel then
173 | StartParticles(vehicleCoords, netId, colors.wheel)
174 | Wait(Config.PaintTime * 1000)
175 | -- local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle) -- does not exist yet
176 | -- SetVehicleExtraColours(vehicle, tonumber(pearlescent) or pearlescentColor, tonumber(wheel) or wheelColor) -- does not exist yet
177 | TriggerClientEvent('qb-mechanicjob:client:vehicleSetColors', -1, netId, 'wheel', wheel)
178 | StopParticles()
179 | end
180 |
181 | FreezeEntityPosition(vehicle, false)
182 | end)
183 |
184 | RegisterNetEvent('qb-mechanicjob:server:syncNitrous', function(plate, hasnitro, level)
185 | if not nitrousVehicles[plate] then
186 | nitrousVehicles[plate] = { hasnitro = hasnitro, level = level }
187 | else
188 | nitrousVehicles[plate].hasnitro = hasnitro
189 | nitrousVehicles[plate].level = level
190 | end
191 | end)
192 |
193 | RegisterNetEvent('qb-mechanicjob:server:syncNitrousFlames', function(netId, toggle)
194 | TriggerClientEvent('qb-mechanicjob:client:syncNitrousFlames', -1, netId, toggle)
195 | end)
196 |
197 | RegisterNetEvent('qb-mechanicjob:server:tuneStatus', function(plate)
198 | if not tunedVehicles[plate] then
199 | tunedVehicles[plate] = true
200 | end
201 | end)
202 |
203 | RegisterNetEvent('qb-mechanicjob:server:SaveVehicleProps', function(vehicleProps)
204 | if IsVehicleOwned(vehicleProps.plate) then
205 | MySQL.update('UPDATE player_vehicles SET mods = ? WHERE plate = ?', { json.encode(vehicleProps), vehicleProps.plate })
206 | end
207 | end)
208 |
209 | RegisterNetEvent('qb-mechanicjob:server:repairVehicleComponent', function(plate, component)
210 | if plate and component then
211 | if not vehicleComponents[plate] then return end
212 | if vehicleComponents[plate][component] then
213 | vehicleComponents[plate][component] = 100
214 | end
215 | end
216 | end)
217 |
218 | RegisterNetEvent('qb-mechanicjob:server:updateVehicleComponents', function(plate, componentData)
219 | if plate and componentData then
220 | if vehicleComponents[plate] then
221 | vehicleComponents[plate] = componentData
222 | else
223 | vehicleComponents[plate] = componentData
224 | end
225 | end
226 | local isOwned = IsVehicleOwned(plate)
227 | if isOwned then MySQL.update('UPDATE player_vehicles SET status = ? WHERE plate = ?', { json.encode(vehicleComponents[plate]), plate }) end
228 | end)
229 |
230 | RegisterNetEvent('qb-mechanicjob:server:updateDrivingDistance', function(plate, distance)
231 | if plate and distance then
232 | if drivingDistance[plate] then
233 | drivingDistance[plate] = drivingDistance[plate] + distance
234 | else
235 | drivingDistance[plate] = distance
236 | end
237 | end
238 | local isOwned = IsVehicleOwned(plate)
239 | if isOwned then MySQL.update('UPDATE player_vehicles SET drivingdistance = drivingdistance + ? WHERE plate = ?', { drivingDistance[plate], plate }) end
240 | end)
241 |
242 | RegisterNetEvent('qb-mechanicjob:server:removeItem', function(part, amount)
243 | local src = source
244 | local Player = QBCore.Functions.GetPlayer(src)
245 | if not Player then return end
246 | if not amount then amount = 1 end
247 | if not exports['qb-inventory']:RemoveItem(src, part, amount, false, 'qb-mechanicjob:server:removeItem') then DropPlayer(src, 'qb-mechanicjob:server:removeItem') end
248 | TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items[part], 'remove')
249 | end)
250 |
251 | -- Items
252 |
253 | local performanceParts = {
254 | 'veh_armor',
255 | 'veh_brakes',
256 | 'veh_engine',
257 | 'veh_suspension',
258 | 'veh_transmission',
259 | 'veh_turbo',
260 | }
261 |
262 | for i = 1, #performanceParts do
263 | QBCore.Functions.CreateUseableItem(performanceParts[i], function(source, item)
264 | local Player = QBCore.Functions.GetPlayer(source)
265 | if not Player then return end
266 | if Config.RequireJob and Player.PlayerData.job.type ~= 'mechanic' then return end
267 | TriggerClientEvent('qb-mechanicjob:client:installPart', source, item.name)
268 | end)
269 | end
270 |
271 | local cosmeticParts = {
272 | 'veh_interior',
273 | 'veh_exterior',
274 | 'veh_wheels',
275 | 'veh_neons',
276 | 'veh_xenons',
277 | 'veh_tint',
278 | 'veh_plates',
279 | }
280 |
281 | for i = 1, #cosmeticParts do
282 | QBCore.Functions.CreateUseableItem(cosmeticParts[i], function(source, item)
283 | local Player = QBCore.Functions.GetPlayer(source)
284 | if not Player then return end
285 | if Config.RequireJob and Player.PlayerData.job.type ~= 'mechanic' then return end
286 | TriggerClientEvent('qb-mechanicjob:client:installCosmetic', source, item.name)
287 | end)
288 | end
289 |
290 | QBCore.Functions.CreateUseableItem('veh_toolbox', function(source)
291 | local Player = QBCore.Functions.GetPlayer(source)
292 | if not Player then return end
293 | if Config.RequireJob and Player.PlayerData.job.type ~= 'mechanic' then return end
294 | TriggerClientEvent('qb-mechanicjob:client:PartsMenu', source)
295 | end)
296 |
297 | QBCore.Functions.CreateUseableItem('tunerlaptop', function(source)
298 | local Player = QBCore.Functions.GetPlayer(source)
299 | if not Player then return end
300 | if Config.RequireJob and Player.PlayerData.job.type ~= 'mechanic' then return end
301 | TriggerClientEvent('qb-mechanicjob:client:openChip', source)
302 | end)
303 |
304 | QBCore.Functions.CreateUseableItem('nitrous', function(source)
305 | local Player = QBCore.Functions.GetPlayer(source)
306 | if not Player then return end
307 | if Config.RequireJob and Player.PlayerData.job.type ~= 'mechanic' then return end
308 | TriggerClientEvent('qb-mechanicjob:client:installNitrous', source)
309 | end)
310 |
311 | QBCore.Functions.CreateUseableItem('tirerepairkit', function(source)
312 | local Player = QBCore.Functions.GetPlayer(source)
313 | if not Player then return end
314 | TriggerClientEvent('qb-mechanicjob:client:repairTire', source)
315 | end)
316 |
317 | QBCore.Functions.CreateUseableItem('repairkit', function(source)
318 | local Player = QBCore.Functions.GetPlayer(source)
319 | if not Player then return end
320 | TriggerClientEvent('qb-mechanicjob:client:repairVehicle', source)
321 | end)
322 |
323 | QBCore.Functions.CreateUseableItem('advancedrepairkit', function(source)
324 | local Player = QBCore.Functions.GetPlayer(source)
325 | if not Player then return end
326 | TriggerClientEvent('qb-mechanicjob:client:repairVehicleFull', source)
327 | end)
328 |
329 | QBCore.Functions.CreateUseableItem('cleaningkit', function(source)
330 | local Player = QBCore.Functions.GetPlayer(source)
331 | if not Player then return end
332 | TriggerClientEvent('qb-mechanicjob:client:cleanVehicle', source)
333 | end)
334 |
335 | -- Commands
336 |
337 | QBCore.Commands.Add('fix', 'Repair your vehicle (Admin Only)', {}, false, function(source)
338 | local ped = GetPlayerPed(source)
339 | local vehicle = GetVehiclePedIsIn(ped, false)
340 | if not vehicle then return end
341 | local plate = GetVehicleNumberPlateText(vehicle)
342 | if not plate then return end
343 | local trimmedPlate = Trim(plate)
344 | if vehicleComponents[trimmedPlate] then
345 | for k in pairs(vehicleComponents[trimmedPlate]) do
346 | vehicleComponents[trimmedPlate][k] = 100
347 | end
348 | end
349 | TriggerClientEvent('qb-mechanicjob:client:fixEverything', source)
350 | end, 'admin')
351 |
--------------------------------------------------------------------------------
/client/cosmetic.lua:
--------------------------------------------------------------------------------
1 | QBCore = exports['qb-core']:GetCoreObject()
2 | local particleEffects = {}
3 | local isPainting = false
4 |
5 | -- Paint
6 |
7 | local function HexToRGB(hex)
8 | if type(hex) ~= 'string' or not hex:match('^#?[%x]+$') or (#hex ~= 6 and #hex ~= 7) then return end
9 | hex = hex:gsub('#', '')
10 | return {
11 | r = tonumber('0x' .. hex:sub(1, 2)),
12 | g = tonumber('0x' .. hex:sub(3, 4)),
13 | b = tonumber('0x' .. hex:sub(5, 6))
14 | }
15 | end
16 |
17 | local function GetHex(category, id)
18 | local hex
19 | for i = 1, #Config.Paints[category] do
20 | if Config.Paints[category][i].id == tonumber(id) then
21 | hex = Config.Paints[category][i].hex
22 | break
23 | end
24 | end
25 | return hex
26 | end
27 |
28 | local function GetPaints(category)
29 | local Paints = {}
30 | Paints[#Paints + 1] = { value = 'none', text = Lang:t('menu.none') }
31 | for i = 1, #Config.Paints[category] do
32 | Paints[#Paints + 1] = {
33 | value = Config.Paints[category][i].id,
34 | text = Config.Paints[category][i].label
35 | }
36 | end
37 | return Paints
38 | end
39 |
40 | local function PaintList(category)
41 | local paintOptions = GetPaints(category)
42 | local dialog = exports['qb-input']:ShowInput({
43 | header = Lang:t('menu.paint_vehicle'),
44 | submitText = Lang:t('menu.submit'),
45 | inputs = {
46 | {
47 | text = Lang:t('menu.primary'),
48 | name = 'primarypaint',
49 | type = 'select',
50 | options = paintOptions
51 | },
52 | {
53 | text = Lang:t('menu.secondary'),
54 | name = 'secondarypaint',
55 | type = 'select',
56 | options = paintOptions
57 | },
58 | {
59 | text = Lang:t('menu.pearlescent'),
60 | name = 'pearlescentpaint',
61 | type = 'select',
62 | options = paintOptions
63 | },
64 | {
65 | text = Lang:t('menu.wheels'),
66 | name = 'wheelpaint',
67 | type = 'select',
68 | options = paintOptions
69 | }
70 | }
71 | })
72 | if not dialog then return end
73 | if dialog.primarypaint and dialog.secondarypaint and dialog.pearlescentpaint and dialog.wheelpaint then
74 | local colors = {
75 | primary = dialog.primarypaint ~= 'none' and HexToRGB(GetHex(category, dialog.primarypaint)) or nil,
76 | secondary = dialog.secondarypaint ~= 'none' and HexToRGB(GetHex(category, dialog.secondarypaint)) or nil,
77 | pearlescent = dialog.pearlescentpaint ~= 'none' and HexToRGB(GetHex(category, dialog.pearlescentpaint)) or nil,
78 | wheel = dialog.wheelpaint ~= 'none' and HexToRGB(GetHex(category, dialog.wheelpaint)) or nil
79 | }
80 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
81 | if vehicle == 0 or distance > 5.0 then return end
82 | local netId = NetworkGetNetworkIdFromEntity(vehicle)
83 | if isPainting then return end
84 | TriggerServerEvent('qb-mechanicjob:server:sprayVehicle', netId, dialog.primarypaint, dialog.secondarypaint, dialog.pearlescentpaint, dialog.wheelpaint, colors)
85 | end
86 | end
87 |
88 | local function CustomColor()
89 | local dialog = exports['qb-input']:ShowInput({
90 | header = Lang:t('menu.custom_color'),
91 | submitText = Lang:t('menu.submit'),
92 | inputs = {
93 | {
94 | text = 'HEX',
95 | name = 'hex',
96 | type = 'text',
97 | isRequired = false
98 | },
99 | {
100 | text = '',
101 | name = 'colorpicker',
102 | type = 'color',
103 | isRequired = false
104 | },
105 | {
106 | text = Lang:t('menu.section'),
107 | name = 'section',
108 | type = 'radio',
109 | options = {
110 | { value = 'primary', text = Lang:t('menu.primary') },
111 | { value = 'secondary', text = Lang:t('menu.secondary') }
112 | }
113 | },
114 | {
115 | text = Lang:t('menu.type'),
116 | name = 'paintType',
117 | type = 'radio',
118 | options = {
119 | { value = 'metallic', text = Lang:t('menu.metallic') },
120 | { value = 'matte', text = Lang:t('menu.matte') },
121 | { value = 'chrome', text = Lang:t('menu.chrome') }
122 | }
123 | }
124 | }
125 | })
126 | if not dialog then return end
127 | if (dialog.hex or dialog.colorpicker) and dialog.section then
128 | local color = (dialog.hex and dialog.hex ~= '') and dialog.hex or dialog.colorpicker
129 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
130 | if vehicle == 0 or distance > 5.0 then return end
131 | local netId = NetworkGetNetworkIdFromEntity(vehicle)
132 | if isPainting then return end
133 | TriggerServerEvent('qb-mechanicjob:server:sprayVehicleCustom', netId, dialog.section, dialog.paintType, HexToRGB(color))
134 | end
135 | end
136 |
137 | function PaintCategories()
138 | local Paints = { { header = Lang:t('menu.paints'), isMenuHeader = true, icon = 'fas fa-fill' } }
139 | Paints[#Paints + 1] = {
140 | header = Lang:t('menu.custom_color'),
141 | params = {
142 | isAction = true,
143 | event = function()
144 | CustomColor()
145 | end,
146 | args = {}
147 | }
148 | }
149 | for k in pairs(Config.Paints) do
150 | Paints[#Paints + 1] = {
151 | header = k,
152 | params = {
153 | isAction = true,
154 | event = function()
155 | PaintList(k)
156 | end,
157 | args = {}
158 | }
159 | }
160 | end
161 | exports['qb-menu']:openMenu(Paints)
162 | end
163 |
164 | -- Interior
165 |
166 | local function OpenInteriors(vehicle)
167 | local mods = { { header = Lang:t('menu.interior'), isMenuHeader = true, icon = 'fas fa-car-side' } }
168 | for i = 1, #Config.InteriorCategories do
169 | local modCount = GetNumVehicleMods(vehicle, Config.InteriorCategories[i].id)
170 | if modCount > 0 then
171 | mods[#mods + 1] = {
172 | header = Config.InteriorCategories[i].label,
173 | params = {
174 | isAction = true,
175 | event = function()
176 | InteriorModList(Config.InteriorCategories[i].id, vehicle, Config.InteriorCategories[i].label)
177 | end,
178 | args = {}
179 | }
180 | }
181 | end
182 | end
183 | exports['qb-menu']:openMenu(mods)
184 | end
185 |
186 | function InteriorModList(id, vehicle, label)
187 | local mods = { { header = label, isMenuHeader = true, icon = 'fas fa-car-side' } }
188 | mods[#mods + 1] = {
189 | header = Lang:t('menu.back'),
190 | icon = 'fas fa-backward',
191 | params = {
192 | isAction = true,
193 | event = function()
194 | OpenInteriors(vehicle)
195 | end,
196 | args = {}
197 | }
198 | }
199 | for i = 0, GetNumVehicleMods(vehicle, id) - 1 do
200 | local modHeader
201 | if id == 14 then
202 | modHeader = Config.HornLabels[i] or Lang:t('menu.unknown')
203 | else
204 | local modTextLabel = GetModTextLabel(vehicle, id, i)
205 | modHeader = modTextLabel and GetLabelText(modTextLabel) or 'Mod ' .. i
206 | end
207 |
208 | mods[#mods + 1] = {
209 | header = modHeader,
210 | params = {
211 | isAction = true,
212 | event = function(data)
213 | SetVehicleModKit(vehicle, 0)
214 | SetVehicleMod(vehicle, data.modType, data.modIndex, false)
215 | if id == 14 then
216 | StartVehicleHorn(vehicle, 10000, 0, false)
217 | end
218 | InteriorModList(id, vehicle, label)
219 | end,
220 | args = {
221 | modType = id,
222 | modIndex = i
223 | }
224 | }
225 | }
226 | end
227 | exports['qb-menu']:openMenu(mods)
228 | end
229 |
230 | -- Exterior
231 |
232 | local function OpenExteriors(vehicle)
233 | local mods = { { header = Lang:t('menu.exterior'), isMenuHeader = true, icon = 'fas fa-car-side' } }
234 | for i = 1, #Config.ExteriorCategories do
235 | local modCount = GetNumVehicleMods(vehicle, Config.ExteriorCategories[i].id)
236 | if modCount > 0 then
237 | mods[#mods + 1] = {
238 | header = Config.ExteriorCategories[i].label,
239 | params = {
240 | isAction = true,
241 | event = function()
242 | ExteriorModList(Config.ExteriorCategories[i].id, vehicle, Config.ExteriorCategories[i].label)
243 | end,
244 | args = {}
245 | }
246 | }
247 | end
248 | end
249 | exports['qb-menu']:openMenu(mods)
250 | end
251 |
252 | function ExteriorModList(id, vehicle, label)
253 | local mods = { { header = label, isMenuHeader = true, icon = 'fas fa-car-side' } }
254 | mods[#mods + 1] = {
255 | header = Lang:t('menu.back'),
256 | icon = 'fas fa-backward',
257 | params = {
258 | isAction = true,
259 | event = function()
260 | OpenExteriors(vehicle)
261 | end,
262 | args = {}
263 | }
264 | }
265 | for i = 1, GetNumVehicleMods(vehicle, id) - 1 do
266 | mods[#mods + 1] = {
267 | header = GetLabelText(GetModTextLabel(vehicle, id, i)),
268 | params = {
269 | isAction = true,
270 | event = function()
271 | SetVehicleModKit(vehicle, 0)
272 | SetVehicleMod(vehicle, id, i, false)
273 | ExteriorModList(id, vehicle, label)
274 | end,
275 | args = {}
276 | }
277 | }
278 | end
279 | exports['qb-menu']:openMenu(mods)
280 | end
281 |
282 | -- Tire Smoke
283 |
284 | local function GetSmokeList()
285 | local smokes = {}
286 | for i = 1, #Config.TyreSmoke do
287 | smokes[#smokes + 1] = {
288 | value = Config.TyreSmoke[i].label,
289 | text = Config.TyreSmoke[i].label
290 | }
291 | end
292 | return smokes
293 | end
294 |
295 | local function GetSmokeColors(color)
296 | for i = 1, #Config.TyreSmoke do
297 | if Config.TyreSmoke[i].label == color then
298 | return Config.TyreSmoke[i].r, Config.TyreSmoke[i].g, Config.TyreSmoke[i].b
299 | end
300 | end
301 | end
302 |
303 | local function TireSmoke(vehicle)
304 | local dialog = exports['qb-input']:ShowInput({
305 | header = Lang:t('menu.tire_smoke'),
306 | submitText = Lang:t('menu.submit'),
307 | inputs = {
308 | {
309 | text = 'HEX',
310 | name = 'hex',
311 | type = 'text',
312 | isRequired = false
313 | },
314 | {
315 | text = '',
316 | name = 'colorpicker',
317 | type = 'color',
318 | isRequired = false
319 | },
320 | {
321 | text = Lang:t('menu.standard'),
322 | name = 'color',
323 | type = 'select',
324 | options = GetSmokeList()
325 | },
326 | {
327 | text = Lang:t('menu.toggle'),
328 | name = 'toggle',
329 | type = 'radio',
330 | options = {
331 | { value = 'togglehex', text = Lang:t('menu.custom') },
332 | { value = 'togglestandard', text = Lang:t('menu.standard') },
333 | }
334 | }
335 | }
336 | })
337 | if not dialog then return end
338 |
339 | if dialog.toggle == 'togglehex' and dialog.hex ~= '' then
340 | local color = HexToRGB(dialog.hex)
341 | ToggleVehicleMod(vehicle, 20, true)
342 | SetVehicleTyreSmokeColor(vehicle, color.r, color.g, color.b)
343 | elseif dialog.toggle == 'togglestandard' and dialog.colorpicker ~= '' then
344 | local color = HexToRGB(dialog.colorpicker)
345 | ToggleVehicleMod(vehicle, 20, true)
346 | SetVehicleTyreSmokeColor(vehicle, color.r, color.g, color.b)
347 | elseif dialog.toggle == 'togglestandard' and tonumber(dialog.color) then
348 | ToggleVehicleMod(vehicle, 20, true)
349 | SetVehicleTyreSmokeColor(vehicle, GetSmokeColors(dialog.color))
350 | else
351 | ToggleVehicleMod(vehicle, 20, false)
352 | end
353 | end
354 |
355 | -- Wheels
356 |
357 | local function OpenWheels(vehicle)
358 | local mods = { { header = Lang:t('menu.wheels'), isMenuHeader = true, icon = 'fas fa-truck-monster' } }
359 | mods[#mods + 1] = {
360 | header = Lang:t('menu.tire_smoke'),
361 | icon = 'fas fa-smog',
362 | params = {
363 | isAction = true,
364 | event = function()
365 | TireSmoke(vehicle)
366 | end,
367 | args = {}
368 | }
369 | }
370 | for i = 1, #Config.WheelCategories do
371 | mods[#mods + 1] = {
372 | header = Config.WheelCategories[i].label,
373 | params = {
374 | isAction = true,
375 | event = function()
376 | OpenWheelList(Config.WheelCategories[i].id, vehicle, Config.WheelCategories[i].label)
377 | end,
378 | args = {}
379 | }
380 | }
381 | end
382 | exports['qb-menu']:openMenu(mods)
383 | end
384 |
385 | function OpenWheelList(id, vehicle, label)
386 | local mods = { { header = label, isMenuHeader = true, icon = 'fas fa-truck-monster' } }
387 | mods[#mods + 1] = {
388 | header = Lang:t('menu.back'),
389 | icon = 'fas fa-backward',
390 | params = {
391 | isAction = true,
392 | event = function()
393 | OpenWheels(vehicle)
394 | end,
395 | args = {}
396 | }
397 | }
398 | SetVehicleWheelType(vehicle, id)
399 | for i = 1, GetNumVehicleMods(vehicle, 23) - 1 do
400 | mods[#mods + 1] = {
401 | header = GetLabelText(GetModTextLabel(vehicle, 23, i)),
402 | params = {
403 | isAction = true,
404 | event = function()
405 | SetVehicleModKit(vehicle, 0)
406 | SetVehicleMod(vehicle, 23, i, false)
407 | OpenWheelList(id, vehicle, label)
408 | end,
409 | args = {}
410 | }
411 | }
412 | end
413 | exports['qb-menu']:openMenu(mods)
414 | end
415 |
416 | -- Neons
417 |
418 | local function GetNeonList()
419 | local neons = {}
420 | for i = 1, #Config.NeonColors do
421 | neons[#neons + 1] = {
422 | value = Config.NeonColors[i].label,
423 | text = Config.NeonColors[i].label
424 | }
425 | end
426 | return neons
427 | end
428 |
429 | local function GetNeonColors(color)
430 | for i = 1, #Config.NeonColors do
431 | if Config.NeonColors[i].label == color then
432 | return Config.NeonColors[i].r, Config.NeonColors[i].g, Config.NeonColors[i].b
433 | end
434 | end
435 | end
436 |
437 | local function OpenNeon(vehicle)
438 | local dialog = exports['qb-input']:ShowInput({
439 | header = Lang:t('menu.neons'),
440 | submitText = Lang:t('menu.submit'),
441 | inputs = {
442 | {
443 | text = Lang:t('menu.color'),
444 | name = 'color',
445 | type = 'select',
446 | options = GetNeonList()
447 | },
448 | {
449 | text = Lang:t('menu.front_toggle'),
450 | name = 'frontenable',
451 | type = 'radio',
452 | options = {
453 | { value = 'enable', text = Lang:t('menu.enabled') },
454 | { value = 'disable', text = Lang:t('menu.disabled') },
455 | }
456 | },
457 | {
458 | text = Lang:t('menu.rear_toggle'),
459 | name = 'rearenable',
460 | type = 'radio',
461 | options = {
462 | { value = 'enable', text = Lang:t('menu.enabled') },
463 | { value = 'disable', text = Lang:t('menu.disabled') },
464 | }
465 | },
466 | {
467 | text = Lang:t('menu.left_toggle'),
468 | name = 'leftenable',
469 | type = 'radio',
470 | options = {
471 | { value = 'enable', text = Lang:t('menu.enabled') },
472 | { value = 'disable', text = Lang:t('menu.disabled') },
473 | }
474 | },
475 | {
476 | text = Lang:t('menu.right_toggle'),
477 | name = 'rightenable',
478 | type = 'radio',
479 | options = {
480 | { value = 'enable', text = Lang:t('menu.enabled') },
481 | { value = 'disable', text = Lang:t('menu.disabled') },
482 | }
483 | }
484 | }
485 | })
486 | if not dialog then return end
487 |
488 | if dialog.frontenable == 'enable' then
489 | SetVehicleNeonLightEnabled(vehicle, 2, true)
490 | else
491 | SetVehicleNeonLightEnabled(vehicle, 2, false)
492 | end
493 |
494 | if dialog.rearenable == 'enable' then
495 | SetVehicleNeonLightEnabled(vehicle, 3, true)
496 | else
497 | SetVehicleNeonLightEnabled(vehicle, 3, false)
498 | end
499 |
500 | if dialog.leftenable == 'enable' then
501 | SetVehicleNeonLightEnabled(vehicle, 0, true)
502 | else
503 | SetVehicleNeonLightEnabled(vehicle, 0, false)
504 | end
505 |
506 | if dialog.rightenable == 'enable' then
507 | SetVehicleNeonLightEnabled(vehicle, 1, true)
508 | else
509 | SetVehicleNeonLightEnabled(vehicle, 1, false)
510 | end
511 |
512 | SetVehicleNeonLightsColour(vehicle, GetNeonColors(dialog.color))
513 | end
514 |
515 | -- Headlights
516 |
517 | local function GetXenonList()
518 | local xenons = {}
519 | for i = 1, #Config.Xenon do
520 | xenons[#xenons + 1] = {
521 | value = Config.Xenon[i].id,
522 | text = Config.Xenon[i].label
523 | }
524 | end
525 | return xenons
526 | end
527 |
528 | local function OpenXenon(vehicle)
529 | local dialog = exports['qb-input']:ShowInput({
530 | header = Lang:t('menu.xenon'),
531 | submitText = Lang:t('menu.submit'),
532 | inputs = {
533 | {
534 | text = 'HEX',
535 | name = 'hex',
536 | type = 'text',
537 | isRequired = false
538 | },
539 | {
540 | text = '',
541 | name = 'colorpicker',
542 | type = 'color',
543 | isRequired = false
544 | },
545 | {
546 | text = Lang:t('menu.color'),
547 | name = 'color',
548 | type = 'select',
549 | options = GetXenonList()
550 | },
551 | {
552 | text = Lang:t('menu.toggle'),
553 | name = 'toggle',
554 | type = 'radio',
555 | options = {
556 | { value = 'enable', text = Lang:t('menu.enabled') },
557 | { value = 'disable', text = Lang:t('menu.disabled') },
558 | }
559 | }
560 | }
561 | })
562 | if not dialog then return end
563 |
564 | if dialog.toggle == 'disable' then
565 | ToggleVehicleMod(vehicle, 22, false)
566 | return
567 | end
568 |
569 | if dialog.hex and dialog.hex ~= '' then
570 | local color = HexToRGB(dialog.hex)
571 | ToggleVehicleMod(vehicle, 22, true)
572 | SetVehicleXenonLightsCustomColor(vehicle, color.r, color.g, color.b)
573 | return
574 | end
575 |
576 | if dialog.colorpicker and dialog.colorpicker ~= '' then
577 | local color = HexToRGB(dialog.colorpicker)
578 | ToggleVehicleMod(vehicle, 22, true)
579 | SetVehicleXenonLightsCustomColor(vehicle, color.r, color.g, color.b)
580 | return
581 | end
582 |
583 | if dialog.color and tonumber(dialog.color) then
584 | ToggleVehicleMod(vehicle, 22, true)
585 | SetVehicleXenonLightsColor(vehicle, tonumber(dialog.color))
586 | end
587 | end
588 |
589 | -- Window Tint
590 |
591 | local function WindowTint(vehicle)
592 | local tints = { { header = Lang:t('menu.window_tint'), isMenuHeader = true, icon = 'fas fa-window-maximize' } }
593 | if GetNumVehicleWindowTints() > 0 then
594 | for i = 1, #Config.WindowTints do
595 | tints[#tints + 1] = {
596 | header = Config.WindowTints[i].label,
597 | params = {
598 | isAction = true,
599 | event = function()
600 | SetVehicleModKit(vehicle, 0)
601 | SetVehicleWindowTint(vehicle, Config.WindowTints[i].id)
602 | WindowTint(vehicle)
603 | end,
604 | args = {}
605 | }
606 | }
607 | end
608 | end
609 | exports['qb-menu']:openMenu(tints)
610 | end
611 |
612 | -- Plates
613 |
614 | local function PlateIndex(vehicle)
615 | local plates = { { header = Lang:t('menu.plate'), isMenuHeader = true, icon = 'fas fa-id-card' } }
616 | for i = 1, #Config.PlateIndexes do
617 | plates[#plates + 1] = {
618 | header = Config.PlateIndexes[i].label,
619 | params = {
620 | isAction = true,
621 | event = function()
622 | SetVehicleNumberPlateTextIndex(vehicle, Config.PlateIndexes[i].id)
623 | PlateIndex(vehicle)
624 | end,
625 | args = {}
626 | }
627 | }
628 | end
629 | exports['qb-menu']:openMenu(plates)
630 | end
631 |
632 | -- Events
633 |
634 | RegisterNetEvent('qb-mechanicjob:client:vehicleSetColors', function(netId, section, colorIndex)
635 | if not NetworkDoesEntityExistWithNetworkId(netId) then return end
636 | local vehicle = NetworkGetEntityFromNetworkId(netId)
637 |
638 | if section == 'primary' then
639 | local _, colorSecondary = GetVehicleColours(vehicle)
640 | ClearVehicleCustomPrimaryColour(vehicle)
641 | SetVehicleColours(vehicle, tonumber(colorIndex), colorSecondary)
642 | end
643 |
644 | if section == 'secondary' then
645 | local colorPrimary, _ = GetVehicleColours(vehicle)
646 | ClearVehicleCustomSecondaryColour(vehicle)
647 | SetVehicleColours(vehicle, colorPrimary, tonumber(colorIndex))
648 | end
649 |
650 | if section == 'pearlescent' then
651 | local _, wheelColor = GetVehicleExtraColours(vehicle)
652 | SetVehicleExtraColours(vehicle, tonumber(colorIndex), wheelColor)
653 | end
654 |
655 | if section == 'wheel' then
656 | local pearlescentColor, _ = GetVehicleExtraColours(vehicle)
657 | SetVehicleExtraColours(vehicle, pearlescentColor, tonumber(colorIndex))
658 | end
659 |
660 |
661 | local props = QBCore.Functions.GetVehicleProperties(vehicle)
662 | TriggerServerEvent('qb-mechanicjob:server:SaveVehicleProps', props)
663 | end)
664 |
665 | RegisterNetEvent('qb-mechanicjob:client:startParticles', function(netId, color)
666 | isPainting = true
667 | local vehicle = NetworkGetEntityFromNetworkId(netId)
668 | if not color then color = { r = 255, g = 255, b = 255 } end
669 | UseParticleFxAsset('core')
670 | local offsetX, offsetY, offsetZ = 0.0, 0.0, 3.0
671 | local xRot, yRot, zRot = 0.0, 180.0, 0.0
672 | local scale = 1.5
673 | local effect = StartNetworkedParticleFxLoopedOnEntity('ent_amb_steam', vehicle, offsetX, offsetY, offsetZ, xRot, yRot, zRot, scale, false, false, false)
674 | particleEffects[#particleEffects + 1] = effect
675 | SetParticleFxLoopedAlpha(effect, 100.0)
676 | SetParticleFxLoopedColour(effect, color.r / 255.0, color.g / 255.0, color.b / 255.0, 0)
677 | end)
678 |
679 | RegisterNetEvent('qb-mechanicjob:client:stopParticles', function()
680 | isPainting = false
681 | for _, effect in ipairs(particleEffects) do
682 | StopParticleFxLooped(effect, true)
683 | end
684 | end)
685 |
686 | RegisterNetEvent('qb-mechanicjob:client:installCosmetic', function(item)
687 | local vehicle, distance = QBCore.Functions.GetClosestVehicle()
688 | if vehicle == 0 or distance > 5.0 then return end
689 | local vehicleClass = GetVehicleClass(vehicle)
690 | if Config.IgnoreClasses[vehicleClass] then return end
691 | if GetVehicleModKit(vehicle) ~= 0 then SetVehicleModKit(vehicle, 0) end
692 | if item == 'veh_interior' then
693 | OpenInteriors(vehicle)
694 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
695 | elseif item == 'veh_exterior' then
696 | OpenExteriors(vehicle)
697 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
698 | elseif item == 'veh_wheels' then
699 | OpenWheels(vehicle)
700 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
701 | elseif item == 'veh_neons' then
702 | OpenNeon(vehicle)
703 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
704 | elseif item == 'veh_xenons' then
705 | OpenXenon(vehicle)
706 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
707 | elseif item == 'veh_tint' then
708 | WindowTint(vehicle)
709 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
710 | elseif item == 'veh_plates' then
711 | if not IsNearBone(vehicle, 'platelight') then return end
712 | PlateIndex(vehicle)
713 | TriggerServerEvent('qb-mechanicjob:server:removeItem', item)
714 | end
715 | end)
716 |
717 | -- Threads
718 |
719 | CreateThread(function()
720 | RequestNamedPtfxAsset('core')
721 | while not HasNamedPtfxAssetLoaded('core') do
722 | Wait(0)
723 | RequestNamedPtfxAsset('core')
724 | end
725 | end)
726 |
--------------------------------------------------------------------------------
/config/const.lua:
--------------------------------------------------------------------------------
1 | Config.IgnoreClasses = {
2 | [13] = true, -- Cycles
3 | [14] = true, -- Boats
4 | [15] = true, -- Helicopters
5 | [16] = true, -- Planes
6 | [21] = true, -- Trains
7 | }
8 |
9 | Config.WheelBones = {
10 | [0] = 'wheel_lf',
11 | [1] = 'wheel_rf',
12 | [2] = 'wheel_lm',
13 | [3] = 'wheel_rm',
14 | [4] = 'wheel_lr',
15 | [5] = 'wheel_rr',
16 | --[45] = '',
17 | --[46] = ''
18 | }
19 |
20 | Config.HornLabels = {
21 | [0] = 'Truck Horn',
22 | [1] = 'Cop Horn',
23 | [2] = 'Clown Horn',
24 | [3] = 'Musical Horn 1',
25 | [4] = 'Musical Horn 2',
26 | [5] = 'Musical Horn 3',
27 | [6] = 'Musical Horn 4',
28 | [7] = 'Musical Horn 5',
29 | [8] = 'Sad Trombone',
30 | [9] = 'Classical Horn 1',
31 | [10] = 'Classical Horn 2',
32 | [11] = 'Classical Horn 3',
33 | [12] = 'Classical Horn 4',
34 | [13] = 'Classical Horn 5',
35 | [14] = 'Classical Horn 6',
36 | [15] = 'Classical Horn 7',
37 | [16] = 'Scale - Do',
38 | [17] = 'Scale - Re',
39 | [18] = 'Scale - Mi',
40 | [19] = 'Scale - Fa',
41 | [20] = 'Scale - Sol',
42 | [21] = 'Scale - La',
43 | [22] = 'Scale - Ti',
44 | [23] = 'Scale - Do',
45 | [24] = 'Jazz Horn 1',
46 | [25] = 'Jazz Horn 2',
47 | [26] = 'Jazz Horn 3',
48 | [27] = 'Jazz Horn Loop',
49 | [28] = 'Star Spangled Banner 1',
50 | [29] = 'Star Spangled Banner 2',
51 | [30] = 'Star Spangled Banner 3',
52 | [31] = 'Star Spangled Banner 4',
53 | [32] = 'Classical Horn 8 Loop',
54 | [33] = 'Classical Horn 9 Loop',
55 | [34] = 'Classical Horn 10 Loop',
56 | [35] = 'Classical Horn 8',
57 | [36] = 'Classical Horn 9',
58 | [37] = 'Classical Horn 10',
59 | [38] = 'Funeral Loop',
60 | [39] = 'Funeral',
61 | [40] = 'Spooky Loop',
62 | [41] = 'Spooky',
63 | [42] = 'San Andreas Loop',
64 | [43] = 'San Andreas',
65 | [44] = 'Liberty City Loop',
66 | [45] = 'Liberty City',
67 | [46] = 'Festive 1 Loop',
68 | [47] = 'Festive 1',
69 | [48] = 'Festive 2 Loop',
70 | [49] = 'Festive 2',
71 | [50] = 'Festive 3 Loop',
72 | [51] = 'Festive 3'
73 | }
74 |
75 | -- https://docs.fivem.net/natives/?_0xB3ED1BFB4BE636DC
76 | Config.WheelCategories = {
77 | { label = 'Sport', id = 0 },
78 | { label = 'Muscle', id = 1 },
79 | { label = 'Lowrider', id = 2 },
80 | { label = 'SUV', id = 3 },
81 | { label = 'Offroad', id = 4 },
82 | { label = 'Tuner', id = 5 },
83 | { label = 'Motorcycle', id = 6 },
84 | { label = 'High End', id = 7 },
85 | { label = 'Benny\'s Originals', id = 8 },
86 | { label = 'Benny\'s Bespoke', id = 9 },
87 | { label = 'Open Wheel', id = 10 },
88 | { label = 'Street', id = 11 },
89 | { label = 'Track', id = 12 },
90 | }
91 |
92 | -- https://docs.fivem.net/natives/?_0x6AF0636DDEDCB6DD
93 | Config.InteriorCategories = {
94 | { label = 'Roll Cage', id = 5 },
95 | { label = 'Horns', id = 14 },
96 | { label = 'Subwoofer', id = 19 },
97 | { label = 'Dashboard', id = 29 },
98 | { label = 'Dial', id = 30 },
99 | { label = 'Door Speaker', id = 31 },
100 | { label = 'Seats', id = 32 },
101 | { label = 'Steering Wheel', id = 33 },
102 | { label = 'Shifter Leaver', id = 34 },
103 | { label = 'Plaque', id = 35 },
104 | { label = 'Speaker', id = 36 },
105 | }
106 |
107 | -- https://docs.fivem.net/natives/?_0x6AF0636DDEDCB6DD
108 | Config.ExteriorCategories = {
109 | { label = 'Spoiler', id = 0 },
110 | { label = 'Front Bumper', id = 1 },
111 | { label = 'Rear Bumper', id = 2 },
112 | { label = 'Side Skirt', id = 3 },
113 | { label = 'Exhaust', id = 4 },
114 | { label = 'Grille', id = 6 },
115 | { label = 'Hood', id = 7 },
116 | { label = 'Left Fender', id = 8 },
117 | { label = 'Right Fender', id = 9 },
118 | { label = 'Roof', id = 10 },
119 | { label = 'Hydraulics', id = 21 },
120 | { label = 'Headlights', id = 22 },
121 | { label = 'Tire Smoke', id = 20 },
122 | { label = 'Rear Wheels', id = 24 },
123 | { label = 'Plate Holder', id = 25 },
124 | { label = 'Vanity Plates', id = 26 },
125 | { label = 'Trim A', id = 27 },
126 | { label = 'Ornaments', id = 28 },
127 | { label = 'Trunk', id = 37 },
128 | { label = 'Hydraulic', id = 38 },
129 | { label = 'Engine Block', id = 39 },
130 | { label = 'Air Filter', id = 40 },
131 | { label = 'Strut', id = 41 },
132 | { label = 'Arch Cover', id = 42 },
133 | { label = 'Aerial', id = 43 },
134 | { label = 'Trim B', id = 44 },
135 | { label = 'Fuel Tank', id = 45 },
136 | { label = 'Window', id = 46 },
137 | { label = 'Door', id = 47 },
138 | { label = 'Livery', id = 48 },
139 | { label = 'Lightbar', id = 49 },
140 | { label = 'Paint', id = 50 }
141 | }
142 |
143 | -- https://docs.fivem.net/natives/?_0x3DFF319A831E0CDB
144 | Config.Xenon = {
145 | { label = 'Default', id = -1 },
146 | { label = 'White', id = 0 },
147 | { label = 'Blue', id = 1 },
148 | { label = 'Electric Blue', id = 2 },
149 | { label = 'Mint Green', id = 3 },
150 | { label = 'Lime Green', id = 4 },
151 | { label = 'Yellow', id = 5 },
152 | { label = 'Golden Shower', id = 6 },
153 | { label = 'Orange', id = 7 },
154 | { label = 'Red', id = 8 },
155 | { label = 'Pony Pink', id = 9 },
156 | { label = 'Hot Pink', id = 10 },
157 | { label = 'Purple', id = 11 },
158 | { label = 'Blacklight', id = 12 },
159 | }
160 |
161 | -- https://docs.fivem.net/natives/?_0x57C51E6BAD752696
162 | Config.WindowTints = {
163 | { label = 'None', id = 0 },
164 | { label = 'Pure black', id = 1 },
165 | { label = 'Dark Smoke', id = 2 },
166 | { label = 'Light Smoke', id = 3 },
167 | { label = 'Stock', id = 4 },
168 | { label = 'Limo', id = 5 },
169 | { label = 'Green', id = 6 },
170 | }
171 |
172 | -- https://docs.fivem.net/natives/?_0x9088EB5A43FFB0A1
173 | Config.PlateIndexes = {
174 | { label = 'Blue on White 1', id = 0 },
175 | { label = 'Yellow on Black', id = 1 },
176 | { label = 'Yellow on Blue', id = 2 },
177 | { label = 'Blue on White 2', id = 3 },
178 | { label = 'Blue on White 3', id = 4 },
179 | { label = 'Yankton', id = 5 },
180 | { label = 'Ecola', id = 6 },
181 | { label = 'Las Venturas', id = 7 },
182 | { label = 'Liberty City', id = 8 },
183 | { label = 'LS Car Meet', id = 9 },
184 | { label = 'Panic', id = 10 },
185 | { label = 'Pounders', id = 11 },
186 | { label = 'Sprunk', id = 12 },
187 | }
188 |
189 | -- https://docs.fivem.net/natives/?_0x2AA720E4287BF269
190 | Config.Neon = {
191 | { label = 'Left', id = 0 },
192 | { label = 'Right', id = 1 },
193 | { label = 'Front', id = 2 },
194 | { label = 'Back', id = 3 },
195 | }
196 |
197 | -- https://docs.fivem.net/natives/?_0x8E0A582209A62695
198 | Config.NeonColors = {
199 | { label = 'White', r = 222, g = 222, b = 255 },
200 | { label = 'Blue', r = 2, g = 21, b = 255 },
201 | { label = 'Electric Blue', r = 3, g = 83, b = 255 },
202 | { label = 'Mint Green', r = 0, g = 255, b = 140 },
203 | { label = 'Lime Green', r = 94, g = 255, b = 1 },
204 | { label = 'Yellow', r = 255, g = 255, b = 0 },
205 | { label = 'Golden Shower', r = 255, g = 150, b = 0 },
206 | { label = 'Orange', r = 255, g = 62, b = 0 },
207 | { label = 'Red', r = 255, g = 1, b = 1 },
208 | { label = 'Pony Pink', r = 255, g = 50, b = 100 },
209 | { label = 'Hot Pink', r = 255, g = 5, b = 190 },
210 | { label = 'Purple', r = 35, g = 1, b = 255 },
211 | { label = 'Blacklight', r = 15, g = 3, b = 255 },
212 | }
213 |
214 | -- https://docs.fivem.net/natives/?_0xB5BA80F839791C0F
215 | Config.TyreSmoke = {
216 | { label = 'White Smoke', r = 254, g = 254, b = 254 },
217 | { label = 'Black Smoke', r = 1, g = 1, b = 1 },
218 | { label = 'Blue Smoke', r = 0, g = 150, b = 255 },
219 | { label = 'Yellow Smoke', r = 255, g = 255, b = 50 },
220 | { label = 'Orange Smoke', r = 255, g = 153, b = 51 },
221 | { label = 'Red Smoke', r = 255, g = 10, b = 10 },
222 | { label = 'Green Smoke', r = 10, g = 255, b = 10 },
223 | { label = 'Purple Smoke', r = 153, g = 10, b = 153 },
224 | { label = 'Pink Smoke', r = 255, g = 102, b = 178 },
225 | { label = 'Gray Smoke', r = 128, g = 128, b = 128 }
226 | }
227 |
228 | Config.Paints = {
229 |
230 | Metallic = {
231 | { label = 'Metallic Black', id = 0, hex = '0d1116' },
232 | { label = 'Metallic Graphite Black', id = 1, hex = '1c1d21' },
233 | { label = 'Metallic Black Steal', id = 2, hex = '32383d' },
234 | { label = 'Metallic Dark Silver', id = 3, hex = '454b4f' },
235 | { label = 'Metallic Silver', id = 4, hex = '999da0' },
236 | { label = 'Metallic Blue Silver', id = 5, hex = 'c2c4c6' },
237 | { label = 'Metallic Steel Gray', id = 6, hex = '979a97' },
238 | { label = 'Metallic Shadow Silver', id = 7, hex = '637380' },
239 | { label = 'Metallic Stone Silver', id = 8, hex = '63625c' },
240 | { label = 'Metallic Midnight Silver', id = 9, hex = '3c3f47' },
241 | { label = 'Metallic Gun Metal', id = 10, hex = '444e54' },
242 | { label = 'Metallic Anthracite Grey', id = 11, hex = '1d2129' },
243 | { label = 'Metallic Red', id = 27, hex = 'c00e1a' },
244 | { label = 'Metallic Torino Red', id = 28, hex = 'da1918' },
245 | { label = 'Metallic Formula Red', id = 29, hex = 'b6111b' },
246 | { label = 'Metallic Blaze Red', id = 30, hex = 'a51e23' },
247 | { label = 'Metallic Graceful Red', id = 31, hex = '7b1a22' },
248 | { label = 'Metallic Garnet Red', id = 32, hex = '8e1b1f' },
249 | { label = 'Metallic Desert Red', id = 33, hex = '6f1818' },
250 | { label = 'Metallic Cabernet Red', id = 34, hex = '49111d' },
251 | { label = 'Metallic Candy Red', id = 35, hex = 'b60f25' },
252 | { label = 'Metallic Sunrise Orange', id = 36, hex = 'd44a17' },
253 | { label = 'Metallic Classic Gold', id = 37, hex = 'c2944f' },
254 | { label = 'Metallic Orange', id = 38, hex = 'f78616' },
255 | { label = 'Metallic Dark Green', id = 49, hex = '132428' },
256 | { label = 'Metallic Racing Green', id = 50, hex = '122e2b' },
257 | { label = 'Metallic Sea Green', id = 51, hex = '12383c' },
258 | { label = 'Metallic Olive Green', id = 52, hex = '31423f' },
259 | { label = 'Metallic Green', id = 53, hex = '155c2d' },
260 | { label = 'Metallic Gasoline Blue Green', id = 54, hex = '1b6770' },
261 | { label = 'Metallic Midnight Blue', id = 61, hex = '222e46' },
262 | { label = 'Metallic Dark Blue', id = 62, hex = '233155' },
263 | { label = 'Metallic Saxony Blue', id = 63, hex = '304c7e' },
264 | { label = 'Metallic Blue', id = 64, hex = '47578f' },
265 | { label = 'Metallic Mariner Blue', id = 65, hex = '637ba7' },
266 | { label = 'Metallic Harbor Blue', id = 66, hex = '394762' },
267 | { label = 'Metallic Diamond Blue', id = 67, hex = 'd6e7f1' },
268 | { label = 'Metallic Surf Blue', id = 68, hex = '76afbe' },
269 | { label = 'Metallic Nautical Blue', id = 69, hex = '345e72' },
270 | { label = 'Metallic Bright Blue', id = 70, hex = '0b9cf1' },
271 | { label = 'Metallic Purple Blue', id = 71, hex = '2f2d52' },
272 | { label = 'Metallic Spinnaker Blue', id = 72, hex = '282c4d' },
273 | { label = 'Metallic Ultra Blue', id = 73, hex = '2354a1' },
274 | { label = 'Metallic Bright Blue', id = 74, hex = '6ea3c6' },
275 | { label = 'Metallic Taxi Yellow', id = 88, hex = 'ffcf20' },
276 | { label = 'Metallic Race Yellow', id = 89, hex = 'fbe212' },
277 | { label = 'Metallic Bronze', id = 90, hex = '916532' },
278 | { label = 'Metallic Yellow Bird', id = 91, hex = 'e0e13d' },
279 | { label = 'Metallic Lime', id = 92, hex = '98d223' },
280 | { label = 'Metallic Champagne', id = 93, hex = '9b8c78' },
281 | { label = 'Metallic Pueblo Beige', id = 94, hex = '503218' },
282 | { label = 'Metallic Dark Ivory', id = 95, hex = '473f2b' },
283 | { label = 'Metallic Choco Brown', id = 96, hex = '221b19' },
284 | { label = 'Metallic Golden Brown', id = 97, hex = '653f23' },
285 | { label = 'Metallic Light Brown', id = 98, hex = '775c3e' },
286 | { label = 'Metallic Straw Beige', id = 99, hex = 'ac9975' },
287 | { label = 'Metallic Moss Brown', id = 100, hex = '6c6b4b' },
288 | { label = 'Metallic Biston Brown', id = 101, hex = '402e2b' },
289 | { label = 'Metallic Beechwood', id = 102, hex = 'a4965f' },
290 | { label = 'Metallic Dark Beechwood', id = 103, hex = '46231a' },
291 | { label = 'Metallic Choco Orange', id = 104, hex = '752b19' },
292 | { label = 'Metallic Beach Sand', id = 105, hex = 'bfae7b' },
293 | { label = 'Metallic Sun Bleeched Sand', id = 106, hex = 'dfd5b2' },
294 | { label = 'Metallic Cream', id = 107, hex = 'f7edd5' },
295 | { label = 'Metallic White', id = 111, hex = 'fffff6' },
296 | { label = 'Metallic Frost White', id = 112, hex = 'eaeaea' },
297 | { label = 'Metallic Securicor Green', id = 125, hex = '83c566' },
298 | { label = 'Metallic Vermillion Pink', id = 137, hex = 'df5891' },
299 | { label = 'Metallic Black Blue', id = 141, hex = '0a0c17' },
300 | { label = 'Metallic Black Purple', id = 142, hex = '0c0d18' },
301 | { label = 'Metallic Black Red', id = 143, hex = '0e0d14' },
302 | { label = 'Metallic Purple', id = 145, hex = '621276' },
303 | { label = 'Metallic V Dark Blue', id = 146, hex = '0b1421' },
304 | { label = 'Metallic Lava Red', id = 150, hex = 'bc1917' },
305 | },
306 |
307 | Matte = {
308 | { label = 'Matte Black', id = 12, hex = '13181f' },
309 | { label = 'Matte Gray', id = 13, hex = '26282a' },
310 | { label = 'Matte Light Grey', id = 14, hex = '515554' },
311 | { label = 'Matte Red', id = 39, hex = 'cf1f21' },
312 | { label = 'Matte Dark Red', id = 40, hex = '732021' },
313 | { label = 'Matte Orange', id = 41, hex = 'f27d20' },
314 | { label = 'Matte Yellow', id = 42, hex = 'ffc91f' },
315 | { label = 'Matte Lime Green', id = 55, hex = '66b81f' },
316 | { label = 'Matte Dark Blue', id = 82, hex = '1f2852' },
317 | { label = 'Matte Blue', id = 83, hex = '253aa7' },
318 | { label = 'Matte Midnight Blue', id = 84, hex = '1c3551' },
319 | { label = 'Matte Green', id = 128, hex = '4e6443' },
320 | { label = 'Matte Brown', id = 129, hex = 'bcac8f' },
321 | { label = 'Matte White', id = 131, hex = 'fcf9f1' },
322 | { label = 'Matte Purple', id = 148, hex = '6b1f7b' },
323 | { label = 'Matte Dark Purple', id = 149, hex = '1e1d22' },
324 | { label = 'Matte Forest Green', id = 151, hex = '2d362a' },
325 | { label = 'Matte Olive Drab', id = 152, hex = '696748' },
326 | { label = 'Matte Desert Brown', id = 153, hex = '7a6c55' },
327 | { label = 'Matte Desert Tan', id = 154, hex = 'c3b492' },
328 | { label = 'Matte Foilage Green', id = 155, hex = '5a6352' },
329 | },
330 |
331 | Util = {
332 | { label = 'Util Black', id = 15, hex = '151921' },
333 | { label = 'Util Black Poly', id = 16, hex = '1e2429' },
334 | { label = 'Util Dark Silver', id = 17, hex = '333a3c' },
335 | { label = 'Util Silver', id = 18, hex = '8c9095' },
336 | { label = 'Util Gun Metal', id = 19, hex = '39434d' },
337 | { label = 'Util Shadow Silver', id = 20, hex = '506272' },
338 | { label = 'Util Red', id = 43, hex = '9c1016' },
339 | { label = 'Util Bright Red', id = 44, hex = 'de0f18' },
340 | { label = 'Util Garnet Red', id = 45, hex = '8f1e17' },
341 | { label = 'Util Dark Green', id = 56, hex = '22383e' },
342 | { label = 'Util Green', id = 57, hex = '1d5a3f' },
343 | { label = 'Util Dark Blue', id = 75, hex = '112552' },
344 | { label = 'Util Midnight Blue', id = 76, hex = '1b203e' },
345 | { label = 'Util Blue', id = 77, hex = '275190' },
346 | { label = 'Util Sea Foam Blue', id = 78, hex = '608592' },
347 | { label = 'Util Lightning Blue', id = 79, hex = '2446a8' },
348 | { label = 'Util Maui Blue Poly', id = 80, hex = '4271e1' },
349 | { label = 'Util Bright Blue', id = 81, hex = '3b39e0' },
350 | { label = 'Util Brown', id = 108, hex = '3a2a1b' },
351 | { label = 'Util Medium Brown', id = 109, hex = '785f33' },
352 | { label = 'Util Light Brown', id = 110, hex = 'b5a079' },
353 | { label = 'Util Off White', id = 122, hex = 'dfddd0' },
354 | },
355 |
356 | Worn = {
357 | { label = 'Worn Black', id = 21, hex = '1e232f' },
358 | { label = 'Worn Graphite', id = 22, hex = '363a3f' },
359 | { label = 'Worn Silver Grey', id = 23, hex = 'a0a199' },
360 | { label = 'Worn Silver', id = 24, hex = 'd3d3d3' },
361 | { label = 'Worn Blue Silver', id = 25, hex = 'b7bfca' },
362 | { label = 'Worn Shadow Silver', id = 26, hex = '778794' },
363 | { label = 'Worn Red', id = 46, hex = 'a94744' },
364 | { label = 'Worn Golden Red', id = 47, hex = 'b16c51' },
365 | { label = 'Worn Dark Red', id = 48, hex = '371c25' },
366 | { label = 'Worn Dark Green', id = 58, hex = '2d423f' },
367 | { label = 'Worn Green', id = 59, hex = '45594b' },
368 | { label = 'Worn Sea Wash', id = 60, hex = '65867f' },
369 | { label = 'Worn Dark Blue', id = 85, hex = '4c5f81' },
370 | { label = 'Worn Blue', id = 86, hex = '58688e' },
371 | { label = 'Worn Light Blue', id = 87, hex = '74b5d8' },
372 | { label = 'Worn Honey Beige', id = 113, hex = 'b0ab94' },
373 | { label = 'Worn Brown', id = 114, hex = '453831' },
374 | { label = 'Worn Dark Brown', id = 115, hex = '2a282b' },
375 | { label = 'Worn Straw Beige', id = 116, hex = '726c57' },
376 | { label = 'Worn Off White', id = 121, hex = 'eae6de' },
377 | { label = 'Worn Orange', id = 123, hex = 'f2ad2e' },
378 | { label = 'Worn Light Orange', id = 124, hex = 'f9a458' },
379 | { label = 'Worn Taxi Yellow', id = 126, hex = 'f1cc40' },
380 | { label = 'Worn Orange', id = 130, hex = 'f8b658' },
381 | { label = 'Worn White', id = 132, hex = 'fffffb' },
382 | { label = 'Worn Olive Army Green', id = 133, hex = '81844c' },
383 | },
384 |
385 | Misc = {
386 | { label = 'Brushed Steel', id = 117, hex = '6a747c' },
387 | { label = 'Brushed Black Steel', id = 118, hex = '354158' },
388 | { label = 'Brushed Aluminium', id = 119, hex = '9ba0a8' },
389 | { label = 'Chrome', id = 120, hex = '5870a1' },
390 | { label = 'Police Car Blue', id = 127, hex = '4cc3da' },
391 | { label = 'Pure White', id = 134, hex = 'ffffff' },
392 | { label = 'Hot Pink', id = 135, hex = 'f21f99' },
393 | { label = 'Salmon Pink', id = 136, hex = 'fdd6cd' },
394 | { label = 'Orange', id = 138, hex = 'f6ae20' },
395 | { label = 'Green', id = 139, hex = 'b0ee6e' },
396 | { label = 'Blue', id = 140, hex = '08e9fa' },
397 | { label = 'Hunter Green', id = 144, hex = '9f9e8a' },
398 | { label = 'Mod Shop Black', id = 147, hex = '11141a' },
399 | { label = 'Alloy', id = 156, hex = '81827f' },
400 | { label = 'Epsilon Blue', id = 157, hex = 'afd6e4' },
401 | { label = 'Pure Gold', id = 158, hex = '7a6440' },
402 | { label = 'Brushed Gold', id = 159, hex = '7f6a48' }
403 | },
404 |
405 | Chameleon = {
406 | { label = 'Anodized Red', id = 161, hex = 'CF1020' },
407 | { label = 'Anodized Wine', id = 162, hex = '5E1224' },
408 | { label = 'Anodized Purple', id = 163, hex = '800080' },
409 | { label = 'Anodized Blue', id = 164, hex = '0000FF' },
410 | { label = 'Anodized Green', id = 165, hex = '008000' },
411 | { label = 'Anodized Lime', id = 166, hex = 'AFFF00' },
412 | { label = 'Anodized Copper', id = 167, hex = 'B87333' },
413 | { label = 'Anodized Bronze', id = 168, hex = 'CD7F32' },
414 | { label = 'Anodized Champagne', id = 169, hex = 'F7E7CE' },
415 | { label = 'Anodized Gold', id = 170, hex = 'FFD700' },
416 | { label = 'Green Blue Flip', id = 171, hex = '1164B4' },
417 | { label = 'Green Red Flip', id = 172, hex = 'B43104' },
418 | { label = 'Green Brown Flip', id = 173, hex = '735C12' },
419 | { label = 'Green Turquoise Flip', id = 174, hex = '43C6DB' },
420 | { label = 'Green Purple Flip', id = 175, hex = '9D00FF' },
421 | { label = 'Teal Purple Flip', id = 176, hex = '6A0DAD' },
422 | { label = 'Turquoise Red Flip', id = 177, hex = 'E60026' },
423 | { label = 'Turquoise Purple Flip', id = 178, hex = '30D5C8' },
424 | { label = 'Cyan Purple Flip', id = 179, hex = '0FF0FC' },
425 | { label = 'Blue Pink Flip', id = 180, hex = '4C2882' },
426 | { label = 'Blue Green Flip', id = 181, hex = '138808' },
427 | { label = 'Purple Red Flip', id = 182, hex = '9B111E' },
428 | { label = 'Purple Green Flip', id = 183, hex = '6B2E53' },
429 | { label = 'Magenta Green Flip', id = 184, hex = 'CA1F7B' },
430 | { label = 'Magenta Yellow Flip', id = 185, hex = 'FEDF00' },
431 | { label = 'Burgundy Green Flip', id = 186, hex = '900020' },
432 | { label = 'Magenta Cyan Flip', id = 187, hex = '00FFA1' },
433 | { label = 'Copper Purple Flip', id = 188, hex = 'B87333' },
434 | { label = 'Magenta Orange Flip', id = 189, hex = 'FF5F1F' },
435 | { label = 'Red Orange Flip', id = 190, hex = 'FF4500' },
436 | { label = 'Orange Purple Flip', id = 191, hex = 'B04080' },
437 | { label = 'Orange Blue Flip', id = 192, hex = '0047AB' },
438 | { label = 'White Purple Flip', id = 193, hex = 'F8F0E3' },
439 | { label = 'Red Rainbow Flip', id = 194, hex = 'ED2939' },
440 | { label = 'Blue Rainbow Flip', id = 195, hex = '4B0082' },
441 | { label = 'Dark Green Pearl', id = 196, hex = '013220' },
442 | { label = 'Dark Teal Pearl', id = 197, hex = '008080' },
443 | { label = 'Dark Blue Pearl', id = 198, hex = '000080' },
444 | { label = 'Dark Purple Pearl', id = 199, hex = '301934' },
445 | { label = 'Oil Slick Pearl', id = 200, hex = '4B0082' },
446 | { label = 'Light Green Pearl', id = 201, hex = '99E550' },
447 | { label = 'Light Blue Pearl', id = 202, hex = 'ADD8E6' },
448 | { label = 'Light Purple Pearl', id = 203, hex = '967BB6' },
449 | { label = 'Light Pink Pearl', id = 203, hex = 'FFB6C1' },
450 | { label = 'Off White Pearl', id = 204, hex = 'F2F0E6' },
451 | { label = 'Pink Pearl', id = 205, hex = 'EAADEA' },
452 | { label = 'Yellow Pearl', id = 206, hex = 'FFF000' },
453 | { label = 'Green Pearl', id = 207, hex = '00A550' },
454 | { label = 'Blue Pearl', id = 208, hex = '0000FF' },
455 | { label = 'Cream Pearl', id = 209, hex = 'FFFDD0' },
456 | { label = 'White Prismatic', id = 210, hex = 'FFFFFF' },
457 | { label = 'Graphite Prismatic', id = 211, hex = '251607' },
458 | { label = 'Dark Blue Prismatic', id = 212, hex = '00008B' },
459 | { label = 'Dark Purple Prismatic', id = 213, hex = '301934' },
460 | { label = 'Hot Pink Prismatic', id = 214, hex = 'FF69B4' },
461 | { label = 'Dark Red Prismatic', id = 215, hex = '8B0000' },
462 | { label = 'Dark GREEN Prismatic', id = 216, hex = '013220' },
463 | { label = 'Black Prismatic', id = 217, hex = '000000' },
464 | { label = 'Black Oil Spill', id = 218, hex = '121212' },
465 | { label = 'Black Rainbow', id = 219, hex = '000000' },
466 | { label = 'Prismatic', id = 220, hex = 'CCCCCC' },
467 | { label = 'Black Holographic', id = 221, hex = '101010' },
468 | { label = 'White Holographic', id = 222, hex = 'E6E8FA' },
469 | { label = 'Monochrome', id = 223, hex = 'B4B4B4' },
470 | { label = 'Night & Day', id = 224, hex = '333366' },
471 | { label = 'The Verlierer', id = 225, hex = '550055' },
472 | { label = 'Sprunk Extreme', id = 226, hex = '00FF00' },
473 | { label = 'Vice City', id = 227, hex = 'FF00FF' },
474 | { label = 'Synthwave Nights', id = 228, hex = 'FF007F' },
475 | { label = 'Four Seasons', id = 229, hex = '73C2FB' },
476 | { label = 'Maisonette 9 Throwback', id = 230, hex = 'DCDCDC' },
477 | { label = 'Bubblegum', id = 231, hex = 'FFC0CB' },
478 | { label = 'Full Rainbow', id = 232, hex = 'FF0000' },
479 | { label = 'Sunset', id = 233, hex = 'FFD700' },
480 | { label = 'The Seven', id = 234, hex = '701C1C' },
481 | { label = 'Kamen Rider', id = 235, hex = '1C1C70' },
482 | { label = 'Chromatic Aberration', id = 236, hex = 'D8BFD8' },
483 | { label = "It's Christmas", id = 237, hex = 'FF0000' },
484 | { label = 'Temperature', id = 238, hex = 'FFA07A' },
485 | { label = 'Yellow Orange Pearl', id = 239, hex = 'FFAE42' },
486 | { label = 'Pink Blue Pearl', id = 240, hex = 'D8BFD8' },
487 | { label = 'Green Blue Pearl', id = 241, hex = '3CB371' },
488 | { label = 'Turquoise Black Pearl', id = 242, hex = '00CED1' }
489 | },
490 | }
491 |
492 | if Config.ColorFavorites then
493 | Config.Paints.Favorites = { -- add your favorite custom colors here by hex
494 | { label = 'My Custom Paint Name!', hex = '' }
495 | }
496 | end
497 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------