├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature-request.md ├── auto_assign.yml ├── contributing.md ├── pull_request_template.md └── workflows │ ├── lint.yml │ └── stale.yml ├── LICENSE ├── README.md ├── client ├── afk.lua ├── binoculars.lua ├── calmai.lua ├── carwash.lua ├── consumables.lua ├── crouchprone.lua ├── cruise.lua ├── discord.lua ├── editor.lua ├── fireworks.lua ├── handsup.lua ├── hudcomponents.lua ├── ignore.lua ├── noshuff.lua ├── point.lua ├── removeentities.lua ├── seatbelt.lua ├── tackle.lua ├── teleports.lua ├── vehiclepush.lua ├── vehicletext.lua └── weapdrop.lua ├── config.lua ├── events.meta ├── fxmanifest.lua ├── locales ├── de.lua ├── en.lua ├── es.lua ├── nl.lua ├── pt-br.lua └── pt.lua ├── popgroups.ymt ├── relationships.dat ├── server ├── afk.lua ├── consumables.lua ├── entities.lua ├── logs.lua ├── main.lua └── timedjobs.lua └── stream └── car_gen_disablers ├── ap1_01_a_strm_0.ymap ├── ap1_01_a_strm_17.ymap ├── ap1_01_a_strm_3.ymap ├── ap1_01_a_strm_6.ymap ├── ap1_01_a_strm_8.ymap ├── ap1_01_c_strm_0.ymap ├── ap1_02_strm_0.ymap ├── ch3_04_strm_0.ymap ├── cs3_07_strm_0.ymap ├── cs3_07_strm_4.ymap ├── cs3_07_strm_5.ymap ├── cs3_07_strm_7.ymap ├── hei_ap1_01_a_strm_0.ymap ├── hei_ap1_01_a_strm_3.ymap ├── hei_ap1_01_c_strm_0.ymap ├── hei_ap1_02_strm_0.ymap ├── hei_ch3_04_strm_0.ymap ├── hei_cs2_06b_strm_0.ymap ├── hei_cs3_07_strm_0.ymap ├── hei_cs3_07_strm_4.ymap └── hei_cs3_07_strm_5.ymap /.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 | -------------------------------------------------------------------------------- /.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/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/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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # qb-smallresources 2 | Base scripts for QB-Core Framework :building_construction: 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](https://github.com/qbcore-framework/qb-core) 25 | 26 | ## Features 27 | - Consumeable foods/beverages/drinks/drugs (sandwich, water_bottle, tosti, beer, vodka etc.) 28 | - Removal of GTA's default weapons drops 29 | - Drug effects 30 | - Removal of GTA's default vehicle spawns (planes, helicopters, emergency vehicles etc.) 31 | - Removal of GTA's default emergency service npcs 32 | - Removal of GTA's default wanted system 33 | - Useable binoculars 34 | - Weapon draw animations (normal/holster) 35 | - Ability to add teleport markers (from a place to another place) 36 | - Taking hostage 37 | - Pointing animation with finger (by pressing "B") 38 | - Seatbelt and cruise control 39 | - Useable parachute 40 | - Useable armor 41 | - Weapon recoil (specific to each weapon) 42 | - Tackle 43 | - Calm AI (adjusting npc/gang npc aggresiveness) 44 | - Race Harness 45 | - /id to see the id 46 | - Adjusting npc/vehicle/parked vehicle spawn rates 47 | - Infinite ammo for fire extinguisher and petrol can 48 | - Removal of GTA's default huds (weapon wheel, cash etc.) 49 | - Fireworks 50 | - Automatically engine on after entering vehicle 51 | - Discord rich presence 52 | - Crouch and prone 53 | 54 | 55 | 56 | 57 | ## Installation 58 | ### Manual 59 | - Download the script and put it in the `[qb]` directory. 60 | - Add the following code to your server.cfg/resouces.cfg 61 | ``` 62 | ensure qb-core 63 | ensure qb-smallresources 64 | ``` 65 | 66 | ## Configuration 67 | Each feature has a different file name correlative with its function. You can configure each one by its own. 68 | -------------------------------------------------------------------------------- /client/afk.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local isLoggedIn = LocalPlayer.state.isLoggedIn 3 | local checkUser = true 4 | local prevPos, time = nil, nil 5 | local timeMinutes = { 6 | ['900'] = 'minutes', 7 | ['600'] = 'minutes', 8 | ['300'] = 'minutes', 9 | ['150'] = 'minutes', 10 | ['60'] = 'minutes', 11 | ['30'] = 'seconds', 12 | ['20'] = 'seconds', 13 | ['10'] = 'seconds', 14 | } 15 | 16 | local function updatePermissionLevel() 17 | QBCore.Functions.TriggerCallback('qb-afkkick:server:GetPermissions', function(userGroups) 18 | for k in pairs(userGroups) do 19 | if Config.AFK.ignoredGroups[k] then 20 | checkUser = false 21 | break 22 | end 23 | checkUser = true 24 | end 25 | end) 26 | end 27 | 28 | RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() 29 | updatePermissionLevel() 30 | isLoggedIn = true 31 | end) 32 | 33 | RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() 34 | isLoggedIn = false 35 | end) 36 | 37 | RegisterNetEvent('QBCore:Client:OnPermissionUpdate', function() 38 | updatePermissionLevel() 39 | end) 40 | 41 | CreateThread(function() 42 | while true do 43 | Wait(10000) 44 | local ped = PlayerPedId() 45 | if isLoggedIn == true or Config.AFK.kickInCharMenu == true then 46 | if checkUser then 47 | local currPos = GetEntityCoords(ped, true) 48 | if prevPos then 49 | if currPos == prevPos then 50 | if time then 51 | if time > 0 then 52 | local _type = timeMinutes[tostring(time)] 53 | if _type == 'minutes' then 54 | QBCore.Functions.Notify(Lang:t('afk.will_kick') .. math.ceil(time / 60) .. Lang:t('afk.time_minutes'), 'error', 10000) 55 | elseif _type == 'seconds' then 56 | QBCore.Functions.Notify(Lang:t('afk.will_kick') .. time .. Lang:t('afk.time_seconds'), 'error', 10000) 57 | end 58 | time -= 10 59 | else 60 | TriggerServerEvent('KickForAFK') 61 | end 62 | else 63 | time = Config.AFK.secondsUntilKick 64 | end 65 | else 66 | time = Config.AFK.secondsUntilKick 67 | end 68 | end 69 | prevPos = currPos 70 | end 71 | end 72 | end 73 | end) -------------------------------------------------------------------------------- /client/binoculars.lua: -------------------------------------------------------------------------------- 1 | local binoculars = false 2 | local fov_max = 70.0 3 | local fov_min = 5.0 -- max zoom level (smaller fov is more zoom) 4 | local fov = (fov_max + fov_min) * 0.5 5 | local speed_lr = 8.0 -- speed by which the camera pans left-right 6 | local speed_ud = 8.0 -- speed by which the camera pans up-down 7 | 8 | --FUNCTIONS-- 9 | 10 | local function HideHUDThisFrame() 11 | local componentsToHide = {1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 18, 19} 12 | 13 | for i = 1, #componentsToHide do 14 | local component = componentsToHide[i] 15 | HideHudComponentThisFrame(component) 16 | end 17 | 18 | HideHelpTextThisFrame() 19 | HideHudAndRadarThisFrame() 20 | end 21 | 22 | local function checkInputRot(cam, zoomValue) 23 | local rightAxisX = GetDisabledControlNormal(0, 220) 24 | local rightAxisY = GetDisabledControlNormal(0, 221) 25 | local rot = GetCamRot(cam, 2) 26 | if rightAxisX ~= 0.0 or rightAxisY ~= 0.0 then 27 | local new_z = rot.z + rightAxisX * -1.0 * speed_ud * (zoomValue + 0.1) 28 | local new_x = math.max(math.min(20.0, rot.x + rightAxisY * -1.0 * speed_lr * (zoomValue + 0.1)), -89.5) 29 | SetCamRot(cam, new_x, 0.0, new_z, 2) 30 | SetEntityHeading(PlayerPedId(), new_z) 31 | end 32 | end 33 | 34 | local function handleZoom(cam) 35 | local ped = PlayerPedId() 36 | local scrollUpControl = IsPedSittingInAnyVehicle(ped) and 17 or 241 37 | local scrollDownControl = IsPedSittingInAnyVehicle(ped) and 16 or 242 38 | 39 | if IsControlJustPressed(0, scrollUpControl) then 40 | fov = math.max(fov - Config.Binoculars.zoomSpeed, fov_min) 41 | end 42 | 43 | if IsControlJustPressed(0, scrollDownControl) then 44 | fov = math.min(fov + Config.Binoculars.zoomSpeed, fov_max) 45 | end 46 | 47 | local current_fov = GetCamFov(cam) 48 | 49 | if math.abs(fov - current_fov) < 0.1 then 50 | fov = current_fov 51 | end 52 | 53 | SetCamFov(cam, current_fov + (fov - current_fov) * 0.05) 54 | end 55 | 56 | --THREADS-- 57 | 58 | function binocularLoop() 59 | CreateThread(function() 60 | local ped = PlayerPedId() 61 | 62 | if not IsPedSittingInAnyVehicle(ped) then 63 | TaskStartScenarioInPlace(ped, 'WORLD_HUMAN_BINOCULARS', 0, true) 64 | PlayPedAmbientSpeechNative(ped, 'GENERIC_CURSE_MED', 'SPEECH_PARAMS_FORCE') 65 | end 66 | 67 | Wait(2500) 68 | 69 | SetTimecycleModifier('default') 70 | SetTimecycleModifierStrength(0.3) 71 | local scaleform = RequestScaleformMovie('BINOCULARS') 72 | while not HasScaleformMovieLoaded(scaleform) do 73 | Wait(10) 74 | end 75 | 76 | local cam = CreateCam('DEFAULT_SCRIPTED_FLY_CAMERA', true) 77 | AttachCamToEntity(cam, ped, 0.0, 0.0, 1.0, true) 78 | SetCamRot(cam, 0.0, 0.0, GetEntityHeading(ped), 2) 79 | SetCamFov(cam, fov) 80 | RenderScriptCams(true, false, 0, true, false) 81 | PushScaleformMovieFunction(scaleform, 'SET_CAM_LOGO') 82 | PushScaleformMovieFunctionParameterInt(0) -- 0 for nothing, 1 for LSPD logo 83 | PopScaleformMovieFunctionVoid() 84 | 85 | while binoculars and IsPedUsingScenario(ped, 'WORLD_HUMAN_BINOCULARS') do 86 | if IsControlJustPressed(0, Config.Binoculars.storeBinocularsKey) then 87 | binoculars = false 88 | PlaySoundFrontend(-1, 'SELECT', 'HUD_FRONTEND_DEFAULT_SOUNDSET', false) 89 | ClearPedTasks(ped) 90 | end 91 | 92 | local zoomValue = (1.0 / (fov_max - fov_min)) * (fov - fov_min) 93 | checkInputRot(cam, zoomValue) 94 | handleZoom(cam) 95 | HideHUDThisFrame() 96 | DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0) 97 | Wait(0) 98 | end 99 | binoculars = false 100 | ClearTimecycleModifier() 101 | fov = (fov_max + fov_min) * 0.5 102 | RenderScriptCams(false, false, 0, true, false) 103 | SetScaleformMovieAsNoLongerNeeded(scaleform) 104 | DestroyCam(cam, false) 105 | SetNightvision(false) 106 | SetSeethrough(false) 107 | end) 108 | end 109 | 110 | --EVENTS-- 111 | 112 | -- Activate binoculars 113 | RegisterNetEvent('binoculars:Toggle', function() 114 | binoculars = not binoculars 115 | if binoculars then binocularLoop() return end 116 | ClearPedTasks(PlayerPedId()) 117 | end) 118 | -------------------------------------------------------------------------------- /client/calmai.lua: -------------------------------------------------------------------------------- 1 | -- Relationship Types: 2 | -- 0 = Companion 3 | -- 1 = Respect 4 | -- 2 = Like 5 | -- 3 = Neutral 6 | -- 4 = Dislike 7 | -- 5 = Hate 8 | 9 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_HILLBILLY`, `PLAYER`) 10 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_BALLAS`, `PLAYER`) 11 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_MEXICAN`, `PLAYER`) 12 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_FAMILY`, `PLAYER`) 13 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_MARABUNTE`, `PLAYER`) 14 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_SALVA`, `PLAYER`) 15 | SetRelationshipBetweenGroups(1, `AMBIENT_GANG_LOST`, `PLAYER`) 16 | SetRelationshipBetweenGroups(1, `GANG_1`, `PLAYER`) 17 | SetRelationshipBetweenGroups(1, `GANG_2`, `PLAYER`) 18 | SetRelationshipBetweenGroups(1, `GANG_9`, `PLAYER`) 19 | SetRelationshipBetweenGroups(1, `GANG_10`, `PLAYER`) 20 | SetRelationshipBetweenGroups(1, `FIREMAN`, `PLAYER`) 21 | SetRelationshipBetweenGroups(1, `MEDIC`, `PLAYER`) 22 | SetRelationshipBetweenGroups(1, `COP`, `PLAYER`) 23 | SetRelationshipBetweenGroups(1, `PRISONER`, `PLAYER`) 24 | -------------------------------------------------------------------------------- /client/carwash.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local washingVeh, listen = false, false 3 | local washPoly = {} 4 | 5 | local function washLoop() 6 | CreateThread(function() 7 | while listen do 8 | local ped = PlayerPedId() 9 | local veh = GetVehiclePedIsIn(ped, false) 10 | local driver = GetPedInVehicleSeat(veh, -1) 11 | local dirtLevel = GetVehicleDirtLevel(veh) 12 | if driver == ped and not washingVeh then 13 | if IsControlPressed(0, 38) then 14 | if dirtLevel > Config.CarWash.dirtLevel then 15 | TriggerServerEvent('qb-carwash:server:washCar') 16 | else 17 | QBCore.Functions.Notify(Lang:t('wash.dirty'), 'error') 18 | end 19 | listen = false 20 | break 21 | end 22 | end 23 | Wait(0) 24 | end 25 | end) 26 | end 27 | 28 | RegisterNetEvent('qb-carwash:client:washCar', function() 29 | local ped = PlayerPedId() 30 | local veh = GetVehiclePedIsIn(ped, false) 31 | washingVeh = true 32 | QBCore.Functions.Progressbar('search_cabin', Lang:t('wash.in_progress'), math.random(4000, 8000), false, true, { 33 | disableMovement = true, 34 | disableCarMovement = true, 35 | disableMouse = false, 36 | disableCombat = true, 37 | }, {}, {}, {}, function() -- Done 38 | SetVehicleDirtLevel(veh, 0.0) 39 | SetVehicleUndriveable(veh, false) 40 | WashDecalsFromVehicle(veh, 1.0) 41 | washingVeh = false 42 | end, function() -- Cancel 43 | QBCore.Functions.Notify(Lang:t('wash.cancel'), 'error') 44 | washingVeh = false 45 | end) 46 | end) 47 | 48 | CreateThread(function() 49 | for k, v in pairs(Config.CarWash.locations) do 50 | if Config.UseTarget then 51 | exports["qb-target"]:AddBoxZone('carwash_'..k, v.coords, v.length, v.width, { 52 | name = 'carwash_'..k, 53 | debugPoly = false, 54 | heading = v.heading, 55 | minZ = v.coords.z - 5, 56 | maxZ = v.coords.z + 5, 57 | }, { 58 | options = { 59 | { 60 | icon = "fa-car-wash", 61 | label = Lang:t('wash.wash_vehicle_target'), 62 | action = function() 63 | local ped = PlayerPedId() 64 | local veh = GetVehiclePedIsIn(ped, false) 65 | local driver = GetPedInVehicleSeat(veh, -1) 66 | local dirtLevel = GetVehicleDirtLevel(veh) 67 | if driver == ped and not washingVeh then 68 | if dirtLevel > Config.CarWash.dirtLevel then 69 | TriggerServerEvent('qb-carwash:server:washCar') 70 | else 71 | QBCore.Functions.Notify(Lang:t('wash.dirty'), 'error') 72 | end 73 | end 74 | end, 75 | canInteract = function() 76 | if IsPedInAnyVehicle(PlayerPedId(), false) then return true end 77 | end, 78 | } 79 | }, 80 | distance = 3 81 | }) 82 | else 83 | washPoly[#washPoly + 1] = BoxZone:Create(vector3(v.coords.x, v.coords.y, v.coords.z), v.length, v.width, { 84 | heading = v.heading, 85 | name = 'carwash', 86 | debugPoly = false, 87 | minZ = v.coords.z - 5, 88 | maxZ = v.coords.z + 5, 89 | }) 90 | local washCombo = ComboZone:Create(washPoly, {name = "washPoly"}) 91 | washCombo:onPlayerInOut(function(isPointInside) 92 | if isPointInside and IsPedInAnyVehicle(PlayerPedId(), false) then 93 | exports['qb-core']:DrawText(Lang:t('wash.wash_vehicle'),'left') 94 | if not listen then 95 | listen = true 96 | washLoop() 97 | end 98 | else 99 | listen = false 100 | exports['qb-core']:HideText() 101 | end 102 | end) 103 | end 104 | end 105 | end) 106 | 107 | CreateThread(function() 108 | for k in pairs(Config.CarWash.locations) do 109 | local carWash = AddBlipForCoord(Config.CarWash.locations[k].coords.x, Config.CarWash.locations[k].coords.y, Config.CarWash.locations[k].coords.z) 110 | SetBlipSprite (carWash, 100) 111 | SetBlipDisplay(carWash, 4) 112 | SetBlipScale (carWash, 0.75) 113 | SetBlipAsShortRange(carWash, true) 114 | SetBlipColour(carWash, 37) 115 | BeginTextCommandSetBlipName('STRING') 116 | AddTextComponentSubstringPlayerName('Hands Free Carwash') 117 | EndTextCommandSetBlipName(carWash) 118 | end 119 | end) -------------------------------------------------------------------------------- /client/consumables.lua: -------------------------------------------------------------------------------- 1 | -- Variables 2 | 3 | local QBCore = exports['qb-core']:GetCoreObject() 4 | local alcoholCount = 0 5 | local healing, parachuteEquipped = false, false 6 | local currVest, currVestTexture = nil, nil 7 | 8 | -- Functions 9 | RegisterNetEvent('QBCore:Client:UpdateObject', function() 10 | QBCore = exports['qb-core']:GetCoreObject() 11 | end) 12 | 13 | local function loadAnimDict(dict) 14 | if HasAnimDictLoaded(dict) then return end 15 | RequestAnimDict(dict) 16 | while not HasAnimDictLoaded(dict) do 17 | Wait(10) 18 | end 19 | end 20 | 21 | local function equipParachuteAnim() 22 | loadAnimDict('clothingshirt') 23 | TaskPlayAnim(PlayerPedId(), 'clothingshirt', 'try_shirt_positive_d', 8.0, 1.0, -1, 49, 0, false, false, false) 24 | end 25 | 26 | local function healOxy() 27 | if healing then return end 28 | 29 | healing = true 30 | 31 | local count = 9 32 | while count > 0 do 33 | Wait(1000) 34 | count -= 1 35 | SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId()) + 6) 36 | end 37 | healing = false 38 | end 39 | 40 | local function trevorEffect() 41 | StartScreenEffect('DrugsTrevorClownsFightIn', 3.0, 0) 42 | Wait(3000) 43 | StartScreenEffect('DrugsTrevorClownsFight', 3.0, 0) 44 | Wait(3000) 45 | StartScreenEffect('DrugsTrevorClownsFightOut', 3.0, 0) 46 | StopScreenEffect('DrugsTrevorClownsFight') 47 | StopScreenEffect('DrugsTrevorClownsFightIn') 48 | StopScreenEffect('DrugsTrevorClownsFightOut') 49 | end 50 | 51 | local function methBagEffect() 52 | local startStamina = 8 53 | trevorEffect() 54 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.49) 55 | while startStamina > 0 do 56 | Wait(1000) 57 | if math.random(5, 100) < 10 then 58 | RestorePlayerStamina(PlayerId(), 1.0) 59 | end 60 | startStamina = startStamina - 1 61 | if math.random(5, 100) < 51 then 62 | trevorEffect() 63 | end 64 | end 65 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.0) 66 | end 67 | 68 | local function ecstasyEffect() 69 | local startStamina = 30 70 | SetFlash(0, 0, 500, 7000, 500) 71 | while startStamina > 0 do 72 | Wait(1000) 73 | startStamina -= 1 74 | RestorePlayerStamina(PlayerId(), 1.0) 75 | if math.random(1, 100) < 51 then 76 | SetFlash(0, 0, 500, 7000, 500) 77 | ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08) 78 | end 79 | end 80 | if IsPedRunning(PlayerPedId()) then 81 | SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) 82 | end 83 | end 84 | 85 | local function alienEffect() 86 | StartScreenEffect('DrugsMichaelAliensFightIn', 3.0, 0) 87 | Wait(math.random(5000, 8000)) 88 | StartScreenEffect('DrugsMichaelAliensFight', 3.0, 0) 89 | Wait(math.random(5000, 8000)) 90 | StartScreenEffect('DrugsMichaelAliensFightOut', 3.0, 0) 91 | StopScreenEffect('DrugsMichaelAliensFightIn') 92 | StopScreenEffect('DrugsMichaelAliensFight') 93 | StopScreenEffect('DrugsMichaelAliensFightOut') 94 | end 95 | 96 | local function crackBaggyEffect() 97 | local startStamina = 8 98 | local ped = PlayerPedId() 99 | alienEffect() 100 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.3) 101 | while startStamina > 0 do 102 | Wait(1000) 103 | if math.random(1, 100) < 10 then 104 | RestorePlayerStamina(PlayerId(), 1.0) 105 | end 106 | startStamina -= 1 107 | if math.random(1, 100) < 60 and IsPedRunning(ped) then 108 | SetPedToRagdoll(ped, math.random(1000, 2000), math.random(1000, 2000), 3, false, false, false) 109 | end 110 | if math.random(1, 100) < 51 then 111 | alienEffect() 112 | end 113 | end 114 | if IsPedRunning(ped) then 115 | SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) 116 | end 117 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.0) 118 | end 119 | 120 | local function cokeBaggyEffect() 121 | local startStamina = 20 122 | local ped = PlayerPedId() 123 | alienEffect() 124 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.1) 125 | while startStamina > 0 do 126 | Wait(1000) 127 | if math.random(1, 100) < 20 then 128 | RestorePlayerStamina(PlayerId(), 1.0) 129 | end 130 | startStamina -= 1 131 | if math.random(1, 100) < 10 and IsPedRunning(ped) then 132 | SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) 133 | end 134 | if math.random(1, 300) < 10 then 135 | alienEffect() 136 | Wait(math.random(3000, 6000)) 137 | end 138 | end 139 | if IsPedRunning(ped) then 140 | SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) 141 | end 142 | SetRunSprintMultiplierForPlayer(PlayerId(), 1.0) 143 | end 144 | 145 | -- Events 146 | 147 | RegisterNetEvent('consumables:client:Eat', function(itemName) 148 | QBCore.Functions.Progressbar('eat_something', Lang:t('consumables.eat_progress'), 5000, false, true, { 149 | disableMovement = false, 150 | disableCarMovement = false, 151 | disableMouse = false, 152 | disableCombat = true 153 | }, { 154 | animDict = 'mp_player_inteat@burger', 155 | anim = 'mp_player_int_eat_burger', 156 | flags = 49 157 | }, { 158 | model = 'prop_cs_burger_01', 159 | bone = 60309, 160 | coords = vec3(0.0, 0.0, -0.02), 161 | rotation = vec3(30, 0.0, 0.0), 162 | }, {}, function() -- Done 163 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove') 164 | TriggerServerEvent('consumables:server:addHunger', QBCore.Functions.GetPlayerData().metadata.hunger + Config.Consumables.eat[itemName]) 165 | TriggerServerEvent('hud:server:RelieveStress', math.random(2, 4)) 166 | end) 167 | end) 168 | 169 | RegisterNetEvent('consumables:client:Drink', function(itemName) 170 | QBCore.Functions.Progressbar('drink_something', Lang:t('consumables.drink_progress'), 5000, false, true, { 171 | disableMovement = false, 172 | disableCarMovement = false, 173 | disableMouse = false, 174 | disableCombat = true 175 | }, { 176 | animDict = 'mp_player_intdrink', 177 | anim = 'loop_bottle', 178 | flags = 49 179 | }, { 180 | model = 'vw_prop_casino_water_bottle_01a', 181 | bone = 60309, 182 | coords = vec3(0.0, 0.0, -0.05), 183 | rotation = vec3(0.0, 0.0, -40), 184 | }, {}, function() -- Done 185 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove') 186 | TriggerServerEvent('consumables:server:addThirst', QBCore.Functions.GetPlayerData().metadata.thirst + Config.Consumables.drink[itemName]) 187 | end) 188 | end) 189 | 190 | RegisterNetEvent('consumables:client:DrinkAlcohol', function(itemName) 191 | QBCore.Functions.Progressbar('drink_alcohol', Lang:t('consumables.liqour_progress'), math.random(3000, 6000), false, true, { 192 | disableMovement = false, 193 | disableCarMovement = false, 194 | disableMouse = false, 195 | disableCombat = true 196 | }, { 197 | animDict = 'mp_player_intdrink', 198 | anim = 'loop_bottle', 199 | flags = 49 200 | }, { 201 | model = 'prop_cs_beer_bot_40oz', 202 | bone = 60309, 203 | coords = vec3(0.0, 0.0, -0.05), 204 | rotation = vec3(0.0, 0.0, -40), 205 | }, {}, function() -- Done 206 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove') 207 | TriggerServerEvent('consumables:server:drinkAlcohol', itemName) 208 | TriggerServerEvent('consumables:server:addThirst', QBCore.Functions.GetPlayerData().metadata.thirst + Config.Consumables.alcohol[itemName]) 209 | TriggerServerEvent('hud:server:RelieveStress', math.random(2, 4)) 210 | alcoholCount += 1 211 | AlcoholLoop() 212 | if alcoholCount > 1 and alcoholCount < 4 then 213 | TriggerEvent('evidence:client:SetStatus', 'alcohol', 200) 214 | elseif alcoholCount >= 4 then 215 | TriggerEvent('evidence:client:SetStatus', 'heavyalcohol', 200) 216 | end 217 | end, function() -- Cancel 218 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 219 | end) 220 | end) 221 | 222 | RegisterNetEvent('consumables:client:Custom', function(itemName) 223 | QBCore.Functions.TriggerCallback('consumables:itemdata', function(data) 224 | QBCore.Functions.Progressbar('custom_consumable', data.progress.label, data.progress.time, false, true, { 225 | disableMovement = false, 226 | disableCarMovement = false, 227 | disableMouse = false, 228 | disableCombat = true 229 | }, { 230 | animDict = data.animation.animDict, 231 | anim = data.animation.anim, 232 | flags = data.animation.flags 233 | }, { 234 | model = data.prop.model, 235 | bone = data.prop.bone, 236 | coords = data.prop.coords, 237 | rotation = data.prop.rotation 238 | }, {}, function() -- Done 239 | ClearPedTasks(PlayerPedId()) 240 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove') 241 | if data.replenish.type then 242 | TriggerServerEvent('consumables:server:add' .. data.replenish.type, QBCore.Functions.GetPlayerData().metadata[string.lower(data.replenish.type)] + data.replenish.replenish) 243 | end 244 | if data.replenish.isAlcohol then 245 | alcoholCount += 1 246 | AlcoholLoop() 247 | if alcoholCount > 1 and alcoholCount < 4 then 248 | TriggerEvent('evidence:client:SetStatus', 'alcohol', 200) 249 | elseif alcoholCount >= 4 then 250 | TriggerEvent('evidence:client:SetStatus', 'heavyalcohol', 200) 251 | end 252 | end 253 | if data.replenish.event then 254 | TriggerEvent(data.replenish.event) 255 | end 256 | end) 257 | end, itemName) 258 | end) 259 | 260 | RegisterNetEvent('consumables:client:Cokebaggy', function() 261 | local ped = PlayerPedId() 262 | QBCore.Functions.Progressbar('snort_coke', Lang:t('consumables.coke_progress'), math.random(5000, 8000), false, true, { 263 | disableMovement = false, 264 | disableCarMovement = false, 265 | disableMouse = false, 266 | disableCombat = true, 267 | }, { 268 | animDict = 'switch@trevor@trev_smoking_meth', 269 | anim = 'trev_smoking_meth_loop', 270 | flags = 49, 271 | }, {}, {}, function() -- Done 272 | StopAnimTask(ped, 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 273 | TriggerServerEvent('consumables:server:useCokeBaggy') 274 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['cokebaggy'], 'remove') 275 | TriggerEvent('evidence:client:SetStatus', 'widepupils', 200) 276 | cokeBaggyEffect() 277 | end, function() -- Cancel 278 | StopAnimTask(ped, 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 279 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 280 | end) 281 | end) 282 | 283 | RegisterNetEvent('consumables:client:Crackbaggy', function() 284 | local ped = PlayerPedId() 285 | QBCore.Functions.Progressbar('snort_coke', Lang:t('consumables.crack_progress'), math.random(7000, 10000), false, true, { 286 | disableMovement = false, 287 | disableCarMovement = false, 288 | disableMouse = false, 289 | disableCombat = true, 290 | }, { 291 | animDict = 'switch@trevor@trev_smoking_meth', 292 | anim = 'trev_smoking_meth_loop', 293 | flags = 49, 294 | }, {}, {}, function() -- Done 295 | StopAnimTask(ped, 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 296 | TriggerServerEvent('consumables:server:useCrackBaggy') 297 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['crack_baggy'], 'remove') 298 | TriggerEvent('evidence:client:SetStatus', 'widepupils', 300) 299 | crackBaggyEffect() 300 | end, function() -- Cancel 301 | StopAnimTask(ped, 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 302 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 303 | end) 304 | end) 305 | 306 | RegisterNetEvent('consumables:client:EcstasyBaggy', function() 307 | QBCore.Functions.Progressbar('use_ecstasy', Lang:t('consumables.ecstasy_progress'), 3000, false, true, { 308 | disableMovement = false, 309 | disableCarMovement = false, 310 | disableMouse = false, 311 | disableCombat = true, 312 | }, { 313 | animDict = 'mp_suicide', 314 | anim = 'pill', 315 | flags = 49, 316 | }, {}, {}, function() -- Done 317 | StopAnimTask(PlayerPedId(), 'mp_suicide', 'pill', 1.0) 318 | TriggerServerEvent('consumables:server:useXTCBaggy') 319 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['xtcbaggy'], 'remove') 320 | ecstasyEffect() 321 | end, function() -- Cancel 322 | StopAnimTask(PlayerPedId(), 'mp_suicide', 'pill', 1.0) 323 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 324 | end) 325 | end) 326 | 327 | RegisterNetEvent('consumables:client:oxy', function() 328 | QBCore.Functions.Progressbar('use_oxy', Lang:t('consumables.healing_progress'), 2000, false, true, { 329 | disableMovement = false, 330 | disableCarMovement = false, 331 | disableMouse = false, 332 | disableCombat = true, 333 | }, { 334 | animDict = 'mp_suicide', 335 | anim = 'pill', 336 | flags = 49, 337 | }, {}, {}, function() -- Done 338 | StopAnimTask(PlayerPedId(), 'mp_suicide', 'pill', 1.0) 339 | TriggerServerEvent('consumables:server:useOxy') 340 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['oxy'], 'remove') 341 | ClearPedBloodDamage(PlayerPedId()) 342 | healOxy() 343 | end, function() -- Cancel 344 | StopAnimTask(PlayerPedId(), 'mp_suicide', 'pill', 1.0) 345 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 346 | end) 347 | end) 348 | 349 | RegisterNetEvent('consumables:client:meth', function() 350 | QBCore.Functions.Progressbar('snort_meth', Lang:t('consumables.meth_progress'), 1500, false, true, { 351 | disableMovement = false, 352 | disableCarMovement = false, 353 | disableMouse = false, 354 | disableCombat = true, 355 | }, { 356 | animDict = 'switch@trevor@trev_smoking_meth', 357 | anim = 'trev_smoking_meth_loop', 358 | flags = 49, 359 | }, {}, {}, function() -- Done 360 | StopAnimTask(PlayerPedId(), 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 361 | TriggerServerEvent('consumables:server:useMeth') 362 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['meth'], 'remove') 363 | TriggerEvent('evidence:client:SetStatus', 'widepupils', 300) 364 | TriggerEvent('evidence:client:SetStatus', 'agitated', 300) 365 | methBagEffect() 366 | end, function() -- Cancel 367 | StopAnimTask(PlayerPedId(), 'switch@trevor@trev_smoking_meth', 'trev_smoking_meth_loop', 1.0) 368 | QBCore.Functions.Notify(Lang:t('consumables.canceled'), 'error') 369 | end) 370 | end) 371 | 372 | RegisterNetEvent('consumables:client:UseJoint', function() 373 | QBCore.Functions.Progressbar('smoke_joint', Lang:t('consumables.joint_progress'), 1500, false, true, { 374 | disableMovement = false, 375 | disableCarMovement = false, 376 | disableMouse = false, 377 | disableCombat = true, 378 | }, {}, {}, {}, function() -- Done 379 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['joint'], 'remove') 380 | if IsPedInAnyVehicle(PlayerPedId(), false) then 381 | QBCore.Functions.PlayAnim('timetable@gardener@smoking_joint', 'smoke_idle', false) 382 | else 383 | QBCore.Functions.PlayAnim('timetable@gardener@smoking_joint', 'smoke_idle', false) 384 | end 385 | TriggerEvent('evidence:client:SetStatus', 'weedsmell', 300) 386 | TriggerServerEvent('hud:server:RelieveStress', Config.RelieveWeedStress) 387 | end) 388 | end) 389 | 390 | RegisterNetEvent('consumables:client:UseParachute', function() 391 | equipParachuteAnim() 392 | QBCore.Functions.Progressbar('use_parachute', Lang:t('consumables.use_parachute_progress'), 5000, false, true, { 393 | disableMovement = false, 394 | disableCarMovement = false, 395 | disableMouse = false, 396 | disableCombat = true, 397 | }, {}, {}, {}, function() -- Done 398 | local ped = PlayerPedId() 399 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['parachute'], 'remove') 400 | GiveWeaponToPed(ped, `GADGET_PARACHUTE`, 1, false, false) 401 | local parachuteData = { 402 | outfitData = { ['bag'] = { item = 7, texture = 0 } } -- Adding Parachute Clothing 403 | } 404 | TriggerEvent('qb-clothing:client:loadOutfit', parachuteData) 405 | parachuteEquipped = true 406 | TaskPlayAnim(ped, 'clothingshirt', 'exit', 8.0, 1.0, -1, 49, 0, false, false, false) 407 | end) 408 | end) 409 | 410 | RegisterNetEvent('consumables:client:ResetParachute', function() 411 | if parachuteEquipped then 412 | equipParachuteAnim() 413 | QBCore.Functions.Progressbar('reset_parachute', Lang:t('consumables.pack_parachute_progress'), 40000, false, true, { 414 | disableMovement = false, 415 | disableCarMovement = false, 416 | disableMouse = false, 417 | disableCombat = true, 418 | }, {}, {}, {}, function() -- Done 419 | local ped = PlayerPedId() 420 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['parachute'], 'add') 421 | local parachuteResetData = { 422 | outfitData = { ['bag'] = { item = 0, texture = 0 } } -- Removing Parachute Clothing 423 | } 424 | TriggerEvent('qb-clothing:client:loadOutfit', parachuteResetData) 425 | TaskPlayAnim(ped, 'clothingshirt', 'exit', 8.0, 1.0, -1, 49, 0, false, false, false) 426 | TriggerServerEvent('consumables:server:AddParachute') 427 | parachuteEquipped = false 428 | end) 429 | else 430 | QBCore.Functions.Notify(Lang:t('consumables.no_parachute'), 'error') 431 | end 432 | end) 433 | 434 | RegisterNetEvent('consumables:client:UseArmor', function() 435 | if GetPedArmour(PlayerPedId()) >= 75 then 436 | QBCore.Functions.Notify(Lang:t('consumables.armor_full'), 'error') 437 | return 438 | end 439 | QBCore.Functions.Progressbar('use_armor', Lang:t('consumables.armor_progress'), 5000, false, true, { 440 | disableMovement = false, 441 | disableCarMovement = false, 442 | disableMouse = false, 443 | disableCombat = true, 444 | }, {}, {}, {}, function() -- Done 445 | TriggerServerEvent('consumables:server:useArmor') 446 | end) 447 | end) 448 | 449 | RegisterNetEvent('consumables:client:UseHeavyArmor', function() 450 | if GetPedArmour(PlayerPedId()) == 100 then 451 | QBCore.Functions.Notify(Lang:t('consumables.armor_full'), 'error') 452 | return 453 | end 454 | local ped = PlayerPedId() 455 | local PlayerData = QBCore.Functions.GetPlayerData() 456 | QBCore.Functions.Progressbar('use_heavyarmor', Lang:t('consumables.heavy_armor_progress'), 5000, false, true, { 457 | disableMovement = false, 458 | disableCarMovement = false, 459 | disableMouse = false, 460 | disableCombat = true, 461 | }, {}, {}, {}, function() -- Done 462 | if not Config.Disable.vestDrawable then 463 | if PlayerData.charinfo.gender == 0 then 464 | currVest = GetPedDrawableVariation(ped, 9) 465 | currVestTexture = GetPedTextureVariation(ped, 9) 466 | if GetPedDrawableVariation(ped, 9) == 7 then 467 | SetPedComponentVariation(ped, 9, 19, GetPedTextureVariation(ped, 9), 2) 468 | else 469 | SetPedComponentVariation(ped, 9, 5, 2, 2) 470 | end 471 | else 472 | currVest = GetPedDrawableVariation(ped, 30) 473 | currVestTexture = GetPedTextureVariation(ped, 30) 474 | SetPedComponentVariation(ped, 9, 30, 0, 2) 475 | end 476 | end 477 | TriggerServerEvent('consumables:server:useHeavyArmor') 478 | end) 479 | end) 480 | 481 | RegisterNetEvent('consumables:client:ResetArmor', function() 482 | local ped = PlayerPedId() 483 | if currVest ~= nil and currVestTexture ~= nil then 484 | QBCore.Functions.Progressbar('remove_armor', Lang:t('consumables.remove_armor_progress'), 2500, false, true, { 485 | disableMovement = false, 486 | disableCarMovement = false, 487 | disableMouse = false, 488 | disableCombat = true, 489 | }, {}, {}, {}, function() -- Done 490 | SetPedComponentVariation(ped, 9, currVest, currVestTexture, 2) 491 | SetPedArmour(ped, 0) 492 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items['heavyarmor'], 'add') 493 | TriggerServerEvent('consumables:server:resetArmor') 494 | end) 495 | else 496 | QBCore.Functions.Notify(Lang:t('consumables.armor_empty'), 'error') 497 | end 498 | end) 499 | 500 | -- RegisterNetEvent('consumables:client:UseRedSmoke', function() 501 | -- if parachuteEquipped then 502 | -- local ped = PlayerPedId() 503 | -- SetPlayerParachuteSmokeTrailColor(ped, 255, 0, 0) 504 | -- SetPlayerCanLeaveParachuteSmokeTrail(ped, true) 505 | -- TriggerEvent("qb-inventory:client:ItemBox", QBCore.Shared.Items["smoketrailred"], "remove") 506 | -- else 507 | -- QBCore.Functions.Notify("You need to have a paracute to activate smoke!", "error") 508 | -- end 509 | -- end) 510 | 511 | --Threads 512 | local looped = false 513 | function AlcoholLoop() 514 | if not looped then 515 | looped = true 516 | CreateThread(function() 517 | while true do 518 | Wait(10) 519 | if alcoholCount > 0 then 520 | Wait(1000 * 60 * 15) 521 | alcoholCount -= 1 522 | else 523 | looped = false 524 | break 525 | end 526 | end 527 | end) 528 | end 529 | end 530 | -------------------------------------------------------------------------------- /client/crouchprone.lua: -------------------------------------------------------------------------------- 1 | local isCrouching = false 2 | local walkSet = 'default' 3 | 4 | local function loadAnimSet(anim) 5 | if not HasAnimSetLoaded(anim) then 6 | RequestAnimSet(anim) 7 | while not HasAnimSetLoaded(anim) do 8 | Wait(10) 9 | end 10 | end 11 | end 12 | 13 | local function resetAnimSet() 14 | local ped = PlayerPedId() 15 | ResetPedMovementClipset(ped, 1.0) 16 | ResetPedWeaponMovementClipset(ped) 17 | ResetPedStrafeClipset(ped) 18 | 19 | if walkSet ~= 'default' then 20 | loadAnimSet(walkSet) 21 | SetPedMovementClipset(ped, walkSet, 1.0) 22 | RemoveAnimSet(walkSet) 23 | end 24 | end 25 | 26 | RegisterNetEvent('crouchprone:client:SetWalkSet', function(clipset) 27 | walkSet = clipset 28 | end) 29 | 30 | RegisterCommand('togglecrouch', function() 31 | local ped = PlayerPedId() 32 | if IsPedSittingInAnyVehicle(ped) or IsPedFalling(ped) or IsPedSwimming(ped) or IsPedSwimmingUnderWater(ped) or IsPauseMenuActive() then 33 | return 34 | end 35 | 36 | ClearPedTasks(ped) 37 | if isCrouching then 38 | resetAnimSet() 39 | SetPedStealthMovement(ped, false, 'DEFAULT_ACTION') 40 | isCrouching = false 41 | else 42 | loadAnimSet('move_ped_crouched') 43 | SetPedMovementClipset(ped, 'move_ped_crouched', 1.0) 44 | SetPedStrafeClipset(ped, 'move_ped_crouched_strafing') 45 | isCrouching = true 46 | end 47 | end, false) 48 | 49 | -- Optional: Register a keybind so they can press CTRL (36) to toggle 50 | RegisterKeyMapping('togglecrouch', 'Toggle Crouch', 'keyboard', 'LCONTROL') 51 | -------------------------------------------------------------------------------- /client/cruise.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local vehicleClasses = { 3 | [0] = true, 4 | [1] = true, 5 | [2] = true, 6 | [3] = true, 7 | [4] = true, 8 | [5] = true, 9 | [6] = true, 10 | [7] = true, 11 | [8] = true, 12 | [9] = true, 13 | [10] = true, 14 | [11] = true, 15 | [12] = true, 16 | [13] = false, 17 | [14] = false, 18 | [15] = false, 19 | [16] = false, 20 | [17] = true, 21 | [18] = true, 22 | [19] = true, 23 | [20] = true, 24 | [21] = false 25 | } 26 | 27 | local function triggerCruiseControl(veh) 28 | local ped = PlayerPedId() 29 | if IsPedInAnyVehicle(ped, false) then 30 | local speed = GetEntitySpeed(veh) 31 | if speed > 0 and GetVehicleCurrentGear(veh) > 0 then 32 | speed = GetEntitySpeed(veh) 33 | local isTurningOrHandbraking = IsControlPressed(2, 76) or IsControlPressed(2, 63) or IsControlPressed(2, 64) 34 | TriggerEvent('seatbelt:client:ToggleCruise', true) 35 | QBCore.Functions.Notify(Lang:t('cruise.activated')) 36 | 37 | CreateThread(function() 38 | while speed > 0 and GetPedInVehicleSeat(veh, -1) == ped do 39 | Wait(0) 40 | if not isTurningOrHandbraking and GetEntitySpeed(veh) < speed - 1.5 then 41 | speed = 0 42 | TriggerEvent('seatbelt:client:ToggleCruise', false) 43 | QBCore.Functions.Notify(Lang:t('cruise.deactivated'), 'error') 44 | Wait(2000) 45 | break 46 | end 47 | 48 | if not isTurningOrHandbraking and IsVehicleOnAllWheels(veh) and GetEntitySpeed(veh) < speed then 49 | SetVehicleForwardSpeed(veh, speed) 50 | end 51 | 52 | if IsControlJustPressed(1, 246) then 53 | speed = GetEntitySpeed(veh) 54 | end 55 | 56 | if IsControlJustPressed(2, 72) then 57 | speed = 0 58 | TriggerEvent('seatbelt:client:ToggleCruise', false) 59 | QBCore.Functions.Notify(Lang:t('cruise.deactivated'), 'error') 60 | Wait(2000) 61 | break 62 | end 63 | end 64 | end) 65 | end 66 | end 67 | end 68 | 69 | RegisterCommand('togglecruise', function() 70 | local ped = PlayerPedId() 71 | local veh = GetVehiclePedIsIn(ped, false) 72 | local driver = GetPedInVehicleSeat(veh, -1) 73 | local vehClass = GetVehicleClass(veh) 74 | if ped == driver and vehicleClasses[vehClass] then 75 | triggerCruiseControl(veh) 76 | end 77 | end, false) 78 | 79 | RegisterKeyMapping('togglecruise', 'Toggle Cruise Control', 'keyboard', 'Y') 80 | -------------------------------------------------------------------------------- /client/discord.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | CreateThread(function() 4 | while Config.Discord.isEnabled do 5 | SetDiscordAppId(Config.Discord.applicationId) 6 | SetDiscordRichPresenceAsset(Config.Discord.iconLarge) 7 | SetDiscordRichPresenceAssetText(Config.Discord.iconLargeHoverText) 8 | SetDiscordRichPresenceAssetSmall(Config.Discord.iconSmall) 9 | SetDiscordRichPresenceAssetSmallText(Config.Discord.iconSmallHoverText) 10 | 11 | if Config.Discord.showPlayerCount then 12 | QBCore.Functions.TriggerCallback('smallresources:server:GetCurrentPlayers', function(result) 13 | SetRichPresence('Players: ' .. result .. '/' .. Config.Discord.maxPlayers) 14 | end) 15 | end 16 | 17 | if Config.Discord.buttons and type(Config.Discord.buttons) == "table" then 18 | for i, v in pairs(Config.Discord.buttons) do 19 | SetDiscordRichPresenceAction(i - 1, v.text, v.url) 20 | end 21 | end 22 | 23 | Wait(Config.Discord.updateRate) 24 | end 25 | end) 26 | -------------------------------------------------------------------------------- /client/editor.lua: -------------------------------------------------------------------------------- 1 | RegisterCommand('record', function() 2 | StartRecording(1) 3 | TriggerEvent('QBCore:Notify', Lang:t('editor.started'), 'success') 4 | end, false) 5 | 6 | RegisterCommand('clip', function() 7 | StartRecording(0) 8 | end, false) 9 | 10 | RegisterCommand('saveclip', function() 11 | StopRecordingAndSaveClip() 12 | TriggerEvent('QBCore:Notify', Lang:t('editor.save'), 'success') 13 | end, false) 14 | 15 | RegisterCommand('delclip', function() 16 | StopRecordingAndDiscardClip() 17 | TriggerEvent('QBCore:Notify', Lang:t('editor.delete'), 'error') 18 | end, false) 19 | 20 | RegisterCommand('editor', function() 21 | NetworkSessionLeaveSinglePlayer() 22 | ActivateRockstarEditor() 23 | TriggerEvent('QBCore:Notify', Lang:t('editor.editor'), 'error') 24 | end, false) 25 | -------------------------------------------------------------------------------- /client/fireworks.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local fireworkTime = 0 3 | local fireworkLoc = nil 4 | local fireworkList = { 5 | ['proj_xmas_firework'] = { 6 | 'scr_firework_xmas_ring_burst_rgw', 7 | 'scr_firework_xmas_burst_rgw', 8 | 'scr_firework_xmas_repeat_burst_rgw', 9 | 'scr_firework_xmas_spiral_burst_rgw', 10 | 'scr_xmas_firework_sparkle_spawn' 11 | }, 12 | ['scr_indep_fireworks'] = { 13 | 'scr_indep_firework_sparkle_spawn', 14 | 'scr_indep_firework_starburst', 15 | 'scr_indep_firework_shotburst', 16 | 'scr_indep_firework_trailburst', 17 | 'scr_indep_firework_trailburst_spawn', 18 | 'scr_indep_firework_burst_spawn', 19 | 'scr_indep_firework_trail_spawn', 20 | 'scr_indep_firework_fountain' 21 | }, 22 | ['proj_indep_firework'] = { 23 | 'scr_indep_firework_grd_burst', 24 | 'scr_indep_launcher_sparkle_spawn', 25 | 'scr_indep_firework_air_burst', 26 | 'proj_indep_flare_trail' 27 | }, 28 | ['proj_indep_firework_v2'] = { 29 | 'scr_firework_indep_burst_rwb', 30 | 'scr_firework_indep_spiral_burst_rwb', 31 | 'scr_xmas_firework_sparkle_spawn', 32 | 'scr_firework_indep_ring_burst_rwb', 33 | 'scr_xmas_firework_burst_fizzle', 34 | 'scr_firework_indep_repeat_burst_rwb' 35 | } 36 | } 37 | 38 | local function DrawText3D(x, y, z, text) 39 | SetTextScale(0.35, 0.35) 40 | SetTextFont(4) 41 | SetTextProportional(true) 42 | SetTextColour(255, 255, 255, 215) 43 | BeginTextCommandDisplayText('STRING') 44 | SetTextCentre(true) 45 | AddTextComponentSubstringPlayerName(text) 46 | SetDrawOrigin(x, y, z, 0) 47 | EndTextCommandDisplayText(0.0, 0.0) 48 | local factor = (string.len(text)) / 370 49 | DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75) 50 | ClearDrawOrigin() 51 | end 52 | 53 | local function fireworkText() 54 | CreateThread(function() 55 | while true do 56 | Wait(0) 57 | if fireworkTime > 0 and fireworkLoc then 58 | DrawText3D(fireworkLoc.x, fireworkLoc.y, fireworkLoc.z, Lang:t('firework.time_left') .. fireworkTime) 59 | end 60 | if fireworkTime <= 0 then break end 61 | end 62 | end) 63 | end 64 | 65 | local function startFirework(asset, coords) 66 | fireworkTime = Config.Fireworks.delay 67 | fireworkLoc = { x = coords.x, y = coords.y, z = coords.z } 68 | CreateThread(function() 69 | fireworkText() 70 | while fireworkTime > 0 do 71 | Wait(1000) 72 | fireworkTime -= 1 73 | end 74 | UseParticleFxAssetNextCall('scr_indep_fireworks') 75 | for _ = 1, math.random(5, 10), 1 do 76 | local firework = fireworkList[asset][math.random(1, #fireworkList[asset])] 77 | UseParticleFxAssetNextCall(asset) 78 | StartNetworkedParticleFxNonLoopedAtCoord(firework, fireworkLoc.x, fireworkLoc.y, fireworkLoc.z + 42.5, 0.0, 0.0, 0.0, math.random() * 0.3 + 0.5, false, false, false) 79 | Wait(math.random() * 500) 80 | end 81 | fireworkLoc = nil 82 | end) 83 | end 84 | 85 | CreateThread(function() 86 | local assets = { 87 | 'scr_indep_fireworks', 88 | 'proj_xmas_firework', 89 | 'proj_indep_firework_v2', 90 | 'proj_indep_firework' 91 | } 92 | 93 | for i = 1, #assets do 94 | local asset = assets[i] 95 | if not HasNamedPtfxAssetLoaded(asset) then 96 | RequestNamedPtfxAsset(asset) 97 | while not HasNamedPtfxAssetLoaded(asset) do 98 | Wait(10) 99 | end 100 | end 101 | end 102 | end) 103 | 104 | RegisterNetEvent('fireworks:client:UseFirework', function(itemName, assetName) 105 | QBCore.Functions.Progressbar('spawn_object', Lang:t('firework.place_progress'), 3000, false, true, { 106 | disableMovement = true, 107 | disableCarMovement = true, 108 | disableMouse = false, 109 | disableCombat = true, 110 | }, { 111 | animDict = 'anim@narcotics@trash', 112 | anim = 'drop_front', 113 | flags = 16, 114 | }, {}, {}, function() -- Done 115 | StopAnimTask(PlayerPedId(), 'anim@narcotics@trash', 'drop_front', 1.0) 116 | TriggerServerEvent('consumables:server:UseFirework', itemName) 117 | TriggerEvent('qb-inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove') 118 | local pos = GetEntityCoords(PlayerPedId()) 119 | startFirework(assetName, pos) 120 | end, function() -- Cancel 121 | StopAnimTask(PlayerPedId(), 'anim@narcotics@trash', 'drop_front', 1.0) 122 | QBCore.Functions.Notify(Lang:t('firework.canceled'), 'error') 123 | end) 124 | end) 125 | -------------------------------------------------------------------------------- /client/handsup.lua: -------------------------------------------------------------------------------- 1 | local handsUp = false 2 | 3 | RegisterCommand(Config.HandsUp.command, function() 4 | local ped = PlayerPedId() 5 | if not HasAnimDictLoaded('missminuteman_1ig_2') then 6 | RequestAnimDict('missminuteman_1ig_2') 7 | while not HasAnimDictLoaded('missminuteman_1ig_2') do 8 | Wait(10) 9 | end 10 | end 11 | handsUp = not handsUp 12 | if exports['qb-policejob']:IsHandcuffed() then return end 13 | if handsUp then 14 | TaskPlayAnim(ped, 'missminuteman_1ig_2', 'handsup_base', 8.0, 8.0, -1, 50, 0, false, false, false) 15 | exports['qb-smallresources']:addDisableControls(Config.HandsUp.controls) 16 | else 17 | ClearPedTasks(ped) 18 | exports['qb-smallresources']:removeDisableControls(Config.HandsUp.controls) 19 | end 20 | end, false) 21 | 22 | RegisterKeyMapping(Config.HandsUp.command, 'Hands Up', 'keyboard', Config.HandsUp.keybind) 23 | exports('getHandsup', function() return handsUp end) 24 | -------------------------------------------------------------------------------- /client/hudcomponents.lua: -------------------------------------------------------------------------------- 1 | local disableHudComponents = Config.Disable.hudComponents 2 | local disableControls = Config.Disable.controls 3 | local displayAmmo = Config.Disable.displayAmmo 4 | 5 | local function decorSet(Type, Value) 6 | if Type == 'parked' then 7 | Config.Density.parked = Value 8 | elseif Type == 'vehicle' then 9 | Config.Density.vehicle = Value 10 | elseif Type == 'multiplier' then 11 | Config.Density.multiplier = Value 12 | elseif Type == 'peds' then 13 | Config.Density.peds = Value 14 | elseif Type == 'scenario' then 15 | Config.Density.scenario = Value 16 | end 17 | end 18 | 19 | exports('DecorSet', decorSet) 20 | 21 | CreateThread(function() 22 | while true do 23 | 24 | for i = 1, #disableHudComponents do 25 | HideHudComponentThisFrame(disableHudComponents[i]) 26 | end 27 | 28 | for i = 1, #disableControls do 29 | DisableControlAction(2, disableControls[i], true) 30 | end 31 | 32 | DisplayAmmoThisFrame(displayAmmo) 33 | 34 | SetParkedVehicleDensityMultiplierThisFrame(Config.Density.parked) 35 | SetVehicleDensityMultiplierThisFrame(Config.Density.vehicle) 36 | SetRandomVehicleDensityMultiplierThisFrame(Config.Density.multiplier) 37 | SetPedDensityMultiplierThisFrame(Config.Density.peds) 38 | SetScenarioPedDensityMultiplierThisFrame(Config.Density.scenario, Config.Density.scenario) -- Walking NPC Density 39 | Wait(0) 40 | end 41 | end) 42 | 43 | exports('addDisableHudComponents', function(hudComponents) 44 | local hudComponentsType = type(hudComponents) 45 | if hudComponentsType == 'number' then 46 | disableHudComponents[#disableHudComponents + 1] = hudComponents 47 | elseif hudComponentsType == 'table' and table.type(hudComponents) == "array" then 48 | for i = 1, #hudComponents do 49 | disableHudComponents[#disableHudComponents + 1] = hudComponents[i] 50 | end 51 | end 52 | end) 53 | 54 | exports('removeDisableHudComponents', function(hudComponents) 55 | local hudComponentsType = type(hudComponents) 56 | if hudComponentsType == 'number' then 57 | for i = 1, #disableHudComponents do 58 | if disableHudComponents[i] == hudComponents then 59 | table.remove(disableHudComponents, i) 60 | break 61 | end 62 | end 63 | elseif hudComponentsType == 'table' and table.type(hudComponents) == "array" then 64 | for i = 1, #disableHudComponents do 65 | for i2 = 1, #hudComponents do 66 | if disableHudComponents[i] == hudComponents[i2] then 67 | table.remove(disableHudComponents, i) 68 | end 69 | end 70 | end 71 | end 72 | end) 73 | 74 | exports('getDisableHudComponents', function() return disableHudComponents end) 75 | 76 | exports('addDisableControls', function(controls) 77 | local controlsType = type(controls) 78 | if controlsType == 'number' then 79 | disableControls[#disableControls + 1] = controls 80 | elseif controlsType == 'table' and table.type(controls) == "array" then 81 | for i = 1, #controls do 82 | disableControls[#disableControls + 1] = controls[i] 83 | end 84 | end 85 | end) 86 | 87 | exports('removeDisableControls', function(controls) 88 | local controlsType = type(controls) 89 | if controlsType == 'number' then 90 | for i = 1, #disableControls do 91 | if disableControls[i] == controls then 92 | table.remove(disableControls, i) 93 | break 94 | end 95 | end 96 | elseif controlsType == 'table' and table.type(controls) == "array" then 97 | for i = 1, #disableControls do 98 | for i2 = 1, #controls do 99 | if disableControls[i] == controls[i2] then 100 | table.remove(disableControls, i) 101 | end 102 | end 103 | end 104 | end 105 | end) 106 | 107 | exports('getDisableControls', function() return disableControls end) 108 | 109 | exports('setDisplayAmmo', function(bool) displayAmmo = bool end) 110 | 111 | exports('getDisplayAmmo', function() return displayAmmo end) -------------------------------------------------------------------------------- /client/ignore.lua: -------------------------------------------------------------------------------- 1 | CreateThread(function() 2 | while true do 3 | for _, sctyp in next, Config.BlacklistedScenarios.types do 4 | SetScenarioTypeEnabled(sctyp, false) 5 | end 6 | for _, scgrp in next, Config.BlacklistedScenarios.groups do 7 | SetScenarioGroupEnabled(scgrp, false) 8 | end 9 | Wait(10000) 10 | end 11 | end) 12 | 13 | AddEventHandler('populationPedCreating', function(x, y, z) 14 | Wait(500) -- Give the entity some time to be created 15 | local _, handle = GetClosestPed(x, y, z, 1.0) -- Get the entity handle 16 | SetPedDropsWeaponsWhenDead(handle, false) 17 | end) 18 | 19 | CreateThread(function() 20 | local mapText = Config.PauseMapText 21 | if mapText == '' or type(mapText) ~= 'string' then mapText = 'FiveM' end 22 | AddTextEntry('FE_THDR_GTAO', mapText) 23 | end) 24 | 25 | CreateThread(function() -- all these should only need to be called once 26 | if Config.Disable.ambience then 27 | StartAudioScene('CHARACTER_CHANGE_IN_SKY_SCENE') 28 | SetAudioFlag('DisableFlightMusic', true) 29 | end 30 | SetAudioFlag('PoliceScannerDisabled', true) 31 | SetGarbageTrucks(false) 32 | SetCreateRandomCops(false) 33 | SetCreateRandomCopsNotOnScenarios(false) 34 | SetCreateRandomCopsOnScenarios(false) 35 | DistantCopCarSirens(false) 36 | RemoveVehiclesFromGeneratorsInArea(335.2616 - 300.0, -1432.455 - 300.0, 46.51 - 300.0, 335.2616 + 300.0, -1432.455 + 300.0, 46.51 + 300.0) -- central los santos medical center 37 | RemoveVehiclesFromGeneratorsInArea(441.8465 - 500.0, -987.99 - 500.0, 30.68 - 500.0, 441.8465 + 500.0, -987.99 + 500.0, 30.68 + 500.0) -- police station mission row 38 | RemoveVehiclesFromGeneratorsInArea(316.79 - 300.0, -592.36 - 300.0, 43.28 - 300.0, 316.79 + 300.0, -592.36 + 300.0, 43.28 + 300.0) -- pillbox 39 | RemoveVehiclesFromGeneratorsInArea(-2150.44 - 500.0, 3075.99 - 500.0, 32.8 - 500.0, -2150.44 + 500.0, -3075.99 + 500.0, 32.8 + 500.0) -- military 40 | RemoveVehiclesFromGeneratorsInArea(-1108.35 - 300.0, 4920.64 - 300.0, 217.2 - 300.0, -1108.35 + 300.0, 4920.64 + 300.0, 217.2 + 300.0) -- nudist 41 | RemoveVehiclesFromGeneratorsInArea(-458.24 - 300.0, 6019.81 - 300.0, 31.34 - 300.0, -458.24 + 300.0, 6019.81 + 300.0, 31.34 + 300.0) -- police station paleto 42 | RemoveVehiclesFromGeneratorsInArea(1854.82 - 300.0, 3679.4 - 300.0, 33.82 - 300.0, 1854.82 + 300.0, 3679.4 + 300.0, 33.82 + 300.0) -- police station sandy 43 | RemoveVehiclesFromGeneratorsInArea(-724.46 - 300.0, -1444.03 - 300.0, 5.0 - 300.0, -724.46 + 300.0, -1444.03 + 300.0, 5.0 + 300.0) -- REMOVE CHOPPERS WOW 44 | end) 45 | 46 | CreateThread(function() 47 | while true do 48 | local sleep = 1000 49 | local ped = PlayerPedId() 50 | if IsPedBeingStunned(ped, 0) then 51 | sleep = 0 52 | SetPedMinGroundTimeForStungun(ped, math.random(4000, 7000)) 53 | end 54 | Wait(sleep) 55 | end 56 | end) 57 | 58 | CreateThread(function() 59 | for i = 1, 15 do 60 | local toggle = Config.AIResponse.dispatchServices[i] 61 | EnableDispatchService(i, toggle) 62 | end 63 | 64 | local wantedLevel = Config.AIResponse.wantedLevels and 5 or 0 65 | SetMaxWantedLevel(wantedLevel) 66 | end) 67 | 68 | CreateThread(function() 69 | if Config.Disable.driveby then 70 | SetPlayerCanDoDriveBy(PlayerId(), false) 71 | end 72 | end) 73 | 74 | if Config.Disable.idleCamera then 75 | CreateThread(function() 76 | while true do 77 | InvalidateIdleCam() 78 | InvalidateVehicleIdleCam() 79 | Wait(1000) 80 | end 81 | end) 82 | end 83 | 84 | RegisterNetEvent('QBCore:Client:DrawWeapon', function() 85 | local sleep 86 | while true do 87 | sleep = 500 88 | local ped = PlayerPedId() 89 | local weapon = GetSelectedPedWeapon(ped) 90 | if weapon ~= `WEAPON_UNARMED` then 91 | if IsPedArmed(ped, 6) then 92 | sleep = 0 93 | DisableControlAction(1, 140, true) 94 | DisableControlAction(1, 141, true) 95 | DisableControlAction(1, 142, true) 96 | end 97 | 98 | if weapon == `WEAPON_FIREEXTINGUISHER` or weapon == `WEAPON_PETROLCAN` then 99 | if IsPedShooting(ped) then 100 | SetPedInfiniteAmmo(ped, true, weapon) 101 | end 102 | end 103 | else 104 | break 105 | end 106 | Wait(sleep) 107 | end 108 | end) 109 | 110 | CreateThread(function() 111 | local pedPool = GetGamePool('CPed') 112 | for _, v in pairs(pedPool) do 113 | SetPedDropsWeaponsWhenDead(v, false) 114 | end 115 | end) 116 | 117 | CreateThread(function() 118 | while true do 119 | Wait(2500) 120 | local ped = PlayerPedId() 121 | local weapon = GetSelectedPedWeapon(ped) 122 | if Config.BlacklistedWeapons[weapon] then 123 | RemoveWeaponFromPed(ped, weapon) 124 | end 125 | end 126 | end) 127 | 128 | CreateThread(function() 129 | while Config.Disable.pistolWhipping do 130 | if IsPedArmed(PlayerPedId(), 6) then 131 | DisableControlAction(1, 140, true) 132 | DisableControlAction(1, 141, true) 133 | DisableControlAction(1, 142, true) 134 | end 135 | Wait(5) 136 | end 137 | end) 138 | -------------------------------------------------------------------------------- /client/noshuff.lua: -------------------------------------------------------------------------------- 1 | local disableShuffle = true 2 | 3 | RegisterNetEvent('QBCore:Client:EnteredVehicle', function(data) 4 | local ped = PlayerPedId() 5 | while IsPedInAnyVehicle(ped, false) do 6 | local sleep = 100 7 | if disableShuffle and GetPedInVehicleSeat(data.vehicle, 0) == ped and GetIsTaskActive(ped, 165) then 8 | sleep = 0 9 | SetPedIntoVehicle(ped, data.vehicle, 0) 10 | SetPedConfigFlag(ped, 184, true) 11 | end 12 | Wait(sleep) 13 | end 14 | end) 15 | 16 | RegisterNetEvent('SeatShuffle', function() 17 | local ped = PlayerPedId() 18 | if IsPedInAnyVehicle(ped, false) then 19 | disableShuffle = false 20 | SetPedConfigFlag(ped, 184, false) 21 | Wait(3000) 22 | disableShuffle = true 23 | else 24 | CancelEvent() 25 | end 26 | end) 27 | 28 | RegisterCommand('shuff', function() 29 | TriggerEvent('SeatShuffle') 30 | end, false) 31 | -------------------------------------------------------------------------------- /client/point.lua: -------------------------------------------------------------------------------- 1 | local mp_pointing = false 2 | 3 | local function startPointing() 4 | local ped = PlayerPedId() 5 | RequestAnimDict("anim@mp_point") 6 | while not HasAnimDictLoaded("anim@mp_point") do 7 | Wait(10) 8 | end 9 | SetPedCurrentWeaponVisible(ped, 0, true, true, true) 10 | SetPedConfigFlag(ped, 36, 1) 11 | TaskMoveNetworkByName(ped, 'task_mp_pointing', 0.5, false, 'anim@mp_point', 24) 12 | RemoveAnimDict("anim@mp_point") 13 | end 14 | 15 | local function stopPointing() 16 | local ped = PlayerPedId() 17 | if not IsPedInjured(ped) then 18 | RequestTaskMoveNetworkStateTransition(ped, 'Stop') 19 | ClearPedSecondaryTask(ped) 20 | if not IsPedInAnyVehicle(ped, 1) then 21 | SetPedCurrentWeaponVisible(ped, 1, true, true, true) 22 | end 23 | SetPedConfigFlag(ped, 36, false) 24 | end 25 | end 26 | 27 | RegisterCommand('point', function() 28 | local ped = PlayerPedId() 29 | if not IsPedInAnyVehicle(ped, false) then 30 | mp_pointing = not mp_pointing 31 | if mp_pointing then 32 | startPointing() 33 | else 34 | stopPointing() 35 | end 36 | while mp_pointing do 37 | local camPitch = GetGameplayCamRelativePitch() 38 | local camHeading = GetGameplayCamRelativeHeading() 39 | local cosCamHeading = Cos(camHeading) 40 | local sinCamHeading = Sin(camHeading) 41 | camPitch = math.max(-70.0, math.min(42.0, camPitch)) 42 | camPitch = (camPitch + 70.0) / 112.0 43 | camHeading = math.max(-180.0, math.min(180.0, camHeading)) 44 | camHeading = (camHeading + 180.0) / 360.0 45 | 46 | local coords = GetOffsetFromEntityInWorldCoords(ped, (cosCamHeading * -0.2) - (sinCamHeading * (0.4 * camHeading + 0.3)), (sinCamHeading * -0.2) + (cosCamHeading * (0.4 * camHeading + 0.3)), 0.6) 47 | local ray = StartShapeTestCapsule(coords.x, coords.y, coords.z - 0.2, coords.x, coords.y, coords.z + 0.2, 0.4, 95, ped, 7) 48 | local _, blocked = GetRaycastResult(ray) 49 | SetTaskMoveNetworkSignalFloat(ped, "Pitch", camPitch) 50 | SetTaskMoveNetworkSignalFloat(ped, "Heading", camHeading * -1.0 + 1.0) 51 | SetTaskMoveNetworkSignalBool(ped, "isBlocked", blocked) 52 | SetTaskMoveNetworkSignalBool(ped, "isFirstPerson", GetCamViewModeForContext(GetCamActiveViewModeContext()) == 4) 53 | Wait(0) 54 | end 55 | end 56 | end, false) 57 | 58 | RegisterKeyMapping('point', 'Toggles Point', 'keyboard', 'B') 59 | -------------------------------------------------------------------------------- /client/removeentities.lua: -------------------------------------------------------------------------------- 1 | local entPoly = {} 2 | 3 | RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() 4 | Wait(5000) 5 | for _, v in pairs(Config.Objects) do 6 | entPoly[#entPoly + 1] = BoxZone:Create(v.coords, v.length, v.width, {name = v.model, debugPoly = false, heading = 0}) 7 | end 8 | 9 | local entCombo = ComboZone:Create(entPoly, {name = "entcombo", debugPoly = false }) 10 | entCombo:onPlayerInOut(function(isPointInside) 11 | if isPointInside then 12 | for _,v in pairs(Config.Objects) do 13 | local model = v.model 14 | if type(v.model) == 'string' then 15 | model = joaat(v.model) 16 | end 17 | 18 | local ent = GetClosestObjectOfType(v.coords.x, v.coords.y, v.coords.z, 2.0, model, false, false, false) 19 | SetEntityAsMissionEntity(ent, true, true) 20 | DeleteObject(ent) 21 | SetEntityAsNoLongerNeeded(ent) 22 | end 23 | end 24 | end) 25 | end) -------------------------------------------------------------------------------- /client/seatbelt.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local seatbeltOn = false 3 | local harnessOn = false 4 | local harnessHp = Config.HarnessUses 5 | local handbrake = 0 6 | local sleep = 0 7 | local harnessData = {} 8 | local newVehBodyHealth = 0 9 | local currVehBodyHealth = 0 10 | local frameBodyChange = 0 11 | local lastFrameVehSpeed = 0 12 | local lastFrameVehSpeed2 = 0 13 | local thisFrameVehSpeed = 0 14 | local tick = 0 15 | local damageDone = false 16 | local modifierDensity = true 17 | local lastVeh = nil 18 | local veloc 19 | 20 | -- Functions 21 | 22 | local function ejectFromVehicle() 23 | local ped = PlayerPedId() 24 | local veh = GetVehiclePedIsIn(ped, false) 25 | local coords = GetOffsetFromEntityInWorldCoords(veh, 1.0, 0.0, 1.0) 26 | SetEntityCoords(ped, coords.x, coords.y, coords.z) 27 | Wait(1) 28 | SetPedToRagdoll(ped, 5511, 5511, 0, 0, 0, 0) 29 | SetEntityVelocity(ped, veloc.x * 4, veloc.y * 4, veloc.z * 4) 30 | local ejectSpeed = math.ceil(GetEntitySpeed(ped) * 8) 31 | if GetEntityHealth(ped) - ejectSpeed > 0 then 32 | SetEntityHealth(ped, GetEntityHealth(ped) - ejectSpeed) 33 | elseif GetEntityHealth(ped) ~= 0 then 34 | SetEntityHealth(ped, 0) 35 | end 36 | end 37 | 38 | local function toggleSeatbelt() 39 | seatbeltOn = not seatbeltOn 40 | SeatBeltLoop() 41 | TriggerEvent("seatbelt:client:ToggleSeatbelt", seatbeltOn) 42 | TriggerServerEvent("InteractSound_SV:PlayWithinDistance", 5.0, seatbeltOn and "carbuckle" or "carunbuckle", 0.25) 43 | end 44 | 45 | local function toggleHarness() 46 | harnessOn = not harnessOn 47 | if not harnessOn then return end 48 | toggleSeatbelt() 49 | end 50 | 51 | local function resetHandBrake() 52 | if handbrake <= 0 then return end 53 | handbrake -= 1 54 | end 55 | 56 | function SeatBeltLoop() 57 | CreateThread(function() 58 | while true do 59 | sleep = 0 60 | if seatbeltOn or harnessOn then 61 | DisableControlAction(0, 75, true) 62 | DisableControlAction(27, 75, true) 63 | end 64 | if not IsPedInAnyVehicle(PlayerPedId(), false) then 65 | seatbeltOn = false 66 | harnessOn = false 67 | TriggerEvent("seatbelt:client:ToggleSeatbelt", seatbeltOn) 68 | break 69 | end 70 | if not seatbeltOn and not harnessOn then break end 71 | Wait(sleep) 72 | end 73 | end) 74 | end 75 | 76 | -- Export 77 | 78 | ---Checks whether you have the harness on or not 79 | ---@return boolean 80 | local function hasHarness() 81 | return harnessOn 82 | end 83 | 84 | exports("HasHarness", hasHarness) 85 | 86 | ---Checks whether the player has their seatbelt on or not 87 | ---@return boolean 88 | local function hasSeatbeltOn() 89 | return seatbeltOn 90 | end 91 | 92 | exports("HasSeatbeltOn", hasSeatbeltOn) 93 | 94 | -- Ejection Logic 95 | 96 | RegisterNetEvent('QBCore:Client:EnteredVehicle', function() 97 | local ped = PlayerPedId() 98 | while IsPedInAnyVehicle(ped, false) do 99 | Wait(0) 100 | local currVehicle = GetVehiclePedIsIn(ped, false) 101 | if currVehicle and currVehicle ~= false and currVehicle ~= 0 then 102 | SetPedHelmet(ped, false) 103 | lastVeh = GetVehiclePedIsIn(ped, false) 104 | if GetVehicleEngineHealth(currVehicle) < 0.0 then 105 | SetVehicleEngineHealth(currVehicle, 0.0) 106 | end 107 | if (GetVehicleHandbrake(currVehicle) or (GetVehicleSteeringAngle(currVehicle)) > 25.0 or (GetVehicleSteeringAngle(currVehicle)) < -25.0) then 108 | if handbrake == 0 then 109 | handbrake = 100 110 | resetHandBrake() 111 | else 112 | handbrake = 100 113 | end 114 | end 115 | 116 | thisFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6 117 | currVehBodyHealth = GetVehicleBodyHealth(currVehicle) 118 | if currVehBodyHealth == 1000 and frameBodyChange ~= 0 then 119 | frameBodyChange = 0 120 | end 121 | if frameBodyChange ~= 0 then 122 | if lastFrameVehSpeed > 110 and thisFrameVehSpeed < (lastFrameVehSpeed * 0.75) and not damageDone then 123 | if frameBodyChange > 18.0 then 124 | if not seatbeltOn and not IsThisModelABike(currVehicle) then 125 | if math.random(math.ceil(lastFrameVehSpeed)) > 60 then 126 | if not harnessOn then 127 | ejectFromVehicle() 128 | else 129 | harnessHp -= 1 130 | TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData) 131 | end 132 | end 133 | elseif (seatbeltOn or harnessOn) and not IsThisModelABike(currVehicle) then 134 | if lastFrameVehSpeed > 150 then 135 | if math.random(math.ceil(lastFrameVehSpeed)) > 150 then 136 | if not harnessOn then 137 | ejectFromVehicle() 138 | else 139 | harnessHp -= 1 140 | TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData) 141 | end 142 | end 143 | end 144 | end 145 | else 146 | if not seatbeltOn and not IsThisModelABike(currVehicle) then 147 | if math.random(math.ceil(lastFrameVehSpeed)) > 60 then 148 | if not harnessOn then 149 | ejectFromVehicle() 150 | else 151 | harnessHp -= 1 152 | TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData) 153 | end 154 | end 155 | elseif (seatbeltOn or harnessOn) and not IsThisModelABike(currVehicle) then 156 | if lastFrameVehSpeed > 120 then 157 | if math.random(math.ceil(lastFrameVehSpeed)) > 200 then 158 | if not harnessOn then 159 | ejectFromVehicle() 160 | else 161 | harnessHp -= 1 162 | TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData) 163 | end 164 | end 165 | end 166 | end 167 | end 168 | damageDone = true 169 | SetVehicleEngineOn(currVehicle, false, true, true) 170 | end 171 | if currVehBodyHealth < 350.0 and not damageDone then 172 | damageDone = true 173 | SetVehicleEngineOn(currVehicle, false, true, true) 174 | Wait(1000) 175 | end 176 | end 177 | if lastFrameVehSpeed < 100 then 178 | Wait(100) 179 | tick = 0 180 | end 181 | frameBodyChange = newVehBodyHealth - currVehBodyHealth 182 | if tick > 0 then 183 | tick -= 1 184 | if tick == 1 then 185 | lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6 186 | end 187 | else 188 | if damageDone then 189 | damageDone = false 190 | frameBodyChange = 0 191 | lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6 192 | end 193 | lastFrameVehSpeed2 = GetEntitySpeed(currVehicle) * 3.6 194 | if lastFrameVehSpeed2 > lastFrameVehSpeed then 195 | lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6 196 | end 197 | if lastFrameVehSpeed2 < lastFrameVehSpeed then 198 | tick = 25 199 | end 200 | 201 | end 202 | if tick < 0 then 203 | tick = 0 204 | end 205 | newVehBodyHealth = GetVehicleBodyHealth(currVehicle) 206 | if not modifierDensity then 207 | modifierDensity = true 208 | end 209 | veloc = GetEntityVelocity(currVehicle) 210 | else 211 | if lastVeh then 212 | SetPedHelmet(ped, true) 213 | Wait(200) 214 | newVehBodyHealth = GetVehicleBodyHealth(lastVeh) 215 | if not damageDone and newVehBodyHealth < currVehBodyHealth then 216 | damageDone = true 217 | SetVehicleEngineOn(lastVeh, false, true, true) 218 | Wait(1000) 219 | end 220 | lastVeh = nil 221 | end 222 | lastFrameVehSpeed2 = 0 223 | lastFrameVehSpeed = 0 224 | newVehBodyHealth = 0 225 | currVehBodyHealth = 0 226 | frameBodyChange = 0 227 | Wait(2000) 228 | break 229 | end 230 | end 231 | end) 232 | 233 | -- Events 234 | 235 | RegisterNetEvent('seatbelt:client:UseHarness', function(ItemData) -- On Item Use (registered server side) 236 | local ped = PlayerPedId() 237 | local inVeh = IsPedInAnyVehicle(ped, false) 238 | local class = GetVehicleClass(GetVehiclePedIsUsing(ped)) 239 | if inVeh and class ~= 8 and class ~= 13 and class ~= 14 then 240 | if not harnessOn then 241 | LocalPlayer.state:set("inv_busy", true, true) 242 | QBCore.Functions.Progressbar("harness_equip", Lang:t('seatbelt.use_harness_progress'), 5000, false, true, { 243 | disableMovement = false, 244 | disableCarMovement = false, 245 | disableMouse = false, 246 | disableCombat = true, 247 | }, {}, {}, {}, function() 248 | LocalPlayer.state:set("inv_busy", false, true) 249 | toggleHarness() 250 | TriggerServerEvent('equip:harness', ItemData) 251 | end) 252 | harnessHp = ItemData.info.uses 253 | harnessData = ItemData 254 | TriggerEvent('hud:client:UpdateHarness', harnessHp) 255 | else 256 | LocalPlayer.state:set("inv_busy", true, true) 257 | QBCore.Functions.Progressbar("harness_equip", Lang:t('seatbelt.remove_harness_progress'), 5000, false, true, { 258 | disableMovement = false, 259 | disableCarMovement = false, 260 | disableMouse = false, 261 | disableCombat = true, 262 | }, {}, {}, {}, function() 263 | LocalPlayer.state:set("inv_busy", false, true) 264 | toggleHarness() 265 | end) 266 | end 267 | else 268 | QBCore.Functions.Notify(Lang:t('seatbelt.no_car'), 'error') 269 | end 270 | end) 271 | 272 | -- Register Key 273 | 274 | RegisterCommand('toggleseatbelt', function() 275 | if not IsPedInAnyVehicle(PlayerPedId(), false) or IsPauseMenuActive() then return end 276 | local class = GetVehicleClass(GetVehiclePedIsUsing(PlayerPedId())) 277 | if class == 8 or class == 13 or class == 14 then return end 278 | toggleSeatbelt() 279 | end, false) 280 | 281 | RegisterKeyMapping('toggleseatbelt', 'Toggle Seatbelt', 'keyboard', 'B') 282 | -------------------------------------------------------------------------------- /client/tackle.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | local function tackleAnim() 4 | local ped = PlayerPedId() 5 | if not HasAnimDictLoaded("swimming@first_person@diving") then 6 | RequestAnimDict("swimming@first_person@diving") 7 | while not HasAnimDictLoaded("swimming@first_person@diving") do 8 | Wait(10) 9 | end 10 | end 11 | if IsEntityPlayingAnim(ped, "swimming@first_person@diving", "dive_run_fwd_-45_loop", 3) then 12 | ClearPedTasksImmediately(ped) 13 | else 14 | TaskPlayAnim(ped, "swimming@first_person@diving", "dive_run_fwd_-45_loop", 3.0, 3.0, -1, 49, 0, false, false, false) 15 | Wait(250) 16 | ClearPedTasksImmediately(ped) 17 | SetPedToRagdoll(ped, 150, 150, 0, false, false, false) 18 | end 19 | end 20 | 21 | RegisterCommand('tackle', function() 22 | local closestPlayer, distance = QBCore.Functions.GetClosestPlayer() 23 | local ped = PlayerPedId() 24 | if distance ~= -1 and distance < 2 and GetEntitySpeed(ped) > 2.5 and not IsPedInAnyVehicle(ped, false) and not QBCore.Functions.GetPlayerData().metadata.ishandcuffed and not IsPedRagdoll(ped) then 25 | TriggerServerEvent("tackle:server:TacklePlayer", GetPlayerServerId(closestPlayer)) 26 | tackleAnim() 27 | end 28 | end) 29 | 30 | RegisterKeyMapping('tackle', 'Tackle Someone', 'KEYBOARD', 'LMENU') 31 | 32 | RegisterNetEvent('tackle:client:GetTackled', function() 33 | SetPedToRagdoll(PlayerPedId(), math.random(1000, 6000), math.random(1000, 6000), 0, false, false, false) 34 | TimerEnabled = true 35 | Wait(1500) 36 | TimerEnabled = false 37 | end) -------------------------------------------------------------------------------- /client/teleports.lua: -------------------------------------------------------------------------------- 1 | local title = Lang:t('teleport.teleport_default') 2 | local ran = false 3 | local teleportPoly = {} 4 | 5 | local function teleportMenu(zones, currentZone) 6 | local menu = {} 7 | for k, v in pairs(Config.Teleports[zones]) do 8 | if k ~= currentZone then 9 | if not v.label then 10 | title = Lang:t('teleport.teleport_default') 11 | else 12 | title = v.label 13 | end 14 | menu[#menu + 1] = { 15 | header = title, 16 | params = { 17 | event = 'teleports:chooseloc', 18 | args = { 19 | car = Config.Teleports[zones][currentZone].allowVeh, 20 | coords = v.poly.coords, 21 | heading = v.poly.heading 22 | } 23 | } 24 | } 25 | end 26 | end 27 | exports['qb-menu']:showHeader(menu) 28 | end 29 | 30 | CreateThread(function() 31 | for i = 1, #Config.Teleports, 1 do 32 | for u = 1, #Config.Teleports[i] do 33 | local portal = Config.Teleports[i][u].poly 34 | teleportPoly[#teleportPoly + 1] = BoxZone:Create(vector3(portal.coords.x, portal.coords.y, portal.coords.z), portal.length, portal.width, { 35 | heading = portal.heading, 36 | name = i, 37 | debugPoly = false, 38 | minZ = portal.coords.z - 5, 39 | maxZ = portal.coords.z + 5, 40 | data = {pad = u} 41 | }) 42 | local teleportCombo = ComboZone:Create(teleportPoly, {name = 'teleportPoly'}) 43 | teleportCombo:onPlayerInOut(function(isPointInside, _, zone) 44 | if isPointInside then 45 | if not ran then 46 | ran = true 47 | teleportMenu(tonumber(zone.name), zone.data.pad) 48 | end 49 | else 50 | ran = false 51 | end 52 | end) 53 | end 54 | end 55 | end) 56 | 57 | RegisterNetEvent('teleports:chooseloc', function(data) 58 | local ped = PlayerPedId() 59 | DoScreenFadeOut(500) 60 | Wait(500) 61 | if data.car then 62 | SetPedCoordsKeepVehicle(ped, data.coords.x, data.coords.y, data.coords.z) 63 | else 64 | SetEntityCoords(ped, data.coords.x, data.coords.y, data.coords.z) 65 | end 66 | SetEntityHeading(ped, data.heading) 67 | Wait(500) 68 | DoScreenFadeIn(500) 69 | end) -------------------------------------------------------------------------------- /client/vehiclepush.lua: -------------------------------------------------------------------------------- 1 | local isInFront = false 2 | 3 | local function loadAnimDict(dict) 4 | if HasAnimDictLoaded(dict) then return end 5 | RequestAnimDict(dict) 6 | while not HasAnimDictLoaded(dict) do 7 | Wait(10) 8 | end 9 | end 10 | 11 | RegisterNetEvent('vehiclepush:client:push', function(veh) 12 | if veh then 13 | local ped = PlayerPedId() 14 | local pos = GetEntityCoords(ped) 15 | local vehPos = GetEntityCoords(veh) 16 | local dimension = GetModelDimensions(GetEntityModel(veh)) 17 | local vehClass = GetVehicleClass(veh) 18 | if not IsEntityAttachedToEntity(ped, veh) and IsVehicleSeatFree(veh, -1) and GetVehicleEngineHealth(veh) <= Config.DamageNeeded and GetVehicleEngineHealth(veh) >= 0 then 19 | if vehClass ~= 13 or vehClass ~= 14 or vehClass ~= 15 or vehClass ~= 16 then 20 | NetworkRequestControlOfEntity(veh) 21 | if #(pos - vehPos) < 3.0 and not IsPedInAnyVehicle(ped, false) then 22 | if #(vehPos + GetEntityForwardVector(veh) - pos) > #(vehPos + GetEntityForwardVector(veh) * -1 - pos) then 23 | isInFront = false 24 | AttachEntityToEntity(ped, veh, GetPedBoneIndex(ped, 6286), 0.0, dimension.y - 0.3, dimension.z + 1.0, 0.0, 0.0, 0.0, false, false, false, true, 0, true) 25 | else 26 | isInFront = true 27 | AttachEntityToEntity(ped, veh, GetPedBoneIndex(ped, 6286), 0.0, dimension.y * -1 + 0.1, dimension.z + 1.0, 0.0, 0.0, 180.0, false, false, false, true, 0, true) 28 | end 29 | loadAnimDict('missfinale_c2ig_11') 30 | TaskPlayAnim(ped, 'missfinale_c2ig_11', 'pushcar_offcliff_m', 2.0, -8.0, -1, 35, 0, false, false, false) 31 | exports['qb-core']:DrawText(Lang:t('pushcar.stop_push'),'left') 32 | while true do 33 | Wait(0) 34 | if IsDisabledControlPressed(0, 34) then 35 | TaskVehicleTempAction(ped, veh, 11, 1000) 36 | end 37 | 38 | if IsDisabledControlPressed(0, 9) then 39 | TaskVehicleTempAction(ped, veh, 10, 1000) 40 | end 41 | 42 | SetVehicleForwardSpeed(veh, isInFront and -1.0 or 1.0) 43 | 44 | if HasEntityCollidedWithAnything(veh) then 45 | SetVehicleOnGroundProperly(veh) 46 | end 47 | 48 | if IsControlJustPressed(0, 38) then 49 | exports['qb-core']:HideText() 50 | DetachEntity(ped, false, false) 51 | StopAnimTask(ped, 'missfinale_c2ig_11', 'pushcar_offcliff_m', 2.0) 52 | FreezeEntityPosition(ped, false) 53 | break 54 | end 55 | end 56 | end 57 | end 58 | end 59 | end 60 | end) 61 | 62 | CreateThread(function() 63 | exports['qb-target']:AddTargetBone({'bonnet', 'boot'}, { 64 | options = { 65 | { 66 | icon = 'fas fa-wrench', 67 | label = 'Push Vehicle', 68 | action = function(entity) 69 | TriggerEvent('vehiclepush:client:push', entity) 70 | end, 71 | distance = 1.3 72 | } 73 | } 74 | }) 75 | end) -------------------------------------------------------------------------------- /client/vehicletext.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | CreateThread(function() 4 | for _, v in pairs(QBCore.Shared.Vehicles) do 5 | local text 6 | local name = string.lower(v.name) 7 | local brand = string.lower(v.brand) 8 | if v.brand and string.match(name, brand) then 9 | local nameWithoutBrand = string.gsub(name, brand, "") 10 | text = v.brand .. ' ' .. nameWithoutBrand 11 | else 12 | text = v.name 13 | end 14 | if v.hash and v.hash ~= 0 then 15 | AddTextEntryByHash(v.hash, text) 16 | end 17 | end 18 | end) -------------------------------------------------------------------------------- /client/weapdrop.lua: -------------------------------------------------------------------------------- 1 | local disabledPickups = { 2 | `PICKUP_WEAPON_ADVANCEDRIFLE`, 3 | `PICKUP_WEAPON_APPISTOL`, 4 | `PICKUP_WEAPON_ASSAULTRIFLE`, 5 | `PICKUP_WEAPON_ASSAULTRIFLE_MK2`, 6 | `PICKUP_WEAPON_ASSAULTSHOTGUN`, 7 | `PICKUP_WEAPON_ASSAULTSMG`, 8 | `PICKUP_WEAPON_AUTOSHOTGUN`, 9 | `PICKUP_WEAPON_BAT`, 10 | `PICKUP_WEAPON_BATTLEAXE`, 11 | `PICKUP_WEAPON_BOTTLE`, 12 | `PICKUP_WEAPON_BULLPUPRIFLE`, 13 | `PICKUP_WEAPON_BULLPUPRIFLE_MK2`, 14 | `PICKUP_WEAPON_BULLPUPSHOTGUN`, 15 | `PICKUP_WEAPON_CARBINERIFLE`, 16 | `PICKUP_WEAPON_CARBINERIFLE_MK2`, 17 | `PICKUP_WEAPON_COMBATMG`, 18 | `PICKUP_WEAPON_COMBATMG_MK2`, 19 | `PICKUP_WEAPON_COMBATPDW`, 20 | `PICKUP_WEAPON_COMBATPISTOL`, 21 | `PICKUP_WEAPON_COMPACTLAUNCHER`, 22 | `PICKUP_WEAPON_COMPACTRIFLE`, 23 | `PICKUP_WEAPON_CROWBAR`, 24 | `PICKUP_WEAPON_DAGGER`, 25 | `PICKUP_WEAPON_DBSHOTGUN`, 26 | `PICKUP_WEAPON_DOUBLEACTION`, 27 | `PICKUP_WEAPON_FIREWORK`, 28 | `PICKUP_WEAPON_FLAREGUN`, 29 | `PICKUP_WEAPON_FLASHLIGHT`, 30 | `PICKUP_WEAPON_GRENADE`, 31 | `PICKUP_WEAPON_GRENADELAUNCHER`, 32 | `PICKUP_WEAPON_GUSENBERG`, 33 | `PICKUP_WEAPON_GOLFCLUB`, 34 | `PICKUP_WEAPON_HAMMER`, 35 | `PICKUP_WEAPON_HATCHET`, 36 | `PICKUP_WEAPON_HEAVYPISTOL`, 37 | `PICKUP_WEAPON_HEAVYSHOTGUN`, 38 | `PICKUP_WEAPON_HEAVYSNIPER`, 39 | `PICKUP_WEAPON_HEAVYSNIPER_MK2`, 40 | `PICKUP_WEAPON_HOMINGLAUNCHER`, 41 | `PICKUP_WEAPON_KNIFE`, 42 | `PICKUP_WEAPON_KNUCKLE`, 43 | `PICKUP_WEAPON_MACHETE`, 44 | `PICKUP_WEAPON_MACHINEPISTOL`, 45 | `PICKUP_WEAPON_MARKSMANPISTOL`, 46 | `PICKUP_WEAPON_MARKSMANRIFLE`, 47 | `PICKUP_WEAPON_MARKSMANRIFLE_MK2`, 48 | `PICKUP_WEAPON_MG`, 49 | `PICKUP_WEAPON_MICROSMG`, 50 | `PICKUP_WEAPON_MINIGUN`, 51 | `PICKUP_WEAPON_MINISMG`, 52 | `PICKUP_WEAPON_MOLOTOV`, 53 | `PICKUP_WEAPON_MUSKET`, 54 | `PICKUP_WEAPON_NIGHTSTICK`, 55 | `PICKUP_WEAPON_PETROLCAN`, 56 | `PICKUP_WEAPON_PIPEBOMB`, 57 | `PICKUP_WEAPON_PISTOL`, 58 | `PICKUP_WEAPON_PISTOL50`, 59 | `PICKUP_WEAPON_PISTOL_MK2`, 60 | `PICKUP_WEAPON_POOLCUE`, 61 | `PICKUP_WEAPON_PROXMINE`, 62 | `PICKUP_WEAPON_PUMPSHOTGUN`, 63 | `PICKUP_WEAPON_PUMPSHOTGUN_MK2`, 64 | `PICKUP_WEAPON_RAILGUN`, 65 | `PICKUP_WEAPON_RAYCARBINE`, 66 | `PICKUP_WEAPON_RAYMINIGUN`, 67 | `PICKUP_WEAPON_RAYPISTOL`, 68 | `PICKUP_WEAPON_REVOLVER`, 69 | `PICKUP_WEAPON_REVOLVER_MK2`, 70 | `PICKUP_WEAPON_RPG`, 71 | `PICKUP_WEAPON_SAWNOFFSHOTGUN`, 72 | `PICKUP_WEAPON_SMG`, 73 | `PICKUP_WEAPON_SMG_MK2`, 74 | `PICKUP_WEAPON_SMOKEGRENADE`, 75 | `PICKUP_WEAPON_SNIPERRIFLE`, 76 | `PICKUP_WEAPON_SNSPISTOL`, 77 | `PICKUP_WEAPON_SNSPISTOL_MK2`, 78 | `PICKUP_WEAPON_SPECIALCARBINE`, 79 | `PICKUP_WEAPON_SPECIALCARBINE_MK2`, 80 | `PICKUP_WEAPON_STICKYBOMB`, 81 | `PICKUP_WEAPON_STONE_HATCHET`, 82 | `PICKUP_WEAPON_STUNGUN`, 83 | `PICKUP_WEAPON_SWITCHBLADE`, 84 | `PICKUP_WEAPON_VINTAGEPISTOL`, 85 | `PICKUP_WEAPON_WRENCH`, 86 | `PICKUP_WEAPON_CERAMICPISTOL`, 87 | `PICKUP_WEAPON_NAVYREVOLVER`, 88 | `PICKUP_WEAPON_GADGETPISTOL`, 89 | `PICKUP_WEAPON_PISTOLXM3`, 90 | `PICKUP_WEAPON_TECPISTOL`, 91 | `PICKUP_WEAPON_HEAVYRIFLE`, 92 | `PICKUP_WEAPON_MILITARYRIFLE`, 93 | `PICKUP_WEAPON_TACTICALRIFLE`, 94 | `PICKUP_WEAPON_SWEEPERSHOTGUN` 95 | } 96 | 97 | CreateThread(function() 98 | for i = 1, #disabledPickups do 99 | ToggleUsePickupsForPlayer(PlayerId(), disabledPickups[i], false) 100 | end 101 | end) -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.UseTarget = GetConvar('UseTarget', 'false') == 'true' -- Use qb-target interactions (don't change this, go to your server.cfg and add `setr UseTarget true` to use this and just that from true to false or the other way around) 4 | Config.PauseMapText = '' -- Text shown above the map when ESC is pressed. If left empty 'FiveM' will appear 5 | Config.HarnessUses = 20 6 | Config.DamageNeeded = 100.0 -- amount of damage till you can push your vehicle. 0-1000 7 | Config.Logging = 'discord' -- fivemanage 8 | 9 | Config.AFK = { 10 | ignoredGroups = { 11 | ['mod'] = true, 12 | ['admin'] = true, 13 | ['god'] = true 14 | }, 15 | secondsUntilKick = 1000000, -- AFK Kick Time Limit (in seconds) 16 | kickInCharMenu = false -- Set to true if you want to kick players for being AFK even when they are in the character menu. 17 | } 18 | 19 | Config.HandsUp = { 20 | command = 'hu', 21 | keybind = 'X', 22 | controls = { 24, 25, 47, 58, 59, 63, 64, 71, 72, 75, 140, 141, 142, 143, 257, 263, 264 } 23 | } 24 | 25 | Config.Binoculars = { 26 | zoomSpeed = 10.0, -- camera zoom speed 27 | storeBinocularsKey = 177 -- backspace by default 28 | } 29 | 30 | Config.AIResponse = { 31 | wantedLevels = false, -- if true, you will recieve wanted levels 32 | dispatchServices = { -- AI dispatch services 33 | [1] = false, -- Police Vehicles 34 | [2] = false, -- Police Helicopters 35 | [3] = false, -- Fire Department Vehicles 36 | [4] = false, -- Swat Vehicles 37 | [5] = false, -- Ambulance Vehicles 38 | [6] = false, -- Police Motorcycles 39 | [7] = false, -- Police Backup 40 | [8] = false, -- Police Roadblocks 41 | [9] = false, -- PoliceAutomobileWaitPulledOver 42 | [10] = false, -- PoliceAutomobileWaitCruising 43 | [11] = false, -- Gang Members 44 | [12] = false, -- Swat Helicopters 45 | [13] = false, -- Police Boats 46 | [14] = false, -- Army Vehicles 47 | [15] = false -- Biker Backup 48 | } 49 | } 50 | 51 | -- To Set This Up visit https://forum.cfx.re/t/how-to-updated-discord-rich-presence-custom-image/157686 52 | Config.Discord = { 53 | isEnabled = false, -- If set to true, then discord rich presence will be enabled 54 | applicationId = '00000000000000000', -- The discord application id 55 | iconLarge = 'logo_name', -- The name of the large icon 56 | iconLargeHoverText = 'This is a Large icon with text', -- The hover text of the large icon 57 | iconSmall = 'small_logo_name', -- The name of the small icon 58 | iconSmallHoverText = 'This is a Small icon with text', -- The hover text of the small icon 59 | updateRate = 60000, -- How often the player count should be updated 60 | showPlayerCount = true, -- If set to true the player count will be displayed in the rich presence 61 | maxPlayers = 48, -- Maximum amount of players 62 | buttons = { 63 | { 64 | text = 'First Button!', 65 | url = 'fivem://connect/localhost:30120' 66 | }, 67 | { 68 | text = 'Second Button!', 69 | url = 'fivem://connect/localhost:30120' 70 | } 71 | } 72 | } 73 | 74 | Config.Density = { 75 | parked = 0.8, 76 | vehicle = 0.8, 77 | multiplier = 0.8, 78 | peds = 0.8, 79 | scenario = 0.8 80 | } 81 | 82 | Config.Disable = { 83 | hudComponents = { 1, 2, 3, 4, 7, 9, 13, 14, 19, 20, 21, 22 }, -- Hud Components: https://docs.fivem.net/natives/?_0x6806C51AD12B83B8 84 | controls = { 37 }, -- Controls: https://docs.fivem.net/docs/game-references/controls/ 85 | displayAmmo = true, -- false disables ammo display 86 | ambience = false, -- disables distance sirens, distance car alarms, flight music, etc 87 | idleCamera = true, -- disables the idle cinematic camera 88 | vestDrawable = false, -- disables the vest equipped when using heavy armor 89 | pistolWhipping = true, -- disables pistol whipping 90 | driveby = false, -- disables driveby 91 | } 92 | 93 | Config.RelieveWeedStress = math.random(15, 20) -- stress relief amount (100 max) 94 | 95 | Config.Consumables = { 96 | eat = { -- default food items 97 | ['sandwich'] = math.random(35, 54), 98 | ['tosti'] = math.random(40, 50), 99 | ['twerks_candy'] = math.random(35, 54), 100 | ['snikkel_candy'] = math.random(40, 50) 101 | }, 102 | drink = { -- default drink items 103 | ['water_bottle'] = math.random(35, 54), 104 | ['kurkakola'] = math.random(35, 54), 105 | ['coffee'] = math.random(40, 50) 106 | }, 107 | alcohol = { -- default alcohol items 108 | ['whiskey'] = math.random(20, 30), 109 | ['beer'] = math.random(30, 40), 110 | ['vodka'] = math.random(20, 40), 111 | }, 112 | custom = { -- put any custom items here 113 | -- ['newitem'] = { 114 | -- progress = { 115 | -- label = 'Using Item...', 116 | -- time = 5000 117 | -- }, 118 | -- animation = { 119 | -- animDict = 'amb@prop_human_bbq@male@base', 120 | -- anim = 'base', 121 | -- flags = 8, 122 | -- }, 123 | -- prop = { 124 | -- model = false, 125 | -- bone = false, 126 | -- coords = false, -- vector 3 format 127 | -- rotation = false, -- vector 3 format 128 | -- }, 129 | -- replenish = {''' 130 | -- type = 'Hunger', -- replenish type 'Hunger'/'Thirst' / false 131 | -- replenish = math.random(20, 40), 132 | -- isAlcohol = false, -- if you want it to add alcohol count 133 | -- event = false, -- 'eventname' if you want it to trigger an outside event on use useful for drugs 134 | -- server = false -- if the event above is a server event 135 | -- } 136 | -- } 137 | } 138 | } 139 | 140 | Config.Fireworks = { 141 | delay = 5, -- time in s till it goes off 142 | items = { -- firework items 143 | 'firework1', 144 | 'firework2', 145 | 'firework3', 146 | 'firework4' 147 | } 148 | } 149 | 150 | Config.BlacklistedScenarios = { 151 | types = { 152 | 'WORLD_VEHICLE_MILITARY_PLANES_SMALL', 153 | 'WORLD_VEHICLE_MILITARY_PLANES_BIG', 154 | 'WORLD_VEHICLE_AMBULANCE', 155 | 'WORLD_VEHICLE_POLICE_NEXT_TO_CAR', 156 | 'WORLD_VEHICLE_POLICE_CAR', 157 | 'WORLD_VEHICLE_POLICE_BIKE' 158 | }, 159 | groups = { 160 | 2017590552, 161 | 2141866469, 162 | 1409640232, 163 | `ng_planes` 164 | } 165 | } 166 | 167 | Config.BlacklistedVehs = { 168 | [`shamal`] = true, 169 | [`luxor`] = true, 170 | [`luxor2`] = true, 171 | [`jet`] = true, 172 | [`lazer`] = true, 173 | [`buzzard`] = true, 174 | [`buzzard2`] = true, 175 | [`annihilator`] = true, 176 | [`savage`] = true, 177 | [`titan`] = true, 178 | [`rhino`] = true, 179 | [`firetruck`] = true, 180 | [`mule`] = true, 181 | [`maverick`] = true, 182 | [`blimp`] = true, 183 | [`airtug`] = true, 184 | [`camper`] = true, 185 | [`hydra`] = true, 186 | [`oppressor`] = true, 187 | [`technical3`] = true, 188 | [`insurgent3`] = true, 189 | [`apc`] = true, 190 | [`tampa3`] = true, 191 | [`trailersmall2`] = true, 192 | [`halftrack`] = true, 193 | [`hunter`] = true, 194 | [`vigilante`] = true, 195 | [`akula`] = true, 196 | [`barrage`] = true, 197 | [`khanjali`] = true, 198 | [`caracara`] = true, 199 | [`blimp3`] = true, 200 | [`menacer`] = true, 201 | [`oppressor2`] = true, 202 | [`scramjet`] = true, 203 | [`strikeforce`] = true, 204 | [`cerberus`] = true, 205 | [`cerberus2`] = true, 206 | [`cerberus3`] = true, 207 | [`scarab`] = true, 208 | [`scarab2`] = true, 209 | [`scarab3`] = true, 210 | [`rrocket`] = true, 211 | [`ruiner2`] = true, 212 | [`deluxo`] = true, 213 | [`cargoplane2`] = true, 214 | [`voltic2`] = true 215 | } 216 | 217 | Config.BlacklistedWeapons = { 218 | [`WEAPON_RAILGUN`] = true, 219 | } 220 | 221 | Config.BlacklistedPeds = { 222 | [`s_m_y_ranger_01`] = true, 223 | [`s_m_y_sheriff_01`] = true, 224 | [`s_m_y_cop_01`] = true, 225 | [`s_f_y_sheriff_01`] = true, 226 | [`s_f_y_cop_01`] = true, 227 | [`s_m_y_hwaycop_01`] = true 228 | } 229 | 230 | Config.Objects = { -- for object removal 231 | { coords = vector3(266.09, -349.35, 44.74), heading = 0, length = 200, width = 200, model = 'prop_sec_barier_02b' }, 232 | { coords = vector3(285.28, -355.78, 45.13), heading = 0, length = 200, width = 200, model = 'prop_sec_barier_02a' }, 233 | } 234 | 235 | -- You may add more than 2 selections and it will bring up a menu for the player to select which floor be sure to label each section though 236 | Config.Teleports = { 237 | [1] = { -- Elevator @ labs 238 | [1] = { -- up 239 | poly = { coords = vector3(3540.74, 3675.59, 20.99), heading = 167.5, length = 2, width = 2 }, 240 | allowVeh = false, -- whether or not to allow use in vehicle 241 | label = false -- set this to a string for a custom label or leave it false to keep the default. if more than 2 options, label all options 242 | 243 | }, 244 | [2] = { -- down 245 | poly = { coords = vector3(3540.74, 3675.59, 28.11), heading = 172.5, length = 2, width = 2 }, 246 | allowVeh = false, 247 | label = false 248 | } 249 | }, 250 | [2] = { --Coke Processing Enter/Exit 251 | [1] = { 252 | poly = { coords = vector3(909.49, -1589.22, 30.51), heading = 92.24, length = 2, width = 2 }, 253 | allowVeh = false, 254 | label = '[E] Enter Coke Processing' 255 | }, 256 | [2] = { 257 | poly = { coords = vector3(1088.81, -3187.57, -38.99), heading = 181.7, length = 2, width = 2 }, 258 | allowVeh = false, 259 | label = '[E] Leave' 260 | } 261 | } 262 | } 263 | 264 | Config.CarWash = { 265 | dirtLevel = 0.1, -- threshold for the dirt level to be counted as dirty 266 | defaultPrice = 20, -- default price for the carwash 267 | locations = { 268 | [1] = { coords = vector3(174.81, -1736.77, 28.87), length = 7.0, width = 8.8, heading = 359 }, -- South Los Santos Carson Avenue 269 | [2] = { coords = vector3(25.2, -1391.98, 28.91), length = 6.6, width = 8.2, heading = 0 }, -- South Los Santos Innocence Boulevard 270 | [3] = { coords = vector3(-74.27, 6427.72, 31.02), length = 9.4, width = 8, heading = 315 }, -- Paleto Bay Boulevard 271 | [4] = { coords = vector3(1362.69, 3591.81, 34.5), length = 6.4, width = 8, heading = 21 }, -- Sandy Shores 272 | [5] = { coords = vector3(-699.84, -932.68, 18.59), length = 11.8, width = 5.2, heading = 0 } -- Little Seoul Gas Station 273 | } 274 | } 275 | -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | lua54 'yes' 4 | use_experimental_fxv2_oal 'yes' 5 | author 'Kakarot' 6 | description 'Various small code snippets compiled into one resource for ease of use' 7 | version '1.4.0' 8 | 9 | shared_scripts { 10 | '@qb-core/shared/locale.lua', 11 | 'locales/en.lua', 12 | 'locales/*.lua', 13 | 'config.lua' 14 | } 15 | server_script 'server/*.lua' 16 | client_scripts { 17 | '@PolyZone/client.lua', 18 | '@PolyZone/BoxZone.lua', 19 | '@PolyZone/ComboZone.lua', 20 | 'client/*.lua' 21 | } 22 | 23 | data_file 'FIVEM_LOVES_YOU_4B38E96CC036038F' 'events.meta' 24 | data_file 'FIVEM_LOVES_YOU_341B23A2F0E0F131' 'popgroups.ymt' 25 | 26 | files { 27 | 'events.meta', 28 | 'popgroups.ymt', 29 | 'relationships.dat' 30 | } 31 | -------------------------------------------------------------------------------- /locales/de.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = 'Du bist AFK und wirst in ', 4 | time_seconds = ' Sekunden gekickt!', 5 | time_minutes = ' Minute(n) gekickt!', 6 | kick_message = 'Du wurdest gekickt, weil du AFK warst' 7 | }, 8 | wash = { 9 | in_progress = "Fahrzeug wird gewaschen...", 10 | wash_vehicle = "[E] Fahrzeug waschen", 11 | wash_vehicle_target = "Fahrzeug waschen", 12 | dirty = "Das Fahrzeug ist nicht schmutzig", 13 | cancel = "Waschen abgebrochen..." 14 | }, 15 | consumables = { 16 | eat_progress = "Essen...", 17 | drink_progress = "Trinken...", 18 | liqour_progress = "Alkohol trinken...", 19 | coke_progress = "Kurzer Zug...", 20 | crack_progress = "Crack rauchen...", 21 | ecstasy_progress = "Pillen einwerfen", 22 | healing_progress = "Heilen", 23 | meth_progress = "Crystal Meth rauchen", 24 | joint_progress = "Joint anzünden...", 25 | use_parachute_progress = "Fallschirm anlegen...", 26 | pack_parachute_progress = "Fallschirm packen...", 27 | no_parachute = "Du hast keinen Fallschirm!", 28 | armor_full = "Du hast bereits genug Rüstung an!", 29 | armor_empty = "Du trägst keine Weste...", 30 | armor_progress = "Schutzweste anlegen...", 31 | heavy_armor_progress = "Schwere Schutzweste anlegen...", 32 | remove_armor_progress = "Schutzweste abnehmen...", 33 | canceled = "Abgebrochen..." 34 | }, 35 | cruise = { 36 | unavailable = "Tempomat nicht verfügbar", 37 | activated = "Tempomat aktiviert", 38 | deactivated = "Tempomat deaktiviert" 39 | }, 40 | editor = { 41 | started = "Aufnahme gestartet!", 42 | save = "Aufnahme gespeichert!", 43 | delete = "Aufnahme gelöscht!", 44 | editor = "Bis später, Alligator!" 45 | }, 46 | firework = { 47 | place_progress = "Feuerwerk platzieren...", 48 | canceled = "Abgebrochen...", 49 | time_left = "Feuerwerk startet in ~r~" 50 | }, 51 | seatbelt = { 52 | use_harness_progress = "Renngurt anlegen", 53 | remove_harness_progress = "Renngurt entfernen", 54 | no_car = "Du bist nicht in einem Auto." 55 | }, 56 | teleport = { 57 | teleport_default = 'Aufzug benutzen' 58 | }, 59 | pushcar = { 60 | stop_push = "[E] Schieben beenden" 61 | } 62 | } 63 | 64 | if GetConvar('qb_locale', 'en') == 'de' then 65 | Lang = Locale:new({ 66 | phrases = Translations, 67 | warnOnMissing = true, 68 | fallbackLang = Lang, 69 | }) 70 | end 71 | 72 | -------------------------------------------------------------------------------- /locales/en.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = 'You are AFK and will be kicked in ', 4 | time_seconds = ' seconds!', 5 | time_minutes = ' minute(s)!', 6 | kick_message = 'You were kicked for being AFK' 7 | }, 8 | wash = { 9 | in_progress = "Vehicle is being washed...", 10 | wash_vehicle = "[E] Wash Vehicle", 11 | wash_vehicle_target = "Wash Vehicle", 12 | dirty = "The vehicle isn't dirty", 13 | cancel = "Washing canceled..." 14 | }, 15 | consumables = { 16 | eat_progress = "Eating...", 17 | drink_progress = "Drinking...", 18 | liqour_progress = "Drinking liquor...", 19 | coke_progress = "Quick sniff...", 20 | crack_progress = "Smoking crack...", 21 | ecstasy_progress = "Pops Pills", 22 | healing_progress = "Healing", 23 | meth_progress = "Smoking Ass Meth", 24 | joint_progress = "Lighting joint...", 25 | use_parachute_progress = "Putting on parachute...", 26 | pack_parachute_progress = "Packing parachute...", 27 | no_parachute = "You dont have a parachute!", 28 | armor_full = "You already have enough armor on!", 29 | armor_empty = "You're not wearing a vest...", 30 | armor_progress = "Putting on the body armour...", 31 | heavy_armor_progress = "Putting on body armour...", 32 | remove_armor_progress = "Removing the body armour...", 33 | canceled = "Canceled..." 34 | }, 35 | cruise = { 36 | unavailable = "Cruise control unavailable", 37 | activated = "Cruise control activated", 38 | deactivated = "Cruise control deactivated" 39 | }, 40 | editor = { 41 | started = "Started Recording!", 42 | save = "Saved Recording!", 43 | delete = "Deleted Recording!", 44 | editor = "Later aligator!" 45 | }, 46 | firework = { 47 | place_progress = "Placing firework...", 48 | canceled = "Canceled...", 49 | time_left = "Firework launch in ~r~" 50 | }, 51 | seatbelt = { 52 | use_harness_progress = "Attaching Race Harness", 53 | remove_harness_progress = "Removing Race Harness", 54 | no_car = "You're not in a car." 55 | }, 56 | teleport = { 57 | teleport_default = 'Use Elevator' 58 | }, 59 | pushcar = { 60 | stop_push = "[E] Stop Pushing" 61 | } 62 | } 63 | 64 | Lang = Lang or Locale:new({ 65 | phrases = Translations, 66 | warnOnMissing = true 67 | }) -------------------------------------------------------------------------------- /locales/es.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = 'Estás AFK y serás expulsado en ', 4 | time_seconds = ' segundos!', 5 | time_minutes = ' minuto(s)!', 6 | kick_message = 'Fuiste expulsado por estar AFK' 7 | }, 8 | wash = { 9 | in_progress = "Vehículo en proceso de lavado...", 10 | wash_vehicle = "[E] Lavar vehículo", 11 | wash_vehicle_target = "Lavar vehículo", 12 | dirty = "El vehículo no está sucio", 13 | cancel = "Lavado cancelado..." 14 | }, 15 | consumables = { 16 | eat_progress = "Comiendo...", 17 | drink_progress = "Bebiendo...", 18 | liqour_progress = "Bebiendo licor...", 19 | coke_progress = "Esnifando rápidamente...", 20 | crack_progress = "Fumando crack...", 21 | ecstasy_progress = "Tomando pastillas", 22 | healing_progress = "Curando", 23 | meth_progress = "Fumando metanfetamina...", 24 | joint_progress = "Encendiendo porro...", 25 | use_parachute_progress = "Poniéndose el paracaídas...", 26 | pack_parachute_progress = "Empacando el paracaídas...", 27 | no_parachute = "¡No tienes un paracaídas!", 28 | armor_full = "¡Ya tienes suficiente chaleco!", 29 | armor_empty = "No llevas un chaleco...", 30 | armor_progress = "Poniéndose la chaleco...", 31 | heavy_armor_progress = "Poniéndose la chaleco...", 32 | remove_armor_progress = "Quitándose la chaleco...", 33 | canceled = "Cancelado..." 34 | }, 35 | cruise = { 36 | unavailable = "Control de crucero no disponible", 37 | activated = "Control de crucero activado", 38 | deactivated = "Control de crucero desactivado" 39 | }, 40 | editor = { 41 | started = "¡Grabación iniciada!", 42 | save = "¡Grabación guardada!", 43 | delete = "¡Grabación eliminada!", 44 | editor = "¡Chao pescao'!" 45 | }, 46 | firework = { 47 | place_progress = "Colocando fuegos artificiales...", 48 | canceled = "Cancelado...", 49 | time_left = "Lanzamiento de fuegos artificiales en ~r~" 50 | }, 51 | seatbelt = { 52 | use_harness_progress = "Colocando arnés de carrera", 53 | remove_harness_progress = "Quitando arnés de carrera", 54 | no_car = "No estás en un coche." 55 | }, 56 | teleport = { 57 | teleport_default = 'Usar ascensor' 58 | }, 59 | pushcar = { 60 | stop_push = "[E] Dejar de empujar" 61 | } 62 | } 63 | 64 | if GetConvar('qb_locale', 'en') == 'es' then 65 | Lang = Locale:new({ 66 | phrases = Translations, 67 | warnOnMissing = true, 68 | fallbackLang = Lang, 69 | }) 70 | end 71 | -------------------------------------------------------------------------------- /locales/nl.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = 'Je bent aFK en je zal gekickt worden in ', 4 | time_seconds = ' seconden!', 5 | time_minutes = ' minuten!', 6 | kick_message = 'Je werd gekickt omdat je AFK was' 7 | }, 8 | wash = { 9 | in_progress = "Je voertuig wordt schoongemaakt...", 10 | wash_vehicle = "[E] Voertuig wassen", 11 | wash_vehicle_target = "Was Voertuig", 12 | dirty = "Het voertuig is niet vies", 13 | cancel = "Wassen geannuleerd..." 14 | }, 15 | consumables = { 16 | eat_progress = "Eten...", 17 | drink_progress = "Drinken...", 18 | liqour_progress = "Alcohol drinken...", 19 | coke_progress = "Aan het snuiven...", 20 | crack_progress = "Crack aan het smoken...", 21 | ecstasy_progress = "Pillen slikken", 22 | healing_progress = "Aan het genezen", 23 | meth_progress = "Meth aan het roken", 24 | joint_progress = "Joint aan het opsteken...", 25 | use_parachute_progress = "Parachute aan het omdoen...", 26 | pack_parachute_progress = "Parachute inpakken...", 27 | no_parachute = "Je hebt geen parachute!", 28 | armor_full = "Je hebt al genoeg bepansering aan!", 29 | armor_empty = "Je draagt geen vest...", 30 | armor_progress = "Kogelvrij vest aan het omdoen...", 31 | heavy_armor_progress = "Kogelvrij vest aan het omdoen...", 32 | remove_armor_progress = "Kogelvrij vest aan het afdoen...", 33 | canceled = "Geannuleerd..." 34 | }, 35 | cruise = { 36 | unavailable = "Cruisecontrol niet beschikbaar", 37 | activated = "Cruise geactiveerd", 38 | deactivated = "Cruise gedeactiveerd" 39 | }, 40 | editor = { 41 | started = "Aan het opnemen!", 42 | save = "Opname opgeslagen!", 43 | delete = "Opname verwijder!", 44 | editor = "Later!" 45 | }, 46 | firework = { 47 | place_progress = "Vuurwerk aan het plaatsen...", 48 | canceled = "Geannuleerd...", 49 | time_left = "Vuurwerk over ~r~" 50 | }, 51 | seatbelt = { 52 | use_harness_progress = "Raceharnas bevestigen", 53 | remove_harness_progress = "Raceharnas verwijderen", 54 | no_car = "Je zit niet in een voertuig." 55 | }, 56 | teleport = { 57 | teleport_default = 'Gebruik lift' 58 | }, 59 | pushcar = { 60 | stop_push = "[E] Stop met duwen" 61 | } 62 | } 63 | 64 | if GetConvar('qb_locale', 'en') == 'nl' then 65 | Lang = Locale:new({ 66 | phrases = Translations, 67 | warnOnMissing = true, 68 | fallbackLang = Lang, 69 | }) 70 | end 71 | -------------------------------------------------------------------------------- /locales/pt-br.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = 'Você está AFK e será expulso em ', 4 | time_seconds = ' segundos!', 5 | time_minutes = ' minuto(s)!', 6 | kick_message = 'Você foi expulso por estar AFK' 7 | }, 8 | wash = { 9 | in_progress = "O veículo está sendo lavado...", 10 | wash_vehicle = "[E] Lavar Veículo", 11 | wash_vehicle_target = "Lavar Veículo", 12 | dirty = "O veículo não está sujo", 13 | cancel = "Lavagem cancelada..." 14 | }, 15 | consumables = { 16 | eat_progress = "Comendo...", 17 | drink_progress = "Bebendo...", 18 | liqour_progress = "Bebendo licor...", 19 | coke_progress = "Cheirando rápido...", 20 | crack_progress = "Fumando crack...", 21 | ecstasy_progress = "Engolindo pílulas...", 22 | healing_progress = "Curando", 23 | meth_progress = "Fumando Metanfetamina", 24 | joint_progress = "Acendendo um baseado...", 25 | use_parachute_progress = "Colocando o paraquedas...", 26 | pack_parachute_progress = "Dobrando o paraquedas...", 27 | no_parachute = "Você não tem um paraquedas!", 28 | armor_full = "Você já tem armadura suficiente!", 29 | armor_empty = "Você não está usando um colete...", 30 | armor_progress = "Colocando a armadura...", 31 | heavy_armor_progress = "Colocando armadura pesada...", 32 | remove_armor_progress = "Removendo a armadura...", 33 | canceled = "Cancelado..." 34 | }, 35 | cruise = { 36 | unavailable = "Controle de cruzeiro indisponível", 37 | activated = "Cruise Control Ativado", 38 | deactivated = "Cruise Control Desativado" 39 | }, 40 | editor = { 41 | started = "Gravação Iniciada!", 42 | save = "Gravação Salva!", 43 | delete = "Gravação Excluída!", 44 | editor = "Até logo, jacaré!" 45 | }, 46 | firework = { 47 | place_progress = "Soltando fogos de artifício...", 48 | canceled = "Cancelado...", 49 | time_left = "Fogos de artifício acabaram ~r~" 50 | }, 51 | seatbelt = { 52 | use_harness_progress = "Prendendo o Cinto de Corrida", 53 | remove_harness_progress = "Removendo o Cinto de Corrida", 54 | no_car = "Você não está em um carro." 55 | }, 56 | teleport = { 57 | teleport_default = 'Usar Elevador' 58 | }, 59 | pushcar = { 60 | stop_push = "[E] Parar de Empurrar" 61 | } 62 | } 63 | 64 | if GetConvar('qb_locale', 'en') == 'pt-br' then 65 | Lang = Locale:new({ 66 | phrases = Translations, 67 | warnOnMissing = true, 68 | fallbackLang = Lang, 69 | }) 70 | end 71 | -------------------------------------------------------------------------------- /locales/pt.lua: -------------------------------------------------------------------------------- 1 | local Translations = { 2 | afk = { 3 | will_kick = "Estás AFK e vais ser kickado em", 4 | time_seconds = " segundos!", 5 | time_minutes = " minutos!", 6 | kick_message = "Foste Kickado Por Estares AFK" 7 | }, 8 | error = { 9 | ["car_wash_canceled"] = "Lavagem cancelada...", 10 | ["car_wash_notdirty"] = "O veículo não está sujo", 11 | ["cruise_deactivated"] = "Cruise control desativado", 12 | ["cruise_unavailable"] = "Cruise control indisponível", 13 | ["not_in_car"] = "Não estás dentro de um carro.", 14 | ["dont_have_enough_money"] = "Não tens dinheiro suficiente...", 15 | ["global_canceled"] = "Cancelado..." 16 | }, 17 | info = { 18 | ["cruise_activated_mp"] = "Cruise Ativado: %{speed} MP/H", 19 | ["cruise_activated_km"] = "Cruise Ativado: %{speed} KM/H" 20 | }, 21 | progress = { 22 | ["car_wash_progress"] = "O veículo está a ser lavado...", 23 | ["placing_firework"] = "A preparar fogo de artifício...", 24 | ["attach_race_harness"] = "A colocar Arnês de Corrida", 25 | ["remove_race_harness"] = "A remover Arnês de Corrida" 26 | }, 27 | text = { 28 | ["car_wash_text"] = "~g~E~w~ - Lavar Veículo (%{price}€)", 29 | ["car_wash_not_available"] = "A estação de lavagem não está disponível...", 30 | ["time_until_firework"] = "Fogo de Artifício em ~r~%{time}", 31 | ["push_vehicle"] = "[~g~SHIFT~w~] + [~g~E~w~] para empurrar veículo" 32 | }, 33 | editor = { 34 | ["record"] = "Gravação Iniciada!", 35 | ["save"] = "Gravação Guardada!", 36 | ["delete_clip"] = "Gravação Apagada!", 37 | ["editor"] = "Later aligator!" 38 | } 39 | } 40 | 41 | if GetConvar('qb_locale', 'en') == 'pt' then 42 | Lang = Locale:new({ 43 | phrases = Translations, 44 | warnOnMissing = true, 45 | fallbackLang = Lang, 46 | }) 47 | end 48 | 49 | -------------------------------------------------------------------------------- /popgroups.ymt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/popgroups.ymt -------------------------------------------------------------------------------- /relationships.dat: -------------------------------------------------------------------------------- 1 | # Acquaintance options: 2 | # - Hate 3 | # - Dislike 4 | # - Like 5 | # - Respect 6 | PLAYER 7 | CIVMALE 8 | CIVFEMALE 9 | COP 10 | SECURITY_GUARD 11 | PRIVATE_SECURITY 12 | FIREMAN 13 | GANG_1 14 | GANG_2 15 | GANG_9 16 | GANG_10 17 | AMBIENT_GANG_LOST 18 | AMBIENT_GANG_MEXICAN 19 | AMBIENT_GANG_FAMILY 20 | AMBIENT_GANG_BALLAS 21 | AMBIENT_GANG_MARABUNTE 22 | AMBIENT_GANG_CULT 23 | AMBIENT_GANG_SALVA 24 | AMBIENT_GANG_WEICHENG 25 | AMBIENT_GANG_HILLBILLY 26 | DEALER 27 | HATES_PLAYER 28 | HEN 29 | WILD_ANIMAL 30 | SHARK 31 | COUGAR 32 | NO_RELATIONSHIP 33 | SPECIAL 34 | MISSION2 35 | MISSION3 36 | MISSION4 37 | MISSION5 38 | MISSION6 39 | MISSION7 40 | MISSION8 41 | ARMY 42 | GUARD_DOG 43 | AGGRESSIVE_INVESTIGATE 44 | MEDIC 45 | CAT 46 | 47 | # 48 | PLAYER 49 | Like PLAYER 50 | CIVMALE 51 | # Respect CIVMALE 52 | # Respect CIVFEMALE 53 | CIVFEMALE 54 | # Respect CIVFEMALE 55 | # Respect CIVMALE 56 | COP 57 | Respect MEDIC FIREMAN COP 58 | Respect ARMY 59 | Respect PLAYER 60 | Like SECURITY_GUARD 61 | ARMY 62 | Like ARMY 63 | Respect COP 64 | SECURITY_GUARD 65 | Like COP SECURITY_GUARD GUARD_DOG 66 | PRIVATE_SECURITY 67 | Like PRIVATE_SECURITY GUARD_DOG 68 | PRISONER 69 | Like PRISONER 70 | Hate PLAYER 71 | FIREMAN 72 | Respect MEDIC FIREMAN COP 73 | Respect PLAYER 74 | GANG_1 75 | Respect GANG_1 76 | GANG_2 77 | Respect GANG_2 78 | GANG_9 79 | Respect GANG_9 80 | GANG_10 81 | Respect GANG_10 82 | HATES_PLAYER 83 | Hate PLAYER 84 | Like HATES_PLAYER AGGRESSIVE_INVESTIGATE 85 | HEN 86 | Dislike PLAYER 87 | AMBIENT_GANG_LOST 88 | Like AMBIENT_GANG_LOST GUARD_DOG 89 | AMBIENT_GANG_MEXICAN 90 | Respect PLAYER 91 | Like AMBIENT_GANG_MEXICAN GUARD_DOG 92 | AMBIENT_GANG_FAMILY 93 | Like AMBIENT_GANG_FAMILY GUARD_DOG 94 | AMBIENT_GANG_BALLAS 95 | Respect PLAYER 96 | Like AMBIENT_GANG_BALLAS GUARD_DOG 97 | AMBIENT_GANG_MARABUNTE 98 | Like AMBIENT_GANG_MARABUNTE GUARD_DOG 99 | AMBIENT_GANG_CULT 100 | Like AMBIENT_GANG_CULT GUARD_DOG 101 | AMBIENT_GANG_SALVA 102 | Like AMBIENT_GANG_SALVA GUARD_DOG 103 | AMBIENT_GANG_WEICHENG 104 | Like AMBIENT_GANG_WEICHENG GUARD_DOG 105 | AMBIENT_GANG_HILLBILLY 106 | Respect PLAYER 107 | Like AMBIENT_GANG_HILLBILLY GUARD_DOG 108 | DOMESTIC_ANIMAL 109 | Hate PLAYER 110 | Like CIVMALE CIVFEMALE COP SECURITY_GUARD DOMESTIC_ANIMAL FIREMAN GANG_1 GANG_2 GANG_9 GANG_10 AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_BALLAS AMBIENT_GANG_FAMILY DEALER HATES_PLAYER 111 | WILD_ANIMAL 112 | Hate PLAYER CIVMALE CIVFEMALE COP SECURITY_GUARD FIREMAN GANG_1 GANG_2 GANG_9 GANG_10 AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_BALLAS AMBIENT_GANG_FAMILY DEALER HATES_PLAYER 113 | DEER 114 | Hate PLAYER CIVMALE CIVFEMALE COP SECURITY_GUARD FIREMAN GANG_1 GANG_2 GANG_9 GANG_10 AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_BALLAS AMBIENT_GANG_FAMILY DEALER HATES_PLAYER 115 | Respect DEER 116 | SHARK 117 | Hate PLAYER 118 | GUARD_DOG 119 | Like GUARD_DOG CIVMALE CIVFEMALE SECURITY_GUARD AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_FAMILY AMBIENT_GANG_BALLAS AMBIENT_GANG_MARABUNTE AMBIENT_GANG_CULT AMBIENT_GANG_SALVA AMBIENT_GANG_WEICHENG AMBIENT_GANG_HILLBILLY PRIVATE_SECURITY 120 | AGGRESSIVE_INVESTIGATE 121 | Hate PLAYER 122 | Like HATES_PLAYER AGGRESSIVE_INVESTIGATE 123 | MEDIC 124 | Respect PLAYER 125 | Like MEDIC 126 | Respect COP ARMY SECURITY_GUARD FIREMAN 127 | COUGAR 128 | Hate PLAYER CIVMALE CIVFEMALE SECURITY_GUARD AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_FAMILY AMBIENT_GANG_BALLAS AMBIENT_GANG_MARABUNTE AMBIENT_GANG_CULT AMBIENT_GANG_SALVA AMBIENT_GANG_WEICHENG AMBIENT_GANG_HILLBILLY PRIVATE_SECURITY COP ARMY PRISONER FIREMAN 129 | CAT 130 | Hate PLAYER 131 | Like CIVMALE CIVFEMALE COP SECURITY_GUARD DOMESTIC_ANIMAL FIREMAN GANG_1 GANG_2 GANG_9 GANG_10 AMBIENT_GANG_LOST AMBIENT_GANG_MEXICAN AMBIENT_GANG_BALLAS AMBIENT_GANG_FAMILY DEALER HATES_PLAYER 132 | 133 | -------------------------------------------------------------------------------- /server/afk.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | RegisterNetEvent('KickForAFK', function() 4 | DropPlayer(source, Lang:t("afk.kick_message")) 5 | end) 6 | 7 | QBCore.Functions.CreateCallback('qb-afkkick:server:GetPermissions', function(source, cb) 8 | cb(QBCore.Functions.GetPermission(source)) 9 | end) 10 | -------------------------------------------------------------------------------- /server/consumables.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | ----------- / alcohol 3 | 4 | for k, _ in pairs(Config.Consumables.alcohol) do 5 | QBCore.Functions.CreateUseableItem(k, function(source, item) 6 | TriggerClientEvent('consumables:client:DrinkAlcohol', source, item.name) 7 | end) 8 | end 9 | 10 | ----------- / Eat 11 | 12 | for k, _ in pairs(Config.Consumables.eat) do 13 | QBCore.Functions.CreateUseableItem(k, function(source, item) 14 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:consumables:eat') then return end 15 | TriggerClientEvent('consumables:client:Eat', source, item.name) 16 | end) 17 | end 18 | 19 | ----------- / Drink 20 | for k, _ in pairs(Config.Consumables.drink) do 21 | QBCore.Functions.CreateUseableItem(k, function(source, item) 22 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:consumables:drink') then return end 23 | TriggerClientEvent('consumables:client:Drink', source, item.name) 24 | end) 25 | end 26 | 27 | ----------- / Custom 28 | for k, _ in pairs(Config.Consumables.custom) do 29 | QBCore.Functions.CreateUseableItem(k, function(source, item) 30 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:consumables:custom') then return end 31 | TriggerClientEvent('consumables:client:Custom', source, item.name) 32 | end) 33 | end 34 | 35 | local function createItem(name, type) 36 | QBCore.Functions.CreateUseableItem(name, function(source, item) 37 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:consumables:createItem') then return end 38 | TriggerClientEvent('consumables:client:' .. type, source, item.name) 39 | end) 40 | end 41 | ----------- / Drug 42 | 43 | QBCore.Functions.CreateUseableItem('joint', function(source, item) 44 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:joint') then return end 45 | TriggerClientEvent('consumables:client:UseJoint', source) 46 | end) 47 | 48 | QBCore.Functions.CreateUseableItem('cokebaggy', function(source) 49 | TriggerClientEvent('consumables:client:Cokebaggy', source) 50 | end) 51 | 52 | QBCore.Functions.CreateUseableItem('crack_baggy', function(source) 53 | TriggerClientEvent('consumables:client:Crackbaggy', source) 54 | end) 55 | 56 | QBCore.Functions.CreateUseableItem('xtcbaggy', function(source) 57 | TriggerClientEvent('consumables:client:EcstasyBaggy', source) 58 | end) 59 | 60 | QBCore.Functions.CreateUseableItem('oxy', function(source) 61 | TriggerClientEvent('consumables:client:oxy', source) 62 | end) 63 | 64 | QBCore.Functions.CreateUseableItem('meth', function(source) 65 | TriggerClientEvent('consumables:client:meth', source) 66 | end) 67 | 68 | ----------- / Tools 69 | 70 | QBCore.Functions.CreateUseableItem('armor', function(source) 71 | TriggerClientEvent('consumables:client:UseArmor', source) 72 | end) 73 | 74 | QBCore.Functions.CreateUseableItem('heavyarmor', function(source) 75 | TriggerClientEvent('consumables:client:UseHeavyArmor', source) 76 | end) 77 | 78 | QBCore.Commands.Add('resetarmor', 'Resets Vest (Police Only)', {}, false, function(source) 79 | local Player = QBCore.Functions.GetPlayer(source) 80 | if Player.PlayerData.job.name == 'police' then 81 | TriggerClientEvent('consumables:client:ResetArmor', source) 82 | else 83 | TriggerClientEvent('QBCore:Notify', source, 'For Police Officer Only', 'error') 84 | end 85 | end) 86 | 87 | QBCore.Functions.CreateUseableItem('binoculars', function(source) 88 | TriggerClientEvent('binoculars:Toggle', source) 89 | end) 90 | 91 | QBCore.Functions.CreateUseableItem('parachute', function(source, item) 92 | if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:parachute') then return end 93 | TriggerClientEvent('consumables:client:UseParachute', source) 94 | end) 95 | 96 | QBCore.Commands.Add('resetparachute', 'Resets Parachute', {}, false, function(source) 97 | TriggerClientEvent('consumables:client:ResetParachute', source) 98 | end) 99 | 100 | ----------- / Firework 101 | 102 | for _, v in pairs(Config.Fireworks.items) do 103 | QBCore.Functions.CreateUseableItem(v, function(source, item) 104 | local src = source 105 | TriggerClientEvent('fireworks:client:UseFirework', src, item.name, 'proj_indep_firework') 106 | end) 107 | end 108 | 109 | ----------- / Lockpicking 110 | 111 | QBCore.Functions.CreateUseableItem('lockpick', function(source) 112 | TriggerClientEvent('lockpicks:UseLockpick', source, false) 113 | end) 114 | 115 | QBCore.Functions.CreateUseableItem('advancedlockpick', function(source) 116 | TriggerClientEvent('lockpicks:UseLockpick', source, true) 117 | end) 118 | 119 | -- Events for adding and removing specific items to fix some exploits 120 | 121 | RegisterNetEvent('consumables:server:AddParachute', function() 122 | local Player = QBCore.Functions.GetPlayer(source) 123 | if not Player then return end 124 | exports['qb-inventory']:AddItem(source, 'parachute', 1, false, false, 'consumables:server:AddParachute') 125 | end) 126 | 127 | RegisterNetEvent('consumables:server:resetArmor', function() 128 | local Player = QBCore.Functions.GetPlayer(source) 129 | if not Player then return end 130 | exports['qb-inventory']:AddItem(source, 'heavyarmor', 1, false, false, 'consumables:server:resetArmor') 131 | end) 132 | 133 | RegisterNetEvent('consumables:server:useHeavyArmor', function() 134 | local Player = QBCore.Functions.GetPlayer(source) 135 | if not Player then return end 136 | if not exports['qb-inventory']:RemoveItem(source, 'heavyarmor', 1, false, 'consumables:server:useHeavyArmor') then return end 137 | TriggerClientEvent('qb-inventory:client:ItemBox', source, QBCore.Shared.Items['heavyarmor'], 'remove') 138 | TriggerClientEvent('hospital:server:SetArmor', source, 100) 139 | SetPedArmour(GetPlayerPed(source), 100) 140 | end) 141 | 142 | RegisterNetEvent('consumables:server:useArmor', function() 143 | local Player = QBCore.Functions.GetPlayer(source) 144 | if not Player then return end 145 | if not exports['qb-inventory']:RemoveItem(source, 'armor', 1, false, 'consumables:server:useArmor') then return end 146 | TriggerClientEvent('qb-inventory:client:ItemBox', source, QBCore.Shared.Items['armor'], 'remove') 147 | TriggerClientEvent('hospital:server:SetArmor', source, 75) 148 | SetPedArmour(GetPlayerPed(source), 75) 149 | end) 150 | 151 | RegisterNetEvent('consumables:server:useMeth', function() 152 | local Player = QBCore.Functions.GetPlayer(source) 153 | if not Player then return end 154 | exports['qb-inventory']:RemoveItem(source, 'meth', 1, false, 'consumables:server:useMeth') 155 | end) 156 | 157 | RegisterNetEvent('consumables:server:useOxy', function() 158 | local Player = QBCore.Functions.GetPlayer(source) 159 | if not Player then return end 160 | exports['qb-inventory']:RemoveItem(source, 'oxy', 1, false, 'consumables:server:useOxy') 161 | end) 162 | 163 | RegisterNetEvent('consumables:server:useXTCBaggy', function() 164 | local Player = QBCore.Functions.GetPlayer(source) 165 | if not Player then return end 166 | exports['qb-inventory']:RemoveItem(source, 'xtcbaggy', 1, false, 'consumables:server:useXTCBaggy') 167 | end) 168 | 169 | RegisterNetEvent('consumables:server:useCrackBaggy', function() 170 | local Player = QBCore.Functions.GetPlayer(source) 171 | if not Player then return end 172 | exports['qb-inventory']:RemoveItem(source, 'crack_baggy', 1, false, 'consumables:server:useCrackBaggy') 173 | end) 174 | 175 | RegisterNetEvent('consumables:server:useCokeBaggy', function() 176 | local Player = QBCore.Functions.GetPlayer(source) 177 | if not Player then return end 178 | exports['qb-inventory']:RemoveItem(source, 'cokebaggy', 1, false, 'consumables:server:useCokeBaggy') 179 | end) 180 | 181 | RegisterNetEvent('consumables:server:drinkAlcohol', function(item) 182 | local Player = QBCore.Functions.GetPlayer(source) 183 | if not Player then return end 184 | local foundItem = nil 185 | 186 | for k in pairs(Config.Consumables.alcohol) do 187 | if k == item then 188 | foundItem = k 189 | break 190 | end 191 | end 192 | 193 | if not foundItem then return end 194 | exports['qb-inventory']:RemoveItem(source, foundItem, 1, false, 'consumables:server:drinkAlcohol') 195 | end) 196 | 197 | RegisterNetEvent('consumables:server:UseFirework', function(item) 198 | local Player = QBCore.Functions.GetPlayer(source) 199 | if not Player then return end 200 | local foundItem = nil 201 | 202 | for i = 1, #Config.Fireworks.items do 203 | if Config.Fireworks.items[i] == item then 204 | foundItem = Config.Fireworks.items[i] 205 | break 206 | end 207 | end 208 | 209 | if not foundItem then return end 210 | exports['qb-inventory']:RemoveItem(source, foundItem, 1, false, 'consumables:server:UseFirework') 211 | end) 212 | 213 | RegisterNetEvent('consumables:server:addThirst', function(amount) 214 | local Player = QBCore.Functions.GetPlayer(source) 215 | if not Player then return end 216 | Player.Functions.SetMetaData('thirst', amount) 217 | TriggerClientEvent('hud:client:UpdateNeeds', source, Player.PlayerData.metadata.hunger, amount) 218 | end) 219 | 220 | RegisterNetEvent('consumables:server:addHunger', function(amount) 221 | local Player = QBCore.Functions.GetPlayer(source) 222 | if not Player then return end 223 | Player.Functions.SetMetaData('hunger', amount) 224 | TriggerClientEvent('hud:client:UpdateNeeds', source, amount, Player.PlayerData.metadata.thirst) 225 | end) 226 | 227 | QBCore.Functions.CreateCallback('consumables:itemdata', function(_, cb, itemName) 228 | cb(Config.Consumables.custom[itemName]) 229 | end) 230 | 231 | ---Checks if item already exists in the table. If not, it creates it. 232 | ---@param drinkName string name of item 233 | ---@param replenish number amount it replenishes 234 | ---@return boolean, string 235 | local function addDrink(drinkName, replenish) 236 | if Config.Consumables.drink[drinkName] ~= nil then 237 | return false, 'already added' 238 | else 239 | Config.Consumables.drink[drinkName] = replenish 240 | createItem(drinkName, 'Drink') 241 | return true, 'success' 242 | end 243 | end 244 | 245 | exports('AddDrink', addDrink) 246 | 247 | ---Checks if item already exists in the table. If not, it creates it. 248 | ---@param foodName string name of item 249 | ---@param replenish number amount it replenishes 250 | ---@return boolean, string 251 | local function addFood(foodName, replenish) 252 | if Config.Consumables.eat[foodName] ~= nil then 253 | return false, 'already added' 254 | else 255 | Config.Consumables.eat[foodName] = replenish 256 | createItem(foodName, 'Eat') 257 | return true, 'success' 258 | end 259 | end 260 | 261 | exports('AddFood', addFood) 262 | 263 | ---Checks if item already exists in the table. If not, it creates it. 264 | ---@param alcoholName string name of item 265 | ---@param replenish number amount it replenishes 266 | ---@return boolean, string 267 | local function addAlcohol(alcoholName, replenish) 268 | if Config.Consumables.alcohol[alcoholName] ~= nil then 269 | return false, 'already added' 270 | else 271 | Config.Consumables.alcohol[alcoholName] = replenish 272 | createItem(alcoholName, 'DrinkAlcohol') 273 | return true, 'success' 274 | end 275 | end 276 | 277 | exports('AddAlcohol', addAlcohol) 278 | 279 | ---Checks if item already exists in the table. If not, it creates it. 280 | ---@param itemName string name of item 281 | ---@param data number amount it replenishes 282 | ---@return boolean, string 283 | local function addCustom(itemName, data) 284 | if Config.Consumables.custom[itemName] ~= nil then 285 | return false, 'already added' 286 | else 287 | Config.Consumables.custom[itemName] = data 288 | createItem(itemName, 'Custom') 289 | return true, 'success' 290 | end 291 | end 292 | 293 | exports('AddCustom', addCustom) 294 | -------------------------------------------------------------------------------- /server/entities.lua: -------------------------------------------------------------------------------- 1 | -- Blacklisting entities can just be handled entirely server side with onesync events 2 | -- No need to run coroutines to supress or delete these when we can simply delete them before they spawn 3 | AddEventHandler("entityCreating", function(handle) 4 | local entityModel = GetEntityModel(handle) 5 | 6 | if Config.BlacklistedVehs[entityModel] or Config.BlacklistedPeds[entityModel] then 7 | CancelEvent() 8 | end 9 | end) -------------------------------------------------------------------------------- /server/logs.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | local Webhooks = { 4 | ['default'] = '', 5 | ['testwebhook'] = '', 6 | ['playermoney'] = '', 7 | ['playerinventory'] = '', 8 | ['robbing'] = '', 9 | ['cuffing'] = '', 10 | ['drop'] = '', 11 | ['trunk'] = '', 12 | ['stash'] = '', 13 | ['glovebox'] = '', 14 | ['banking'] = '', 15 | ['vehicleshop'] = '', 16 | ['vehicleupgrades'] = '', 17 | ['shops'] = '', 18 | ['dealers'] = '', 19 | ['storerobbery'] = '', 20 | ['bankrobbery'] = '', 21 | ['powerplants'] = '', 22 | ['death'] = '', 23 | ['joinleave'] = '', 24 | ['ooc'] = '', 25 | ['report'] = '', 26 | ['me'] = '', 27 | ['pmelding'] = '', 28 | ['112'] = '', 29 | ['bans'] = '', 30 | ['anticheat'] = '', 31 | ['weather'] = '', 32 | ['moneysafes'] = '', 33 | ['bennys'] = '', 34 | ['bossmenu'] = '', 35 | ['robbery'] = '', 36 | ['casino'] = '', 37 | ['traphouse'] = '', 38 | ['911'] = '', 39 | ['palert'] = '', 40 | ['house'] = '', 41 | ['qbjobs'] = '', 42 | } 43 | 44 | local colors = { -- https://www.spycolor.com/ 45 | ['default'] = 14423100, 46 | ['blue'] = 255, 47 | ['red'] = 16711680, 48 | ['green'] = 65280, 49 | ['white'] = 16777215, 50 | ['black'] = 0, 51 | ['orange'] = 16744192, 52 | ['yellow'] = 16776960, 53 | ['pink'] = 16761035, 54 | ['lightgreen'] = 65309, 55 | } 56 | 57 | local logQueue = {} 58 | 59 | RegisterNetEvent('qb-log:server:CreateLog', function(name, title, color, message, tagEveryone, imageUrl) 60 | local tag = tagEveryone or false 61 | 62 | if Config.Logging == 'discord' then 63 | if not Webhooks[name] then 64 | print('Tried to call a log that isn\'t configured with the name of ' .. name) 65 | return 66 | end 67 | local webHook = Webhooks[name] ~= '' and Webhooks[name] or Webhooks['default'] 68 | local embedData = { 69 | { 70 | ['title'] = title, 71 | ['color'] = colors[color] or colors['default'], 72 | ['footer'] = { 73 | ['text'] = os.date('%c'), 74 | }, 75 | ['description'] = message, 76 | ['author'] = { 77 | ['name'] = 'QBCore Logs', 78 | ['icon_url'] = 'https://raw.githubusercontent.com/GhzGarage/qb-media-kit/main/Display%20Pictures/Logo%20-%20Display%20Picture%20-%20Stylized%20-%20Red.png', 79 | }, 80 | ['image'] = imageUrl and imageUrl ~= '' and { ['url'] = imageUrl } or nil, 81 | } 82 | } 83 | 84 | if not logQueue[name] then logQueue[name] = {} end 85 | logQueue[name][#logQueue[name] + 1] = { webhook = webHook, data = embedData } 86 | 87 | if #logQueue[name] >= 10 then 88 | local postData = { username = 'QB Logs', embeds = {} } 89 | 90 | if tag then 91 | postData.content = '@everyone' 92 | end 93 | 94 | for i = 1, #logQueue[name] do postData.embeds[#postData.embeds + 1] = logQueue[name][i].data[1] end 95 | PerformHttpRequest(logQueue[name][1].webhook, function() end, 'POST', json.encode(postData), { ['Content-Type'] = 'application/json' }) 96 | logQueue[name] = {} 97 | end 98 | elseif Config.Logging == 'fivemanage' then 99 | local FiveManageAPIKey = GetConvar('FIVEMANAGE_LOGS_API_KEY', 'false') 100 | if FiveManageAPIKey == 'false' then 101 | print('You need to set the FiveManage API key in your server.cfg') 102 | return 103 | end 104 | local extraData = { 105 | level = tagEveryone and 'warn' or 'info', -- info, warn, error or debug 106 | message = title, -- any string 107 | metadata = { -- a table or object with any properties you want 108 | description = message, 109 | playerId = source, 110 | playerLicense = GetPlayerIdentifierByType(source, 'license'), 111 | playerDiscord = GetPlayerIdentifierByType(source, 'discord') 112 | }, 113 | resource = GetInvokingResource(), 114 | } 115 | PerformHttpRequest('https://api.fivemanage.com/api/logs', function(statusCode, response, headers) 116 | -- Uncomment the following line to enable debugging 117 | -- print(statusCode, response, json.encode(headers)) 118 | end, 'POST', json.encode(extraData), { 119 | ['Authorization'] = FiveManageAPIKey, 120 | ['Content-Type'] = 'application/json', 121 | }) 122 | end 123 | end) 124 | 125 | Citizen.CreateThread(function() 126 | local timer = 0 127 | while true do 128 | Wait(1000) 129 | timer = timer + 1 130 | if timer >= 60 then -- If 60 seconds have passed, post the logs 131 | timer = 0 132 | for name, queue in pairs(logQueue) do 133 | if #queue > 0 then 134 | local postData = { username = 'QB Logs', embeds = {} } 135 | for i = 1, #queue do 136 | postData.embeds[#postData.embeds + 1] = queue[i].data[1] 137 | end 138 | PerformHttpRequest(queue[1].webhook, function() end, 'POST', json.encode(postData), { ['Content-Type'] = 'application/json' }) 139 | logQueue[name] = {} 140 | end 141 | end 142 | end 143 | end 144 | end) 145 | 146 | QBCore.Commands.Add('testwebhook', 'Test Your Discord Webhook For Logs (God Only)', {}, false, function() 147 | TriggerEvent('qb-log:server:CreateLog', 'testwebhook', 'Test Webhook', 'default', 'Webhook setup successfully') 148 | end, 'god') 149 | -------------------------------------------------------------------------------- /server/main.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | RegisterNetEvent('tackle:server:TacklePlayer', function(playerId) 4 | TriggerClientEvent('tackle:client:GetTackled', playerId) 5 | end) 6 | 7 | QBCore.Commands.Add('id', 'Check Your ID #', {}, false, function(source) 8 | TriggerClientEvent('QBCore:Notify', source, 'ID: ' .. source) 9 | end) 10 | 11 | QBCore.Functions.CreateUseableItem('harness', function(source, item) 12 | TriggerClientEvent('seatbelt:client:UseHarness', source, item) 13 | end) 14 | 15 | RegisterNetEvent('equip:harness', function(item) 16 | local src = source 17 | local Player = QBCore.Functions.GetPlayer(src) 18 | if not Player then return end 19 | if not Player.PlayerData.items[item.slot].info.uses then 20 | Player.PlayerData.items[item.slot].info.uses = Config.HarnessUses - 1 21 | Player.Functions.SetInventory(Player.PlayerData.items) 22 | elseif Player.PlayerData.items[item.slot].info.uses == 1 then 23 | exports['qb-inventory']:RemoveItem(src, 'harness', 1, false, 'equip:harness') 24 | TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['harness'], 'remove') 25 | else 26 | Player.PlayerData.items[item.slot].info.uses -= 1 27 | Player.Functions.SetInventory(Player.PlayerData.items) 28 | end 29 | end) 30 | 31 | RegisterNetEvent('seatbelt:DoHarnessDamage', function(hp, data) 32 | local src = source 33 | local Player = QBCore.Functions.GetPlayer(src) 34 | if not Player then return end 35 | if hp == 0 then 36 | exports['qb-inventory']:RemoveItem(src, 'harness', 1, data.slot, 'seatbelt:DoHarnessDamage') 37 | else 38 | Player.PlayerData.items[data.slot].info.uses -= 1 39 | Player.Functions.SetInventory(Player.PlayerData.items) 40 | end 41 | end) 42 | 43 | RegisterNetEvent('qb-carwash:server:washCar', function() 44 | local src = source 45 | local Player = QBCore.Functions.GetPlayer(src) 46 | 47 | if not Player then return end 48 | 49 | if Player.Functions.RemoveMoney('cash', Config.CarWash.defaultPrice, 'car-washed') then 50 | TriggerClientEvent('qb-carwash:client:washCar', src) 51 | elseif Player.Functions.RemoveMoney('bank', Config.CarWash.defaultPrice, 'car-washed') then 52 | TriggerClientEvent('qb-carwash:client:washCar', src) 53 | else 54 | TriggerClientEvent('QBCore:Notify', src, Lang:t('error.dont_have_enough_money'), 'error') 55 | end 56 | end) 57 | 58 | QBCore.Functions.CreateCallback('smallresources:server:GetCurrentPlayers', function(_, cb) 59 | cb(#GetPlayers()) 60 | end) 61 | -------------------------------------------------------------------------------- /server/timedjobs.lua: -------------------------------------------------------------------------------- 1 | -- Variables 2 | local jobs = {} 3 | 4 | -- Functions 5 | function GetTime() 6 | local timestamp = os.time() 7 | local day = tonumber(os.date('*t', timestamp).wday) 8 | local hour = tonumber(os.date('%H', timestamp)) 9 | local min = tonumber(os.date('%M', timestamp)) 10 | 11 | return {day = day, hour = hour, min = min} 12 | end 13 | 14 | function CheckTimes(day, hour, min) 15 | for i = 1, #jobs, 1 do 16 | local data = jobs[i] 17 | if data.hour == hour and data.min == min then 18 | data.cb(day, hour, min) 19 | end 20 | end 21 | end 22 | 23 | -- Exports 24 | 25 | ---Creates a Timed Job 26 | ---@param hour number 27 | ---@param min number 28 | ---@param cb function 29 | exports("CreateTimedJob", function(hour, min, cb) 30 | if hour and type(hour) == "number" and min and type(min) == "number" and cb and (type(cb) == "function" or type(cb) == "table") then 31 | jobs[#jobs + 1] = { 32 | min = min, 33 | hour = hour, 34 | cb = cb 35 | } 36 | 37 | return #jobs 38 | else 39 | print("WARN: Invalid arguments for export CreateTimedJob(hour, min, cb)") 40 | return nil 41 | end 42 | end) 43 | 44 | ---Force runs a Timed Job 45 | ---@param idx number 46 | exports("ForceRunTimedJob", function(idx) 47 | if jobs[idx] then 48 | local time = GetTime() 49 | jobs[idx].cb(time.day, time.hour, time.min) 50 | end 51 | end) 52 | 53 | ---Stops a Timed Job 54 | ---@param idx number 55 | exports("StopTimedJob", function(idx) 56 | if jobs[idx] then 57 | jobs[idx] = nil 58 | end 59 | end) 60 | 61 | -- Main Loop 62 | CreateThread(function() 63 | while true do 64 | local time = GetTime() 65 | CheckTimes(time.day, time.hour, time.min) 66 | 67 | Wait(60 * 1000) 68 | end 69 | end) 70 | -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_a_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_a_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_a_strm_17.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_a_strm_17.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_a_strm_3.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_a_strm_3.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_a_strm_6.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_a_strm_6.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_a_strm_8.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_a_strm_8.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_01_c_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_01_c_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ap1_02_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ap1_02_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/ch3_04_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/ch3_04_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/cs3_07_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/cs3_07_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/cs3_07_strm_4.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/cs3_07_strm_4.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/cs3_07_strm_5.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/cs3_07_strm_5.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/cs3_07_strm_7.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/cs3_07_strm_7.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_ap1_01_a_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_ap1_01_a_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_ap1_01_a_strm_3.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_ap1_01_a_strm_3.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_ap1_01_c_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_ap1_01_c_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_ap1_02_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_ap1_02_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_ch3_04_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_ch3_04_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_cs2_06b_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_cs2_06b_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_cs3_07_strm_0.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_cs3_07_strm_0.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_cs3_07_strm_4.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_cs3_07_strm_4.ymap -------------------------------------------------------------------------------- /stream/car_gen_disablers/hei_cs3_07_strm_5.ymap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbcore-framework/qb-smallresources/c5da72cda680a2199aeef77bde0b008bbaf1fc5b/stream/car_gen_disablers/hei_cs3_07_strm_5.ymap --------------------------------------------------------------------------------