├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── features.md └── scripts.md └── police ├── client ├── armory.lua ├── client.lua ├── cloackroom.lua ├── garage.lua ├── html │ ├── css │ │ └── style.css │ ├── fonts │ │ ├── BebasNeue.otf │ │ └── SignPainter-HouseScript.ttf │ ├── img │ │ ├── arrows_upanddown.jpg │ │ └── background.png │ ├── index.html │ └── js │ │ └── script.js ├── i18n.lua └── menu.lua ├── config ├── cloackroom.lua ├── config.lua ├── objects.lua ├── vehicles.lua └── weapons.lua ├── fxmanifest.lua ├── locales ├── de.lua ├── en.lua └── fr.lua └── server └── server.lua /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.5.0 2 | * Added compatibility for OneSync. 3 | * Added daily income: Cops now receive daily at 10:00 a paycheck, you can enable or disable this option in **config/config.lua**. 4 | * Changed the position of the interaction menu (F5) to right. 5 | * Fixed objects not spawning. 6 | * Replaced __resource.lua with fxmanifest.lua. 7 | 8 | ## 1.4.9 9 | * Fixed labels for objects return NULL. 10 | 11 | ## 1.4.8 12 | * Server admins can now configure basic loadouts in config/weapons.lua. 13 | * Various issues regarding handcuffing have been fixed. 14 | * Support for [Simple Banking](https://forum.fivem.net/t/discontinued-simple-banking-2-0-now-with-gui/13896) has been removed. 15 | 16 | ## 1.4.7 17 | * Fixed character selector. 18 | 19 | ## 1.4.6 20 | * Undercover cops are using their own skin instead of a random model, but still receive the basic kit loadout. 21 | * Players who are cuffed can walk. 22 | * Added more objects to be spawned. 23 | * Fixed a bug where ghmattimysql was still being used when whitelist is disabled. 24 | 25 | ## 1.4.5 26 | * Improved the menu theme. 27 | * Resolved a issue where cop skins would not be displayed inside **the police locker room menu** when whitelisting is disabled. 28 | 29 | ## 1.4.4.4 30 | * Removed support for `mysql-async` and replaced it with `ghmattimysql` for better performance. 31 | * Removed support for additional resources (Vdk_inventory, JobSystem, es_weashop, garages, emergency). 32 | 33 | ## 1.4.4.3 34 | * Added missing command `CopDept`. 35 | 36 | ## 1.4.4.2 37 | * A fix has been provided regarding the mysql error `MySQL-async.js:209563: uncaught type error: cannot convert undefined or null object.` 38 | * The vehicles list in the garage will only display vehicles that are assigned to the players department. 39 | 40 | ## 1.4.4.1 41 | * Fixed a issue regarding the garage. 42 | 43 | ## 1.4.4 44 | a lot of work has been provided under and above the hood in this update as part of our commitment to continuously improving the script. 45 | Please let us know if you have any issues or suggestions. 46 | 47 | To all translators, please provide us your translations so we can add them in our next update. 48 | 49 | Also we would like to give some credit to [Dex](https://github.com/dexslab) for providing us the fix to make the resource compatible with [ELS-Plus](https://github.com/friendsincode/ELS-Plus). 50 | 51 | * Deprecated the old translation method. 52 | * Added the feature in **config/objects.lua** to add more objects to the **Objects menu**. 53 | * Added the feature in **config/weapons.lua** to add more weapons to the **Armory menu**. 54 | * Added the feature in **config/cloackroom.lua** to configure models for each department. 55 | * Added the feature in **config/vehicles.lua** to configure vehicles for each department. 56 | * Added Spike stripes. 57 | * Restyled the cops menu. 58 | * Improved the update notification system. 59 | * Various code fixes. 60 | * Updated license to [GNU AGPL v3](LICENSE). 61 | 62 | ## 1.4.3 63 | * Added i18n. 64 | * Added new command /copdept **ID** **DepartmentID**, this will limit the player to only one skin. 65 | * Added armory marker at each police station. 66 | 67 | ## 1.4.2 (08/01/2018) 68 | * Added auto table creation to reduce installation issues. 69 | * Added the option to enable or disable the blips for police stations. 70 | * Allow two players forced into one vehicle 71 | 72 | ## 1.4.1 (12/06/2017) 73 | * Add CopAddAdmin, CopAdd, CopRem and CopRank rcon command 74 | * Warning message when performing copadd/coprem when whitelist is disabled 75 | * Add version notifier 76 | * Add suggestion commands 77 | * Fix : Cloackroom isn't working with no record in db (whitelist disable) 78 | 79 | ## 1.4.0 (09/23/2017) 80 | * Add ranks 81 | * Add chat police rank 82 | * Add parameter in menu system 83 | * Add bindings in config file 84 | * Remove essentialmode requirement 85 | * Remove CouchDb support 86 | * Remove cfx-server version support 87 | * Fix : Disconnection won't change the job id 88 | * Fix : Heading for police vehicles 89 | * Fix : parachute isn't working 90 | * Fix : Disconnect player stuck to cop when dragged 91 | 92 | ## 1.3.0 (07/07/2017) 93 | * FXServer compatibility (drop mysql support on FXServer version) 94 | * New en translation (thanks BCTB and BritishBrotherhood) and de translation (thanks SyfuxX) 95 | * Add armory 96 | * New menu (Web UI, thanks BritishBrotherhood) 97 | * Multi location support 98 | * Add blips to stations location 99 | * Add cancel emote and confiscate weapons (thanks BritishBrotherhood) 100 | * Add props spawner 101 | * NPC stop near props (thanks Frazzle and BritishBrotherhood) 102 | * Add flashlight on weapons 103 | * Remove weapons in cops vehicles (thanks Valderg) 104 | * Fix : unable to cuff/drag cops 105 | * Fix : player stay attached to cop after death (drag) 106 | * Fix : Person can run while cuffed after stunned 107 | * Some little things 108 | 109 | ## 1.2.0 (06/05/2017) 110 | * mysql-async support 111 | * couchdb support 112 | * emergency support 113 | * gc-identity support 114 | * add custom fines 115 | * add two new mode for your service 116 | * accept and refuse fines 117 | * drag players 118 | * lot of bugfixes 119 | * others things I probably forgot ^^' 120 | 121 | ## 1.1.0 (05/14/2017) 122 | * Delete personal weapons in service then restore it 123 | * Job_system link 124 | * Female model support 125 | * Boost cop vehicle 126 | * Checkplate 127 | * Helicpoter 128 | * Unseat 129 | * GUI 130 | * Cops can see each other (blips) 131 | * Fix inventory check 132 | 133 | ## 1.0.1 134 | * Fix 1 bullet per weapon 135 | * Fix keep weapons when stop work as cop 136 | * Keep skin and only change clothes when take or stop service (thanks Xtas3) 137 | 138 | ## 1.0.0 139 | * Original files added 140 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at teddy.valette1@etu.univ-lorraine.fr. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guide 2 | 3 | We welcome contributions to the project. Please read the following guide on how you can contribute. 4 | 5 | ## Bug reports 6 | 7 | A bug is a *demonstrable* problem that caused by the code in the repository. 8 | Good bug reports are extremely helpful, so thankes! 9 | 10 | Guidelines for bug reports: 11 | 12 | 2. **Use the Github issue search function** - check if the issue has already reported. 13 | 3. **Check if the issue has been fixed** - try to reproduce it using the latest `master` or `dev`branch in the repo. 14 | 4. **Isolate the problem** - So the developers doesn't have hard times finding the possible bug. 15 | 16 | A good bug report shouldn't have leave others needing to chase up for more information. 17 | Please try to be detailed as possible in your report. What steps ill reproduce the issue? etc.. 18 | All these details will help people to fix potential bugs. 19 | 20 | ## Pull Requests 21 | 22 | - **Feature requests** first need to be discussed and accepted [through an issue](https://github.com/Kyominii/Cops_FiveM/issues/new) before sending in a pull request. 23 | - Pull requests will be merged after being reviewed. 24 | - Please be respectful to other contributors and hold to [The Code Manifesto](http://codemanifesto.com/) 25 | 26 | ## Disclaimer 27 | - Everything submitted to the repository must be in source.That meaning any soft of obfuscated files, binary files, passworded files, and/or encrypted files will immediately removed (unless the file is a representation of the latest compiled **compatible AND working version** of which this file must only be binary source and include a virustotal scan). 28 | - DO NOT RENAME a resource. Retain the authenticity of it. Everything is designed the way it is for a reason. Do not go behind someone else and redo what someone took the time and effort to do to make everything work. 29 | - Contributions are made to this repository as a goodness of heart and a record kept of the contributor's contributions history for their work. 30 | - Violating any of the above hereby informs you that you will be removed from this community and branded as a leech. 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 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 Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cops_FiveM 2 | [![GitHub release](https://img.shields.io/github/release/FiveM-Scripts/Cops_FiveM.svg)](https://github.com/FiveM-Scripts/Cops_FiveM/releases/latest) [![GitHub license](https://img.shields.io/github/license/FiveM-Scripts/Cops_FiveM.svg)](https://github.com/FiveM-Scripts/Cops_FiveM/blob/master/LICENSE) 3 | 4 | Cops_FiveM is a resource mainly for RP servers. It gives servers a cops system with loadouts, vehicles, fines, ... 5 | You can find a complete overview with all the features [here](docs/features.md). 6 | 7 | ## Changelog 8 | You can find the latest changes [here](CHANGELOG.md). 9 | 10 | ## Community Support 11 | A Discord server is available: [![](https://discordapp.com/api/guilds/361144123681538060/widget.png)](https://discord.gg/qnAqCEd) 12 | 13 | ## Requirements 14 | If you are using a database then you need to setup **ghmattimysql** before you can start using Cops_FiveM. 15 | In case you are using **ZAP-Hosting** and don't know what your database name/username/password is then [watch this video](https://www.youtube.com/watch?v=4UcC9zNZkFc). 16 | 17 | - Download [ghmattimysql](https://github.com/GHMatti/ghmattimysql/releases/download/1.3.2/ghmattimysql.zip) 18 | - Extract the zipfile and make sure that the folder is named **ghmattimysql**. 19 | - Open ghmattimysql/config.json and edit the config lines with your db name/user/password/host. 20 | - Copy the **ghmattimysql** folder to resources. 21 | - Open `server.cfg` and add **start ghmattimysql**. 22 | 23 | ## Installation 24 | 1. Verify that you have installed the requirements from above. 25 | 2. Download the latest version from the [GitHub repository](https://github.com/FiveM-Scripts/Cops_FiveM/releases/latest). 26 | 3. Only copy the subdirectory *police* to the *resources* folder on your server. 27 | 4. Edit [config file](https://github.com/FiveM-Scripts/Cops_FiveM/blob/master/police/config/config.lua) to your preferences 28 | 5. Add *start police* in server.cfg (make sure you start this resource after all dependencies). 29 | 6. The first time when you enter the game you will need to add yourself to the police database. 30 | you can do this in your server console enter `CopAddAdmin 1` or `CopAdd 1` press **enter** and you should receive a confirmation message. 31 | 32 | ## Commands 33 | You can use these commands with RCON (`CopAdd` / `CopAddAdmin` / `CopDept`/ `CopRem` / `CopRank`). 34 | To see how to use them, just type the command you want without any parameter. 35 | 36 | ## Departments 37 | | ID | Name | 38 | | -- | ---- | 39 | | 0 | Park Rangers | 40 | | 1 | Los Santos Police Department| 41 | | 2 | Sheriff's Department | 42 | | 3 | State Highway Patrol | 43 | | 4 | Prison Department| 44 | 45 | ## Ranks 46 | | ID | Name | 47 | | -- | ---- | 48 | | 0 | Trainee| 49 | | 1 | Trooper| 50 | | 2 | Master Police Officer| 51 | | 3 | Sergeant| 52 | | 4 | Lieutenant| 53 | | 5 | Captain| 54 | | 6 | Chief of Police| 55 | | 7 | Admin Police Rank| 56 | 57 | ## Contribute 58 | If you are a developer and would like to contribute any help is welcome!. 59 | The contribution guide can be found [here](https://github.com/Kyominii/Cops_FiveM/blob/master/CONTRIBUTING.md). 60 | -------------------------------------------------------------------------------- /docs/features.md: -------------------------------------------------------------------------------- 1 | # Current Features 2 | 3 | * support ghmattimysql 4 | * configurable (features and language) 5 | * cops whitelist 6 | * take/break service (positions with blips) 7 | * different service mode 8 | * cop garage (vehicle/heli) 9 | * fines (legacy feature) 10 | * cuff/uncuff 11 | * weapons removed (legacy feature) 12 | * force cuffed player to go in the vehicle 13 | * unseat this player (Thanks @Thefoxeur54 ) 14 | * GUI menu with some animations 15 | * cops can see each other blips : (thanks @Scammer -- https://forum.fivem.net/t/release-scammers-script-collection-09-03-17/3313) 16 | * drag players (thanks @Frazzle and others : https://forum.fivem.net/t/release-drag-command/22174) 17 | * ranks (example of use : cloackroom.lua line 12) 18 | * so many other features ... 19 | -------------------------------------------------------------------------------- /docs/scripts.md: -------------------------------------------------------------------------------- 1 | # Supported scripts 2 | * [ghmattimysql](https://github.com/GHMatti/ghmattimysql) 3 | * [Venomous Freemode](https://github.com/FiveM-Scripts/venomous-freemode) 4 | -------------------------------------------------------------------------------- /police/client/armory.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | local buttonsCategories = {} 18 | local buttonWeaponList = {} 19 | 20 | function load_armory() 21 | for k in ipairs (buttonsCategories) do 22 | buttonsCategories [k] = nil 23 | end 24 | 25 | for k in ipairs (buttonWeaponList) do 26 | buttonWeaponList [k] = nil 27 | end 28 | 29 | buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_basic_kit"), func = "giveBasicKit", params = ""} 30 | if config.enableOutfits then 31 | buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_add_bulletproof_vest_title"), func = "addBulletproofVest", params = ""} 32 | buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_remove_bulletproof_vest_title"), func = "removeBulletproofVest", params = ""} 33 | end 34 | buttonsCategories[#buttonsCategories+1] = {name = i18n.translate("armory_weapons_list"), func = "openWeaponListMenu", params = ""} 35 | 36 | buttonsCategories[#buttonsCategories+1] = {name = "Close", func = "CloseArmory", params = ""} 37 | 38 | for k,v in pairs(weapons) do 39 | buttonWeaponList[#buttonWeaponList+1] = {name = tostring(v.name), func = 'GiveCustomWeapon', params = tostring(v.hash)} 40 | end 41 | end 42 | 43 | local hashSkin = GetHashKey("mp_m_freemode_01") 44 | 45 | function createArmoryPed() 46 | if not DoesEntityExist(armoryPed) then 47 | local model = GetHashKey("s_m_y_cop_01") 48 | 49 | RequestModel(model) 50 | while not HasModelLoaded(model) do 51 | Wait(0) 52 | end 53 | 54 | local armoryPed = CreatePed(26, model, 454.165, -979.999, 30.690, 92.298, false, false) 55 | SetEntityInvincible(armoryPed, true) 56 | TaskTurnPedToFaceEntity(armoryPed, PlayerId(), -1) 57 | 58 | return armoryPed 59 | end 60 | end 61 | 62 | function giveBasicKit() 63 | for k,v in pairs(basic_kit) do 64 | GiveWeaponToPed(PlayerPedId(), GetHashKey(v), -1, true, false) 65 | end 66 | 67 | SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true) 68 | PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 69 | end 70 | 71 | function giveBasicPrisonKit() 72 | GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_PISTOL50"), -1, true, true) 73 | GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_STUNGUN"), -1, true, true) 74 | GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_NIGHTSTICK"), 200, true, true) 75 | GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_FLASHLIGHT"), 200, true, true) 76 | 77 | PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 78 | end 79 | 80 | function addBulletproofVest() 81 | if(config.enableOutfits == true) then 82 | if(GetEntityModel(PlayerPedId()) == hashSkin) then 83 | SetPedComponentVariation(PlayerPedId(), 9, 4, 1, 2) 84 | else 85 | SetPedComponentVariation(PlayerPedId(), 9, 6, 1, 2) 86 | end 87 | end 88 | 89 | SetPedArmour(PlayerPedId(), 100) 90 | PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 91 | end 92 | 93 | function removeBulletproofVest() 94 | if(config.enableOutfits == true) then 95 | SetPedComponentVariation(PlayerPedId(), 9, 0, 1, 2) 96 | end 97 | 98 | SetPedArmour(PlayerPedId(), 0) 99 | PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 100 | end 101 | 102 | function GiveCustomWeapon(weaponData) 103 | GiveWeaponToPed(PlayerPedId(), GetHashKey(weaponData), -1, false, true) 104 | SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true) 105 | PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 106 | end 107 | 108 | function CloseArmory() 109 | if not IsAnySpeechPlaying(armoryPed) then 110 | PlayAmbientSpeechWithVoice(armoryPed, "WEPSEXPERT_BYESHOPGEN", "WEPSEXP", "SPEECH_PARAMS_FORCE", 0) 111 | end 112 | 113 | Wait(850) 114 | CloseMenu() 115 | RenderScriptCams(false, 1, 1000, 1, 0, 0) 116 | SetCamActive(ArmoryRoomCam, false) 117 | DestroyCam(ArmoryRoomCam, true) 118 | 119 | DoScreenFadeOut(500) 120 | Wait(600) 121 | 122 | if DoesEntityExist(armoryPed) then 123 | DeleteEntity(armoryPed) 124 | end 125 | 126 | FreezeEntityPosition(PlayerPedId(), false) 127 | SetEntityCoords(PlayerPedId(), Lx, Ly, Lz) 128 | 129 | Citizen.Wait(500) 130 | DoScreenFadeIn(500) 131 | end 132 | 133 | 134 | function openWeaponListMenu() 135 | CloseMenu() 136 | SendNUIMessage({ 137 | title = i18n.translate("armory_global_title"), 138 | subtitle = i18n.translate("armory_weapons_list"), 139 | buttons = buttonWeaponList, 140 | action = "setAndOpen" 141 | }) 142 | 143 | anyMenuOpen.menuName = "armory-weapon_list" 144 | anyMenuOpen.isActive = true 145 | end 146 | 147 | function OpenArmory() 148 | if((anyMenuOpen.menuName ~= "armory" and anyMenuOpen.menuName ~= "armory-weapon_list") and not anyMenuOpen.isActive) then 149 | SendNUIMessage({ 150 | title = i18n.translate("armory_global_title"), 151 | subtitle = GetLabelText("PM_WEAPONS"), 152 | buttons = buttonsCategories, 153 | action = "setAndOpen" 154 | }) 155 | 156 | anyMenuOpen.menuName = "armory" 157 | anyMenuOpen.isActive = true 158 | end 159 | end 160 | 161 | function BackArmory() 162 | CloseMenu() 163 | OpenArmory() 164 | end -------------------------------------------------------------------------------- /police/client/client.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | -- 18 | --Local variables : Please do not touch theses variables 19 | -- 20 | 21 | if(config.useCopWhitelist == true) then 22 | isCop = false 23 | else 24 | isCop = true 25 | end 26 | 27 | local firstSpawn = true 28 | local isInService = false 29 | local policeHeli = nil 30 | local handCuffed = false 31 | local isAlreadyDead = false 32 | local allServiceCops = {} 33 | local blipsCops = {} 34 | local drag = false 35 | local officerDrag = -1 36 | 37 | rank = -1 38 | 39 | anyMenuOpen = { 40 | menuName = "", 41 | isActive = false 42 | } 43 | 44 | SpawnedSpikes = {} 45 | 46 | -- 47 | --Events handlers 48 | -- 49 | 50 | AddEventHandler("playerSpawned", function() 51 | if config.useCopWhitelist then 52 | TriggerServerEvent("police:checkIsCop") 53 | else 54 | isCop = true 55 | TriggerServerEvent("police:checkIsCop") 56 | load_armory() 57 | load_garage() 58 | end 59 | 60 | if firstSpawn then 61 | TriggerServerEvent("police:GetPayChecks") 62 | firstSpawn = false 63 | end 64 | end) 65 | 66 | RegisterNetEvent('police:receiveIsCop') 67 | AddEventHandler('police:receiveIsCop', function(svrank, svdept) 68 | if(svrank == -1) then 69 | if(config.useCopWhitelist == true) then 70 | isCop = false 71 | else 72 | isCop = true 73 | rank = 0 74 | dept = 1 75 | 76 | load_armory() 77 | load_garage() 78 | end 79 | else 80 | isCop = true 81 | rank = svrank 82 | dept = svdept 83 | if(isInService) then --and config.enableOutfits 84 | if(GetEntityModel(PlayerPedId()) == GetHashKey("mp_m_freemode_01")) then 85 | SetPedComponentVariation(PlayerPedId(), 10, 8, config.rank.outfit_badge[rank], 2) 86 | else 87 | SetPedComponentVariation(PlayerPedId(), 10, 7, config.rank.outfit_badge[rank], 2) 88 | end 89 | end 90 | 91 | load_armory() 92 | load_garage() 93 | end 94 | end) 95 | 96 | if(config.useCopWhitelist == true) then 97 | RegisterNetEvent('police:nowCop') 98 | AddEventHandler('police:nowCop', function() 99 | isCop = true 100 | end) 101 | end 102 | 103 | RegisterNetEvent('police:Update') 104 | AddEventHandler('police:Update', function(boolState) 105 | local data = GetResourceMetadata(GetCurrentResourceName(), 'resource_fname', 0) 106 | 107 | if boolState then 108 | DisplayNotificationLabel("FMMC_ENDVERC1", "~y~" .. data .. "~s~") 109 | end 110 | end) 111 | 112 | if(config.useCopWhitelist == true) then 113 | RegisterNetEvent('police:noLongerCop') 114 | AddEventHandler('police:noLongerCop', function() 115 | if(config.useCopWhitelist == true) then 116 | isCop = false 117 | end 118 | 119 | isInService = false 120 | 121 | if(config.enableOutfits == true) then 122 | RemoveAllPedWeapons(PlayerPedId()) 123 | TriggerServerEvent("skin_customization:SpawnPlayer") 124 | else 125 | local model = GetHashKey("a_m_y_mexthug_01") 126 | 127 | RequestModel(model) 128 | while not HasModelLoaded(model) do 129 | Citizen.Wait(0) 130 | end 131 | 132 | SetPlayerModel(PlayerId(), model) 133 | SetModelAsNoLongerNeeded(model) 134 | RemoveAllPedWeapons(PlayerPedId()) 135 | end 136 | 137 | if(policeHeli ~= nil) then 138 | SetEntityAsMissionEntity(policeHeli, true, true) 139 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(policeHeli)) 140 | policeHeli = nil 141 | end 142 | 143 | ServiceOff() 144 | end) 145 | end 146 | 147 | RegisterNetEvent('police:getArrested') 148 | AddEventHandler('police:getArrested', function() 149 | handCuffed = not handCuffed 150 | if(handCuffed) then 151 | TriggerEvent("police:notify", "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("now_cuffed")) 152 | else 153 | TriggerEvent("police:notify", "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("now_uncuffed")) 154 | cuffing = false 155 | drag = false 156 | ClearPedTasksImmediately(PlayerPedId()) 157 | end 158 | end) 159 | 160 | --Inspired from emergency for request system (by Jyben : https://forum.fivem.net/t/release-job-save-people-be-a-hero-paramedic-emergency-coma-ko/19773) 161 | local lockAskingFine = false 162 | RegisterNetEvent('police:payFines') 163 | AddEventHandler('police:payFines', function(amount, sender) 164 | Citizen.CreateThread(function() 165 | 166 | if(lockAskingFine ~= true) then 167 | lockAskingFine = true 168 | local notifReceivedAt = GetGameTimer() 169 | Notification(i18n.translate("info_fine_request_before_amount")..amount..i18n.translate("info_fine_request_after_amount")) 170 | while(true) do 171 | Wait(0) 172 | 173 | if (GetTimeDifference(GetGameTimer(), notifReceivedAt) > 15000) then 174 | TriggerServerEvent('police:finesETA', sender, 2) 175 | Notification(i18n.translate("request_fine_expired")) 176 | lockAskingFine = false 177 | break 178 | end 179 | 180 | if IsControlPressed(1, config.bindings.accept_fine) then 181 | TriggerServerEvent('bank:withdraw', amount) 182 | Notification(i18n.translate("pay_fine_success_before_amount")..amount..i18n.translate("pay_fine_success_after_amount")) 183 | TriggerServerEvent('police:finesETA', sender, 0) 184 | lockAskingFine = false 185 | break 186 | end 187 | 188 | if IsControlPressed(1, config.bindings.refuse_fine) then 189 | TriggerServerEvent('police:finesETA', sender, 3) 190 | lockAskingFine = false 191 | break 192 | end 193 | end 194 | else 195 | TriggerServerEvent('police:finesETA', sender, 1) 196 | end 197 | end) 198 | end) 199 | 200 | RegisterNetEvent('police:receivePaycheck') 201 | AddEventHandler('police:receivePaycheck', function(amount) 202 | if amount then 203 | local _, currentValue = StatGetInt("BANK_BALANCE", -1) 204 | local value = math.floor(amount + currentValue) 205 | 206 | StatSetInt("BANK_BALANCE", value, true) 207 | ShowHudComponentThisFrame(4) 208 | end 209 | end) 210 | 211 | -- Copy/paste from fs_freemode (by FiveM-Script: https://github.com/FiveM-Scripts/fs_freemode) 212 | 213 | RegisterNetEvent("police:notify") 214 | AddEventHandler("police:notify", function(icon, type, sender, title, text) 215 | SetNotificationTextEntry("STRING") 216 | AddTextComponentString(text) 217 | SetNotificationMessage(icon, icon, true, type, sender, title, text) 218 | DrawNotification(false, true) 219 | end) 220 | 221 | --Piece of code given by Thefoxeur54 222 | RegisterNetEvent('police:unseatme') 223 | AddEventHandler('police:unseatme', function(t) 224 | local ped = GetPlayerPed(t) 225 | ClearPedTasksImmediately(ped) 226 | plyPos = GetEntityCoords(PlayerPedId(), true) 227 | local xnew = plyPos.x+2 228 | local ynew = plyPos.y+2 229 | 230 | SetEntityCoords(PlayerPedId(), xnew, ynew, plyPos.z) 231 | end) 232 | 233 | RegisterNetEvent('police:toggleDrag') 234 | AddEventHandler('police:toggleDrag', function(t) 235 | if(handCuffed) then 236 | drag = not drag 237 | officerDrag = t 238 | end 239 | end) 240 | 241 | RegisterNetEvent('police:forcedEnteringVeh') 242 | AddEventHandler('police:forcedEnteringVeh', function(veh) 243 | if(handCuffed) then 244 | local pos = GetEntityCoords(PlayerPedId()) 245 | local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0) 246 | 247 | local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0) 248 | local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle) 249 | 250 | if vehicleHandle ~= nil then 251 | if(IsVehicleSeatFree(vehicleHandle, 1)) then 252 | SetPedIntoVehicle(PlayerPedId(), vehicleHandle, 1) 253 | else 254 | if(IsVehicleSeatFree(vehicleHandle, 2)) then 255 | SetPedIntoVehicle(PlayerPedId(), vehicleHandle, 2) 256 | end 257 | end 258 | end 259 | end 260 | end) 261 | 262 | RegisterNetEvent('police:removeWeapons') 263 | AddEventHandler('police:removeWeapons', function() 264 | RemoveAllPedWeapons(PlayerPedId(), true) 265 | end) 266 | 267 | if(config.enableOtherCopsBlips == true) then 268 | RegisterNetEvent('police:resultAllCopsInService') 269 | AddEventHandler('police:resultAllCopsInService', function(array) 270 | allServiceCops = array 271 | enableCopBlips() 272 | end) 273 | end 274 | 275 | -- 276 | --Functions 277 | -- 278 | 279 | function Notification(msg) 280 | SetNotificationTextEntry("STRING") 281 | AddTextComponentString(msg) 282 | DrawNotification(0,1) 283 | end 284 | 285 | function drawNotification(text) 286 | SetNotificationTextEntry("STRING") 287 | AddTextComponentString(text) 288 | DrawNotification(false, false) 289 | end 290 | 291 | function DisplayNotificationLabel(label, sublabel) 292 | SetNotificationTextEntry(label) 293 | if sublabel then 294 | AddTextComponentSubstringPlayerName(sublabel) 295 | end 296 | 297 | DrawNotification(true, true) 298 | end 299 | 300 | --From Player Blips and Above Head Display (by Scammer : https://forum.fivem.net/t/release-scammers-script-collection-09-03-17/3313) 301 | function enableCopBlips() 302 | for k, existingBlip in pairs(blipsCops) do 303 | RemoveBlip(existingBlip) 304 | end 305 | blipsCops = {} 306 | 307 | local localIdCops = {} 308 | for _, player in ipairs(GetActivePlayers()) do 309 | if(GetPlayerPed(player) ~= PlayerPedId()) then 310 | for i,c in pairs(allServiceCops) do 311 | if(i == GetPlayerServerId(player)) then 312 | localIdCops[player] = c 313 | break 314 | end 315 | end 316 | end 317 | end 318 | 319 | for id, c in pairs(localIdCops) do 320 | local ped = GetPlayerPed(id) 321 | local blip = GetBlipFromEntity(ped) 322 | 323 | if not DoesBlipExist(blip) then 324 | blip = AddBlipForEntity(ped) 325 | SetBlipSprite(blip, 1) 326 | Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, true) 327 | HideNumberOnBlip( blip) 328 | SetBlipNameToPlayerName(blip, id) 329 | 330 | SetBlipScale(blip, 0.85) 331 | SetBlipAlpha(blip, 255) 332 | 333 | table.insert(blipsCops, blip) 334 | else 335 | blipSprite = GetBlipSprite(blip) 336 | 337 | HideNumberOnBlip(blip) 338 | if blipSprite ~= 1 then 339 | SetBlipSprite(blip, 1) 340 | Citizen.InvokeNative(0x5FBCA48327B914DF, blip, true) 341 | end 342 | 343 | SetBlipNameToPlayerName(blip, id) 344 | SetBlipScale(blip, 0.85) 345 | SetBlipAlpha(blip, 255) 346 | 347 | table.insert(blipsCops, blip) 348 | end 349 | end 350 | end 351 | 352 | function GetPlayers() 353 | local players = {} 354 | 355 | for _, player in ipairs(GetActivePlayers()) do 356 | if NetworkIsPlayerActive(player) then 357 | table.insert(players, player) 358 | end 359 | end 360 | 361 | return players 362 | end 363 | 364 | function GetClosestPlayer() 365 | local players = GetPlayers() 366 | local closestDistance = -1 367 | local closestPlayer = -1 368 | local ply = PlayerPedId() 369 | local plyCoords = GetEntityCoords(ply, 0) 370 | 371 | for index,value in ipairs(players) do 372 | local target = GetPlayerPed(value) 373 | if(target ~= ply) then 374 | local targetCoords = GetEntityCoords(GetPlayerPed(value), 0) 375 | local distance = Vdist(targetCoords["x"], targetCoords["y"], targetCoords["z"], plyCoords["x"], plyCoords["y"], plyCoords["z"]) 376 | if(closestDistance == -1 or closestDistance > distance) then 377 | closestPlayer = value 378 | closestDistance = distance 379 | end 380 | end 381 | end 382 | 383 | return closestPlayer, closestDistance 384 | end 385 | 386 | function drawTxt(text,font,centre,x,y,scale,r,g,b,a) 387 | SetTextFont(font) 388 | SetTextProportional(0) 389 | SetTextScale(scale, scale) 390 | SetTextColour(r, g, b, a) 391 | SetTextDropShadow(0, 0, 0, 0,255) 392 | SetTextEdge(1, 0, 0, 0, 255) 393 | SetTextDropShadow() 394 | SetTextOutline() 395 | SetTextCentre(centre) 396 | SetTextEntry("STRING") 397 | AddTextComponentString(text) 398 | DrawText(x, y) 399 | end 400 | 401 | function isNearTakeService() 402 | local distance = 10000 403 | local pos = {} 404 | for i = 1, #clockInStation do 405 | local coords = GetEntityCoords(PlayerPedId(), 0) 406 | local currentDistance = Vdist(clockInStation[i].x, clockInStation[i].y, clockInStation[i].z, coords.x, coords.y, coords.z) 407 | if(currentDistance < distance) then 408 | distance = currentDistance 409 | pos = clockInStation[i] 410 | end 411 | end 412 | 413 | if anyMenuOpen.menuName == "cloackroom" and anyMenuOpen.isActive and distance > 3 then 414 | CloseMenu() 415 | end 416 | 417 | if(distance < 30) then 418 | if anyMenuOpen.menuName ~= "cloackroom" and not anyMenuOpen.isActive then 419 | DrawMarker(1, pos.x, pos.y, pos.z-1, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 155, 255, 200, 0, 0, 2, 0, 0, 0, 0) 420 | end 421 | end 422 | 423 | if(distance < 2) then 424 | return true 425 | end 426 | end 427 | 428 | function isNearStationGarage() 429 | local distance = 10000 430 | local pos = {} 431 | for i = 1, #garageStation do 432 | local coords = GetEntityCoords(PlayerPedId(), 0) 433 | local currentDistance = Vdist(garageStation[i].x, garageStation[i].y, garageStation[i].z, coords.x, coords.y, coords.z) 434 | if(currentDistance < distance) then 435 | distance = currentDistance 436 | pos = garageStation[i] 437 | end 438 | end 439 | 440 | if anyMenuOpen.menuName == "garage" and anyMenuOpen.isActive and distance > 5 then 441 | CloseMenu() 442 | end 443 | 444 | if(distance < 30) then 445 | if anyMenuOpen.menuName ~= "garage" and not anyMenuOpen.isActive then 446 | DrawMarker(1, pos.x, pos.y, pos.z-1, 0, 0, 0, 0, 0, 0, 2.0, 2.0, 1.0, 0, 155, 255, 200, 0, 0, 2, 0, 0, 0, 0) 447 | end 448 | end 449 | 450 | if(distance < 2) then 451 | return true 452 | end 453 | end 454 | 455 | function isNearHelicopterStation() 456 | local distance = 10000 457 | local pos = {} 458 | for i = 1, #heliStation do 459 | local coords = GetEntityCoords(PlayerPedId(), 0) 460 | local currentDistance = Vdist(heliStation[i].x, heliStation[i].y, heliStation[i].z, coords.x, coords.y, coords.z) 461 | if(currentDistance < distance) then 462 | distance = currentDistance 463 | pos = heliStation[i] 464 | end 465 | end 466 | 467 | if(distance < 30) then 468 | DrawMarker(1, pos.x, pos.y, pos.z-1, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 1.0, 0, 155, 255, 200, 0, 0, 2, 0, 0, 0, 0) 469 | end 470 | if(distance < 2) then 471 | return true 472 | end 473 | end 474 | 475 | function isNearArmory() 476 | local distance = 10000 477 | local pos = {} 478 | for i = 1, #armoryStation do 479 | local coords = GetEntityCoords(PlayerPedId(), 0) 480 | local currentDistance = Vdist(armoryStation[i].x, armoryStation[i].y, armoryStation[i].z, coords.x, coords.y, coords.z) 481 | if(currentDistance < distance) then 482 | distance = currentDistance 483 | pos = armoryStation[i] 484 | end 485 | end 486 | 487 | if (anyMenuOpen.menuName == "armory" or anyMenuOpen.menuName == "armory-weapon_list") and anyMenuOpen.isActive and distance > 2 then 488 | CloseMenu() 489 | end 490 | if(distance < 30) then 491 | DrawMarker(1, pos.x, pos.y, pos.z-1, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 155, 255, 200, 0, 0, 2, 0, 0, 0, 0) 492 | end 493 | if(distance < 2) then 494 | return true 495 | end 496 | end 497 | 498 | function ServiceOn() 499 | isInService = true 500 | TriggerServerEvent("police:takeService") 501 | end 502 | 503 | function ServiceOff() 504 | isInService = false 505 | TriggerServerEvent("police:breakService") 506 | 507 | if config.enableOtherCopsBlips == true then 508 | allServiceCops = {} 509 | 510 | for k, existingBlip in pairs(blipsCops) do 511 | RemoveBlip(existingBlip) 512 | end 513 | blipsCops = {} 514 | end 515 | end 516 | 517 | function DisplayHelpText(str) 518 | BeginTextCommandDisplayHelp("STRING") 519 | AddTextComponentSubstringPlayerName(str) 520 | EndTextCommandDisplayHelp(0, 0, 1, -1) 521 | end 522 | 523 | function CloseMenu() 524 | SendNUIMessage({ 525 | action = "close" 526 | }) 527 | 528 | anyMenuOpen.menuName = "" 529 | anyMenuOpen.isActive = false 530 | end 531 | 532 | RegisterNUICallback('sendAction', function(data, cb) 533 | _G[data.action](data.params) 534 | cb('ok') 535 | end) 536 | 537 | -- 538 | --Threads 539 | -- 540 | 541 | local alreadyDead = false 542 | local playerStillDragged = false 543 | 544 | Citizen.CreateThread(function() 545 | DoScreenFadeIn(100) 546 | local gxt = "fmmc" 547 | local CurrentSlot = 0 548 | 549 | while HasAdditionalTextLoaded(CurrentSlot) and not HasThisAdditionalTextLoaded(gxt, CurrentSlot) do 550 | Wait(1) 551 | CurrentSlot = CurrentSlot + 1 552 | end 553 | 554 | if not HasThisAdditionalTextLoaded(gxt, CurrentSlot) then 555 | ClearAdditionalText(CurrentSlot, true) 556 | RequestAdditionalText(gxt, CurrentSlot) 557 | while not HasThisAdditionalTextLoaded(gxt, CurrentSlot) do 558 | Wait(0) 559 | end 560 | end 561 | 562 | RequestAnimDict('mp_arresting') 563 | while not HasAnimDictLoaded('mp_arresting') do 564 | Citizen.Wait(50) 565 | end 566 | 567 | if not IsIplActive("FIBlobby") then 568 | RequestIpl("FIBlobbyfake") 569 | end 570 | 571 | TriggerServerEvent("police:checkIsCop") 572 | 573 | if config.enableNeverWanted then 574 | SetMaxWantedLevel(0) 575 | SetWantedLevelMultiplier(0.0) 576 | else 577 | SetMaxWantedLevel(5) 578 | SetWantedLevelMultiplier(1.0) 579 | end 580 | 581 | if config.stationBlipsEnabled then 582 | for _, item in pairs(clockInStation) do 583 | item.blip = AddBlipForCoord(item.x, item.y, item.z) 584 | SetBlipSprite(item.blip, 60) 585 | SetBlipScale(item.blip, 0.8) 586 | SetBlipAsShortRange(item.blip, true) 587 | end 588 | end 589 | 590 | while true do 591 | Citizen.Wait(5) 592 | DisablePlayerVehicleRewards(PlayerId()) 593 | 594 | if(anyMenuOpen.isActive) then 595 | DisableControlAction(1, 21) 596 | DisableControlAction(1, 140) 597 | DisableControlAction(1, 141) 598 | DisableControlAction(1, 142) 599 | 600 | SetDisableAmbientMeleeMove(PlayerPedId(), true) 601 | 602 | if (IsControlJustPressed(1,172)) then 603 | SendNUIMessage({ 604 | action = "keyup" 605 | }) 606 | PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 607 | elseif (IsControlJustPressed(1,173)) then 608 | SendNUIMessage({ 609 | action = "keydown" 610 | }) 611 | PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 612 | elseif (anyMenuOpen.menuName == "cloackroom") then 613 | if IsControlJustPressed(1, 176) then 614 | SendNUIMessage({ 615 | action = "keyenter" 616 | }) 617 | 618 | PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 619 | Citizen.Wait(500) 620 | CloseMenu() 621 | end 622 | elseif (IsControlJustPressed(1,176)) then 623 | SendNUIMessage({ 624 | action = "keyenter" 625 | }) 626 | PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 627 | elseif (IsControlJustPressed(1,177)) then 628 | if(anyMenuOpen.menuName == "policemenu" or anyMenuOpen.menuName == "cloackroom" or anyMenuOpen.menuName == "garage") then 629 | CloseMenu() 630 | elseif(anyMenuOpen.menuName == "armory") then 631 | CloseArmory() 632 | elseif(anyMenuOpen.menuName == "armory-weapon_list") then 633 | BackArmory() 634 | else 635 | BackMenuPolice() 636 | end 637 | end 638 | else 639 | EnableControlAction(1, 21) 640 | EnableControlAction(1, 140) 641 | EnableControlAction(1, 141) 642 | EnableControlAction(1, 142) 643 | end 644 | 645 | --Control death events 646 | if(config.useModifiedEmergency == false) then 647 | if(IsPlayerDead(PlayerId())) then 648 | if(alreadyDead == false) then 649 | if(isInService) then 650 | ServiceOff() 651 | end 652 | 653 | handCuffed = false 654 | drag = false 655 | alreadyDead = true 656 | end 657 | else 658 | alreadyDead = false 659 | end 660 | end 661 | 662 | if (handCuffed == true) then 663 | local myPed = PlayerPedId() 664 | local animation = 'idle' 665 | local flags = 50 666 | 667 | while IsPedBeingStunned(myPed, 0) do 668 | ClearPedTasksImmediately(myPed) 669 | end 670 | 671 | DisableControlAction(1, 12, true) 672 | DisableControlAction(1, 13, true) 673 | DisableControlAction(1, 14, true) 674 | 675 | DisableControlAction(1, 23, true) 676 | DisableControlAction(1, 24, true) 677 | 678 | DisableControlAction(1, 15, true) 679 | DisableControlAction(1, 16, true) 680 | DisableControlAction(1, 17, true) 681 | 682 | if not cuffing then 683 | SetCurrentPedWeapon(myPed, GetHashKey("WEAPON_UNARMED"), true) 684 | RemoveAllPedWeapons(myPed, true) 685 | cuffing = true 686 | end 687 | 688 | if not IsEntityPlayingAnim(myPed, "mp_arresting", animation, 3) then 689 | TaskPlayAnim(myPed, "mp_arresting", animation, 8.0, -8.0, -1, flags, 0, 0, 0, 0 ) 690 | end 691 | else 692 | EnableControlAction(1, 12, false) 693 | EnableControlAction(1, 13, false) 694 | EnableControlAction(1, 14, false) 695 | 696 | EnableControlAction(1, 23, false) 697 | EnableControlAction(1, 24, false) 698 | 699 | EnableControlAction(1, 15, false) 700 | EnableControlAction(1, 16, false) 701 | EnableControlAction(1, 17, false) 702 | 703 | if IsEntityPlayingAnim(PlayerPedId(), "mp_arresting", "idle", 3) then 704 | StopAnimTask(PlayerPedId(), "mp_arresting", animation, 3) 705 | ClearPedTasksImmediately(PlayerPedId()) 706 | end 707 | 708 | cuffing = false 709 | end 710 | 711 | --Piece of code from Drag command (by Frazzle, Valk, Michael_Sanelli, NYKILLA1127 : https://forum.fivem.net/t/release-drag-command/22174) 712 | if drag then 713 | local ped = GetPlayerPed(GetPlayerFromServerId(officerDrag)) 714 | local myped = PlayerPedId() 715 | AttachEntityToEntity(myped, ped, 4103, 11816, 0.48, 0.00, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) 716 | playerStillDragged = true 717 | else 718 | if(playerStillDragged) then 719 | DetachEntity(PlayerPedId(), true, false) 720 | playerStillDragged = false 721 | end 722 | end 723 | 724 | if config.enableNeverWanted then 725 | if IsPlayerWantedLevelGreater(PlayerId(), 0) then 726 | ClearPlayerWantedLevel(PlayerId()) 727 | end 728 | end 729 | 730 | if(isCop) then 731 | if(isNearTakeService()) then 732 | if not (anyMenuOpen.isActive) then 733 | DisplayHelpText(i18n.translate("help_text_open_cloackroom") .. GetLabelText("collision_8vlv02g"),0,1,0.5,0.8,0.6,255,255,255,255) 734 | if IsControlJustPressed(1,config.bindings.interact_position) then 735 | load_cloackroom() 736 | OpenCloackroom() 737 | end 738 | end 739 | end 740 | 741 | if(isInService) then 742 | if(isNearStationGarage()) then 743 | if(policevehicle ~= nil) then 744 | if not (anyMenuOpen.isActive) then 745 | DisplayHelpText(i18n.translate("help_text_put_car_into_garage"),0,1,0.5,0.8,0.6,255,255,255,255) 746 | end 747 | else 748 | DisplayHelpText(i18n.translate("help_text_get_car_out_garage"),0,1,0.5,0.8,0.6,255,255,255,255) 749 | end 750 | 751 | if IsControlJustPressed(1,config.bindings.interact_position) then 752 | if(policevehicle ~= nil) then 753 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(policevehicle)) 754 | policevehicle = nil 755 | else 756 | OpenGarage() 757 | end 758 | end 759 | end 760 | 761 | --Open Armory menu 762 | if(isNearArmory()) then 763 | if not (anyMenuOpen.isActive) then 764 | DisplayHelpText(i18n.translate("help_text_open_armory"),0,1,0.5,0.8,0.6,255,255,255,255) 765 | 766 | if IsControlJustPressed(1,config.bindings.interact_position) then 767 | Lx, Ly, Lz = table.unpack(GetEntityCoords(PlayerPedId(), true)) 768 | DoScreenFadeOut(500) 769 | Wait(600) 770 | 771 | SetEntityCoords(PlayerPedId(), 452.119966796875, -980.061966796875, 30.690966796875) 772 | Wait(800) 773 | armoryPed = createArmoryPed() 774 | 775 | if not DoesCamExist(ArmoryRoomCam) then 776 | ArmoryRoomCam = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true) 777 | AttachCamToEntity(ArmoryRoomCam, PlayerPedId(), 0.0, 0.0, 1.0, true) 778 | PointCamAtEntity(ArmoryRoomCam, armoryPed, 0.0, -30.0, 1.0, true) 779 | 780 | SetCamRot(ArmoryRoomCam, 0.0,0.0, GetEntityHeading(PlayerPedId())) 781 | SetCamFov(ArmoryRoomCam, 70.0) 782 | end 783 | 784 | Wait(100) 785 | DoScreenFadeIn(500) 786 | 787 | if DoesEntityExist(armoryPed) then 788 | TaskTurnPedToFaceEntity(PlayerPedId(), armoryPed, -1) 789 | end 790 | 791 | Wait(300) 792 | OpenArmory() 793 | if not IsAmbientSpeechPlaying(armoryPed) then 794 | PlayAmbientSpeechWithVoice(armoryPed, "WEPSEXPERT_GREETSHOPGEN", "WEPSEXP", "SPEECH_PARAMS_FORCE", 0) 795 | end 796 | end 797 | end 798 | end 799 | 800 | if (anyMenuOpen.menuName == "armory") then 801 | if DoesCamExist(ArmoryRoomCam) then 802 | RenderScriptCams(true, 1, 1800, 1, 0) 803 | end 804 | end 805 | 806 | if (IsControlJustPressed(1,config.bindings.use_police_menu)) then 807 | load_menu() 808 | TogglePoliceMenu() 809 | end 810 | 811 | if isNearHelicopterStation() then 812 | if(policeHeli ~= nil) then 813 | DisplayHelpText(i18n.translate("help_text_put_heli_into_garage"),0,1,0.5,0.8,0.6,255,255,255,255) 814 | else 815 | DisplayHelpText(i18n.translate("help_text_get_heli_out_garage"),0,1,0.5,0.8,0.6,255,255,255,255) 816 | end 817 | 818 | if IsControlJustPressed(1,config.bindings.interact_position) then 819 | if(policeHeli ~= nil) then 820 | Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(policeHeli)) 821 | policeHeli = nil 822 | else 823 | local heli = GetHashKey("polmav") 824 | local ply = PlayerPedId() 825 | local plyCoords = GetEntityCoords(ply, 0) 826 | 827 | RequestModel(heli) 828 | while not HasModelLoaded(heli) do 829 | Citizen.Wait(0) 830 | end 831 | 832 | policeHeli = CreateVehicle(heli, plyCoords["x"], plyCoords["y"], plyCoords["z"], 90.0, true, false) 833 | SetVehicleHasBeenOwnedByPlayer(policevehicle,true) 834 | 835 | local netid = NetworkGetNetworkIdFromEntity(policeHeli) 836 | SetNetworkIdCanMigrate(netid, true) 837 | NetworkRegisterEntityAsNetworked(VehToNet(policeHeli)) 838 | 839 | SetVehicleLivery(policeHeli, 0) 840 | TaskWarpPedIntoVehicle(ply, policeHeli, -1) 841 | SetEntityAsMissionEntity(policeHeli, true, true) 842 | end 843 | end 844 | end 845 | end 846 | end 847 | end 848 | end) 849 | 850 | if config.enablePaychecks then 851 | Citizen.CreateThread(function() 852 | while true do 853 | Wait(1600) 854 | if GetClockHours() == 10 and GetClockMinutes() == 00 then 855 | TriggerServerEvent("police:TransferPayCheck") 856 | end 857 | end 858 | end) 859 | end 860 | 861 | Citizen.CreateThread(function() 862 | while true do 863 | if drag then 864 | local ped = GetPlayerPed(GetPlayerFromServerId(playerPedDragged)) 865 | plyPos = GetEntityCoords(ped, true) 866 | SetEntityCoords(ped, plyPos.x, plyPos.y, plyPos.z) 867 | end 868 | Citizen.Wait(1000) 869 | end 870 | end) 871 | 872 | Citizen.CreateThread(function() 873 | while true do 874 | Citizen.Wait(1) 875 | if IsPedInAnyVehicle(PlayerPedId(), false) then 876 | currentVeh = GetVehiclePedIsIn(PlayerPedId(), false) 877 | x,y,z = table.unpack(GetEntityCoords(PlayerPedId(), true)) 878 | 879 | if DoesObjectOfTypeExistAtCoords(x, y, z, 0.9, GetHashKey("P_ld_stinger_s"), true) then 880 | for i= 0, 7 do 881 | SetVehicleTyreBurst(currentVeh, i, true, 1148846080) 882 | end 883 | 884 | Citizen.Wait(100) 885 | DeleteSpike() 886 | end 887 | end 888 | end 889 | end) 890 | -------------------------------------------------------------------------------- /police/client/cloackroom.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | local buttons = {} 18 | 19 | function load_cloackroom() 20 | for k in ipairs (buttons) do 21 | buttons [k] = nil 22 | end 23 | 24 | for k, data in pairs(skins) do 25 | if config.useCopWhitelist then 26 | if dept == k then 27 | for k, v in pairs(data) do 28 | buttons[#buttons+1] = {name = tostring(v.name), func = "clockIn", params = tostring(v.model)} 29 | end 30 | end 31 | else 32 | for k, v in pairs(data) do 33 | buttons[#buttons+1] = {name = tostring(v.name), func = "clockIn", params = tostring(v.model)} 34 | end 35 | end 36 | end 37 | 38 | buttons[#buttons+1] = {name = i18n.translate("cloackroom_break_service_title"), func = "clockOut", params = ""} 39 | 40 | if(config.enableOutfits == true) then 41 | if(rank <= 0) then 42 | buttons[#buttons+1] = {name = i18n.translate("cloackroom_add_yellow_vest_title"), func = "cloackroom_add_yellow_vest", params = ""} 43 | buttons[#buttons+1] = {name = i18n.translate("cloackroom_remove_yellow_vest_title"), func = "cloackroom_rem_yellow_vest", params = ""} 44 | end 45 | end 46 | end 47 | 48 | function clockIn(model) 49 | if model then 50 | if IsModelValid(model) and IsModelInCdimage(model) then 51 | ServiceOn() 52 | SetCopModel(model) 53 | 54 | drawNotification(i18n.translate("now_in_service_notification")) 55 | drawNotification(i18n.translate("help_open_menu_notification")) 56 | else 57 | drawNotification("This model is ~r~invalid~w~.") 58 | end 59 | end 60 | end 61 | 62 | function clockOut() 63 | ServiceOff() 64 | removeUniforme() 65 | drawNotification(i18n.translate("break_service_notification")) 66 | end 67 | 68 | function cloackroom_add_yellow_vest() 69 | Citizen.CreateThread(function() 70 | if(GetEntityModel(PlayerPedId()) == hashSkin) then 71 | SetPedComponentVariation(PlayerPedId(), 8, 59, 0, 2) 72 | else 73 | SetPedComponentVariation(PlayerPedId(), 8, 36, 0, 2) 74 | end 75 | end) 76 | end 77 | 78 | function cloackroom_rem_yellow_vest() 79 | Citizen.CreateThread(function() 80 | if(GetEntityModel(PlayerPedId()) == hashSkin) then 81 | SetPedComponentVariation(PlayerPedId(), 8, 58, 0, 2) 82 | else 83 | SetPedComponentVariation(PlayerPedId(), 8, 35, 0, 2) 84 | end 85 | end) 86 | end 87 | 88 | function SetCopModel(model) 89 | SetMaxWantedLevel(0) 90 | SetWantedLevelMultiplier(0.0) 91 | SetRelationshipBetweenGroups(0, GetHashKey("police"), GetHashKey("PLAYER")) 92 | SetRelationshipBetweenGroups(0, GetHashKey("PLAYER"), GetHashKey("police")) 93 | 94 | modelHash = GetHashKey(model) 95 | 96 | RequestModel(modelHash) 97 | while not HasModelLoaded(modelHash) do 98 | Citizen.Wait(0) 99 | end 100 | 101 | if model == "s_m_y_cop_01" then 102 | if (config.enableOutfits == true) then 103 | if(GetEntityModel(PlayerPedId()) == GetHashKey("mp_m_freemode_01")) then 104 | SetPedPropIndex(PlayerPedId(), 1, 5, 0, 2) --Sunglasses 105 | SetPedPropIndex(PlayerPedId(), 2, 0, 0, 2) --Bluetoothn earphone 106 | SetPedComponentVariation(PlayerPedId(), 11, 55, 0, 2) --Shirt 107 | SetPedComponentVariation(PlayerPedId(), 8, 58, 0, 2) --Nightstick decoration 108 | SetPedComponentVariation(PlayerPedId(), 4, 35, 0, 2) --Pants 109 | SetPedComponentVariation(PlayerPedId(), 6, 24, 0, 2) --Shooes 110 | SetPedComponentVariation(PlayerPedId(), 10, 8, config.rank.outfit_badge[rank], 2) --rank 111 | else 112 | SetPedPropIndex(PlayerPedId(), 1, 11, 3, 2) --Sunglasses 113 | SetPedPropIndex(PlayerPedId(), 2, 0, 0, 2) --Bluetoothn earphone 114 | SetPedComponentVariation(PlayerPedId(), 3, 14, 0, 2) --Non buggy tshirt 115 | SetPedComponentVariation(PlayerPedId(), 11, 48, 0, 2) --Shirt 116 | SetPedComponentVariation(PlayerPedId(), 8, 35, 0, 2) --Nightstick decoration 117 | SetPedComponentVariation(PlayerPedId(), 4, 34, 0, 2) --Pants 118 | SetPedComponentVariation(PlayerPedId(), 6, 29, 0, 2) --Shooes 119 | SetPedComponentVariation(PlayerPedId(), 10, 7, config.rank.outfit_badge[rank], 2) --rank 120 | end 121 | else 122 | SetPlayerModel(PlayerId(), modelHash) 123 | end 124 | elseif model == "s_m_y_hwaycop_01" then 125 | SetPlayerModel(PlayerId(), modelHash) 126 | SetPedComponentVariation(PlayerPedId(), 10, 7, config.rank.outfit_badge[rank], 2) 127 | elseif model == "s_m_y_sheriff_01" then 128 | SetPlayerModel(PlayerId(), modelHash) 129 | SetPedComponentVariation(PlayerPedId(), 10, 7, config.rank.outfit_badge[rank], 2) 130 | elseif model == "s_m_y_ranger_01" then 131 | SetPlayerModel(PlayerId(), modelHash) 132 | SetPedComponentVariation(PlayerPedId(), 10, 7, config.rank.outfit_badge[rank], 2) 133 | elseif model == "a_m_y_genstreet_01" then 134 | 135 | else 136 | SetPlayerModel(PlayerId(), modelHash) 137 | end 138 | 139 | giveBasicKit() 140 | SetModelAsNoLongerNeeded(modelHash) 141 | end 142 | 143 | function removeUniforme() 144 | if(config.enableOutfits == true) then 145 | RemoveAllPedWeapons(PlayerPedId()) 146 | TriggerServerEvent("skin_customization:SpawnPlayer") 147 | else 148 | local model = GetHashKey("a_m_y_mexthug_01") 149 | RequestModel(model) 150 | while not HasModelLoaded(model) do 151 | Citizen.Wait(0) 152 | end 153 | 154 | SetPlayerModel(PlayerId(), model) 155 | SetModelAsNoLongerNeeded(model) 156 | 157 | SetMaxWantedLevel(5) 158 | SetWantedLevelMultiplier(1.0) 159 | 160 | SetRelationshipBetweenGroups(3, GetHashKey("police"), GetHashKey("PLAYER")) 161 | SetRelationshipBetweenGroups(3, GetHashKey("PLAYER"), GetHashKey("police")) 162 | end 163 | end 164 | 165 | function OpenCloackroom() 166 | if anyMenuOpen.menuName ~= "cloackroom" and not anyMenuOpen.isActive then 167 | SendNUIMessage({ 168 | title = GetLabelText("collision_8vlv02g"), 169 | subtitle = GetLabelText("INPUT_CHARACTER_WHEEL"), 170 | buttons = buttons, 171 | action = "setAndOpen" 172 | }) 173 | 174 | anyMenuOpen.menuName = "cloackroom" 175 | anyMenuOpen.isActive = true 176 | if config.enableVersionNotifier then 177 | TriggerServerEvent('police:UpdateNotifier') 178 | end 179 | end 180 | end 181 | -------------------------------------------------------------------------------- /police/client/garage.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | local buttons = {} 18 | 19 | function load_garage() 20 | for k in ipairs (buttons) do 21 | buttons [k] = nil 22 | end 23 | 24 | for k, data in pairs(vehicles) do 25 | if config.useCopWhitelist then 26 | if dept == k then 27 | for k, v in pairs(data) do 28 | buttons[#buttons+1] = {name = tostring(v.name), func = "SpawnerVeh", params = tostring(v.model)} 29 | end 30 | end 31 | else 32 | if dept == 1 then 33 | for k, v in pairs(data) do 34 | buttons[#buttons+1] = {name = tostring(v.name), func = "SpawnerVeh", params = tostring(v.model)} 35 | end 36 | end 37 | end 38 | end 39 | end 40 | 41 | function SpawnerVeh(hash) 42 | if IsPedInAnyVehicle(PlayerPedId(), false) then 43 | currentVehicle = GetVehiclePedIsIn(PlayerPedId(), false) 44 | DeleteEntity(currentVehicle) 45 | end 46 | 47 | local car = GetHashKey(hash) 48 | local playerPed = PlayerPedId() 49 | 50 | RequestModel(car) 51 | while not HasModelLoaded(car) do 52 | Citizen.Wait(0) 53 | end 54 | 55 | local playerCoords = GetEntityCoords(playerPed) 56 | local playerHeading = GetEntityHeading(playerPed) 57 | 58 | policevehicle = CreateVehicle(car, playerCoords, 90.0, true, false) 59 | SetVehicleEngineOn(policevehicle, true, true, true) 60 | SetVehicleMod(policevehicle, 11, 2) 61 | SetVehicleMod(policevehicle, 12, 2) 62 | SetVehicleMod(policevehicle, 13, 2) 63 | 64 | SetEntityHeading(policevehicle, (playerHeading+160)%360) 65 | SetVehicleEnginePowerMultiplier(policevehicle, 25.0) 66 | SetVehicleOnGroundProperly(policevehicle) 67 | SetVehicleHasBeenOwnedByPlayer(policevehicle,true) 68 | 69 | SetVehRadioStation(policevehicle, "OFF") 70 | 71 | local netid = NetworkGetNetworkIdFromEntity(policevehicle) 72 | SetNetworkIdCanMigrate(netid, true) 73 | NetworkRegisterEntityAsNetworked(VehToNet(policevehicle)) 74 | 75 | TaskWarpPedIntoVehicle(playerPed, policevehicle, -1) 76 | SetEntityInvincible(policevehicle, false) 77 | end 78 | 79 | function OpenGarage() 80 | CloseMenu() 81 | SendNUIMessage({ 82 | title = i18n.translate("garage_global_title"), 83 | subtitle = GetLabelText("VEX_NMB"), 84 | buttons = buttons, 85 | action = "setAndOpen" 86 | }) 87 | 88 | anyMenuOpen.menuName = "garage" 89 | anyMenuOpen.isActive = true 90 | end -------------------------------------------------------------------------------- /police/client/html/css/style.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Cops_FiveM Menu 3 | * Authors: Streetcorps, Kyominii 4 | * Website: Cops_FiveM 5 | * License: AGPL-3.0 6 | */ 7 | 8 | @font-face { 9 | font-family: 'SignPainter'; 10 | src: url('../fonts/SignPainter-HouseScript.ttf') format('truetype'); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | html, body, { 16 | height: 100%; 17 | } 18 | 19 | body { 20 | font-family: Arial, Helvetica Neue, Helvetica, sans-serif; 21 | padding-top: 5px; 22 | } 23 | 24 | .menu { 25 | float: right; 26 | margin-right: 10px; 27 | width: 418px; 28 | background: rgba(0, 0, 0, 0.8); 29 | display: none; 30 | } 31 | 32 | .header { 33 | background: rgb(30,87,153); 34 | background: url("../img/background.png") no-repeat; 35 | color: #fff; 36 | padding-top: 15px; 37 | font-size: 52px; 38 | font-family: 'SignPainter'; 39 | min-height: 66px; 40 | text-align: center; 41 | text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); 42 | } 43 | 44 | .subheader { 45 | height: 35px; 46 | color: #3e8fcc !important; 47 | background: rgb(0, 0, 0); 48 | box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.5); 49 | font-size: 18px; 50 | padding-top: 10px; 51 | padding-left: 10px; 52 | overflow: hidden; 53 | } 54 | 55 | .content { 56 | background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%); 57 | box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.5); 58 | user-select: none; 59 | color: #fff; 60 | font-size: 20px; 61 | overflow: hidden; 62 | } 63 | 64 | .list { 65 | padding-left: 0; 66 | margin-top: 0; 67 | margin-bottom: 0; 68 | } 69 | 70 | ul li:nth-of-type(1n+10) { 71 | display: none; 72 | } 73 | 74 | li { 75 | position: relative; 76 | padding: 10px; 77 | font-size: 17px; 78 | color: #D4D5D6; 79 | font-family: Arial, Helvetica Neue, Helvetica, sans-serif; 80 | padding-top: 8px; 81 | padding-left: 10px; 82 | padding-bottom: 7px; 83 | } 84 | 85 | .item { 86 | list-style-type: none; 87 | } 88 | 89 | .item.active { 90 | color: #111; 91 | background: rgba(255,255,255,1); 92 | background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 100%); 93 | } 94 | 95 | .scroll { 96 | background: rgba(0, 0, 0, 0.7) url('../img/arrows_upanddown.jpg') center center no-repeat; 97 | border-top: 1px solid rgba(255, 255, 255, 0.2); 98 | display: none; 99 | height: 38px; 100 | width: 100%; 101 | } -------------------------------------------------------------------------------- /police/client/html/fonts/BebasNeue.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/client/html/fonts/BebasNeue.otf -------------------------------------------------------------------------------- /police/client/html/fonts/SignPainter-HouseScript.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/client/html/fonts/SignPainter-HouseScript.ttf -------------------------------------------------------------------------------- /police/client/html/img/arrows_upanddown.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/client/html/img/arrows_upanddown.jpg -------------------------------------------------------------------------------- /police/client/html/img/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/client/html/img/background.png -------------------------------------------------------------------------------- /police/client/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 23 | 24 | -------------------------------------------------------------------------------- /police/client/html/js/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | window.addEventListener('message', (event) => { 4 | if(event.data.action == "setAndOpen"){ 5 | 6 | $(".header").append(event.data.title); 7 | $(".subheader").append(event.data.subtitle); 8 | 9 | for(let i = 0; i < event.data.buttons.length; i++){ 10 | let li = $("
  • ").append(event.data.buttons[i].name).addClass("item").attr("function", event.data.buttons[i].func).attr("params", event.data.buttons[i].params); 11 | if(i == 0) { 12 | li.addClass("active"); 13 | } 14 | $(".list").append(li); 15 | } 16 | 17 | var count = $("ul").children().length; 18 | if (count > 10) { 19 | $(".scroll").show(); 20 | } else { 21 | $(".scroll").hide(); 22 | } 23 | 24 | $(".menu").show(); 25 | } 26 | 27 | if(event.data.action == "close"){ 28 | $(".menu").hide(); 29 | $(".list").empty(); 30 | $(".header").empty(); 31 | $(".subheader").empty(); 32 | } 33 | 34 | if(event.data.action == "keyup"){ 35 | if($(".item").length > 1) { 36 | let active = $(".active").removeClass("active"); 37 | 38 | if(active.prev().length != 0 && active.prev().css("display") == "none"){ 39 | $(".list").find(".item:visible:last").hide(); 40 | active.prev().show(); 41 | } 42 | 43 | if(active.prev().length == 0) { 44 | active.siblings().last().addClass("active"); 45 | $(".item").hide(); 46 | $(".item").slice(-10).show(); 47 | } else { 48 | active.prev().addClass("active"); 49 | } 50 | } 51 | } 52 | 53 | if(event.data.action == "keydown") { 54 | if($(".item").length > 1) { 55 | let active = $(".active").removeClass("active"); 56 | 57 | if(active.next().length != 0 && active.next().css("display") == "none"){ 58 | $(".list").find(".item:visible:first").hide(); 59 | active.next().show(); 60 | } 61 | 62 | if(active.next().length == 0) { 63 | active.siblings().first().addClass("active"); 64 | $(".item").hide(); 65 | $(".item").slice(0, 10).show(); 66 | } else { 67 | active.next().addClass("active"); 68 | } 69 | } 70 | } 71 | 72 | if(event.data.action == "keyenter"){ 73 | let action = $(".active").attr("function"); 74 | let params = $(".active").attr("params"); 75 | $.post('http://police/sendAction', JSON.stringify({ 76 | action: action, 77 | params: params 78 | })); 79 | } 80 | }); 81 | }); -------------------------------------------------------------------------------- /police/client/i18n.lua: -------------------------------------------------------------------------------- 1 | i18n = setmetatable({}, i18n) 2 | i18n.__index = i18n 3 | 4 | local store = {} 5 | local lang = {} 6 | avalLangs = {} 7 | 8 | function i18n.setup(l) 9 | 10 | if(l ~= nil)then 11 | lang = l 12 | end 13 | 14 | end 15 | 16 | function i18n.exportData() 17 | local result = store 18 | return result 19 | end 20 | 21 | function i18n.importData(l,s) 22 | table.insert( avalLangs, l) 23 | store[l] = s 24 | end 25 | 26 | function i18n.setLang(l) 27 | lang = l 28 | end 29 | 30 | function i18n.translate(key) 31 | local result = "" 32 | if(store == nil) then 33 | result = "Error 502 : no translation available !" 34 | else 35 | result = store[lang][key] 36 | if(result == nil) then 37 | result = "Error 404 : key not found !" 38 | end 39 | end 40 | 41 | return result 42 | end -------------------------------------------------------------------------------- /police/client/menu.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | local buttonsCategories = {} 18 | local buttonsAnimation = {} 19 | local buttonsCitizen = {} 20 | local buttonsFine = {} 21 | local buttonsVehicle = {} 22 | local buttonsProps = {} 23 | 24 | function load_menu() 25 | for k in ipairs (buttonsCategories) do 26 | buttonsCategories [k] = nil 27 | end 28 | 29 | for k in ipairs (buttonsAnimation) do 30 | buttonsAnimation [k] = nil 31 | end 32 | 33 | for k in ipairs (buttonsCitizen) do 34 | buttonsCitizen [k] = nil 35 | end 36 | 37 | for k in ipairs (buttonsFine) do 38 | buttonsFine [k] = nil 39 | end 40 | 41 | for k in ipairs (buttonsVehicle) do 42 | buttonsVehicle [k] = nil 43 | end 44 | 45 | for k in ipairs (buttonsProps) do 46 | buttonsProps [k] = nil 47 | end 48 | 49 | --Categories 50 | buttonsCategories[#buttonsCategories+1] = {name = GetLabelText("CRW_ANIMATION"), func = "OpenAnimMenu", params = ""} 51 | buttonsCategories[#buttonsCategories+1] = {name = GetLabelText("collision_c29ovv"), func = "OpenCitizenMenu", params = ""} 52 | buttonsCategories[#buttonsCategories+1] = {name = GetLabelText("PIM_TVEHI"), func = "OpenVehMenu", params = ""} 53 | buttonsCategories[#buttonsCategories+1] = {name = GetLabelText("collision_9o6rwvf"), func = "OpenPropsMenu", params = ""} 54 | 55 | --Animations 56 | buttonsAnimation[#buttonsAnimation+1] = {name = i18n.translate("menu_anim_do_traffic_title"), func = 'DoTraffic', params = ""} 57 | buttonsAnimation[#buttonsAnimation+1] = {name = i18n.translate("menu_anim_take_notes_title"), func = 'Note', params = ""} 58 | buttonsAnimation[#buttonsAnimation+1] = {name = i18n.translate("menu_anim_standby_title"), func = 'StandBy', params = ""} 59 | buttonsAnimation[#buttonsAnimation+1] = {name = i18n.translate("menu_anim_standby_2_title"), func = 'StandBy2', params = ""} 60 | buttonsAnimation[#buttonsAnimation+1] = {name = i18n.translate("menu_anim_Cancel_emote_title"), func = 'CancelEmote', params = ""} 61 | 62 | --Citizens 63 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_weapons_title"), func = 'RemoveWeapons', params = ""} 64 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_toggle_cuff_title"), func = 'ToggleCuff', params = ""} 65 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_force_player_get_in_car_title"), func = 'PutInVehicle', params = ""} 66 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_force_player_get_out_car_title"), func = 'UnseatVehicle', params = ""} 67 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_drag_player_title"), func = 'DragPlayer', params = ""} 68 | buttonsCitizen[#buttonsCitizen+1] = {name = i18n.translate("menu_fines_title"), func = 'OpenMenuFine', params = ""} 69 | 70 | --Fines 71 | buttonsFine[#buttonsFine+1] = {name = "$250", func = 'Fines', params = 250} 72 | buttonsFine[#buttonsFine+1] = {name = "$500", func = 'Fines', params = 500} 73 | buttonsFine[#buttonsFine+1] = {name = "$1000", func = 'Fines', params = 1000} 74 | buttonsFine[#buttonsFine+1] = {name = "$1500", func = 'Fines', params = 1500} 75 | buttonsFine[#buttonsFine+1] = {name = "$2000", func = 'Fines', params = 2000} 76 | buttonsFine[#buttonsFine+1] = {name = "$4000", func = 'Fines', params = 4000} 77 | buttonsFine[#buttonsFine+1] = {name = "$6000", func = 'Fines', params = 6000} 78 | buttonsFine[#buttonsFine+1] = {name = "$8000", func = 'Fines', params = 8000} 79 | buttonsFine[#buttonsFine+1] = {name = "$10000", func = 'Fines', params = 10000} 80 | buttonsFine[#buttonsFine+1] = {name = i18n.translate("menu_custom_amount_fine_title"), func = 'Fines', params = -1} 81 | 82 | -- vehicles 83 | buttonsVehicle[#buttonsVehicle+1] = {name = i18n.translate("menu_crochet_veh_title"), func = 'Crochet', params = ""} 84 | buttonsVehicle[#buttonsVehicle+1] = {name = GetLabelText("FMMC_REMVEH"), func = 'DropVehicle', params = ""} 85 | buttonsVehicle[#buttonsVehicle+1] = {name = "Spike Stripes", func = 'SpawnSpikesStripe', params = ""} 86 | 87 | --Props 88 | for k,v in pairs(SpawnObjects) do 89 | buttonsProps[#buttonsProps+1] = {name = v.name, func = "SpawnProps", params = tostring(v.hash)} 90 | end 91 | 92 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_PR_23"), func = "SpawnProps", params="prop_mp_barrier_01b"} 93 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_PR_BARQADB"), func = "SpawnProps", params="prop_barrier_work05"} 94 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_DPR_LTRFCN"), func = "SpawnProps", params="prop_air_conelight"} 95 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_PR_PBARR"), func = "SpawnProps", params="prop_barrier_work06a"} 96 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_PR_CABTBTH"), func = "SpawnProps", params="prop_tollbooth_1"} 97 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_DPR_TRFCNE"), func = "SpawnProps", params="prop_mp_cone_01"} 98 | buttonsProps[#buttonsProps+1] = {name=GetLabelText("FMMC_DPR_TRFPLE"), func = "SpawnProps", params="prop_mp_cone_04"} 99 | 100 | buttonsProps[#buttonsProps+1] = {name = GetLabelText("collision_7x5xu9w"), func = "RemoveLastProps", params = ""} 101 | buttonsProps[#buttonsProps+1] = {name = GetLabelText("FMMC_REMOBJ"), func = "RemoveAllProps", params = ""} 102 | end 103 | 104 | function DoTraffic() 105 | Citizen.CreateThread(function() 106 | if not IsPedInAnyVehicle(PlayerPedId(), false) then 107 | TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, false) 108 | Citizen.Wait(60000) 109 | ClearPedTasksImmediately(PlayerPedId()) 110 | drawNotification(i18n.translate("menu_doing_traffic_notification")) 111 | else 112 | drawNotification(GetLabelText("PEN_EXITV")) 113 | end 114 | end) 115 | end 116 | 117 | function Note() 118 | Citizen.CreateThread(function() 119 | if not IsPedInAnyVehicle(PlayerPedId(), false) then 120 | TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CLIPBOARD", 0, false) 121 | Citizen.Wait(20000) 122 | ClearPedTasksImmediately(PlayerPedId()) 123 | else 124 | drawNotification(GetLabelText("PEN_EXITV")) 125 | end 126 | end) 127 | end 128 | 129 | function StandBy() 130 | Citizen.CreateThread(function() 131 | if not IsPedInAnyVehicle(PlayerPedId(), false) then 132 | TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_COP_IDLES", 0, true) 133 | Citizen.Wait(20000) 134 | ClearPedTasksImmediately(PlayerPedId()) 135 | else 136 | drawNotification(GetLabelText("PEN_EXITV")) 137 | end 138 | end) 139 | end 140 | 141 | function StandBy2() 142 | Citizen.CreateThread(function() 143 | if not IsPedInAnyVehicle(PlayerPedId(), false) then 144 | TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_GUARD_STAND", 0, 1) 145 | Citizen.Wait(20000) 146 | ClearPedTasksImmediately(PlayerPedId()) 147 | else 148 | drawNotification(GetLabelText("PEN_EXITV")) 149 | end 150 | end) 151 | end 152 | 153 | function CancelEmote() 154 | Citizen.CreateThread(function() 155 | ClearPedTasksImmediately(PlayerPedId()) 156 | end) 157 | end 158 | 159 | function CheckInventory() 160 | local t, distance = GetClosestPlayer() 161 | if(distance ~= -1 and distance < 3) then 162 | TriggerServerEvent("police:targetCheckInventory", GetPlayerServerId(t)) 163 | else 164 | drawNotification(i18n.translate("no_player_near_ped")) 165 | end 166 | end 167 | 168 | function RemoveWeapons() 169 | local t, distance = GetClosestPlayer() 170 | if(distance ~= -1 and distance < 3) then 171 | TriggerServerEvent("police:removeWeapons", GetPlayerServerId(t)) 172 | else 173 | drawNotification(i18n.translate("no_player_near_ped")) 174 | end 175 | end 176 | 177 | function ToggleCuff() 178 | local t, distance = GetClosestPlayer() 179 | if(distance ~= -1 and distance < 3) then 180 | TriggerServerEvent("police:cuffGranted", GetPlayerServerId(t)) 181 | else 182 | drawNotification(i18n.translate("no_player_near_ped")) 183 | end 184 | end 185 | 186 | function PutInVehicle() 187 | local t, distance = GetClosestPlayer() 188 | if(distance ~= -1 and distance < 3) then 189 | local v = GetVehiclePedIsIn(PlayerPedId(), true) 190 | TriggerServerEvent("police:forceEnterAsk", GetPlayerServerId(t), v) 191 | else 192 | drawNotification(i18n.translate("no_player_near_ped")) 193 | end 194 | end 195 | 196 | function UnseatVehicle() 197 | local t, distance = GetClosestPlayer() 198 | if(distance ~= -1 and distance < 3) then 199 | TriggerServerEvent("police:confirmUnseat", GetPlayerServerId(t)) 200 | else 201 | drawNotification(i18n.translate("no_player_near_ped")) 202 | end 203 | end 204 | 205 | function DragPlayer() 206 | local t, distance = GetClosestPlayer() 207 | if(distance ~= -1 and distance < 3) then 208 | TriggerServerEvent("police:dragRequest", GetPlayerServerId(t)) 209 | TriggerEvent("police:notify", "CHAR_ANDREAS", 1, i18n.translate("title_notification"), false, i18n.translate("drag_sender_notification_part_1") .. GetPlayerName(serverTargetPlayer) .. i18n.translate("drag_sender_notification_part_2")) 210 | else 211 | drawNotification(i18n.translate("no_player_near_ped")) 212 | end 213 | end 214 | 215 | function Fines(amount) 216 | local t, distance = GetClosestPlayer() 217 | if(distance ~= -1 and distance < 3) then 218 | Citizen.Trace("Price : "..tonumber(amount)) 219 | if(tonumber(amount) == -1) then 220 | DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP8S", "", "", "", "", "", 20) 221 | while (UpdateOnscreenKeyboard() == 0) do 222 | DisableAllControlActions(0); 223 | Wait(0); 224 | end 225 | if (GetOnscreenKeyboardResult()) then 226 | local res = tonumber(GetOnscreenKeyboardResult()) 227 | if(res ~= nil and res ~= 0) then 228 | amount = tonumber(res) 229 | end 230 | end 231 | 232 | if(tonumber(amount) ~= -1) then 233 | TriggerServerEvent("police:finesGranted", GetPlayerServerId(t), tonumber(amount)) 234 | end 235 | else 236 | TriggerServerEvent("police:finesGranted", GetPlayerServerId(t), tonumber(amount)) 237 | end 238 | else 239 | drawNotification(i18n.translate("no_player_near_ped")) 240 | end 241 | end 242 | 243 | function Crochet() 244 | Citizen.CreateThread(function() 245 | local pos = GetEntityCoords(PlayerPedId()) 246 | local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0) 247 | 248 | local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0) 249 | local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle) 250 | if DoesEntityExist(vehicleHandle) and IsEntityAVehicle(vehicleHandle) then 251 | local prevObj = GetClosestObjectOfType(pos.x, pos.y, pos.z, 10.0, GetHashKey("prop_weld_torch"), false, true, true) 252 | if(IsEntityAnObject(prevObj)) then 253 | SetEntityAsMissionEntity(prevObj) 254 | DeleteObject(prevObj) 255 | end 256 | 257 | TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_WELDING", 0, true) 258 | Citizen.Wait(20000) 259 | SetVehicleDoorsLocked(vehicleHandle, 1) 260 | ClearPedTasksImmediately(PlayerPedId()) 261 | drawNotification(i18n.translate("menu_veh_opened_notification")) 262 | else 263 | drawNotification(i18n.translate("no_veh_near_ped")) 264 | end 265 | end) 266 | end 267 | 268 | function DropVehicle() 269 | Citizen.CreateThread(function() 270 | local pos = GetEntityCoords(PlayerPedId()) 271 | local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0) 272 | 273 | local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0) 274 | local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle) 275 | if DoesEntityExist(vehicleHandle) and IsEntityAVehicle(vehicleHandle) then 276 | DeleteEntity(vehicleHandle) 277 | else 278 | drawNotification(i18n.translate("no_veh_near_ped")) 279 | end 280 | end) 281 | end 282 | 283 | function SpawnSpikesStripe() 284 | if IsPedInAnyPoliceVehicle(PlayerPedId()) then 285 | local modelHash = GetHashKey("P_ld_stinger_s") 286 | local currentVeh = GetVehiclePedIsIn(PlayerPedId(), false) 287 | local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(currentVeh, 0.0, -5.2, -0.25)) 288 | 289 | RequestScriptAudioBank("BIG_SCORE_HIJACK_01", true) 290 | Citizen.Wait(500) 291 | 292 | RequestModel(modelHash) 293 | while not HasModelLoaded(modelHash) do 294 | Citizen.Wait(0) 295 | end 296 | 297 | if HasModelLoaded(modelHash) then 298 | SpikeObject = CreateObject(modelHash, x, y, z, true, false, true) 299 | SetEntityNoCollisionEntity(SpikeObject, PlayerPedId(), 1) 300 | SetEntityDynamic(SpikeObject, false) 301 | ActivatePhysics(SpikeObject) 302 | 303 | if DoesEntityExist(SpikeObject) then 304 | local height = GetEntityHeightAboveGround(SpikeObject) 305 | 306 | SetEntityCoords(SpikeObject, x, y, z - height + 0.05) 307 | SetEntityHeading(SpikeObject, GetEntityHeading(PlayerPedId())-80.0) 308 | SetEntityCollision(SpikeObject, false, false) 309 | PlaceObjectOnGroundProperly(SpikeObject) 310 | 311 | SetEntityAsMissionEntity(SpikeObject, false, false) 312 | SetModelAsNoLongerNeeded(modelHash) 313 | PlaySoundFromEntity(-1, "DROP_STINGER", PlayerPedId(), "BIG_SCORE_3A_SOUNDS", 0, 0) 314 | end 315 | drawNotification("Spike stripe~g~ deployed~w~.") 316 | end 317 | else 318 | drawNotification("You need to get ~y~inside~w~ a ~y~police vehicle~w~.") 319 | PlaySoundFrontend(-1, "ERROR", "HUD_FRONTEND_DEFAULT_SOUNDSET", true) 320 | end 321 | end 322 | 323 | function DeleteSpike() 324 | local model = GetHashKey("P_ld_stinger_s") 325 | local x,y,z = table.unpack(GetEntityCoords(PlayerPedId(), true)) 326 | 327 | if DoesObjectOfTypeExistAtCoords(x, y, z, 0.9, model, true) then 328 | local spike = GetClosestObjectOfType(x, y, z, 0.9, model, false, false, false) 329 | DeleteObject(spike) 330 | end 331 | end 332 | 333 | local propslist = {} 334 | 335 | function SpawnProps(model) 336 | if(#propslist < config.propsSpawnLimitByCop) then 337 | local prophash = GetHashKey(tostring(model)) 338 | RequestModel(prophash) 339 | while not HasModelLoaded(prophash) do 340 | Citizen.Wait(0) 341 | end 342 | 343 | local offset = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 0.75, 0.0) 344 | local _, worldZ = GetGroundZFor_3dCoord(offset.x, offset.y, offset.z) 345 | local propsobj = CreateObjectNoOffset(prophash, offset.x, offset.y, worldZ, true, true, true) 346 | local heading = GetEntityHeading(PlayerPedId()) 347 | 348 | SetEntityHeading(propsobj, heading) 349 | SetEntityAsMissionEntity(propsobj) 350 | SetModelAsNoLongerNeeded(prophash) 351 | 352 | propslist[#propslist+1] = ObjToNet(propsobj) 353 | end 354 | end 355 | 356 | function RemoveLastProps() 357 | DeleteObject(NetToObj(propslist[#propslist])) 358 | propslist[#propslist] = nil 359 | end 360 | 361 | function RemoveAllProps() 362 | for i, props in pairs(propslist) do 363 | DeleteObject(NetToObj(props)) 364 | propslist[i] = nil 365 | end 366 | 367 | end 368 | 369 | function TogglePoliceMenu() 370 | if((anyMenuOpen.menuName ~= "policemenu" and anyMenuOpen.menuName ~= "policemenu-anim" and anyMenuOpen.menuName ~= "policemenu-citizens" and anyMenuOpen.menuName ~= "policemenu-veh" and anyMenuOpen.menuName ~= "policemenu-fines" and anyMenuOpen.menuName ~= "policemenu-props") and not anyMenuOpen.isActive) then 371 | SendNUIMessage({ 372 | title = i18n.translate("menu_global_title"), 373 | subtitle = GetLabelText("PM_MP_OPTIONS"), 374 | buttons = buttonsCategories, 375 | action = "setAndOpen" 376 | }) 377 | 378 | anyMenuOpen.menuName = "policemenu" 379 | anyMenuOpen.isActive = true 380 | else 381 | if((anyMenuOpen.menuName ~= "policemenu" and anyMenuOpen.menuName ~= "policemenu-anim" and anyMenuOpen.menuName ~= "policemenu-citizens" and anyMenuOpen.menuName ~= "policemenu-veh" and anyMenuOpen.menuName ~= "policemenu-fines" and anyMenuOpen.menuName ~= "policemenu-props") and anyMenuOpen.isActive) then 382 | CloseMenu() 383 | TogglePoliceMenu() 384 | else 385 | CloseMenu() 386 | end 387 | end 388 | end 389 | 390 | function BackMenuPolice() 391 | if(anyMenuOpen.menuName == "policemenu-anim" or anyMenuOpen.menuName == "policemenu-citizens" or anyMenuOpen.menuName == "policemenu-veh" or anyMenuOpen.menuName == "policemenu-props") then 392 | CloseMenu() 393 | TogglePoliceMenu() 394 | else 395 | CloseMenu() 396 | OpenCitizenMenu() 397 | end 398 | end 399 | 400 | function OpenAnimMenu() 401 | CloseMenu() 402 | SendNUIMessage({ 403 | title = i18n.translate("menu_global_title"), 404 | subtitle = GetLabelText("CRW_ANIMATION"), 405 | buttons = buttonsAnimation, 406 | action = "setAndOpen" 407 | }) 408 | 409 | anyMenuOpen.menuName = "policemenu-anim" 410 | anyMenuOpen.isActive = true 411 | end 412 | 413 | function OpenCitizenMenu() 414 | CloseMenu() 415 | SendNUIMessage({ 416 | title = i18n.translate("menu_global_title"), 417 | subtitle = GetLabelText("collision_c29ovv"), 418 | buttons = buttonsCitizen, 419 | action = "setAndOpen" 420 | }) 421 | 422 | anyMenuOpen.menuName = "policemenu-citizens" 423 | anyMenuOpen.isActive = true 424 | end 425 | 426 | function OpenVehMenu() 427 | CloseMenu() 428 | SendNUIMessage({ 429 | title = i18n.translate("menu_global_title"), 430 | subtitle = GetLabelText("PIM_TVEHI"), 431 | buttons = buttonsVehicle, 432 | action = "setAndOpen" 433 | }) 434 | 435 | anyMenuOpen.menuName = "policemenu-veh" 436 | anyMenuOpen.isActive = true 437 | end 438 | 439 | function OpenMenuFine() 440 | CloseMenu() 441 | SendNUIMessage({ 442 | title = i18n.translate("menu_global_title"), 443 | subtitle = GetLabelText("PM_MP_OPTIONS"), 444 | buttons = buttonsFine, 445 | action = "setAndOpen" 446 | }) 447 | 448 | anyMenuOpen.menuName = "policemenu-fines" 449 | anyMenuOpen.isActive = true 450 | end 451 | 452 | function OpenPropsMenu() 453 | CloseMenu() 454 | SendNUIMessage({ 455 | title = i18n.translate("menu_global_title"), 456 | subtitle = GetLabelText("collision_9o6rwvf"), 457 | buttons = buttonsProps, 458 | action = "setAndOpen" 459 | }) 460 | 461 | anyMenuOpen.menuName = "policemenu-props" 462 | anyMenuOpen.isActive = true 463 | end 464 | 465 | Citizen.CreateThread(function() 466 | while true do 467 | Citizen.Wait(5) 468 | for _, props in pairs(propslist) do 469 | local ox, oy, oz = table.unpack(GetEntityCoords(NetToObj(props), true)) 470 | local cVeh = GetClosestVehicle(ox, oy, oz, 20.0, 0, 70) 471 | if(IsEntityAVehicle(cVeh)) then 472 | if IsEntityAtEntity(cVeh, NetToObj(props), 3.0, 5.0, 2.0, 0, 1, 0) then 473 | local cDriver = GetPedInVehicleSeat(cVeh, -1) 474 | TaskVehicleTempAction(cDriver, cVeh, 6, 1000) 475 | 476 | SetVehicleHandbrake(cVeh, true) 477 | SetVehicleIndicatorLights(cVeh, 0, true) 478 | SetVehicleIndicatorLights(cVeh, 1, true) 479 | end 480 | end 481 | 482 | end 483 | end 484 | end) -------------------------------------------------------------------------------- /police/config/cloackroom.lua: -------------------------------------------------------------------------------- 1 | skins = { 2 | [0] = { 3 | {name="Park Ranger", model="s_m_y_ranger_01"} 4 | }, 5 | [1] = { 6 | {name="Police Officer", model="s_m_y_cop_01"}, 7 | {name="IAA Officer", model="s_m_m_ciasec_01"}, 8 | {name="FIB Officer", model="s_m_y_swat_01"}, 9 | {name="Undercover", model="a_m_y_genstreet_01"} 10 | }, 11 | [2] = { 12 | {name="Sheriff Male", model="s_m_y_sheriff_01"} 13 | }, 14 | [3] = {{name="Highway Patrol", model="s_m_y_hwaycop_01"}}, 15 | [4] = { 16 | {name="Prison Officer", model="s_m_m_prisguard_01"} 17 | } 18 | } -------------------------------------------------------------------------------- /police/config/config.lua: -------------------------------------------------------------------------------- 1 | config = { 2 | enableVersionNotifier = true, --notify if a new version is available (server console) 3 | enableOutfits = false, 4 | 5 | stationBlipsEnabled = true, -- switch between true or false to enable/disable blips for police stations 6 | useCopWhitelist = true, 7 | 8 | enableOtherCopsBlips = true, 9 | useNativePoliceGarage = true, 10 | enableNeverWanted = true, 11 | 12 | enablePaychecks = true, 13 | weekly_salary = 931, 14 | 15 | propsSpawnLimitByCop = 20, 16 | 17 | --Available languages : 'en', 'fr', 'de' 18 | lang = 'en', 19 | 20 | bindings = { 21 | interact_position = 51, -- E 22 | use_police_menu = 166, -- F5 23 | accept_fine = 246, -- Y 24 | refuse_fine = 45 -- R 25 | }, 26 | 27 | --Customizable Departments 28 | departments = { 29 | label = { 30 | [0] = "Park Rangers", 31 | [1] = "Los Santos Police Department", 32 | [2] = "Sheriff's Department", 33 | [3] = "State Highway Patrol", 34 | [4] = "Prison Department" 35 | }, 36 | 37 | minified_label = { 38 | [0] = "PR", 39 | [1] = "LSPD", 40 | [2] = "SHR", 41 | [3] = "SHP ", 42 | [4] = "PRISON" 43 | } 44 | }, 45 | 46 | --Customizable ranks 47 | rank = { 48 | 49 | --You can add or remove ranks as you want (just make sure to use numeric index, ascending) 50 | label = { 51 | [0] = "Trainee", -- Ranger Rank 52 | [1] = "Trainee", -- LSPD Rank 53 | [2] = "Trainee", -- Sheriff Rank 54 | [3] = "Trainee", -- State Highway Patrol Rank 55 | 56 | [4] = "Park Ranger", 57 | [5] = "Police Officer", 58 | [6] = "Deputy Sheriff", 59 | [7] = "State Trooper", 60 | 61 | [8] = "Park Ranger II", 62 | [9] = "Master Police Officer", 63 | [10] = "Deputy Sheriff II", 64 | [11] = "State Trooper II", 65 | 66 | [12] = "Sergeant", 67 | [13] = "Sergeant", 68 | [14] = "Sergeant", 69 | [15] = "Sergeant", 70 | 71 | [16] = "Lieutenant", 72 | [17] = "Lieutenant", 73 | [18] = "Lieutenant", 74 | [19] = "Lieutenant", 75 | 76 | [20] = "Captian", 77 | [21] = "Captian", 78 | [22] = "Captian", 79 | [23] = "Captian", 80 | 81 | [24] = "Game Warden ", 82 | [25] = "Chief of Police", 83 | [26] = "Sheriff", 84 | [27] = "Chief of SHP", 85 | 86 | [28] = "Ranger Admin Rank", 87 | [29] = "Police Admin Rank", 88 | [30] = "Sheriff Admin Rank", 89 | [31] = "SHP Admin Rank", 90 | }, 91 | 92 | --Used for chat 93 | minified_label = { 94 | [0] = "TNE", 95 | [1] = "TNE", --1 96 | [2] = "TNE", 97 | [3] = "TNE", 98 | 99 | [4] = "PR", 100 | [5] = "PO", --2 101 | [6] = "DS", 102 | [7] = "ST", 103 | 104 | [8] = "PR2", 105 | [9] = "MPO", --3 106 | [10] = "DS2", 107 | [11] = "ST2", 108 | 109 | [12] = "SGT", 110 | [13] = "SGT", --4 111 | [14] = "SGT", 112 | [15] = "SGT", 113 | 114 | [16] = "LT", 115 | [17] = "LT", --5 116 | [18] = "LT", 117 | [19] = "LT", 118 | 119 | [20] = "CPT", 120 | [21] = "CPT", --6 121 | [22] = "CPT", 122 | [23] = "CPT", 123 | 124 | [24] = "GW", 125 | [25] = "COP", --7 126 | [26] = "SHF", 127 | [27] = "COS", 128 | 129 | [28] = "RAR", 130 | [29] = "APR", --8 131 | [30] = "ASR", 132 | [31] = "SSR", 133 | }, 134 | 135 | --You can set here a badge for each rank you have. You have to enable "enableOutfits" to use this 136 | --The index is the rank index, the value is the badge index. 137 | --Here a link where you have the 4 MP Models badges with their index : https://kyominii.com/fivem/index.php/MP_Badges 138 | outfit_badge = { 139 | [0] = 0, 140 | [1] = 0, 141 | [2] = 0, 142 | [3] = 0, 143 | 144 | [4] = 0, 145 | [5] = 0, 146 | [6] = 0, 147 | [7] = 0, 148 | 149 | [8] = 1, 150 | [9] = 1, 151 | [10] = 1, 152 | [11] = 1, 153 | 154 | [12] = 1, 155 | [13] = 1, 156 | [14] = 1, 157 | [15] = 1, 158 | 159 | [16] = 2, 160 | [17] = 2, 161 | [18] = 2, 162 | [19] = 2, 163 | 164 | [20] = 2, 165 | [21] = 2, 166 | [22] = 2, 167 | [23] = 2, 168 | 169 | [24] = 3, 170 | [25] = 3, 171 | [26] = 3, 172 | [27] = 3, 173 | 174 | [28] = 3, 175 | [29] = 3, 176 | [30] = 3, 177 | [31] = 3, 178 | }, 179 | 180 | --Minimum rank require to modify officers rank 181 | min_rank_set_rank = 24 182 | } 183 | } 184 | 185 | clockInStation = { 186 | {x=850.156677246094, y=-1283.92004394531, z=28.0047378540039}, -- La Mesa 187 | {x=457.956909179688, y=-992.72314453125, z=30.6895866394043}, -- Mission Row 188 | {x=1856.91320800781, y=3689.50073242188, z=34.2670783996582}, -- Sandy Shore 189 | {x=-450.063201904297, y=6016.5751953125, z=31.7163734436035}, -- Paleto Bay 190 | {x=-1093.0604248046875, y=-808.6140747070312, z=19.28019142150879}, -- Vespucci 191 | {x=360.3169860839844, y=-1583.9188232421875, z=29.291934967041016} -- Davis Sheriff station 192 | } 193 | 194 | garageStation = { 195 | {x=-470.85266113281, y=6022.9296875, z=31.340530395508}, -- La Mesa 196 | {x=1873.3372802734, y=3687.3508300781, z=33.616954803467}, -- Mission Row 197 | {x=452.115966796875, y=-1018.10681152344, z=28.4786586761475}, -- Sandy Shore 198 | {x=855.24249267578, y=-1279.9300537109, z=26.513223648071 }, --Paleto Bay 199 | {x=-1070.1719970703125, y=-854.4666137695312, z=4.8671650886535645 }, -- Vespucci 200 | {x=383.7397766113281, y=-1624.2393798828125, z=29.291946411132812} -- Davis Sheriff station 201 | } 202 | 203 | heliStation = { 204 | {x=449.113966796875, y=-981.084966796875, z=43.691966796875} -- Mission Row 205 | } 206 | 207 | armoryStation = { 208 | {x=452.119966796875, y=-980.061966796875, z=30.690966796875}, -- La Mesa 209 | {x=853.157, y=-1267.74, z= 26.6729}, -- Mission Row 210 | {x=1849.63, y=3689.48, z=34.2671}, -- Sandy Shore 211 | {x=-448.219, y= 6008.98, z=31.7164}, -- Paleto Bay 212 | -- still need to add vespucci 213 | {x=352.9969177246094, y=-1592.7291259765625, z=29.291934967041016} -- Davis Sheriff station 214 | } 215 | 216 | i18n.setLang(tostring(config.lang)) 217 | -------------------------------------------------------------------------------- /police/config/objects.lua: -------------------------------------------------------------------------------- 1 | -- Configure the objects that cops can spawn on the map. 2 | SpawnObjects = { 3 | -- {name="Something", hash="prop_mp_barrier_01b"}, 4 | } -------------------------------------------------------------------------------- /police/config/vehicles.lua: -------------------------------------------------------------------------------- 1 | vehicles = { 2 | [0] = { 3 | {name="Park Ranger Truck", model="pranger"}, 4 | }, 5 | [1] = { 6 | {name="Police Buffalo", model="police2"}, 7 | {name="Police Stanier", model="police"}, 8 | {name="Police Interceptor", model="police3"}, 9 | {name="Police Motorcycle", model="policeb"}, 10 | {name="Police Transport Van", model="policet"}, 11 | {name="Undercover Police Stanier", model="police4"} 12 | }, 13 | [2] = { 14 | {name="Sheriff Stanier", model="sheriff"}, 15 | {name="Sheriff Granger", model="sheriff2"}, 16 | {name="Police Motorcycle", model="policeb"} 17 | }, 18 | [3] = { 19 | {name="FIB Buffalo", model="fbi"}, 20 | {name="FIB Granger", model="fbi2"}, 21 | {name="Police Buffalo", model="police2"}, 22 | }, 23 | [4] = { 24 | {name="Police Stanier", model="police"}, 25 | {name="Prison Transport Van", model="PBus"}, 26 | {name="Sheriff Stanier", model="sheriff"}, 27 | } 28 | } -------------------------------------------------------------------------------- /police/config/weapons.lua: -------------------------------------------------------------------------------- 1 | -- Configure the items that cops receive when they get on duty. 2 | basic_kit = { 3 | "WEAPON_STUNGUN", 4 | "WEAPON_NIGHTSTICK", 5 | "WEAPON_FLASHLIGHT" 6 | } 7 | 8 | -- Configure the weapons that cops can choose in the armory room. 9 | weapons = { 10 | {name="Assault SMG", hash="WEAPON_ASSAULTSMG"}, 11 | {name="Assault Shotgun", hash="WEAPON_ASSAULTSHOTGUN"}, 12 | {name="Combact Pistol", hash="WEAPON_COMBATPISTOL"}, 13 | {name="Heavy Sniper", hash="WEAPON_HEAVYSNIPER"}, 14 | {name="Micro SMG", hash="WEAPON_MICROSMG"}, 15 | {name="Pistol 50.", hash="WEAPON_PISTOL50"}, 16 | {name="Shotgun", hash="WEAPON_PUMPSHOTGUN"}, 17 | {name="SMG", hash="WEAPON_SMG"}, 18 | {name="Smoke grenade", hash="WEAPON_SMOKEGRENADE"}, 19 | } -------------------------------------------------------------------------------- /police/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'bodacious' 2 | game 'gta5' 3 | version '1.5.1' 4 | 5 | ui_page('client/html/index.html') 6 | 7 | files({ 8 | 'client/html/index.html', 9 | 'client/html/js/script.js', 10 | 'client/html/css/style.css', 11 | 'client/html/img/background.png', 12 | 'client/html/img/arrows_upanddown.jpg', 13 | 'client/html/fonts/SignPainter-HouseScript.ttf' 14 | }) 15 | 16 | client_scripts { 17 | 'client/i18n.lua', 18 | 'locales/en.lua', 19 | 'locales/fr.lua', 20 | 'locales/de.lua', 21 | 'config/cloackroom.lua', 22 | 'config/config.lua', 23 | 'config/objects.lua', 24 | 'config/vehicles.lua', 25 | 'config/weapons.lua', 26 | 'client/client.lua', 27 | 'client/cloackroom.lua', 28 | 'client/menu.lua', 29 | 'client/garage.lua', 30 | 'client/armory.lua' 31 | } 32 | 33 | server_scripts { 34 | 'client/i18n.lua', 35 | 'locales/en.lua', 36 | 'locales/fr.lua', 37 | 'locales/de.lua', 38 | 'config/config.lua', 39 | 'server/server.lua' 40 | } 41 | -------------------------------------------------------------------------------- /police/locales/de.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/locales/de.lua -------------------------------------------------------------------------------- /police/locales/en.lua: -------------------------------------------------------------------------------- 1 | i18n.importData("en", { 2 | police_station = "Police Station", 3 | title_notification = "Government", 4 | now_cuffed = "You've been hand cuffed!", 5 | now_uncuffed = "Freedom!", 6 | info_fine_request_before_amount = "Press ~g~Y~s~ to accept the $", 7 | info_fine_request_after_amount = " fine, press ~r~R~s~ to refuse !", 8 | request_fine_expired = "The fine request has just ~r~expired~s~ !", 9 | pay_fine_success_before_amount = "You have just paid a fine or summons of $", 10 | pay_fine_success_after_amount = " fine.", 11 | help_text_open_cloackroom = "Press ~INPUT_CONTEXT~ to open the ~b~", 12 | help_text_put_car_into_garage = "Press ~INPUT_CONTEXT~ to put the police vehicle into the ~b~garage", 13 | help_text_get_car_out_garage = "Press ~INPUT_CONTEXT~ to get a police vehicle out of the ~b~garage", 14 | help_text_put_heli_into_garage = "Press ~INPUT_CONTEXT~ to put the helicopter into the ~b~garage", 15 | help_text_get_heli_out_garage = "Press ~INPUT_CONTEXT~ to get an helicopter out of the ~b~garage", 16 | no_player_near_ped = "No players near you", 17 | no_veh_near_ped = "No vehicles near you", 18 | cop_whitelist_disabled = "Cop whitelist is disable, please enable the whitelist to use this command !", 19 | menu_id_card_title = "ID Card", 20 | menu_check_inventory_title = "Check Inventory", 21 | menu_toggle_cuff_title = "Toggle Hand-Cuffs", 22 | menu_weapons_title = "Confiscate weapons", 23 | menu_force_player_get_in_car_title = "Put player in vehicle!", 24 | menu_force_player_get_out_car_title = "Get player out of vehicle!", 25 | menu_drag_player_title = "Drag the player forcefully", 26 | menu_fines_title = "Fines and Summons", 27 | menu_check_plate_title = "Run Plates", 28 | menu_crochet_veh_title = "Lockpick car", 29 | menu_global_title = "Police Menu", 30 | menu_categories_title = "Categories", 31 | menu_animations_title = "Animations", 32 | menu_citizens_title = "Citizens", 33 | menu_vehicles_title = "Vehicles", 34 | menu_close_menu_title = "Close the menu", 35 | menu_anim_do_traffic_title = "Do a traffic stop", 36 | menu_anim_take_notes_title = "Take notes", 37 | menu_anim_standby_title = "Stand By", 38 | menu_anim_standby_2_title = "Stand By 2", 39 | menu_anim_Cancel_emote_title = "Cancel emote", 40 | menu_custom_amount_fine_title = "Custom amount", 41 | menu_doing_traffic_notification = "~g~You're now running a traffic stop.", 42 | menu_taking_notes_notification = "~g~You're taking notes.", 43 | menu_being_stand_by_notification = "~g~You're awaiting orders.", 44 | menu_veh_opened_notification = "The vehicle is ~g~open~w~.", 45 | menu_put_in_jail_title = "Put in jail", 46 | menu_arrest_title = "Arrest", 47 | menu_custom_amount_jail_title = "Custom amount in seconds", 48 | menu_delete_vehicle_title = "Delete Vehicle", 49 | jail_notification_title = "^4[JAIL]", 50 | jail_arrest_notification_part_1 = "You got Arrested for ^1", -- send to the client after he got put into the jail 51 | jail_arrest_notification_part_2 = " ^0seconds!", 52 | jail_weapons_removed = "Your Weapons have been removed for being Arrested!", 53 | jail_not_cuffed = "Player need to be cuffed!", 54 | jail_remove_weapons_notification_part_1 = "All the weapons from ", 55 | jail_remove_weapons_notification_part_2 = " got removed.", 56 | garage_global_title = "Police garage", 57 | garage_loading = "~b~Loading...", 58 | cloackroom_global_title = "Police's Cloackroom", 59 | cloackroom_take_service_ranger_title = "Clock in as Park Ranger", 60 | cloackroom_take_service_normal_title = "Clock in as Officer", 61 | cloackroom_take_service_sheriff_title = "Clock in as Sheriff", 62 | cloackroom_take_service_chp_title = "Clock in as State Trooper", 63 | cloackroom_take_service_prison_title = "Clock in as a Prison Guard", 64 | cloackroom_take_service_hidden_title = "Clock in as Detective", 65 | cloackroom_take_service_swat_title = "Clock in as S.W.A.T", 66 | cloackroom_break_service_title = "Clock out", 67 | cloackroom_add_yellow_vest_title = "Put on a yellow vest", 68 | cloackroom_remove_yellow_vest_title = "Remove your yellow vest", 69 | now_in_service_notification = "You've just ~g~clocked in", 70 | break_service_notification = "You've just ~r~clocked out", 71 | help_open_menu_notification = "Press ~g~F5~w~ to open ~b~the police menu", 72 | menu_props_title = "Objects", 73 | menu_spawn_props_title = "Spawn a cone", 74 | menu_spawn_barrier_title = "Spawn a police barrier", 75 | menu_spawn_work_ahead_barrier_title = "Spawn work ahead barrier", 76 | menu_remove_last_props_title = "Remove last props", 77 | menu_remove_all_props_title = "Remove all props", 78 | removed_prop = "Object has been ~g~removed~w~.", 79 | removed_props = "Objects have been ~g~removed~w~.", 80 | vehicle_checking_plate_part_1 = "The vehicle #", -- before number plate 81 | vehicle_checking_plate_part_2 = " belongs to ", -- between number plate and player name when veh registered 82 | vehicle_checking_plate_part_3 = "", -- after player name when veh registered 83 | vehicle_checking_plate_not_registered = " isn't registered!", -- after player name 84 | unseat_sender_notification_part_1 = "", -- before player name 85 | unseat_sender_notification_part_2 = " has escaped!", -- after player name 86 | drag_sender_notification_part_1 = "Dragging ", -- before player name 87 | drag_sender_notification_part_2 = "", -- after player name 88 | checking_inventory_part_1 = "", 89 | checking_inventory_part_2 = "'s inventory : ", 90 | checking_weapons_part_1 = "", 91 | checking_weapons_part_2 = "'s weapons : ", 92 | send_fine_request_part_1 = "Tell the player to pay a $", 93 | send_fine_request_part_2 = " fine request to ", 94 | already_have_a_pendind_fine_request = " already has a pending fine request", 95 | request_fine_timeout = " hasn't answered to the fine request", 96 | request_fine_refused = " has refused to pay thier fine", 97 | request_fine_accepted = " has paid the fine", 98 | toggle_cuff_player_part_1 = "Trying to toggle cuff to ", 99 | toggle_cuff_player_part_2 = "", 100 | force_player_get_in_vehicle_part_1 = "Trying to force ", 101 | force_player_get_in_vehicle_part_2 = " to enter the vehicle", 102 | usage_command_copadd = "Usage: /copadd [ID]", 103 | usage_command_coprem = "Usage: /coprem [ID]", 104 | usage_command_coprank = "Usage: /coprank [ID] [RANK]", 105 | command_received = "Roger that !", 106 | become_cop_success = "Welcome to the Force!~w~", 107 | remove_from_cops = "You've been fired !~w~.", 108 | no_player_with_this_id = "No player with this ID!", 109 | not_enough_permission = "You don't have the permission to execute this task.", 110 | new_dept = "Congrats, you are now part of the", 111 | same_dept = "That's the same department!", 112 | new_rank = "Congrats, you are now: ", 113 | player_not_cop = "This player isn't a cop", 114 | rank_not_exist = "This rank doesn't exist", 115 | dept_not_exist = "This department doesn't exist", 116 | armory_global_title = "Police Armory", 117 | help_text_open_armory = "Press ~INPUT_CONTEXT~ to open police's armory", 118 | armory_add_bulletproof_vest_title = "Put on a bulletproof vest", 119 | armory_remove_bulletproof_vest_title = "Take off your bulletproof vest", 120 | armory_weapons_list = "Choose weapons", 121 | armory_basic_kit = "Basic cop kit", 122 | }) -------------------------------------------------------------------------------- /police/locales/fr.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/aa094313c2b9916c4e5492f5970fe6539082c462/police/locales/fr.lua -------------------------------------------------------------------------------- /police/server/server.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Cops_FiveM - A cops script for FiveM RP servers. 3 | Copyright (C) 2018 FiveM-Scripts 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | You should have received a copy of the GNU Affero General Public License 14 | along with Cops_FiveM in the file "LICENSE". If not, see . 15 | ]] 16 | 17 | 18 | if config.useCopWhitelist then 19 | local setupTable = "CREATE TABLE IF NOT EXISTS `police` (`identifier` varchar(255) COLLATE utf8_unicode_ci NOT NULL,`dept` int(11) NOT NULL DEFAULT '0',`rank` int(11) NOT NULL DEFAULT '0', `amount` int(11) NOT NULL DEFAULT '1000')" 20 | exports.ghmattimysql:execute(setupTable, {}, function() 21 | IsDatabaseVerified = true 22 | end) 23 | end 24 | 25 | if GetResourceMetadata(GetCurrentResourceName(), 'resource_Isdev', 0) == "yes" then 26 | RconPrint("/!\\ You are running a dev version of Cops FiveM !\n") 27 | end 28 | 29 | if config.enableVersionNotifier then 30 | PerformHttpRequest("https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/master/police/fxmanifest.lua", function(errorCode, result, headers) 31 | local version = GetResourceMetadata(GetCurrentResourceName(), 'version', 0) 32 | 33 | if string.find(tostring(result), version) == nil then 34 | print("\n\r[Cops_FiveM] The version on this server is not up to date. Please update now.\n\r") 35 | end 36 | end, "GET", "", "") 37 | end 38 | 39 | local inServiceCops = {} 40 | 41 | function addCop(identifier) 42 | exports.ghmattimysql:scalar("SELECT identifier FROM police WHERE identifier = @identifier", { ['identifier'] = tostring(identifier)}, function (result) 43 | if not result then 44 | exports.ghmattimysql:execute("INSERT INTO police (`identifier`) VALUES ('"..identifier.."')", {['@identifier'] = identifier}) 45 | end 46 | end) 47 | end 48 | 49 | function setDept(source, player,playerDept) 50 | local identifier = getPlayerID(player) 51 | if(config.departments.label[playerDept]) then 52 | exports.ghmattimysql:execute("SELECT * FROM police WHERE identifier = '"..identifier.."'", { ['@identifier'] = identifier}, function (result) 53 | if(result[1]) then 54 | if(result[1].dept ~= playerDept) then 55 | exports.ghmattimysql:execute("UPDATE police SET dept="..playerDept.." WHERE identifier='"..identifier.."'", { ['identifier'] = identifier}) 56 | TriggerClientEvent('chatMessage', source, i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("command_received")) 57 | TriggerClientEvent("police:notify", player, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("new_dept") .. " " .. config.departments.label[playerDept]) 58 | TriggerClientEvent('police:receiveIsCop', source, result[1].rank, playerDept) 59 | else 60 | TriggerClientEvent('chatMessage', source, i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("same_dept")) 61 | end 62 | else 63 | TriggerClientEvent('chatMessage', source, i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("player_not_cop")) 64 | end 65 | end) 66 | else 67 | TriggerClientEvent('chatMessage', source, i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("dept_not_exist")) 68 | end 69 | end 70 | 71 | function remCop(identifier) 72 | exports.ghmattimysql:execute("DELETE FROM police WHERE identifier = '"..identifier.."'", { ['identifier'] = identifier}) 73 | end 74 | 75 | AddEventHandler('playerDropped', function() 76 | if(inServiceCops[source]) then 77 | inServiceCops[source] = nil 78 | 79 | for i, c in pairs(inServiceCops) do 80 | TriggerClientEvent("police:resultAllCopsInService", i, inServiceCops) 81 | end 82 | end 83 | end) 84 | 85 | RegisterServerEvent('police:checkIsCop') 86 | AddEventHandler('police:checkIsCop', function() 87 | local identifier = getPlayerID(source) 88 | local src = source 89 | 90 | if config.useCopWhitelist then 91 | exports.ghmattimysql:scalar("SELECT `identifier` FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function(result) 92 | if not result then 93 | TriggerClientEvent('police:receiveIsCop', src, -1) 94 | else 95 | exports.ghmattimysql:execute("SELECT * FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function(data) 96 | if data then 97 | TriggerClientEvent('police:receiveIsCop', src, data[1].rank, data[1].dept) 98 | end 99 | end) 100 | end 101 | end) 102 | else 103 | TriggerClientEvent('police:receiveIsCop', src, 0, 1) 104 | end 105 | end) 106 | 107 | RegisterServerEvent('police:takeService') 108 | AddEventHandler('police:takeService', function() 109 | 110 | if(not inServiceCops[source]) then 111 | inServiceCops[source] = getPlayerID(source) 112 | 113 | for i, c in pairs(inServiceCops) do 114 | TriggerClientEvent("police:resultAllCopsInService", i, inServiceCops) 115 | end 116 | end 117 | end) 118 | 119 | RegisterServerEvent('police:breakService') 120 | AddEventHandler('police:breakService', function() 121 | 122 | if(inServiceCops[source]) then 123 | inServiceCops[source] = nil 124 | 125 | for i, c in pairs(inServiceCops) do 126 | TriggerClientEvent("police:resultAllCopsInService", i, inServiceCops) 127 | end 128 | end 129 | end) 130 | 131 | RegisterServerEvent('police:getAllCopsInService') 132 | AddEventHandler('police:getAllCopsInService', function() 133 | TriggerClientEvent("police:resultAllCopsInService", source, inServiceCops) 134 | end) 135 | 136 | RegisterServerEvent('police:removeWeapons') 137 | AddEventHandler('police:removeWeapons', function(target) 138 | local identifier = getPlayerID(target) 139 | TriggerClientEvent("police:removeWeapons", target) 140 | end) 141 | 142 | RegisterServerEvent('police:confirmUnseat') 143 | AddEventHandler('police:confirmUnseat', function(t) 144 | TriggerClientEvent("police:notify", source, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("unseat_sender_notification_part_1") .. GetPlayerName(t) .. i18n.translate("unseat_sender_notification_part_2")) 145 | TriggerClientEvent('police:unseatme', t) 146 | end) 147 | 148 | RegisterServerEvent('police:dragRequest') 149 | AddEventHandler('police:dragRequest', function(t) 150 | TriggerClientEvent("police:notify", source, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("drag_sender_notification_part_1").. GetPlayerName(t) .. i18n.translate("drag_sender_notification_part_2")) 151 | TriggerClientEvent('police:toggleDrag', t, source) 152 | end) 153 | 154 | RegisterServerEvent('police:finesGranted') 155 | AddEventHandler('police:finesGranted', function(target, amount) 156 | TriggerClientEvent('police:payFines', target, amount, source) 157 | TriggerClientEvent("police:notify", source, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("send_fine_request_part_1")..amount..i18n.translate("send_fine_request_part_2")..GetPlayerName(target)) 158 | end) 159 | 160 | RegisterServerEvent('police:finesETA') 161 | AddEventHandler('police:finesETA', function(officer, code) 162 | if(code==1) then 163 | TriggerClientEvent("police:notify", officer, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, GetPlayerName(source)..i18n.translate("already_have_a_pendind_fine_request")) 164 | elseif(code==2) then 165 | TriggerClientEvent("police:notify", officer, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, GetPlayerName(source)..i18n.translate("request_fine_timeout")) 166 | elseif(code==3) then 167 | TriggerClientEvent("police:notify", officer, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, GetPlayerName(source)..i18n.translate("request_fine_refused")) 168 | elseif(code==0) then 169 | TriggerClientEvent("police:notify", officer, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, GetPlayerName(source)..i18n.translate("request_fine_accepted")) 170 | end 171 | end) 172 | 173 | RegisterServerEvent('police:cuffGranted') 174 | AddEventHandler('police:cuffGranted', function(t) 175 | TriggerClientEvent("police:notify", source, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("toggle_cuff_player_part_1")..GetPlayerName(t)..i18n.translate("toggle_cuff_player_part_2")) 176 | TriggerClientEvent('police:getArrested', t) 177 | end) 178 | 179 | RegisterServerEvent('police:forceEnterAsk') 180 | AddEventHandler('police:forceEnterAsk', function(t, v) 181 | TriggerClientEvent("police:notify", source, "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("force_player_get_in_vehicle_part_1")..GetPlayerName(t)..i18n.translate("force_player_get_in_vehicle_part_2")) 182 | TriggerClientEvent('police:forcedEnteringVeh', t, v) 183 | end) 184 | 185 | RegisterServerEvent('CheckPoliceVeh') 186 | AddEventHandler('CheckPoliceVeh', function(vehicle) 187 | TriggerClientEvent('FinishPoliceCheckForVeh',source) 188 | TriggerClientEvent('policeveh:spawnVehicle', source, vehicle) 189 | end) 190 | 191 | RegisterServerEvent('police:GetPayChecks') 192 | AddEventHandler('police:GetPayChecks', function(t) 193 | local identifier = getPlayerID(source) 194 | local src = source 195 | 196 | exports.ghmattimysql:scalar("SELECT `amount` FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function(result) 197 | if result then 198 | data = json.encode(result) 199 | print(data) 200 | TriggerClientEvent('police:receivePaycheck', src, data) 201 | end 202 | end) 203 | end) 204 | 205 | RegisterServerEvent('police:TransferPayCheck') 206 | AddEventHandler('police:TransferPayCheck', function(t) 207 | local identifier = getPlayerID(source) 208 | local src = source 209 | 210 | exports.ghmattimysql:scalar("SELECT `amount` FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function(result) 211 | if result then 212 | data = json.encode(result) 213 | salary = config.weekly_salary + tonumber(data) 214 | local values = { "police", "amount", salary, { ["identifier"] = identifier } } 215 | exports.ghmattimysql:execute("UPDATE ?? SET ?? = ? WHERE ?", values, function(data) 216 | if data then 217 | TriggerClientEvent('police:receivePaycheck', src, salary) 218 | end 219 | end) 220 | end 221 | end) 222 | end) 223 | 224 | RegisterServerEvent('police:UpdateNotifier') 225 | AddEventHandler('police:UpdateNotifier', function() 226 | local src = source 227 | PerformHttpRequest("https://raw.githubusercontent.com/FiveM-Scripts/Cops_FiveM/master/police/__resource.lua", function(errorCode, result, headers) 228 | local version = GetResourceMetadata(GetCurrentResourceName(), 'resource_version', 0) 229 | if string.find(tostring(result), version) == nil then 230 | TriggerClientEvent('police:Update', src, true) 231 | end 232 | end, "GET", "", "") 233 | end) 234 | 235 | RegisterCommand("CopAddAdmin", function(source,args,raw) 236 | if #args ~= 1 then 237 | RconPrint("Usage: CopAddAdmin [ingame-id]\n") 238 | CancelEvent() 239 | return 240 | else 241 | local maxi = -1 242 | for key, value in pairs(config.rank.label) do 243 | if key > maxi then 244 | maxi = key 245 | end 246 | end 247 | 248 | if(GetPlayerName(tonumber(args[1])) == nil)then 249 | RconPrint("Player is not ingame\n") 250 | CancelEvent() 251 | 252 | return 253 | end 254 | 255 | local identifier = getPlayerID(tonumber(args[1])) 256 | exports.ghmattimysql:scalar("SELECT identifier FROM police WHERE identifier = @identifier", {['identifier'] = identifier}, function(result) 257 | if not result then 258 | exports.ghmattimysql:execute("INSERT INTO police (`identifier`, `dept`, `rank`) VALUES (@identifier, @dept, @maxi)", { ['identifier'] = identifier, ['dept'] = 1, ['maxi'] = maxi}) 259 | TriggerClientEvent("police:notify", tonumber(args[1]), "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("become_cop_success")) 260 | 261 | RconPrint(GetPlayerName(tonumber(args[1])) .. " is now added to the police database.\n") 262 | TriggerClientEvent('police:receiveIsCop', tonumber(args[1]), maxi, 1) 263 | else 264 | RconPrint(GetPlayerName(tonumber(args[1])) .. ' already exists.\n') 265 | end 266 | end) 267 | CancelEvent() 268 | end 269 | end, true) 270 | 271 | RegisterCommand("CopAdd", function(source,args,raw) 272 | if #args ~= 1 then 273 | RconPrint("Usage: CopAdd [ingame-id]\n") 274 | CancelEvent() 275 | return 276 | else 277 | if GetPlayerName(tonumber(args[1])) == nil then 278 | RconPrint("Player is not ingame\n") 279 | CancelEvent() 280 | return 281 | end 282 | 283 | local identifier = getPlayerID(tonumber(args[1])) 284 | exports.ghmattimysql:scalar("SELECT identifier FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function (result) 285 | if not result then 286 | print('Adding record for player to the database') 287 | addCop(identifier) 288 | 289 | TriggerClientEvent("police:notify", tonumber(args[1]), "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("become_cop_success")) 290 | TriggerClientEvent('police:receiveIsCop', tonumber(args[1]), 0, 1) 291 | 292 | RconPrint(GetPlayerName(tonumber(args[1])) .. " is now added to the police database.\n") 293 | else 294 | RconPrint(GetPlayerName(tonumber(args[1])) .. " is already a police officer.\n") 295 | end 296 | end) 297 | end 298 | end, true) 299 | 300 | RegisterCommand("CopRem", function(source,args,raw) 301 | if #args ~= 1 then 302 | RconPrint("Usage: CopRem [ingame-id]\n") 303 | CancelEvent() 304 | return 305 | else 306 | if(GetPlayerName(tonumber(args[1])) == nil)then 307 | RconPrint("Player is not ingame\n") 308 | CancelEvent() 309 | return 310 | end 311 | 312 | local identifier = getPlayerID(tonumber(args[1])) 313 | 314 | exports.ghmattimysql:scalar("SELECT identifier FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function (result) 315 | if not result then 316 | RconPrint(GetPlayerName(tonumber(args[1])) .. " isn't here.\n") 317 | else 318 | exports.ghmattimysql:execute("DELETE FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}) 319 | TriggerClientEvent('police:noLongerCop', tonumber(args[1])) 320 | TriggerClientEvent("police:notify", tonumber(args[1]), "CHAR_AGENT14", 1, i18n.translate("title_notification"), false, i18n.translate("remove_from_cops")) 321 | RconPrint(GetPlayerName(tonumber(args[1])) .. " is now removed from the police database.\n") 322 | end 323 | end) 324 | 325 | CancelEvent() 326 | end 327 | end, true) 328 | 329 | RegisterCommand("CopRank", function(source,args,raw) 330 | if #args ~= 2 then 331 | RconPrint("Usage: CopRank [ingame-id] [rank]\n") 332 | CancelEvent() 333 | return 334 | elseif(not config.rank.label[tonumber(args[2])]) then 335 | RconPrint("You have to enter a valid rank !\n") 336 | CancelEvent() 337 | return 338 | else 339 | if(GetPlayerName(tonumber(args[1])) == nil)then 340 | RconPrint("Player is not ingame\n") 341 | CancelEvent() 342 | return 343 | end 344 | 345 | local identifier = getPlayerID(tonumber(args[1])) 346 | exports.ghmattimysql:scalar("SELECT `identifier` FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function (rank) 347 | if(rank == nil) then 348 | RconPrint(GetPlayerName(tonumber(args[1])) .. " isn't here.\n") 349 | else 350 | exports.ghmattimysql:execute("UPDATE police SET `rank` = @rank WHERE identifier = @identifier", { ['identifier'] = identifier, ['rank'] = args[2]}) 351 | TriggerClientEvent('police:receiveIsCop', tonumber(args[1]), tonumber(args[2])) 352 | RconPrint(GetPlayerName(tonumber(args[1])) .. " information has been updated.\n") 353 | end 354 | end) 355 | 356 | CancelEvent() 357 | end 358 | end, true) 359 | 360 | RegisterCommand("CopDept", function(source,args,raw) 361 | if #args ~= 2 then 362 | RconPrint("Usage: CopDept [ingame-id] [department]\n") 363 | CancelEvent() 364 | return 365 | else 366 | if(GetPlayerName(tonumber(args[1])) == nil) then 367 | RconPrint("Player is not ingame\n") 368 | CancelEvent() 369 | return 370 | end 371 | 372 | local identifier = getPlayerID(tonumber(args[1])) 373 | exports.ghmattimysql:scalar("SELECT `identifier` FROM police WHERE identifier = @identifier", { ['identifier'] = identifier}, function (result) 374 | if result then 375 | if GetPlayerName(tonumber(args[1])) ~= nil then 376 | local player = tonumber(args[1]) 377 | local dept = tonumber(args[2]) 378 | 379 | setDept(args[1], player, dept) 380 | else 381 | TriggerClientEvent('chatMessage', args[1], i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("no_player_with_this_id")) 382 | end 383 | else 384 | TriggerClientEvent('chatMessage', args[1], i18n.translate("title_notification"), {255, 0, 0}, i18n.translate("not_enough_permission")) 385 | end 386 | end) 387 | 388 | CancelEvent() 389 | end 390 | end, true) 391 | 392 | function getPlayerID(source) 393 | local identifiers = GetPlayerIdentifiers(source) 394 | local player = getIdentifiant(identifiers) 395 | return player 396 | end 397 | 398 | function getIdentifiant(id) 399 | for _, v in ipairs(id) do 400 | return v 401 | end 402 | end 403 | --------------------------------------------------------------------------------